﻿:root {
  --bg: #070b13;
  --panel: #121a2a;
  --panel-alt: #0d1524;
  --text: #e8edf7;
  --muted: #9ba8bf;
  --line: #2b3954;
  --brand: #5ec2ff;
  --brand-soft: #244f72;
  --success: #4dd6a8;
  --danger: #ff6b7b;
  --warn: #ffd166;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top right, #132235, #070b13 50%);
  color: var(--text);
  font-family: "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif;
  min-height: 100%;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1100px, 92vw);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(8, 12, 20, 0.84);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.03em;
}

nav {
  display: flex;
  gap: 0.5rem;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  transition: 0.2s;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--text);
  background: #1f2f4b;
}

main {
  padding: 1.2rem 0 2.8rem;
}

.hero {
  background: linear-gradient(145deg, rgba(18, 26, 42, 0.95), rgba(12, 19, 33, 0.96));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.hero-copy {
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  color: var(--brand);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.two-col {
  grid-template-columns: 1fr;
}

.panel {
  background: linear-gradient(180deg, rgba(18, 26, 42, 0.93), rgba(13, 21, 36, 0.93));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

p,
li {
  line-height: 1.55;
}

.muted {
  color: var(--muted);
}

.lead {
  font-size: 1.18rem;
}

.text-link {
  color: var(--brand);
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.search-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  min-width: 160px;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  background: #0e1828;
  color: var(--text);
  border: 1px solid #2a3a58;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
.result-item:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

button {
  border: 1px solid #3477a5;
  background: linear-gradient(180deg, #2e7ab1, #1d5f8d);
  color: white;
  border-radius: 10px;
  padding: 0.65rem 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.ghost-btn {
  background: #14243b;
  border-color: #2a4568;
}

.rating-list,
.result-list,
.hint-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rating-list {
  display: grid;
  gap: 0.6rem;
}

.rating-item {
  border: 1px solid #273955;
  border-radius: 12px;
  background: #0b1220;
}

.rating-link,
.result-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
}

.rating-link:hover,
.result-item:hover {
  background: #111b2d;
}

.rating-link[aria-pressed="true"] {
  background: #173251;
  border-left: 3px solid #7ac8ff;
}

.rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.rating-main {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.rank-pill,
.score-pill,
.type-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.74rem;
  padding: 0.18rem 0.5rem;
}

.rank-pill {
  background: #26354f;
  color: #cae3ff;
}

.score-pill {
  background: #15436c;
  color: #d7f0ff;
  font-weight: 700;
}

.type-pill {
  background: #30405c;
  color: #d7dded;
}

.rating-sub {
  color: var(--muted);
  font-size: 0.88rem;
}

.state {
  margin: 0.7rem 0 0;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  border: 1px solid transparent;
}

.state.empty,
.state.loading {
  color: var(--muted);
  background: #0f1727;
  border-color: #25354e;
}

.state.error {
  color: #ffc5cb;
  background: #2a1418;
  border-color: #7c2e37;
}

.state.success {
  color: #c5ffeb;
  background: #103126;
  border-color: #2f7c63;
}

.inline-message {
  margin-top: 0.8rem;
  border-radius: 12px;
  padding: 0.8rem;
  border: 1px solid;
}

.inline-message.info {
  border-color: #2a5172;
  background: #112238;
}

.inline-message.error {
  border-color: #7a2d3a;
  background: #241319;
}

.inline-message p {
  margin: 0;
}

.hint-list {
  margin-top: 0.4rem;
  display: grid;
  gap: 0.4rem;
}

.hint-list li {
  font-size: 0.9rem;
  color: #ffd8de;
}

.score-rail {
  position: relative;
  min-height: 116px;
  border-radius: 14px;
  border: 1px solid #2b3f5e;
  background: linear-gradient(180deg, #0c1425, #0a1221);
  overflow: hidden;
}

.score-rail::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 52%;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, #274266, #3d628f, #6ca3d1);
}

.rail-tick {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1px;
  height: 22px;
  background: #5b7599;
}

.rail-tick-label {
  position: absolute;
  top: calc(50% + 14px);
  transform: translateX(-50%);
  color: #9db0ce;
  font-size: 0.72rem;
}

.rail-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #d3ebff;
  background: #1d7ebe;
  cursor: pointer;
}

.rail-marker:hover {
  background: #37a6f3;
}

.rail-marker.selected {
  width: 14px;
  height: 14px;
  background: #ffd166;
  border-color: #ffedd0;
}

.selected-card {
  border: 1px solid #335074;
  background: #10213a;
  border-radius: 12px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
}

.selected-card h3 {
  margin: 0;
}

.result-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.55rem;
  max-height: 360px;
  overflow: auto;
}

.result-item {
  border: 1px solid #2a3d5c;
  border-radius: 12px;
}

.result-item[aria-selected="true"] {
  border-color: #5ebeff;
  background: #112844;
}

.stack-form {
  display: grid;
  gap: 0.7rem;
}

.between-grid {
  grid-template-columns: 1fr;
  align-items: end;
}

.full {
  grid-column: 1 / -1;
}

.detail-card {
  display: grid;
  gap: 1rem;
}

.detail-poster {
  border-radius: 12px;
  border: 1px solid #2b3c59;
  width: min(280px, 100%);
}

.detail-body h1 {
  margin-top: 0;
}

.detail-stats {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.detail-stats dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.detail-stats dd {
  margin: 0.2rem 0 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.prose ul {
  padding-left: 1.1rem;
}

.page-head h1,
.hero h1,
.panel h1,
.panel h2,
.panel h3 {
  margin-top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}

.footer-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.token-settings {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1200;
  max-width: min(360px, calc(100vw - 20px));
}

.token-settings-toggle {
  font-size: 0.82rem;
  padding: 0.44rem 0.66rem;
  border-radius: 999px;
}

.token-settings-panel {
  margin-top: 0.45rem;
  width: min(340px, calc(100vw - 20px));
  border-radius: 12px;
  border: 1px solid #2a4568;
  background: #0f1d33;
  padding: 0.75rem;
  box-shadow: var(--shadow);
}

.token-settings-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.token-settings-panel .field {
  margin-top: 0.55rem;
}

.token-settings-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.token-settings-actions button {
  font-size: 0.82rem;
  padding: 0.5rem 0.65rem;
}

.token-settings-panel .state {
  margin-top: 0.6rem;
  margin-bottom: 0;
}

@media (min-width: 760px) {
  main {
    padding-top: 1.8rem;
  }

  .hero {
    padding: 1.8rem;
  }

  .two-col {
    grid-template-columns: 1fr 1fr;
  }

  .between-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-card {
    grid-template-columns: minmax(220px, 280px) 1fr;
  }
}
