@font-face {
  font-family: "Jua";
  src: url("fonts/Jua-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #1a1220;
  --ink-2: #241829;
  --ink-3: #31213a;
  --line: #4a3452;
  --cream: #fff0d4;
  --cream-2: #e9d3b0;
  --cream-3: #b99f85;
  --gold: #f4b845;
  --gold-deep: #c98a1c;
  --orange: #ee8a2b;
  --orange-deep: #c2631a;
  --dusk: #6a3a63;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --display: "Jua", "Noto Sans KR", sans-serif;
  --body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scrollbar-color: var(--gold-deep) var(--ink); scrollbar-width: thin; }
body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--gold); color: var(--ink); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; text-wrap: balance; letter-spacing: -0.01em; }
p { text-wrap: pretty; max-width: 62ch; }
.num { font-variant-numeric: tabular-nums; }

/* top bar */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px var(--gutter);
  background: linear-gradient(to bottom, rgb(26 18 32 / 0.92), rgb(26 18 32 / 0));
}
.bar-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--display); font-size: 1.25rem; }
.bar-brand img { width: 34px; height: 34px; border-radius: 9px; }
.bar nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); font-size: 0.95rem; }
.bar nav a { text-decoration: none; color: var(--cream-2); }
.bar nav a:hover { color: var(--gold); }
@media (max-width: 720px) { .bar nav a:not(.btn) { display: none; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px; border-radius: 12px;
  font-family: var(--display); font-size: 1.1rem; text-decoration: none; cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-color 0.2s;
}
.btn-main {
  background: linear-gradient(to bottom, #f7a443, var(--orange-deep));
  color: #2a1406;
  box-shadow: 0 10px 24px -8px rgb(238 138 43 / 0.55), inset 0 1px 0 rgb(255 255 255 / 0.35);
}
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -8px rgb(238 138 43 / 0.6), inset 0 1px 0 rgb(255 255 255 / 0.35); }
.btn-main:active { transform: translateY(0); }
.btn-ghost { border: 1.5px solid var(--line); color: var(--cream); background: rgb(255 240 212 / 0.04); }
.btn-ghost:hover { border-color: var(--gold); background: rgb(244 184 69 / 0.1); }
.btn svg { width: 18px; height: 18px; }
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* hero */
.hero {
  min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
  background: radial-gradient(120% 90% at 100% 0%, var(--dusk) 0%, var(--ink) 60%);
  overflow: hidden;
}
.hero-text { padding: 140px var(--gutter) 72px; align-self: center; max-width: 720px; justify-self: end; }
.hero h1 { font-size: clamp(3.2rem, 8.4vw, 6rem); color: var(--cream); }
.hero h1 b { font-weight: 400; color: var(--gold); display: block; }
.hero-tag { margin-top: 18px; font-family: var(--display); font-size: clamp(1.3rem, 2.6vw, 1.8rem); color: var(--cream-2); }
.hero-sub { margin-top: 22px; color: var(--cream-2); font-size: 1.05rem; }
.hero-cta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note { margin-top: 22px; font-size: 0.9rem; color: var(--cream-3); }
.hero-art { position: relative; min-height: 420px; order: -1; }
.hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 40%; }
.hero-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, transparent 55%, var(--ink) 100%), linear-gradient(to top, var(--ink) 0%, transparent 22%);
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { order: 0; min-height: 52svh; }
  .hero-art::after { background: linear-gradient(to top, var(--ink) 0%, transparent 45%); }
  .hero-text { padding-top: 24px; justify-self: start; }
}

/* authored moment: hero arrival */
@keyframes rise { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); transform: scale(1.06); } to { clip-path: inset(0); transform: none; } }
.hero-art img { animation: reveal 1.4s var(--ease) both; }
.hero-text > * { animation: rise 1s var(--ease) both; }
.hero-text > :nth-child(1) { animation-delay: 0.25s; }
.hero-text > :nth-child(2) { animation-delay: 0.4s; }
.hero-text > :nth-child(3) { animation-delay: 0.52s; }
.hero-text > :nth-child(4) { animation-delay: 0.64s; }
.hero-text > :nth-child(5) { animation-delay: 0.76s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art img, .hero-text > * { animation: none; }
  .btn { transition: none; }
}

/* sections */
section { padding: clamp(72px, 11vw, 150px) var(--gutter); position: relative; }
.wrap { max-width: 1240px; margin: 0 auto; }
h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.lead { margin-top: 20px; color: var(--cream-2); font-size: 1.08rem; }
.shot {
  border-radius: 16px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 30px 60px -24px rgb(0 0 0 / 0.7), 0 6px 14px -6px rgb(0 0 0 / 0.5);
  background: var(--ink-2);
}

/* play */
.play { background: var(--ink); }
.play-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.steps { margin-top: 36px; display: grid; gap: 0; }
.steps div { padding: 20px 0; border-top: 1px solid var(--line); }
.steps div:last-child { border-bottom: 1px solid var(--line); }
.steps h3 { font-size: 1.35rem; color: var(--gold); }
.steps p { margin-top: 6px; color: var(--cream-2); font-size: 0.98rem; }
@media (max-width: 900px) { .play-grid { grid-template-columns: 1fr; } }

/* heroes */
.cats { background: var(--ink-2); overflow: hidden; }
.cats-head { display: flex; justify-content: space-between; align-items: end; gap: 40px; flex-wrap: wrap; }
.cat-row { margin-top: 56px; display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: clamp(8px, 2vw, 32px); align-items: end; }
.cat { position: relative; text-align: center; }
.cat:nth-child(2) { transform: translateY(-34px); }
.cat:nth-child(3) { transform: translateY(14px); }
.cat img { margin: 0 auto; width: 100%; max-width: 420px; filter: drop-shadow(0 18px 18px rgb(0 0 0 / 0.45)); }
.cat h3 { margin-top: 6px; font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--gold); }
.cat p { margin: 4px auto 0; color: var(--cream-2); font-size: 0.98rem; max-width: 24ch; }
.synergy { margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line); color: var(--cream-2); max-width: 70ch; }
@media (max-width: 720px) {
  .cat-row { grid-template-columns: 1fr; gap: 28px; }
  .cat:nth-child(n) { transform: none; }
  .cat img { max-width: 240px; }
}

/* adventure */
.adv { background: linear-gradient(to bottom, var(--ink-2), var(--ink)); }
.adv .shot { margin-top: 48px; }
.chapters { margin-top: 64px; display: flex; gap: 10px; overflow-x: auto; padding-bottom: 14px; scroll-snap-type: x proximity; }
.chapter {
  flex: 0 0 clamp(96px, 11vw, 132px); aspect-ratio: 3 / 5; position: relative; border-radius: 12px; overflow: hidden;
  scroll-snap-align: start; border: 1px solid var(--line);
  transition: transform 0.5s var(--ease);
}
.chapter:nth-child(even) { margin-top: 28px; }
.chapter:hover { transform: translateY(-8px); }
.chapter img { width: 100%; height: 100%; object-fit: cover; }
.chapter span {
  position: absolute; inset: auto 0 0 0; padding: 40px 10px 12px;
  background: linear-gradient(to top, rgb(26 18 32 / 0.95), transparent);
  font-family: var(--display); font-size: 1rem; text-align: center; line-height: 1.25;
}
.mobs { margin-top: 56px; display: flex; flex-wrap: wrap; align-items: end; gap: clamp(10px, 2.4vw, 30px); }
.mobs img { height: clamp(56px, 8vw, 96px); width: auto; filter: drop-shadow(0 8px 8px rgb(0 0 0 / 0.5)); }
.mobs-note { margin-top: 16px; color: var(--cream-3); font-size: 0.95rem; }

/* online */
.online { background: var(--ink); }
.online-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.modes { margin-top: 32px; }
.modes div { padding: 20px 0; border-top: 1px solid var(--line); }
.modes div:last-child { border-bottom: 1px solid var(--line); }
.modes h3 { font-size: 1.35rem; color: var(--gold); }
.modes p { margin-top: 6px; color: var(--cream-2); font-size: 0.98rem; }
@media (max-width: 900px) { .online-grid { grid-template-columns: 1fr; } .online .shot { order: 2; } }

/* fair */
.fair { background: var(--ink-3); }
.fair-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.fair ul { margin: 32px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.fair li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; color: var(--cream-2); }
.fair li svg { width: 22px; height: 22px; margin-top: 4px; color: var(--gold); }
.fair li b { color: var(--cream); font-weight: 700; }
.fine { margin-top: 28px; font-size: 0.86rem; color: var(--cream-3); }
@media (max-width: 900px) { .fair-grid { grid-template-columns: 1fr; } }

/* final */
.final { text-align: center; background: radial-gradient(90% 120% at 50% 100%, var(--dusk) 0%, var(--ink) 70%); }
.final img { margin: 0 auto; width: clamp(150px, 20vw, 230px); filter: drop-shadow(0 20px 24px rgb(0 0 0 / 0.5)); }
.final h2 { margin-top: 20px; font-size: clamp(2.2rem, 6vw, 4.2rem); }
.final p { margin: 18px auto 0; color: var(--cream-2); }
.final .hero-cta { justify-content: center; }

footer { padding: 36px var(--gutter) 48px; background: var(--ink); border-top: 1px solid var(--line); color: var(--cream-3); font-size: 0.9rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 40px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer a { color: var(--cream-2); }
footer a:hover { color: var(--gold); }

/* chapter cards open a dialog with the real battle screen */
button.chapter { padding: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.chapters-hint { margin-top: 40px; color: var(--cream-3); font-size: 0.95rem; }
.chapters-hint + .chapters { margin-top: 14px; }
body.cdlg-on { overflow: hidden; }
.cdlg[hidden] { display: none; }
.cdlg { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.cdlg-back { position: absolute; inset: 0; background: rgb(10 6 14 / 0.82); }
.cdlg-card { position: relative; width: min(960px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--ink-2); border: 1px solid var(--line); border-radius: 16px; }
.cdlg-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--ink); }
.cdlg-body { padding: 20px 24px 26px; display: grid; gap: 8px; }
.cdlg-no { color: var(--gold); font-size: 0.9rem; }
.cdlg-body h3 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.cdlg-boss { color: var(--cream); }
.cdlg-story { color: var(--cream-3); font-size: 0.95rem; }
.cdlg-mobs { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.cdlg-mobs li { color: var(--cream-2); font-size: 0.95rem; }
.cdlg-mobs b { color: var(--gold); font-weight: 700; }
.cdlg-x, .cdlg-nav { position: absolute; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgb(26 18 32 / 0.82); color: var(--cream); font-size: 1.7rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.cdlg-x { top: 10px; right: 10px; }
.cdlg-nav { top: min(25vw, 220px); transform: translateY(-50%); }
.cdlg-prev { left: 10px; } .cdlg-next { right: 10px; }
.cdlg-x:hover, .cdlg-nav:hover { border-color: var(--gold); color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .chapter { transition: none; } }

/* notices (data in notices.json, newest first) */
.notice { padding: clamp(56px, 9vw, 110px) var(--gutter); background: var(--ink-2); border-top: 1px solid var(--line); }
.notice-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; max-width: 760px; }
.notice-list li { padding: 18px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink); display: grid; gap: 6px; }
.notice-list time { color: var(--gold); font-size: 0.9rem; }
.notice-list h3 { font-size: 1.3rem; }
.notice-list p, .notice-empty { color: var(--cream-2); font-size: 0.98rem; }
