:root {
  --ink: #f5f7ff;
  --muted: #c5ccea;
  --gold: #f0c56a;
  --line: rgba(176, 190, 255, 0.32);
  --card: rgba(14, 20, 58, 0.82);
  --sans: "Noto Sans KR", "Malgun Gothic", sans-serif;
  --serif: "Song Myung", "Batang", serif;
  --logo: "Jua", "Malgun Gothic", sans-serif;
  --header: 76px;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(900px 480px at 80% 120%, rgba(86, 54, 150, 0.28), transparent 60%),
    linear-gradient(180deg, #10183c 0%, #0c122c 280px, #080b18 100%);
  line-height: 1.65;
}

body.modal-open { overflow: hidden; }

img { max-width: 100%; }

a { color: inherit; }

button, input, textarea, select { font-family: inherit; }

:focus-visible {
  outline: 2px solid #ffb15e;
  outline-offset: 3px;
}

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px 12px;
  transition: background 0.25s ease, border-color 0.25s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(8, 12, 32, 0.86);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.brand {
  text-decoration: none;
  color: white;
  flex: 0 0 auto;
}

.brand-word {
  font-family: var(--logo);
  font-size: 34px;
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow: 0 6px 18px rgba(40, 70, 160, 0.45);
}

.brand-o { position: relative; display: inline-block; }

.flame {
  position: absolute;
  left: 50%;
  bottom: 62%;
  width: 14px;
  height: 20px;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 6px rgba(190, 220, 255, 0.85));
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}

.nav a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.82);
  display: inline-flex;
  align-items: center;
  padding: 4px 2px;
}

.nav a:hover,
.nav a.is-active,
.nav a[aria-current="page"] { color: white; }

.nav a.is-active,
.nav a[aria-current="page"] {
  text-shadow: 0 0 14px rgba(190, 210, 255, 0.85);
}

.sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.38);
}

.hero {
  position: relative;
  min-height: max(680px, 100vh);
  display: flex;
  overflow: hidden;
}

.hero-bg,
.page-hero .hero-bg {
  position: absolute;
  inset: 0;
  background: url("../img/common/bg_night.png") center top / cover no-repeat;
}

.hero-island {
  position: absolute;
  z-index: 1;
  top: 9%;
  left: 48%;
  width: min(620px, 46vw);
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 20, 0.35));
}

.city {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: min(240px, 30vh);
  z-index: 2;
  pointer-events: none;
}

.hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 160px;
  z-index: 2;
  background: linear-gradient(transparent, #0c122c);
  pointer-events: none;
}

.hero-layout {
  position: relative;
  z-index: 4;
  flex: 1;
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 440px) minmax(280px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 108px 0 48px;
}

.hero-copy h1 {
  margin: 18px 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.28;
  letter-spacing: -0.03em;
  text-shadow: 0 8px 24px rgba(8, 12, 40, 0.45);
}

.hero-copy p {
  margin: 0;
  color: #e4e9ff;
  font-size: 16px;
  text-shadow: 0 2px 10px rgba(8, 12, 40, 0.45);
}

.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding: 9px 20px 9px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: white;
  background: linear-gradient(180deg, #ffc16a 0%, #ff7d2e 100%);
  box-shadow: 0 10px 26px rgba(255, 122, 40, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-play:hover { transform: translateY(-2px); filter: brightness(1.05); }

.btn-play .ko {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.btn-play .en {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  opacity: 0.92;
  line-height: 1.2;
}

.gem {
  width: 8px;
  height: 8px;
  background: white;
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
}

.tri {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent white;
}

.hero-cast {
  justify-self: end;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(78vh, 760px);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 20, 0.28));
  pointer-events: none;
}

.cloud-divider {
  display: block;
  width: min(1080px, calc(100% - 32px));
  margin: -28px auto 8px;
  position: relative;
  z-index: 5;
  opacity: 0.95;
}

.band { padding: 10px 0 18px; }

.panel {
  background: linear-gradient(180deg, rgba(24, 34, 88, 0.9), rgba(12, 18, 52, 0.92));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  padding: 20px 20px 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head h2,
.shot-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.en {
  margin: 0;
  color: #a9b4de;
  font-size: 11px;
  letter-spacing: 0.16em;
  line-height: 1.2;
}

.badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #e7ecff;
  background: rgba(130, 150, 255, 0.12);
  border: 1px solid rgba(190, 205, 255, 0.32);
  flex: 0 0 auto;
}

.split {
  display: grid;
  grid-template-columns: 1.7fr 0.86fr;
  gap: 16px;
  align-items: stretch;
}

.story-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 16px;
  align-items: center;
}

.lead {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.7;
}

.lead em {
  font-style: normal;
  color: var(--gold);
}

.story-copy p { margin: 0 0 14px; color: #e6ebff; font-size: 14px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(198, 210, 255, 0.55);
  background: rgba(18, 26, 70, 0.35);
  color: white;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-ghost:hover { background: rgba(90, 110, 200, 0.35); transform: translateY(-1px); }

.island-link {
  display: block;
  overflow: hidden;
  border-radius: 18px;
  line-height: 0;
}

.island-link img {
  width: 100%;
  height: auto;
  transform: scale(1);
  transition: transform 0.45s ease;
}

.island-link:hover img,
.island-link:focus-visible img { transform: scale(1.06); }

.char-panel {
  display: flex;
  flex-direction: column;
}

.portrait-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  text-decoration: none;
}

.portrait-grid img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.portrait-grid:hover img { transform: scale(1.035); filter: brightness(1.06); }

.char-panel .btn-ghost {
  align-self: center;
  margin-top: 14px;
}

.trio {
  display: grid;
  grid-template-columns: 1.52fr 1.36fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.trio-img,
.rank-link img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

.rank-link {
  display: block;
  border-radius: 16px;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.rank-link:hover { transform: translateY(-3px); filter: brightness(1.08); }

.shot-panel {
  position: relative;
  aspect-ratio: 361 / 213;
  border-radius: 16px;
  overflow: hidden;
  background: #16143a;
  border: 1px solid rgba(176, 190, 255, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.shot-view { position: absolute; inset: 0; }

.shot-view img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.shot-view img.is-active { opacity: 1; }

.shot-head {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.shot-head .badge { width: 30px; height: 30px; border-radius: 10px; }

.shot-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: rgba(8, 12, 32, 0.48);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.shot-nav:hover { background: rgba(8, 12, 32, 0.72); }

.shot-nav.prev { left: 8px; }
.shot-nav.next { right: 8px; }

.shot-dots {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.shot-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.shot-dots button[aria-current="true"] {
  width: 18px;
  background: white;
}

.shot-shade,
.shot-shade-top {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}

.shot-shade-top {
  top: 0;
  height: 58px;
  background: linear-gradient(rgba(10, 16, 44, 0.62), transparent);
}

.shot-shade {
  bottom: 0;
  height: 36px;
  background: linear-gradient(transparent, rgba(8, 10, 28, 0.55));
}

.site-footer {
  position: relative;
  margin-top: 28px;
  padding: 26px 0 28px;
  background: linear-gradient(180deg, rgba(10, 16, 42, 0.2), #0b1024 28%);
}

.skyline {
  position: absolute;
  left: 0;
  right: 0;
  top: -70px;
  width: 100%;
  height: 80px;
  pointer-events: none;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-actions { display: flex; flex-wrap: wrap; gap: 4px 8px; }

.footer-actions button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.footer-actions img {
  height: 54px;
  width: auto;
  display: block;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.footer-actions button:hover img {
  filter: brightness(1.35);
  transform: translateY(-2px);
}

.footer-brand { text-align: right; }

.footer-brand .brand-word { font-size: 28px; }

.footer-brand small {
  display: block;
  margin-top: 4px;
  color: #b7c0e4;
  font-size: 12px;
}

.page-hero {
  position: relative;
  min-height: 440px;
  display: flex;
  align-items: flex-end;
  padding: 130px 0 54px;
  overflow: hidden;
}

.page-hero .hero-bg { background-position: center 20%; }

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 10, 28, 0.12), rgba(8, 11, 24, 0.88));
}

.page-hero .wrap { position: relative; z-index: 2; }

.page-kicker {
  margin: 0;
  color: #c9d4ff;
  letter-spacing: 0.18em;
  font-size: 12px;
}

.page-hero h1 {
  margin: 8px 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.25;
}

.page-hero .lede {
  margin: 0;
  max-width: 460px;
  color: #e5eaff;
}

.page-float {
  position: absolute;
  z-index: 1;
  right: 2%;
  bottom: -6%;
  width: min(540px, 48vw);
  pointer-events: none;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.35));
}

.page-main { padding: 8px 0 56px; }

.stack { display: grid; gap: 16px; }

.chapter {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px 16px;
  align-items: start;
}

.chapter .num {
  font-family: var(--serif);
  font-size: 40px;
  color: var(--gold);
  line-height: 1;
}

.chapter h2 { margin: 6px 0 6px; font-size: 20px; }
.chapter p { margin: 0; color: #e4e9ff; }

.pull {
  margin: 0;
  padding: 8px 4px 4px 16px;
  border-left: 2px solid var(--gold);
  color: #f3efe2;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.6;
}

.roster {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.char-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 16px;
  align-items: center;
}

.char-card img {
  width: 100%;
  border-radius: 16px;
  display: block;
}

.char-card h2 { margin: 0 0 2px; font-size: 24px; }
.role { margin: 0 0 8px; color: var(--gold); font-size: 13px; }
.quote { margin: 0 0 8px; color: #f4f1e6; }
.char-card p { margin: 0; color: #e4e9ff; font-size: 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.tags span {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(190, 205, 255, 0.35);
  font-size: 12px;
  color: #d5def8;
}

.board-wrap { overflow-x: auto; }

.board {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.board th {
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: #b7c2ea;
  padding: 8px 12px 12px;
}

.board td {
  padding: 13px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.board tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.rank-no {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
}

.top1 { background: linear-gradient(90deg, rgba(240, 197, 106, 0.18), transparent 70%); }
.top2 { background: linear-gradient(90deg, rgba(196, 206, 230, 0.14), transparent 70%); }
.top3 { background: linear-gradient(90deg, rgba(196, 132, 90, 0.16), transparent 70%); }

.top1 .rank-no { background: #f0c56a; color: #2a2110; }
.top2 .rank-no { background: #d5deef; color: #243044; }

#home, #story, #characters, #screenshots, #ranking { scroll-margin-top: 84px; }
.top3 .rank-no { background: #d08a5c; color: #2a160e; }

.note { margin: 12px 4px 0; color: #aeb6d8; font-size: 13px; }

.week {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

.week h2 { margin: 0; font-size: 22px; }
.week p { margin: 4px 0 0; color: var(--gold); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(4, 6, 18, 0.72);
}

.modal[hidden] { display: none; }

.modal-card {
  width: min(640px, 100%);
  max-height: min(82vh, 720px);
  overflow: auto;
  padding: 26px 26px 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, #1c255c, #121736);
  border: 1px solid rgba(186, 198, 255, 0.38);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.modal-card h2 { margin: 0 0 6px; font-size: 22px; }
.modal-card .en { margin-bottom: 14px; }

.modal-card h3 { margin: 16px 0 8px; font-size: 15px; }

.modal-card p,
.modal-card li { color: #e6ebff; font-size: 14px; }

.keys {
  width: 100%;
  border-collapse: collapse;
}

.keys th,
.keys td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.keys th { color: #b7c2ea; font-weight: 500; }

.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid { display: grid; gap: 10px; }

.form-grid label { display: grid; gap: 4px; font-size: 13px; color: #d5def8; }

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(190, 205, 255, 0.35);
  background: rgba(6, 10, 28, 0.45);
  color: white;
  padding: 10px 12px;
}

.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.form-note { margin: 8px 0 0; color: var(--gold); font-size: 13px; }

.modal-close {
  float: right;
  border: 0;
  background: transparent;
  color: white;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.end-cta { text-align: center; padding: 8px 0 4px; }

@media (max-width: 980px) {
  .split,
  .story-grid,
  .roster,
  .cols { grid-template-columns: 1fr; }

  .trio { grid-template-columns: 1fr; }

  .shot-panel { aspect-ratio: 16 / 9; }

  .char-card { grid-template-columns: 140px 1fr; }

  .page-float { opacity: 0.9; width: min(380px, 54vw); }
}

@media (max-width: 760px) {
  .site-header {
    flex-wrap: wrap;
    padding: 12px 14px 10px;
  }

  .brand-word { font-size: 28px; }

  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
    font-size: 13px;
  }

  .hero { min-height: 0; }

  .hero-layout {
    grid-template-columns: 1fr;
    width: min(560px, calc(100% - 32px));
    padding-top: 108px;
    text-align: center;
  }

  .hero-island { width: min(420px, 86vw); top: 18%; }

  .hero-cast {
    max-height: 420px;
    margin: 0 auto;
  }

  .chapter { grid-template-columns: 1fr; }
  .chapter .num { font-size: 28px; }

  .char-card { grid-template-columns: 1fr; }

  .footer-row { flex-direction: column; align-items: flex-start; }
  .footer-brand { text-align: left; }

  .footer-actions img { height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
