/* Binder Town homepage — minimal, atmospheric. Dark night page, big type,
   lots of air; the game's own art does the talking. The game's window
   language (paper body + blue banner) is kept for the one UI-like piece:
   Patch Notes. Fonts = the game's (Kanit + Noto Sans Thai). */

:root {
  --bg: #0a1328;
  --bg-2: #0f1c3a;
  --ink: #1c2636;
  --ink-2: #3d4a5e;
  --txt: #eef2f8;
  --txt-2: #aebbd0;
  --txt-3: #7d8ca6;
  --hair: rgba(255, 255, 255, .09);
  --rim: #5f9fe6;
  --rim-hi: #9bd9ff;
  --seal: #2f74e0;
  --gold: #f0b43c;
  --gold-txt: #e9bd62;
  --display: "Kanit", "Noto Sans Thai", system-ui, sans-serif;
  --body: "Noto Sans Thai", "Kanit", system-ui, sans-serif;
  --halo: 0 1px 0 rgba(4, 14, 36, .9), 0 0 10px rgba(4, 14, 36, .7), 0 0 22px rgba(4, 14, 36, .45);
  --gutter: clamp(16px, 4vw, 48px);
  --navh: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--navh); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font: 400 16px/1.7 var(--body); overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.px, .dio img, .plot img { image-rendering: pixelated; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 0 var(--gutter); }
.sec { padding-top: clamp(96px, 13vw, 168px); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* ---------------- type ---------------- */
.intro { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.intro.left { text-align: left; margin: 0 0 32px; padding: 0; }
.eyebrow { margin: 0 0 10px; font: 500 13px/1 var(--display); letter-spacing: 3px; text-transform: uppercase; color: var(--gold-txt); }
.intro h2 { margin: 0; font: 600 clamp(32px, 4.6vw, 56px)/1.12 var(--display); letter-spacing: -.3px; }
.intro p:not(.eyebrow) { margin: 16px auto 0; color: var(--txt-2); font-size: clamp(16px, 1.4vw, 18px); max-width: 600px; }
.intro.left p:not(.eyebrow) { margin-left: 0; }
.link { color: var(--rim-hi); text-decoration: none; font: 500 15px/1 var(--display); }
.link:hover { text-decoration: underline; }

/* ---------------- buttons ---------------- */
.btn-play {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 14px;
  padding: 10px 34px 10px 10px;
  border: 2px solid var(--gold); border-radius: 999px;
  background: linear-gradient(180deg, #5f9fff 0%, #2f74e0 50%, #1d4fb0 100%);
  box-shadow: inset 0 2px rgba(255, 255, 255, .5), inset 0 -3px rgba(8, 26, 74, .4), 0 0 0 1px #6e4a0a, 0 5px 0 #0f2f6e, 0 18px 40px rgba(3, 12, 34, .6), 0 0 50px rgba(240, 180, 60, .25);
  color: #fff; text-decoration: none;
  transition: transform .12s, filter .15s, box-shadow .12s;
}
.btn-play b { font: 600 clamp(22px, 2.4vw, 28px)/1 var(--display); letter-spacing: .3px; text-shadow: 0 2px 0 rgba(10, 32, 90, .5); }
.btn-play::before {
  content: ""; position: absolute; top: -40%; bottom: -40%; left: -60%; width: 36%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-18deg); animation: sweep 4s ease-in-out infinite;
}
.btn-play:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn-play:active { transform: translateY(3px); box-shadow: inset 0 2px rgba(255, 255, 255, .4), 0 0 0 1px #6e4a0a, 0 2px 0 #0f2f6e, 0 8px 18px rgba(3, 12, 34, .5); }
.bp-ic {
  display: grid; place-items: center; flex: none; width: 50px; height: 50px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6dc, #f0b43c 55%, #b9831c);
  box-shadow: inset 0 -3px rgba(110, 74, 10, .5), 0 2px 6px rgba(0, 0, 0, .35);
}
.bp-ic svg { width: 24px; height: 24px; margin-left: 3px; fill: #1b3f8f; }
@keyframes sweep { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn-sm {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--gold); background: linear-gradient(180deg, #4a8cf2, #2461c9);
  box-shadow: inset 0 1px rgba(255, 255, 255, .4), 0 2px 0 #133a80;
  color: #fff; text-decoration: none; font: 500 15px/1 var(--display); white-space: nowrap;
}
.btn-sm:hover { filter: brightness(1.1); }

/* ---------------- nav ---------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--navh);
  display: flex; align-items: center; gap: 14px; padding: env(safe-area-inset-top) var(--gutter) 0;
  transition: background .3s, box-shadow .3s;
}
.nav.solid, .nav.open { background: rgba(8, 16, 36, .86); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--hair); }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; font: 600 19px/1 var(--display); text-shadow: var(--halo); }
.brand-ic { width: 32px; height: 32px; image-rendering: pixelated; }
.links { display: flex; gap: 2px; }
.links a { padding: 8px 11px; border-radius: 8px; text-decoration: none; font: 400 15px/1 var(--display); color: #dbe4f3; text-shadow: var(--halo); }
.links a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.snd {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 50%; background: rgba(8, 18, 40, .45); cursor: pointer;
}
.snd svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.snd .spk { fill: #fff; stroke: none; }
.snd .wave { display: none; }
.snd.on { border-color: var(--gold); box-shadow: 0 0 16px rgba(240, 180, 60, .35); }
.snd.on .wave { display: block; }
.snd.on .mute { display: none; }
.snd-eq { position: absolute; right: -2px; bottom: -2px; display: none; gap: 1.5px; align-items: flex-end; height: 10px; padding: 2px 3px; border-radius: 4px; background: var(--gold); }
.snd.on .snd-eq { display: flex; }
.snd-eq i { width: 2px; background: #3a2600; animation: eq .9s ease-in-out infinite; }
.snd-eq i:nth-child(2) { animation-delay: -.3s; } .snd-eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 2px; } 50% { height: 7px; } }
.burger { display: none; }

/* ---------------- hero ---------------- */
.hero { position: relative; height: 100svh; min-height: 620px; max-height: 1100px; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.hero-art, .hero-art .scene { position: absolute; inset: 0; }
.hero-art .scene { opacity: 0; transition: opacity 1.6s ease; }
.hero-art .scene.on { opacity: 1; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.hero-art .scene.on img { animation: drift 18s ease-out both; }
@keyframes drift { from { transform: scale(1.06); } to { transform: scale(1); } }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 16, 36, .5) 0, transparent 110px), linear-gradient(0deg, var(--bg) 0%, rgba(10, 19, 40, .7) 18%, transparent 46%);
}
.hero-body { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 var(--gutter) clamp(84px, 12vh, 130px); }
.kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; font: 400 15px/1 var(--display); color: #e6eefb; text-shadow: var(--halo); letter-spacing: .4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #5fe08f; animation: live 2.2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(95, 224, 143, .7); } 70%, 100% { box-shadow: 0 0 0 9px rgba(95, 224, 143, 0); } }
.hero-note { margin: 18px 0 0; font: 300 14.5px/1.4 var(--display); color: #cfd9ea; text-shadow: var(--halo); letter-spacing: .3px; }
.scroll-hint { position: absolute; z-index: 2; left: 50%; bottom: 26px; width: 22px; height: 34px; margin-left: -11px; border: 1.5px solid rgba(255, 255, 255, .45); border-radius: 12px; }
.scroll-hint span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: #fff; animation: wheel 2s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(-3px); } 40% { opacity: 1; } 80%, 100% { opacity: 0; transform: translateY(9px); } }

/* ---------------- sprites (4-frame strips, stepped) ---------------- */
.spr {
  display: block; width: 88px; height: 88px;
  background: var(--img) 0 calc(-88px * var(--row)) / 352px 1056px no-repeat;
  image-rendering: pixelated;
  animation: strip88 var(--dur) steps(4) infinite;
}
@keyframes strip88 { to { background-position-x: -352px; } }
.mob {
  display: block; width: 64px; height: 64px;
  background: var(--img) 0 0 / 256px 64px no-repeat; image-rendering: pixelated;
  animation: strip64 var(--dur, .7s) steps(4) infinite;
}
@keyframes strip64 { to { background-position-x: -256px; } }

/* =========================================================== DIORAMA */
.dio-wrap { position: relative; overflow-x: clip; overflow-y: visible; }
.dio {
  position: relative; transform: scale(var(--s, 1)); transform-origin: 0 0; isolation: isolate;
  --tint: rgba(0, 0, 0, 0); --slen: -.6; --sop: .4; --lights: 0;
}
.dio .scene { position: absolute; left: 50%; top: 0; transform: translateX(-50%); }
.dio-sky {
  position: absolute; inset: -20% -30%; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 45% 42% at 50% 58%, rgba(120, 170, 255, .2), transparent 70%);
  transition: background 1s;
}
.dio[data-phase="dawn"] .dio-sky, .dio[data-phase="dusk"] .dio-sky { background: radial-gradient(ellipse 45% 42% at 50% 58%, rgba(255, 150, 90, .22), transparent 70%); }
.dio[data-phase="night"] .dio-sky { background: radial-gradient(ellipse 45% 42% at 50% 58%, rgba(90, 110, 255, .14), transparent 70%); }
.gnd { position: absolute; left: 0; top: 0; z-index: 1; }
.gnd.grass { background: url("art/tile/grass.png") 0 0 / 256px 256px; }
.gnd.dirt { background: url("art/tile/dirt.png") 0 0 / 256px 256px; }
.gnd.water { background: url("art/tile/water.png") 0 0 / 256px 256px; animation: water 14s linear infinite; }
@keyframes water { to { background-position: 256px 64px; } }
.gnd.skirt { background: linear-gradient(180deg, #3d2e20 0%, #24190f 60%, #120c07 100%); }
.gnd.edge { background: radial-gradient(ellipse 50% 50% at 50% 50%, transparent 52%, rgba(0, 0, 0, .42) 70.7%, rgba(0, 0, 0, .8) 100%); }
.dio .gnd.edge { background: radial-gradient(ellipse 288px 144px at 288px 264px, transparent 52%, rgba(0, 0, 0, .42) 70.7%, rgba(0, 0, 0, .8) 100%); }
.gnd.fxclip { z-index: 2; overflow: hidden; }
.cloud {
  position: absolute; width: 260px; height: 120px; border-radius: 50%;
  background: rgba(10, 20, 40, .28); filter: blur(22px);
  opacity: calc(1 - var(--lights)); animation: cloud 40s linear infinite;
}
.cloud.c1 { top: 22%; }
.cloud.c2 { top: 52%; width: 200px; animation-duration: 55s; animation-delay: -26s; }
@keyframes cloud { from { transform: translateX(-280px); } to { transform: translateX(640px); } }
.shadows { position: absolute; inset: 0; z-index: 3; opacity: var(--sop); filter: blur(.7px); pointer-events: none; }
.sh { position: absolute; transform: skewX(42deg) scaleY(var(--slen)); }
.sh img, .sh .spr, .sh .mob { filter: brightness(0) !important; }
.sh.flat, .sh.fire { display: none; }
.ents { position: absolute; inset: 0; z-index: 4; }
.ent { position: absolute; }
.ent img { width: 100%; height: 100%; pointer-events: none; user-select: none; }
.sway img { transform-origin: 50% 92%; animation: sway 5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-.6deg); } 50% { transform: rotate(.7deg); } }
.hop .mob { animation: strip64 .7s steps(4) infinite, hop 2.4s ease-in-out infinite; }
@keyframes hop { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-6px); } }
.wispy .mob { animation: strip64 .8s steps(4) infinite, float 3.2s ease-in-out infinite; filter: drop-shadow(0 0 4px rgba(140, 255, 230, calc(.2 + var(--lights) * .8))); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.is-golden .ent.golden img { filter: drop-shadow(0 0 2px #ffd34d) drop-shadow(0 0 7px rgba(255, 196, 60, .8)) saturate(1.3) brightness(1.08); }
.is-golden .ent.golden::after {
  content: ""; position: absolute; left: 50%; top: 30%; width: 6px; height: 6px; margin-left: -3px;
  background: #fff3b0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle 1.6s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.4) rotate(45deg); } }
.is-night .ent.lamp img { filter: drop-shadow(0 0 3px rgba(255, 210, 140, .9)); }
.tint {
  position: absolute; inset: -40px -60px; z-index: 5; pointer-events: none;
  background: var(--tint); mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse 52% 60% at 50% 56%, #000 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 52% 60% at 50% 56%, #000 60%, transparent 100%);
}
.glow { position: absolute; z-index: 6; border-radius: 50%; pointer-events: none; mix-blend-mode: screen; opacity: var(--lights); }
.lamp-g { background: radial-gradient(circle, rgba(255, 214, 150, .85) 0, rgba(255, 170, 90, .32) 30%, transparent 68%); }
.fire-g { background: radial-gradient(circle, rgba(255, 190, 110, .9) 0, rgba(255, 120, 50, .35) 32%, transparent 68%); animation: flicker 1.8s ease-in-out infinite; opacity: calc(.25 + var(--lights) * .75); }
.win-g { background: radial-gradient(circle, rgba(255, 210, 140, .7) 0, transparent 65%); }
.wisp-g { background: radial-gradient(circle, rgba(140, 255, 230, .6) 0, transparent 66%); opacity: calc(.15 + var(--lights) * .85); }
@keyframes flicker { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.06); } 55% { transform: scale(.95); } 80% { transform: scale(1.03); } }
.gnd.flyclip { z-index: 7; overflow: hidden; pointer-events: none; }
.fly {
  position: absolute; left: var(--x); top: var(--y); width: 3px; height: 3px; border-radius: 50%;
  background: #f4ffb0; box-shadow: 0 0 6px 2px rgba(220, 255, 120, .7);
  opacity: 0; animation: firefly var(--d) ease-in-out var(--o) infinite;
}
.is-night .fly { opacity: 1; }
@keyframes firefly { 0%, 100% { transform: translate(0, 0); opacity: 0; } 30% { opacity: 1; } 50% { transform: translate(14px, -10px); } 70% { opacity: .8; } }

/* clock */
.clock { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; max-width: 760px; margin-top: 24px; }
.clock-play { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .05); cursor: pointer; }
.clock-play svg { width: 18px; height: 18px; fill: #fff; }
.clock-play .i-play, .clock-play[aria-pressed="true"] .i-pause { display: block; }
.clock-play .i-pause, .clock-play[aria-pressed="true"] .i-play { display: none; }
.clock-track { position: relative; }
#clock {
  -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 0; background: transparent; cursor: pointer;
}
#clock::-webkit-slider-runnable-track {
  height: 6px; border-radius: 6px;
  background: linear-gradient(90deg, #1e2b66 0%, #2a3474 20%, #ff9a5a 26%, #ffe3a8 33%, #bfe3ff 50%, #ffe3a8 66%, #ff7a45 73%, #3b3f86 79%, #1e2b66 100%);
}
#clock::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, #1e2b66 0%, #2a3474 20%, #ff9a5a 26%, #ffe3a8 33%, #bfe3ff 50%, #ffe3a8 66%, #ff7a45 73%, #3b3f86 79%, #1e2b66 100%); }
#clock::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; border: 3px solid #fff; background: var(--gold); box-shadow: 0 0 0 4px rgba(240, 180, 60, .25), 0 2px 8px rgba(0, 0, 0, .5); }
#clock::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; background: var(--gold); box-shadow: 0 0 0 4px rgba(240, 180, 60, .25); }
.clock-marks { display: flex; justify-content: space-between; margin-top: -2px; font: 400 11.5px/1 var(--display); color: var(--txt-3); }
.clock-read { display: flex; flex-direction: column; align-items: flex-end; min-width: 84px; }
.clock-read b { font: 500 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.clock-read span { margin-top: 4px; font: 400 14px/1 var(--display); color: var(--gold-txt); }
.clock-note { max-width: 760px; min-height: 3.4em; margin-top: 18px; text-align: center; color: var(--txt-2); font-size: 15.5px; }
.clock-note b { color: #fff; font-weight: 600; }

/* =========================================================== SOUND */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.sfx-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-snd {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .04); font: 400 14.5px/1 var(--display);
  transition: border-color .2s, background .2s;
}
.chip-snd i { width: 0; height: 0; border-left: 8px solid var(--gold); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.chip-snd:hover { border-color: var(--gold); background: rgba(240, 180, 60, .08); }
.chip-snd.hit { animation: thump .35s ease; }
@keyframes thump { 40% { transform: scale(.94); } }
.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.trk { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 16px 4px; border-bottom: 1px solid var(--hair); }
.trk button {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid rgba(240, 180, 60, .6); background: rgba(240, 180, 60, .06);
}
.trk button:hover { background: rgba(240, 180, 60, .16); }
.pp { width: 0; height: 0; margin-left: 3px; border-left: 12px solid var(--gold); border-top: 7.5px solid transparent; border-bottom: 7.5px solid transparent; }
.trk.playing .pp { width: 12px; height: 14px; margin: 0; border: 0; border-left: 4px solid var(--gold); border-right: 4px solid var(--gold); }
.trk-t b { display: block; font: 500 18px/1.3 var(--display); }
.trk-t small { color: var(--txt-3); font-size: 13.5px; }
.trk.on .trk-t b { color: var(--gold-txt); }
.trk.boss .trk-t b::after { content: "BOSS"; margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: #c43c3c; font: 500 10.5px/1.6 var(--display); letter-spacing: 1px; vertical-align: 3px; color: #fff; }
.trk-d { font: 400 14px/1 var(--display); color: var(--txt-3); font-variant-numeric: tabular-nums; }
.trk-bar { position: absolute; left: 0; bottom: -1px; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--gold); opacity: 0; }
.trk.on .trk-bar { opacity: 1; }

/* =========================================================== LIFE SKILL */
.life { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 3vw, 36px); }
.lcard h3 { margin: 18px 0 4px; font: 600 22px/1.2 var(--display); }
.lcard h3 small { margin-left: 6px; font: 400 15px/1 var(--display); color: var(--txt-3); }
.lcard > p { margin: 0; color: var(--txt-2); font-size: 15px; line-height: 1.6; min-height: 3.2em; }
.plot-wrap {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer; overflow-x: clip; overflow-y: visible;
  background: radial-gradient(ellipse 60% 46% at 50% 60%, rgba(120, 170, 255, .1), transparent 72%);
}
.plot { position: absolute; top: 0; transform-origin: 0 0; --slen: -.55; --sop: .36; }
.plot .gnd { width: 100%; height: 100%; }
.plot .gnd.edge { background: radial-gradient(ellipse 83px 42px at 96px 112px, transparent 50%, rgba(0, 0, 0, .4) 70.7%, rgba(0, 0, 0, .75) 100%); }
.tap {
  position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); padding: 3px 10px; border-radius: 999px;
  background: rgba(8, 18, 40, .7); border: 1px solid rgba(255, 255, 255, .15);
  font: 400 12.5px/1.4 var(--display); color: #dbe4f3; white-space: nowrap; transition: opacity .3s;
}
.lcard.tried .tap { opacity: 0; }
.plot-wrap:hover .ent.node img, .plot-wrap:hover .ent.node .spr { filter: brightness(1.15) drop-shadow(0 0 2px rgba(255, 255, 255, .6)); }
.wob { animation: wob .32s ease; }
@keyframes wob { 20% { transform: translateX(-3px) rotate(-3deg); } 50% { transform: translateX(3px) rotate(2deg); } 80% { transform: translateX(-1px); } }
.gain {
  position: absolute; left: 50%; top: 22%; z-index: 9; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 4px; border-radius: 999px; background: rgba(8, 18, 40, .82); border: 1px solid rgba(255, 255, 255, .2);
  font: 500 14px/1.3 var(--display); color: #fff; white-space: nowrap; pointer-events: none;
  animation: gain 1.3s ease-out forwards;
}
.gain img { width: 24px; height: 24px; }
.gain.rare { border-color: var(--gold); color: var(--gold-txt); }
@keyframes gain { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -34px); } }
.tiers { display: flex; gap: 6px; margin-top: 16px; }
.tier { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: rgba(255, 255, 255, .05); border: 1px solid var(--hair); }
.tier img { width: 32px; height: 32px; }
.tier i { position: absolute; right: -3px; bottom: -6px; padding: 0 3px; border-radius: 3px; background: var(--bg); font: 500 9.5px/1.4 var(--display); font-style: normal; color: var(--txt-3); }
.rare { display: flex; align-items: center; gap: 6px; margin: 14px 0 0; font-size: 14px; color: var(--gold-txt); }
.rare img { width: 24px; height: 24px; }

.craft { margin-top: clamp(48px, 7vw, 80px); border-top: 1px solid var(--hair); }
.craft-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--hair); }
.craft-row b { font: 600 19px/1 var(--display); }
.craft-row > span { color: var(--txt-2); font-size: 15px; }
.ci-row { display: flex; gap: 4px; }
.ci { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: rgba(255, 255, 255, .04); }
.ci img { width: 32px; height: 32px; }
.craft-facts { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.craft-facts li { color: var(--txt-2); font-size: 14.5px; line-height: 1.6; }
.craft-facts b { display: block; margin-bottom: 4px; font: 500 16px/1.3 var(--display); color: #fff; }

/* =========================================================== CLASSES */
.lineup { display: flex; justify-content: center; gap: 4px; padding-top: 10px; }
.lu {
  position: relative; display: flex; flex-direction: column; align-items: center; width: 112px; padding: 0 0 10px;
  border: 0; background: none; cursor: pointer; border-radius: 12px;
}
.lu-spr { position: relative; display: grid; place-items: end center; height: 150px; width: 100%; overflow-x: clip; }
.lu-spr::before { content: ""; position: absolute; bottom: 4px; left: 50%; width: 64px; height: 14px; margin-left: -32px; border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, .55), transparent 70%); }
.lu .spr { transform: scale(2); transform-origin: 50% 84%; margin-bottom: 14px; }
.lu b { font: 400 15px/1 var(--display); color: var(--txt-3); transition: color .2s; }
.lu:hover b { color: var(--txt); }
.lu[aria-selected="true"] b { color: #fff; font-weight: 500; }
.lu[aria-selected="true"] .lu-spr::before { width: 96px; margin-left: -48px; height: 22px; background: radial-gradient(color-mix(in srgb, var(--cc) 70%, transparent), transparent 70%); }
.lu[aria-selected="true"]::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 24px; height: 2px; margin-left: -12px; background: var(--gold); }
.cls { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; margin-top: 48px; }
.cls-art { margin: 0; border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 4.6; background: #eef3f9; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 30px 80px -20px color-mix(in srgb, var(--cc) 55%, transparent); animation: fade .4s ease; }
.cls-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cls-txt { animation: fade .4s ease; }
.cls-role { margin: 0; font: 500 14px/1 var(--display); letter-spacing: 2px; color: color-mix(in srgb, var(--cc) 55%, white); }
.cls-txt h3 { margin: 10px 0 16px; font: 600 clamp(40px, 5.5vw, 68px)/1 var(--display); }
.cls-play { margin: 0; font-size: 17px; color: var(--txt-2); }
.cls-pros { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.cls-pros li { position: relative; padding-left: 26px; font-size: 15.5px; }
.cls-pros li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; background: var(--gold); }
.cls-lines { margin: 24px 0 18px; font: 500 15px/1.4 var(--display); color: #dbe4f3; }
.cls-lines span { color: var(--txt-3); font-weight: 400; }

/* =========================================================== WORLD */
.world { align-items: start; grid-template-columns: minmax(0, .7fr) minmax(0, 1fr); }
.atlas { margin: 0; position: sticky; top: calc(var(--navh) + 24px); }
.atlas img { width: 100%; max-width: 380px; margin: 0 auto; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 24px 60px rgba(0, 0, 0, .5); }
.regions { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.regions li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--hair); }
.r-id { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(240, 180, 60, .55); font: 500 17px/1 var(--display); color: var(--gold-txt); }
.r-name b { display: block; font: 500 20px/1.25 var(--display); }
.r-name small { color: var(--txt-3); font-size: 14px; }
.r-lv { font: 400 15px/1 var(--display); color: var(--txt-2); white-space: nowrap; }
.bossrow { display: flex; gap: 8px; margin-top: clamp(56px, 8vw, 96px); overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.bs { flex: none; width: 150px; display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; scroll-snap-align: start; }
.bs-spr { display: grid; place-items: end center; width: 100%; height: 140px; background: radial-gradient(ellipse 45% 40% at 50% 62%, color-mix(in srgb, var(--bc) 32%, transparent), transparent 70%); }
.bs .mob { transform: scale(2); transform-origin: 50% 100%; margin-bottom: 10px; transition: transform .2s; }
.bs.mini .mob { transform: scale(1.5); }
.bs:hover .mob { transform: scale(2) translateY(-3px); }
.bs b { margin-top: 8px; font: 500 14.5px/1.25 var(--display); }
.bs small { margin-top: 2px; color: var(--txt-3); font-size: 12.5px; line-height: 1.4; }

/* =========================================================== NEWS (game window) */
.win {
  max-width: 860px; margin: 0 auto; overflow: hidden;
  border: 2px solid var(--rim); border-radius: 14px;
  background: url("art/ui/paper.webp") center / 100% 100%, #eef3f9;
  box-shadow: inset 0 0 0 2px #fff, 0 30px 80px rgba(2, 8, 24, .6);
  color: var(--ink);
}
.win-head {
  padding: 15px 24px; border-bottom: 2px solid var(--rim-hi);
  background: #2056a9 url("art/ui/banner.webp") 70% 50% / cover;
  background-image: linear-gradient(90deg, rgba(12, 38, 92, .94), rgba(16, 52, 120, .75) 45%, transparent), url("art/ui/banner.webp");
  box-shadow: inset 0 -2px #d8f5ff;
}
.win-head h2 { margin: 0; color: #fff; font: 600 21px/1.3 var(--display); text-shadow: 0 1px 0 #0b2456, 0 0 6px rgba(4, 18, 48, .8); }
.win-body { padding: 8px 24px 18px; }
.notes { list-style: none; margin: 0; padding: 0; }
.note { display: grid; grid-template-columns: 116px 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid #d3dae5; }
.note:last-child { border-bottom: 0; }
.note time b { display: block; font: 600 18px/1.2 var(--display); color: var(--ink); }
.note time span { font: 400 12.5px/1.4 var(--display); color: #5d6878; }
.note p { margin: 6px 0 0; font-size: 15px; line-height: 1.65; color: var(--ink); }
.note p i { font-style: normal; color: #9aa6b8; }
.kind { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 5px; background: var(--seal); color: #fff; font: 500 12px/1.6 var(--display); }
.kind.hot { background: #e5484d; }
.kind.new { background: var(--gold); color: #3a2600; }
.more { display: block; margin: 6px auto 0; min-height: 40px; padding: 0 18px; border: 1px solid #b9c4d4; border-radius: 999px; background: #fff; color: var(--ink); font: 500 14px/1 var(--display); cursor: pointer; }
.more:hover { border-color: var(--rim); color: #1b4fa6; }
.beta-line { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px 0 0; text-align: center; color: var(--txt-2); font-size: 14.5px; }
.beta-line img { width: 22px; height: 22px; flex: none; }

/* =========================================================== WIKI */
.wiki { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px); border-top: 1px solid var(--hair); }
.wg { padding: 20px 0; border-bottom: 1px solid var(--hair); }
.wg b { display: block; margin-bottom: 8px; font: 500 13px/1 var(--display); letter-spacing: 2px; color: var(--gold-txt); }
.wg p { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.wg a { text-decoration: none; color: #dbe4f3; font: 400 15px/1.9 var(--display); }
.wg a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

/* =========================================================== FINAL + FOOTER */
.final { position: relative; overflow: hidden; margin-top: clamp(110px, 14vw, 180px); min-height: 520px; display: grid; place-items: center; padding: 80px var(--gutter) 140px; text-align: center; }
.final-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.final::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, var(--bg) 0%, rgba(10, 19, 40, .45) 35%, rgba(10, 19, 40, .45) 65%, var(--bg) 100%); }
.final-body { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 30px; }
.final h2 { margin: 0; font: 600 clamp(34px, 5vw, 60px)/1.1 var(--display); text-shadow: var(--halo); }
.parade { position: absolute; left: 0; right: 0; bottom: 6px; height: 80px; z-index: 2; overflow: hidden; pointer-events: none; }
.pm { position: absolute; bottom: 0; left: 0; animation: across var(--dur) linear var(--delay) infinite; }
.pm .mob { transform: scale(1.25); transform-origin: 50% 100%; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .5)); }
@keyframes across { from { transform: translateX(105vw); } to { transform: translateX(-120px); } }
.foot { padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hair); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; font: 500 16px/1 var(--display); margin-right: auto; }
.foot-brand img { width: 24px; height: 24px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot-links a { color: var(--txt-2); text-decoration: none; font: 400 14px/2 var(--display); }
.foot-links a:hover { color: #fff; }
.foot small { width: 100%; color: var(--txt-3); font-size: 12.5px; }
.mobile-cta { display: none; }

/* =========================================================== RESPONSIVE */
@media (max-width: 1080px) {
  .links a { padding: 8px 8px; font-size: 14.5px; }
  .life { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 56px; }
}
@media (max-width: 960px) {
  .links {
    position: fixed; top: calc(var(--navh) + env(safe-area-inset-top)); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 18px;
    background: rgba(8, 16, 36, .97); border-bottom: 1px solid var(--hair);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .2s;
  }
  .nav.open .links { opacity: 1; visibility: visible; transform: none; }
  .links a { padding: 15px 4px; font-size: 18px; border-radius: 0; border-bottom: 1px solid var(--hair); }
  .burger { display: grid; align-content: center; gap: 6px; width: 44px; height: 44px; padding: 0 12px; border: 0; background: none; cursor: pointer; }
  .burger span { height: 2px; border-radius: 2px; background: #fff; transition: .2s; }
  .nav.open .burger span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.open .burger span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .split, .world, .cls { grid-template-columns: 1fr; }
  .atlas { position: static; }
  .cls-art { max-width: 520px; aspect-ratio: 16 / 11; }
  .lineup { flex-wrap: wrap; }
}
/* phones + portrait screens: hero art on top, words under it */
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .hero { height: auto; min-height: 0; max-height: none; display: block; }
  .hero-art { position: relative; height: min(125vw, 72svh); -webkit-mask-image: linear-gradient(180deg, #000 64%, transparent); mask-image: linear-gradient(180deg, #000 64%, transparent); }
  .hero-art .scene { position: absolute; }
  .hero::after { background: linear-gradient(180deg, rgba(8, 16, 36, .5) 0, transparent 90px); }
  .hero-body { margin-top: -96px; padding-bottom: 72px; }
  .scroll-hint { display: none; }
}
@media (max-width: 760px) {
  :root { --navh: 58px; }
  .btn-sm { display: none; }
  .brand { font-size: 18px; }
  .intro { margin-bottom: 28px; }
  .clock { grid-template-columns: auto 1fr; gap: 12px 14px; }
  .clock-read { grid-column: 1 / -1; flex-direction: row; align-items: baseline; justify-content: center; gap: 10px; order: -1; }
  .clock-note { font-size: 15px; }
  .life { grid-template-columns: 1fr 1fr; gap: 44px 16px; }
  .lcard h3 { font-size: 19px; }
  .lcard h3 small { display: block; margin: 4px 0 0; }
  .lcard > p { font-size: 14px; }
  .tiers { display: grid; grid-template-columns: repeat(5, minmax(0, 32px)); gap: 3px; }
  .tier { width: auto; height: auto; aspect-ratio: 1; }
  .tier img { width: 75%; height: auto; }
  .craft-row { grid-template-columns: 1fr; gap: 8px; }
  .ci-row { flex-wrap: wrap; }
  .craft-facts { grid-template-columns: 1fr; gap: 18px; }
  .lineup { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .lu { width: auto; }
  .lu-spr { height: 104px; }
  .lu .spr { transform: scale(1.5); margin-bottom: 8px; }
  .lu b { font-size: 13.5px; }
  .cls { margin-top: 32px; }
  .cls-txt h3 { margin-bottom: 12px; }
  .cls-play { font-size: 16px; }
  .regions li { gap: 14px; }
  .note { grid-template-columns: 1fr; gap: 4px; }
  .note time { display: flex; align-items: baseline; gap: 8px; }
  .win-body { padding: 4px 16px 16px; }
  .wiki { grid-template-columns: 1fr; }
  .mobile-cta {
    position: fixed; z-index: 60; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom));
    display: grid; place-items: center; min-height: 54px; border-radius: 999px;
    border: 2px solid var(--gold); background: linear-gradient(180deg, #5f9fff, #2f74e0 50%, #1d4fb0);
    box-shadow: inset 0 1px rgba(255, 255, 255, .5), 0 4px 0 #0f2f6e, 0 12px 30px rgba(0, 0, 0, .55);
    color: #fff; text-decoration: none; font: 600 19px/1 var(--display);
    transform: translateY(150%); transition: transform .25s ease;
  }
  .mobile-cta.on { transform: none; }
  .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .life { grid-template-columns: 1fr; }
  .lineup { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lu b { font-size: 12px; }
}
@media (max-height: 520px) and (orientation: landscape) and (min-width: 761px) {
  .hero { min-height: 100svh; height: auto; }
  .hero-body { padding-top: 55svh; padding-bottom: 36px; }
  .scroll-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
