/* =========================================================
   FCCS · Wanted Board  (v2)
   ========================================================= */

:root {
  --sea: #0b1420;
  --sea-2: #12263a;
  --sea-3: #1b3a55;
  --paper: #ecdcb0;
  --ink: #2b1d0e;
  --ink-soft: #5a4127;
  --gold: #e0b04f;
  --gold-2: #f4d58a;
  --blood: #9b2020;
  --wood: #3a2414;
  --cream: #f1e6cc;
  --muted: #a9b6c4;
  --hack: #5dff9b;

  --font-body: "Be Vietnam Pro", system-ui, sans-serif;
  --font-poster: "Playfair Display", "Times New Roman", serif;
  --font-pirate: "Grenze Gotisch", "Playfair Display", serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

}

@font-face {
  /* Playfair 900 chỉ gồm chữ số + dấu, đã đóng băng kiểu chữ số thẳng (lnum) — dùng cho số tiền trên canvas */
  font-family: "FCCS Num"; src: url("../fonts/fccs-num.woff2") format("woff2"); font-weight: 900; font-display: swap;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; --z: 1; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) { html { --z: .8; zoom: var(--z); } }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--sea);
  color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
code { font-family: var(--font-mono); font-size: .9em; color: var(--gold-2); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; top: -60px; left: 16px; z-index: 100; padding: .6em 1em; background: var(--gold); color: var(--ink); font-weight: 700; border-radius: 4px; transition: top .2s; }
.skip:focus { top: 12px; }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px;
  padding: .85em 1.6em;
  font: 700 1rem/1 var(--font-body);
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform .2s var(--ease-out), box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn-gold {
  position: relative; overflow: hidden;
  border: 0;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--ink);
  box-shadow: 0 4px 0 #8a6420, 0 10px 22px rgba(0,0,0,.35);
}
.btn-gold::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .6s var(--ease-out);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #8a6420, 0 14px 28px rgba(0,0,0,.4); }
.btn-gold:hover::after { transform: translateX(120%); }
.btn-gold:active { transform: translateY(2px); box-shadow: 0 2px 0 #8a6420; }
.btn-ghost { background: transparent; border: 2px solid rgba(241,230,204,.4); color: var(--cream); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); transform: translateY(-2px); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  color: var(--cream);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(241,230,204,.18);
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease-out);
}
.icon-btn:hover { color: var(--gold-2); border-color: var(--gold); transform: scale(1.08); }
.icon-btn[aria-pressed="true"] { color: var(--gold-2); border-color: rgba(224,176,79,.6); }
#motionBtn[aria-pressed="false"] { color: var(--muted); }
#motionBtn[aria-pressed="false"] .ico { opacity: .5; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(16px, calc((100% - 1180px) / 2));
  transition: background .3s, box-shadow .3s, transform .4s var(--ease-out);
}
.nav.scrolled { background: rgba(11,20,32,.85); backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(224,176,79,.15); }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.6rem/1 var(--font-pirate); color: var(--gold-2); }
.nav-logo img { width: 32px; height: auto; transition: transform .5s var(--ease-out); filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.nav-logo:hover img { transform: rotate(-12deg) scale(1.1); }
.nav-links { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav-links a { position: relative; padding: 6px 0; text-decoration: none; font-weight: 500; color: var(--cream); opacity: .85; transition: opacity .2s, color .2s; }
.nav-links a:not(.nav-cta)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out); }
.nav-links a:hover, .nav-links a.active { opacity: 1; color: var(--gold-2); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links .nav-cta { padding: .45em 1em; border: 1.5px solid var(--gold); border-radius: 4px; color: var(--gold-2); opacity: 1; }
.nav-links .nav-cta:hover { background: var(--gold); color: var(--ink); }
.nav-tools { display: flex; gap: 8px; }
.nav-toggle { display: none; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: calc(100svh / var(--z));
  display: grid; place-items: center;
  padding: 110px 16px 170px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 45% at 50% 32%, rgba(244,213,138,.13), transparent 70%),
    linear-gradient(180deg, #050a12 0%, var(--sea) 55%, var(--sea-2) 100%);
  overflow: hidden;
  isolation: isolate;
}
.layer { position: absolute; inset: -40px; pointer-events: none; transform: translate3d(var(--px, 0), var(--py, 0), 0); will-change: transform; }
.stars.far {
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8, transparent), radial-gradient(1px 1px at 28% 42%, #fff6, transparent),
    radial-gradient(1px 1px at 44% 12%, #fff9, transparent), radial-gradient(1px 1px at 63% 30%, #fff7, transparent),
    radial-gradient(1px 1px at 78% 16%, #fff8, transparent), radial-gradient(1px 1px at 88% 48%, #fff6, transparent),
    radial-gradient(1px 1px at 8% 60%, #fff5, transparent), radial-gradient(1px 1px at 55% 55%, #fff4, transparent),
    radial-gradient(1px 1px at 35% 70%, #fff5, transparent), radial-gradient(1px 1px at 92% 72%, #fff5, transparent),
    radial-gradient(1px 1px at 20% 35%, #fff5, transparent), radial-gradient(1px 1px at 70% 8%, #fff7, transparent);
}
.stars.near {
  background-image:
    radial-gradient(2px 2px at 18% 24%, #fff, transparent), radial-gradient(1.5px 1.5px at 52% 20%, #ffe9b0, transparent),
    radial-gradient(2px 2px at 83% 34%, #fff, transparent), radial-gradient(1.5px 1.5px at 33% 52%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 66% 62%, #ffe9b0, transparent), radial-gradient(2px 2px at 6% 44%, #fff, transparent);
  animation: twinkle 3.5s ease-in-out infinite alternate;
}
@keyframes twinkle { to { opacity: .35; } }

.moon-wrap { inset: auto; top: 13%; right: 12%; width: clamp(70px, 9vw, 120px); aspect-ratio: 1; }
.moon {
  width: 100%; height: 100%; border-radius: 50%;
  background:
    radial-gradient(circle at 30% 35%, rgba(0,0,0,.08) 0 9%, transparent 10%),
    radial-gradient(circle at 62% 60%, rgba(0,0,0,.07) 0 13%, transparent 14%),
    radial-gradient(circle at 55% 25%, rgba(0,0,0,.06) 0 6%, transparent 7%),
    radial-gradient(circle at 40% 40%, #fff8e1, #f4d58a 70%, #d9b05a);
  box-shadow: 0 0 40px rgba(244,213,138,.55), 0 0 120px rgba(244,213,138,.25);
}

.beam {
  position: absolute; left: -10%; bottom: 90px; z-index: -1;
  width: 150vmax; height: 150vmax;
  transform-origin: 0 100%;
  translate: 0 50%;
  background: conic-gradient(from 60deg at 0 100%, transparent 0deg, rgba(244,213,138,.09) 6deg, rgba(244,213,138,.02) 14deg, transparent 18deg);
  animation: sweep 12s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes sweep { from { rotate: -18deg; } to { rotate: 22deg; } }

.hero-wanted { z-index: 1; }
.hw { position: absolute; width: clamp(130px, 12vw, 180px); pointer-events: none; }
.hw .poster { transform: rotate(var(--r, 0deg)); animation: hw-drop 1s var(--ease-out) both, flap 5.5s ease-in-out infinite; transform-origin: 50% 0; }
.hw .poster-card { filter: drop-shadow(0 18px 18px rgba(0,0,0,.6)) brightness(.88); }
.hw1 { left: 7%; top: 21%; } .hw1 .poster { --r: -9deg; animation-delay: 1.1s, 2.1s; }
.hw2 { right: 7%; top: 44%; } .hw2 .poster { --r: 7deg; animation-delay: 1.3s, 2.3s; animation-duration: 1s, 6.4s; }
@keyframes hw-drop { from { opacity: 0; transform: translateY(-120vh) rotate(calc(var(--r) * -3)); } to { transform: rotate(var(--r)); } }
@keyframes flap {
  0%, 100% { transform: rotate(var(--r)) skewX(0deg); }
  30% { transform: rotate(calc(var(--r) + 3deg)) skewX(-1.5deg); }
  65% { transform: rotate(calc(var(--r) - 2deg)) skewX(1deg); }
}
@media (max-width: 1100px) and (orientation: portrait) { .hw2 { display: none; } }
@media (max-width: 1100px) { .hw1 { left: calc(2% + 40px); top: 14%; } .hw2 { right: calc(2% + 40px); top: 58%; } }
@media (max-width: 760px) {
  .hw { width: 80px; }
  .hw1 { left: 54px; top: 146px; } /* lớp parallax lùi -40px */
  .hw2 { display: none; }
  .hw .p-foot { visibility: hidden; }
}
.hero-inner { position: relative; z-index: 2; max-width: 820px; min-width: 0; }
.js .hero-emblem {
  width: clamp(130px, 15vw, 210px);
  margin: 0 auto 6px;
  perspective: 700px;
}
.hero-emblem img {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 16px 26px rgba(0,0,0,.6));
  transform: rotateX(var(--ex, 0deg)) rotateY(var(--ey, 0deg));
  transition: transform .25s var(--ease-out);
}
.js .hero-emblem { animation: emblem-in 1.1s var(--ease-spring) both, bob 5s ease-in-out 1.1s infinite; }
@keyframes emblem-in {
  0% { opacity: 0; transform: translateY(-50px) scale(.3) rotate(-18deg); }
  60% { opacity: 1; transform: translateY(6px) scale(1.08) rotate(4deg); }
  100% { transform: none; }
}
.hero-emblem.wiggle img { animation: wiggle .6s var(--ease-out); }
@keyframes wiggle { 20% { rotate: -9deg; scale: 1.08; } 45% { rotate: 7deg; } 70% { rotate: -3deg; } 100% { rotate: 0deg; scale: 1; } }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-2deg); } }

.hero-title { margin: 0; font: 800 clamp(3rem, 10vw, 7rem)/1.05 var(--font-pirate); color: var(--gold-2); perspective: 600px; }
.hero-title > span { display: block; }
.hero-title .t1 { text-shadow: 0 4px 0 #6b4a16, 0 10px 40px rgba(0,0,0,.6); }
.hero-title .t2 { margin-top: .12em; font-size: .55em; color: var(--cream); text-shadow: 0 3px 0 #3a2a10, 0 8px 30px rgba(0,0,0,.6); }
.hero-title .ch { display: inline-block; white-space: pre; }
.js .hero-title .ch { animation: ch-in .7s var(--ease-out) both; animation-delay: calc(.3s + var(--ci) * 28ms); }
@keyframes ch-in { from { opacity: 0; transform: translateY(.6em) rotateX(-80deg); filter: blur(4px); } }
.js .hero-title .t2 { animation: glitch .45s steps(2) 1.5s 1; }
@keyframes glitch {
  0% { text-shadow: -3px 0 var(--hack), 3px 0 var(--blood), 0 3px 0 #3a2a10; transform: translateX(2px); }
  50% { text-shadow: 3px 0 var(--hack), -3px 0 var(--blood), 0 3px 0 #3a2a10; transform: translateX(-2px); }
}

.js .intro-item { animation: rise .8s var(--ease-out) both; }
.js .terminal.intro-item { animation-delay: .7s; }
.js .hero-actions.intro-item { animation-delay: .85s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.terminal {
  display: block;
  width: min(100%, 480px);
  margin: 26px auto 32px;
  padding: .6em 1.1em;
  text-align: left;
  font: 400 clamp(.8rem, 2.4vw, 1rem)/1.4 var(--font-mono);
  color: var(--hack);
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(93,255,155,.25);
  border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.terminal .prompt { color: var(--gold); }
.terminal.ok { color: var(--gold-2); }
.caret { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }


.waves { position: absolute; left: 0; bottom: -1px; z-index: 2; width: 200%; height: 130px; pointer-events: none; }
.wave.w1 { fill: var(--sea-3); opacity: .45; animation: drift 22s linear infinite; }
.wave.w2 { fill: #163049; opacity: .8; animation: drift 15s linear infinite reverse; }
.wave.w3 { fill: var(--sea-2); animation: drift 10s linear infinite; }
@keyframes drift { to { transform: translateX(-50%); } }

/* ---------- Thuyền hải tặc FCCS ---------- */
.waves-front { z-index: 4; height: 90px; }
.flagship {
  position: absolute; left: 3%; bottom: 34px; z-index: 3;
  width: clamp(230px, 25vw, 400px);
  padding: 0; border: 0; background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: translate3d(var(--sx, 0), 0, 0);
  transition: transform .6s var(--ease-out);
}
.flagship:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; border-radius: 12px; }
.flagship-bob { position: relative; display: block; animation: ship-bob 5.5s ease-in-out infinite; transform-origin: 50% 85%; }
.flagship img { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 22px rgba(0,0,0,.55)) brightness(.92) saturate(.95); }
.flagship:hover img { filter: drop-shadow(0 18px 22px rgba(0,0,0,.55)) brightness(1.02); }
.js .flagship { animation: ship-in 1.6s var(--ease-out) .5s backwards; }
@keyframes ship-in { from { opacity: 0; transform: translate3d(-60%, 20px, 0) rotate(-4deg); } }
@keyframes ship-bob {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-7px) rotate(1.4deg); }
}
.lantern-glow {
  position: absolute; left: 22%; top: 38%; width: 60%; height: 40%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,196,90,.28), transparent 65%);
  mix-blend-mode: screen; pointer-events: none;
  animation: lantern 3.2s ease-in-out infinite alternate;
}
@keyframes lantern { from { opacity: .45; } to { opacity: 1; } }
.cannon-smoke, .cannon-flash, .cannon-shot { position: absolute; pointer-events: none; z-index: 5; }
.cannon-flash { width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: radial-gradient(circle, #fff6d0, rgba(255,170,60,.85) 35%, transparent 70%); }
.cannon-smoke { width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, rgba(235,230,220,.85), rgba(160,160,165,.45) 55%, transparent 72%); }
.cannon-shot { width: 64px; }
.cannon-shot .poster { cursor: default; }
@media (max-width: 760px) {
  .flagship { width: 160px; left: -6px; bottom: 14px; }
  .waves-front { height: 70px; }
}

.scroll-cue { position: absolute; bottom: 28px; left: 50%; z-index: 5; translate: -50% 0; width: 26px; height: 42px; border: 2px solid rgba(241,230,204,.5); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--gold); animation: cue 1.8s var(--ease-out) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: var(--rd, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Section titles ---------- */
.section-title { text-wrap: balance; margin: 0 0 10px; text-align: center; font: 900 clamp(2rem, 5vw, 3.2rem)/1.1 var(--font-poster); color: var(--gold-2); }
.section-sub { text-wrap: balance; max-width: 640px; margin: 0 auto 44px; text-align: center; color: var(--muted); }
.on-wood { text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.section-sub.on-wood { color: #d7c39a; }

/* ---------- Crew stats ---------- */










/* =========================================================
   WOOD BOARD
   ========================================================= */
.board {
  overflow-x: clip;
  position: relative;
  padding: 100px 0 120px;
  background-color: var(--wood);
  background-image:
    linear-gradient(rgba(20,10,4,.35), rgba(20,10,4,.35)),
    url("../images/gen/wood-tall.webp");
  background-size: auto, 1400px auto;
  background-repeat: repeat;
  box-shadow: inset 0 30px 60px rgba(0,0,0,.6), inset 0 -30px 60px rgba(0,0,0,.6);
}
.lamp {
  position: absolute; left: 0; top: 0; z-index: 0;
  width: 700px; height: 700px; margin: -350px 0 0 -350px;
  background: radial-gradient(circle, rgba(255,200,120,.14), transparent 65%);
  pointer-events: none;
  transform: translate3d(var(--lx, 50vw), var(--ly, 300px), 0);
  opacity: 0; transition: opacity .4s;
  will-change: transform;
}
.board:hover .lamp { opacity: 1; }
.board > .container { position: relative; z-index: 1; }

.toolbar {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px;
  background: rgba(20,12,6,.65);
  border: 1px solid rgba(224,176,79,.2);
  border-radius: 8px;
  backdrop-filter: blur(4px);
}
.search, .sort {
  min-height: 44px;
  font: 500 1rem var(--font-body);
  color: var(--cream);
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(224,176,79,.3);
  border-radius: 6px;
  padding: .55em .9em;
}
.search-wrap { position: relative; flex: 1 1 260px; min-width: 0; display: flex; }
.search-wrap .ico { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: #a8957a; pointer-events: none; }
.search-wrap .search { width: 100%; min-width: 0; padding-left: 2.6em; }
.search::placeholder { color: #a8957a; }
.search::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; cursor: pointer;
  background: var(--gold-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
}
.search:focus, .sort:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.sort option { background: var(--wood); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.chip img { width: 26px; height: 26px; margin-left: -.5em; border-radius: 50%; object-fit: cover; filter: sepia(.5); }
.chip {
  min-height: 44px;
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 .9rem var(--font-body);
  color: #d7c39a;
  background: transparent;
  border: 1px solid rgba(224,176,79,.3);
  border-radius: 999px;
  padding: .4em .95em;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .25s var(--ease-out);
}
.chip:hover { color: var(--gold-2); border-color: var(--gold); transform: translateY(-1px); }
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.result-count { position: relative; margin: 14px 2px 40px; font: 500 .85rem var(--font-mono); color: #c9b48a; letter-spacing: .05em; }

.posters {
  position: relative;
  overflow: clip; overflow-clip-margin: 220px;
  padding: 14px 6px 6px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 56px 36px;
}
.empty { position: relative; text-align: center; color: #d7c39a; font-style: italic; }

/* =========================================================
   THE WANTED POSTER
   ========================================================= */
.poster { --tilt: 0deg; position: relative; min-width: 0; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.poster.pending { opacity: 0; }
.poster-card {
  --rx: 0deg; --ry: 0deg; --lift: 0px; --sc: 1;
  position: relative;
  container-type: inline-size;
  aspect-ratio: 5 / 7.2;
  transform: perspective(900px) translateY(var(--lift)) rotate(var(--tilt)) rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--sc));
  transition: transform .55s var(--ease-spring), filter .35s;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.55));
}
.poster:hover .poster-card, .poster:focus-visible .poster-card { --tilt: 0deg; --lift: -10px; --sc: 1.035; filter: drop-shadow(0 30px 28px rgba(0,0,0,.6)); }
.poster.tilting .poster-card { transition: transform .12s linear, filter .35s; }
.poster-hit { position: absolute; inset: 0; z-index: 5; padding: 0; background: transparent; border: 0; border-radius: 4px; cursor: pointer; }
.poster-hit:focus { outline: none; }
.poster:has(.poster-hit:focus-visible) .poster-card { --tilt: 0deg; --lift: -10px; --sc: 1.035; outline: 3px solid var(--gold); outline-offset: 8px; border-radius: 4px; }
.poster:active .poster-card { --sc: .98; }

.pin {
  position: absolute; top: -1.5cqw; left: 50%; z-index: 3;
  width: 6.5cqw; height: 6.5cqw;
  margin-left: -3.25cqw;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a7b, #a31d14 60%, #5a0c08);
  box-shadow: 0 .8cqw 1.2cqw rgba(0,0,0,.5);
}

.paper {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 6cqw 7.5cqw 4.5cqw;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("../images/gen/parchment.webp");
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 3cqw rgba(110,65,20,.45), inset 0 0 .8cqw rgba(80,45,10,.5);
  clip-path: polygon(0 1%, 4% 0, 12% .6%, 22% 0, 35% .8%, 48% .1%, 60% .7%, 73% 0, 86% .9%, 96% .2%, 100% 1.2%,
                     99.4% 12%, 100% 25%, 99.3% 40%, 100% 55%, 99.5% 70%, 100% 85%, 99.4% 99%,
                     90% 100%, 78% 99.3%, 64% 100%, 50% 99.4%, 36% 100%, 22% 99.2%, 10% 100%, 0 99.3%,
                     .6% 86%, 0 72%, .7% 58%, 0 44%, .5% 30%, 0 16%);
}
.glare {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255,252,235,.55), transparent 45%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity .3s;
}
.poster:hover .glare { opacity: 1; }

.p-wanted { margin: 0; font: 900 19.5cqw/0.95 var(--font-poster); letter-spacing: .02em; transform: scaleY(1.08); }
.p-photo {
  width: 100%;
  aspect-ratio: 6 / 5;
  margin-top: 3cqw;
  border: 1cqw solid var(--ink-soft);
  outline: .4cqw solid rgba(43,29,14,.5);
  outline-offset: .8cqw;
  background: #b89a62;
  overflow: hidden;
}
.p-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: sepia(.55) contrast(1.08) saturate(.85) brightness(.97);
  transition: filter .4s, transform .6s var(--ease-out);
}
.poster:hover .p-photo img { filter: sepia(.2) contrast(1.05) saturate(1); transform: scale(1.06); }

.p-doa {
  display: flex; align-items: center; gap: 2.5cqw;
  width: 100%;
  margin: 3.6cqw 0 1cqw;
  font: 700 6.8cqw/1 var(--font-poster);
  letter-spacing: .06em;
  white-space: nowrap;
}
.p-doa::before, .p-doa::after { content: ""; flex: 1; height: .6cqw; background: var(--ink); }
.p-name {
  margin: 0; width: 100%;
  padding-top: .14em;
  font: 900 var(--name-size, 10cqw)/1.12 var(--font-poster);
  text-align: center; text-transform: uppercase; letter-spacing: .02em;
  white-space: nowrap; overflow-x: clip; overflow-y: visible; text-overflow: ellipsis;
}
.p-bounty {
  display: flex; align-items: baseline; justify-content: center; gap: 1cqw;
  margin: 1.5cqw 0 0;
  font: 900 var(--bounty-size, 10.5cqw)/1 var(--font-poster);
  letter-spacing: .03em;
  font-variant-numeric: lining-nums;
  white-space: nowrap;
}
/* Berry: chữ B của chính font + 2 nét dọc (không font nào trong bộ có ký tự ฿) */
.amt { white-space: nowrap; }
.berry { position: relative; display: inline-block; margin-right: .12em; font-family: var(--font-poster); font-weight: 900; }
.berry::before, .berry::after { content: ""; position: absolute; top: -.1em; bottom: -.08em; width: .075em; background: currentColor; }
.berry::before { left: 30%; }
.berry::after { left: 52%; }
.p-foot { margin-top: auto; width: 100%; display: flex; justify-content: space-between; align-items: flex-end; font: 700 3.4cqw/1.2 var(--font-poster); letter-spacing: .1em; }
.p-foot .fine.faux { color: transparent; height: 4.4cqw; background: repeating-linear-gradient(180deg, rgba(43,29,14,.45) 0 .5cqw, transparent .5cqw 1.3cqw); -webkit-line-clamp: unset; }
.p-foot .fine { max-width: 74%; font: italic 400 2.7cqw/1.3 var(--font-poster); letter-spacing: 0; opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-stamp {
  position: absolute; right: 5cqw; top: 46%;
  padding: .8cqw 2.4cqw;
  font: 900 5.5cqw/1 var(--font-poster); letter-spacing: .08em;
  color: rgba(155,32,32,.8);
  border: .8cqw solid rgba(155,32,32,.72);
  border-radius: 1.5cqw;
  transform: rotate(-14deg);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.poster-cap {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-top: 16px; padding: 0 4px;
  font-size: .82rem;
  color: #d7c39a;
}
.cap-crime { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; font-weight: 600; color: var(--cream); line-height: 1.35; }
.cap-date { display: block; margin-top: 2px; font: 500 .78rem var(--font-mono); color: #b9a47c; letter-spacing: .04em; }
.view-hint { flex: none; margin-top: 2px; display: inline-flex; align-items: center; gap: 5px; transition: color .2s, transform .3s var(--ease-out); }
.view-hint .ico { width: 16px; height: 16px; }
.poster:hover .view-hint { color: var(--gold-2); transform: translateX(3px); }

/* ---------- Footer ---------- */
.footer-logo { display: block; width: 52px; height: auto; margin: 0 auto 10px; opacity: .95; }
.footer { padding: 34px 16px; text-align: center; background: #070d15; color: var(--muted); font-size: .9rem; }
.footer p { margin: 4px 0; text-wrap: pretty; }
.footer a { color: var(--gold-2); }
.footer .fine { font-size: .78rem; opacity: .75; }

/* =========================================================
   MODAL / DOSSIER
   ========================================================= */
@property --pa { syntax: "<number>"; inherits: false; initial-value: 1; }
.modal {
  --pa: 1;
  width: min(960px, 100% - 32px);
  max-height: calc((100svh - 32px) / var(--z));
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(224,176,79, calc(.35 * var(--pa)));
  border-radius: 10px;
  background: radial-gradient(ellipse at 0% 0%, rgba(224,176,79, calc(.08 * var(--pa))), transparent 50%), rgba(15,28,43, var(--pa));
  color: var(--cream);
  box-shadow: 0 30px 80px rgba(0,0,0, calc(.7 * var(--pa)));
}
.modal:not([open]) { display: none; }
.modal::backdrop { background: rgba(3,6,10,.8); backdrop-filter: blur(5px); }
.modal-close:hover { background: var(--blood); color: #fff; border-color: var(--blood); }
.modal-bar {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 24px;
  background: rgba(15,28,43, calc(.92 * var(--pa)));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(224,176,79, calc(.15 * var(--pa)));
}
.modal-count { font: 600 .8rem var(--font-mono); letter-spacing: .12em; color: var(--gold); white-space: nowrap; }
.modal-nav { display: flex; gap: 8px; }
.modal-body { touch-action: pan-y; position: relative; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 40px; padding: 28px 40px 40px; }
.case-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.case-actions .btn { min-height: 44px; padding: .7em 1.1em; font-size: .92rem; }
.case-story { margin: 0 0 22px; color: #e6d7b5; }
.other-cases { margin-top: 26px; padding-top: 18px; border-top: 1px dashed rgba(224,176,79,.25); }
.other-list { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.other-list button { width: 64px; height: 54px; padding: 0; border: 2px solid rgba(224,176,79,.3); border-radius: 4px; overflow: hidden; cursor: pointer; background: #000; transition: border-color .2s, transform .2s var(--ease-spring); }
.other-list button:hover, .other-list button[aria-current="true"] { border-color: var(--gold); transform: translateY(-2px); }
.other-list img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.5); }
.flash { position: absolute; inset: 0; z-index: 4; background: #fff; pointer-events: none; opacity: 0; }
.modal-body .poster { cursor: default; }
.modal-body .poster-card { --tilt: -1.5deg; }
.modal-body .poster:hover .poster-card { --tilt: 0deg; --lift: -4px; --sc: 1.01; }
.dossier { position: relative; min-width: 0; }
.dossier .case-name { margin: 0; font: 800 clamp(2.2rem, 4.6vw, 3rem)/1.1 var(--font-pirate); color: var(--gold-2); }
.dossier .case-crime { text-wrap: balance; margin: 6px 0 18px; font: 900 clamp(1.2rem, 2.4vw, 1.5rem)/1.3 var(--font-poster); color: var(--cream); }
.copy-row { display: flex; gap: 8px; margin-top: 10px; }
.copy-row input { flex: 1; min-width: 0; min-height: 44px; padding: .5em .8em; font: 500 .9rem var(--font-mono); color: var(--cream); background: rgba(0,0,0,.35); border: 1px solid var(--gold); border-radius: 6px; }
.dossier dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0 0 22px; }
.dossier dt { color: var(--muted); font-size: .9rem; }
.dossier dd { margin: 0; font-weight: 700; }
.dossier dd.money { color: var(--gold-2); font-family: var(--font-poster); font-size: 1.15rem; font-variant-numeric: lining-nums tabular-nums; }
.dossier .sub-h, .dossier h4 { margin: 0 0 8px; font: 600 .78rem var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }

@media not ((hover: hover) and (pointer: fine)) { .lamp { display: none; } }
html.reduce-motion .lamp { display: none; }

/* =========================================================
   HERO LEAD + STATS TEXT
   ========================================================= */
.hero-lead { text-wrap: pretty; max-width: 520px; margin: 18px auto 0; color: #c9d3de; font-size: clamp(.95rem, 2.3vw, 1.1rem); }
.js .hero-lead.intro-item { animation-delay: .55s; }
.hero-lead + .terminal { margin-top: 18px; }



/* =========================================================
   ROSTER — danh sách băng
   ========================================================= */






















/* =========================================================
   TICKER — bản tin chạy ngang
   ========================================================= */
.ticker {
  position: relative; z-index: 2;
  display: flex; align-items: stretch;
  background: var(--blood);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  overflow: hidden;
  margin: 0;
}
.ticker-label { flex: none; display: grid; place-items: center; padding: 0 18px; font: 700 .8rem var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink); background: var(--gold-2); }
.ticker-view { flex: 1; min-width: 0; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: flex; width: max-content; animation: tick 46s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tick-run { display: flex; align-items: center; white-space: nowrap; padding: 12px 0; }
.tick-item { padding: 0 18px; font-size: .95rem; }
.tick-item b { font-family: var(--font-poster); font-weight: 900; letter-spacing: .03em; text-transform: uppercase; }
.tick-item em { font-style: normal; font-weight: 700; color: var(--gold-2); font-variant-numeric: lining-nums; }
.tick-sep { flex: none; width: 7px; height: 7px; background: var(--gold-2); opacity: .8; transform: rotate(45deg); }
@keyframes tick { to { transform: translateX(-50%); } }
html.reduce-motion .ticker-view { overflow-x: auto; }
@media (prefers-reduced-motion: reduce) { .ticker-view { overflow-x: auto; } }

/* =========================================================
   SPOTLIGHT — truy nã đặc biệt
   ========================================================= */
.spotlight {
  position: relative; overflow-x: clip; overflow-y: visible;
  padding: 110px 0;
  background:
    radial-gradient(ellipse 50% 60% at 25% 50%, rgba(224,176,79,.16), transparent 70%),
    radial-gradient(ellipse at 80% 0%, rgba(155,32,32,.18), transparent 50%),
    linear-gradient(180deg, var(--sea-2), #0a1522);
}
.spotlight::before {
  content: "WANTED"; position: absolute; right: -2vw; top: 50%; translate: 0 -50%;
  font: 900 clamp(8rem, 22vw, 20rem)/1 var(--font-poster);
  color: transparent; -webkit-text-stroke: 1px rgba(224,176,79,.12);
  pointer-events: none; white-space: nowrap;
}
.spot-inner { position: relative; display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 70px; align-items: center; }
.spot-poster { perspective: 1200px; }
.sweep { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255,250,225,.7) 50%, transparent 65%); mix-blend-mode: soft-light; transform: translateX(-120%); }
.spot-poster .poster { cursor: zoom-in; }
.spot-poster .poster-card { --tilt: -3deg; }
.p-stamp.case-stamp, .p-stamp.spot-stamp { mix-blend-mode: normal; background: rgba(236,220,176,.82); box-shadow: 0 .4cqw 1cqw rgba(0,0,0,.25); top: 84cqw; bottom: auto; right: 6cqw; font-size: 4.4cqw; padding: .8cqw 2cqw; transform: rotate(-12deg); color: rgba(170,28,28,.88); border-color: rgba(170,28,28,.85); }
.spot-name { margin: 0; font: 800 clamp(2.8rem, 7.4vw, 5.2rem)/1.05 var(--font-pirate); color: var(--gold-2); text-shadow: 0 4px 0 #6b4a16; }
.spot-crime { margin: 10px 0 6px; font: 700 clamp(1.15rem, 2.6vw, 1.5rem)/1.35 var(--font-poster); color: var(--cream); }
.spot-bounty { margin: 0 0 16px; font: 900 clamp(1.6rem, 4vw, 2.6rem)/1.1 var(--font-poster); color: var(--gold); font-variant-numeric: lining-nums tabular-nums; }
.spot-story { max-width: 520px; margin: 0 0 26px; color: var(--muted); }
.spot-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* =========================================================
   CREW WANTED — bảng điều tra toàn băng
   ========================================================= */
.crew-wanted {
  position: relative; overflow-x: clip;
  padding: 100px 0 110px;
  background: radial-gradient(ellipse 60% 45% at 50% 50%, rgba(224,176,79,.1), transparent 70%), linear-gradient(180deg, #0a1522, var(--sea));
}
.cw-board {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 150px;
  grid-template-rows: repeat(6, auto);
  gap: 14px 34px;
  align-items: center; align-content: center;
  padding: 54px 40px 44px;
  border-radius: 6px;
  background:
    radial-gradient(ellipse 55% 45% at 50% 38%, rgba(244,213,138,.12), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #172a3e, #0f1d2c);
  box-shadow:
    inset 0 0 0 12px #3a2414, inset 0 0 0 14px #24140a,
    inset 0 0 50px 16px rgba(0,0,0,.55),
    0 30px 60px rgba(0,0,0,.45);
}
.cw-secret {
  position: absolute; top: 18px; left: 50%; z-index: 4;
  padding: 4px 12px;
  font: 900 .95rem/1 var(--font-poster); letter-spacing: .16em;
  color: #ff7a7a;
  border: 3px solid #ff7a7a;
  border-radius: 5px;
  transform: translateX(-50%) rotate(-3deg);
  pointer-events: none;
}
.cw-center { grid-column: 2; grid-row: 1 / -1; position: relative; z-index: 2; display: grid; justify-items: center; gap: 16px; }
.cw-card { position: relative; width: min(700px, 100%); container-type: inline-size; transform: rotate(-.6deg); filter: drop-shadow(0 24px 26px rgba(0,0,0,.55)); }
.cw-card .pin { top: -1.3cqw; width: 3cqw; height: 3cqw; margin-left: -1.5cqw; }
.cw-card .pin.l { left: 9%; } .cw-card .pin.r { left: 91%; }
.cw-paper {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 3cqw 4.5cqw 2.8cqw;
  color: var(--ink);
  background: var(--paper) url("../images/gen/parchment.webp") center / cover;
  box-shadow: inset 0 0 3cqw rgba(110,65,20,.5), inset 0 0 .6cqw rgba(80,45,10,.55);
  clip-path: polygon(0 1.5%, 3% 0, 11% 1%, 22% 0, 34% 1.2%, 47% .2%, 60% 1%, 72% 0, 85% 1.2%, 95% .2%, 100% 1.6%, 99.5% 20%, 100% 42%, 99.4% 63%, 100% 84%, 99.5% 99%, 88% 100%, 75% 99.2%, 61% 100%, 48% 99.3%, 34% 100%, 21% 99.1%, 9% 100%, 0 99.2%, .5% 80%, 0 58%, .6% 36%, 0 17%);
}
.cw-wanted { margin: 0; font: 900 9.6cqw/.95 var(--font-poster); letter-spacing: .05em; transform: scaleY(1.06); }
.cw-sub { margin: .7cqw 0 0; text-align: center; font: 700 max(.78rem, 2.1cqw)/1.2 var(--font-poster); letter-spacing: .32em; text-transform: uppercase; }
.cw-photo {
  position: relative; display: block;
  width: 100%; aspect-ratio: var(--ar, 2 / 1);
  margin-top: 2cqw; padding: 0;
  border: .6cqw solid var(--ink-soft);
  outline: .25cqw solid rgba(43,29,14,.5); outline-offset: .5cqw;
  overflow: hidden;
  background: #b89a62;
  cursor: zoom-in;
}
.cw-photo:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.cw-photo img { width: 100%; height: 100%; object-fit: cover; object-position: var(--fp, 50% 40%); filter: sepia(.45) contrast(1.05) saturate(.9); transition: filter .4s, transform .6s var(--ease-out); }
.cw-photo:hover img, .cw-photo:focus-visible img { filter: sepia(.15) contrast(1.03); transform: scale(1.03); }
.cw-zoom { position: absolute; right: 2cqw; bottom: 2cqw; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--gold-2); background: rgba(11,20,32,.78); opacity: 0; transition: opacity .2s; }
.cw-photo:hover .cw-zoom, .cw-photo:focus-visible .cw-zoom { opacity: 1; }
.cw-card .p-doa { width: 100%; margin: 2cqw 0 .4cqw; font-size: max(.72rem, 3.2cqw); gap: 1.6cqw; }
.cw-card .p-doa::before, .cw-card .p-doa::after { height: .3cqw; }
.cw-bounty { margin: 0; font: 900 6cqw/1.1 var(--font-poster); letter-spacing: .03em; font-variant-numeric: lining-nums; white-space: nowrap; }
.cw-cap { margin: .8cqw 0 0; padding-top: .1em; font: 800 max(1rem, 2.8cqw)/1.3 var(--font-poster); text-align: center; }
.cw-meta { text-wrap: balance; margin: .5cqw 0 0; font: 600 max(.85rem, 1.8cqw)/1.35 var(--font-mono); color: var(--ink-soft); letter-spacing: .04em; text-align: center; }
.p-stamp.cw-stamp { top: 28%; right: 7cqw; font-size: 4.2cqw; transform: rotate(-9deg); mix-blend-mode: normal; background: rgba(236,220,176,.88); }
.cw-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.cw-count { min-width: 112px; margin: 0; text-align: center; font: 600 .9rem var(--font-mono); letter-spacing: .12em; color: var(--gold-2); }
.cw-all { min-height: 44px; padding: .55em 1.1em; font-size: .95rem; }

.cw-crew { display: contents; }
.cw-badge {
  grid-column: var(--col); grid-row: var(--row);
  position: relative; z-index: 3; justify-self: center;
  display: grid; justify-items: center; gap: 6px;
  width: 128px; padding: 8px 8px 10px;
  font: inherit; color: var(--ink);
  background: #f4ead2;
  border: 0; border-radius: 2px;
  box-shadow: 0 10px 18px rgba(0,0,0,.45);
  transform: translateY(var(--sy, 0px)) rotate(var(--br, 0deg));
  cursor: pointer;
  transition: transform .35s var(--ease-out), box-shadow .25s, filter .3s;
}
.cw-badge:hover, .cw-badge:focus-visible { transform: translateY(calc(var(--sy, 0px) - 4px)) rotate(0deg) scale(1.05); box-shadow: 0 16px 26px rgba(0,0,0,.55); }
.cw-badge:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.cw-badge .pin { position: absolute; top: -7px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8a7b, #a31d14 60%, #5a0c08); box-shadow: 0 3px 5px rgba(0,0,0,.5); }
.cw-badge img { width: 100%; aspect-ratio: 1; object-fit: cover; filter: sepia(.35) contrast(1.05); transition: filter .3s; }
.cw-badge-name { max-width: 100%; padding-top: .14em; font: 800 1rem/1.2 var(--font-poster); text-transform: uppercase; white-space: nowrap; overflow-x: clip; overflow-y: visible; text-overflow: ellipsis; }
.cw-badge-gone {
  position: absolute; left: 50%; top: 40%;
  padding: 2px 8px;
  font: 900 .95rem/1.2 var(--font-poster); letter-spacing: .1em;
  color: rgba(170,28,28,.92);
  background: rgba(244,234,210,.82);
  border: 3px solid rgba(170,28,28,.85); border-radius: 4px;
  transform: translate(-50%, -50%) rotate(-14deg);
  opacity: 0;
  pointer-events: none;
}
.cw-badge[style*="--col:3"], .cw-badge[style*="--col: 3"] { --sy: 50%; }
.cw-badge.gone img { filter: grayscale(1) brightness(.7); }
.cw-badge.gone .cw-badge-gone { opacity: 1; }

.cw-strings { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.cw-strings path { fill: none; stroke: #c62828; stroke-width: 2.2; stroke-linecap: round; filter: drop-shadow(0 2px 1px rgba(0,0,0,.5)); transition: stroke .2s, stroke-width .2s; }
.cw-strings path.hot { stroke: var(--gold-2); stroke-width: 3.4; }

.cw-roll {
  display: flex; gap: 10px; justify-content: safe center;
  max-width: 1000px; margin: 26px auto 0;
  padding: 16px 16px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin;
  background:
    repeating-linear-gradient(90deg, rgba(241,230,204,.5) 0 8px, transparent 8px 20px) left 4px top 4px / 100% 6px no-repeat local,
    repeating-linear-gradient(90deg, rgba(241,230,204,.5) 0 8px, transparent 8px 20px) left 4px bottom 4px / 100% 6px no-repeat local,
    #0b0b0d;
  border-radius: 4px;
}
.cw-roll button { flex: none; width: 120px; aspect-ratio: 3 / 2; padding: 0; overflow: hidden; background: #000; border: 2px solid transparent; border-radius: 3px; opacity: .6; cursor: pointer; scroll-snap-align: center; transition: opacity .2s, border-color .2s, transform .25s var(--ease-out); }
.cw-roll button:hover { opacity: 1; transform: translateY(-2px); }
.cw-roll button[aria-current="true"] { opacity: 1; border-color: var(--gold); }
.cw-roll button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.cw-roll img { width: 100%; height: 100%; object-fit: cover; }

/* lightbox */
.cwbox { width: min(1200px, 100% - 24px); }
.cwbox-body { padding: 18px 22px 26px; }
.cwbox-figure { margin: 0; display: grid; gap: 14px; }
.cwbox-figure img { width: 100%; max-height: calc((100svh - 240px) / var(--z)); object-fit: contain; background: #05090f; border-radius: 4px; }
.cwbox-cap h2 { margin: 0; font: 800 clamp(1.3rem, 2.6vw, 1.8rem)/1.3 var(--font-poster); color: var(--gold-2); }
.cwbox-cap p { margin: 4px 0 0; font: 600 .95rem var(--font-mono); color: var(--muted); }
.cwbox-who { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.cwbox-who li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; font-weight: 600; border: 1px solid rgba(224,176,79,.35); border-radius: 999px; }
.cwbox-who img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.cwbox-year + .cwbox-year { margin-top: 26px; }
.cwbox-year h3 { margin: 0 0 12px; font: 600 .9rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.cwbox-grid { columns: 4 220px; column-gap: 14px; }
.cwbox-grid button {
  display: block; width: 100%; margin: 0 0 14px; padding: 8px 8px 10px;
  break-inside: avoid;
  font: inherit; color: var(--ink); text-align: left;
  background: #f4ead2; border: 0; border-radius: 2px;
  box-shadow: 0 8px 16px rgba(0,0,0,.4);
  transform: rotate(var(--r, 0deg));
  cursor: pointer;
  transition: transform .3s var(--ease-out);
}
.cwbox-grid button:hover, .cwbox-grid button:focus-visible { transform: rotate(0deg) scale(1.03); }
.cwbox-grid img { display: block; width: 100%; height: auto; }
.cwbox-grid span { display: block; margin-top: 6px; font: 700 .95rem/1.3 var(--font-poster); }

@media (max-width: 900px) {
  .cw-board { display: block; padding: 34px 16px 22px; box-shadow: inset 0 0 0 8px #3a2414, inset 0 0 0 10px #24140a, inset 0 0 36px 10px rgba(0,0,0,.55), 0 20px 40px rgba(0,0,0,.4); }
  .cw-secret { position: static; display: table; margin: -18px auto 16px; font-size: .8rem; transform: rotate(-3deg); }
  .cw-crew { display: flex; gap: 12px; margin-top: 18px; padding: 14px 4px 10px; overflow-x: auto; scroll-snap-type: x proximity; }
  .cw-badge { flex: none; width: 92px; padding: 6px 6px 8px; scroll-snap-align: start; }
  .cw-crew .cw-badge[style] { --sy: 0px; }
  .cw-badge-name { font-size: .85rem; }
  .cw-badge-gone { font-size: .8rem; }
  .cw-strings { display: none; }
  .cw-roll button { width: 96px; }
}

/* =========================================================
   MAKER — xưởng in
   ========================================================= */
.maker { padding: 100px 0 110px; background: linear-gradient(180deg, var(--sea), var(--sea-2)); overflow-x: clip; }
.maker-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 56px; align-items: start; max-width: 940px; margin: 0 auto; }
.maker-form { display: grid; gap: 16px; }
.file-drop {
  position: relative;
  display: grid; justify-items: center; gap: 6px;
  padding: 26px 16px;
  text-align: center;
  border: 2px dashed rgba(224,176,79,.4);
  border-radius: 10px;
  background: rgba(224,176,79,.04);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s var(--ease-out);
}
.file-drop:hover, .file-drop.drag { border-color: var(--gold); background: rgba(224,176,79,.1); }
.file-drop.drag { transform: scale(1.02); }
.file-drop:focus-within { outline: 3px solid var(--gold); outline-offset: 3px; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop .ico { width: 34px; height: 34px; color: var(--gold); }
.file-title { font-weight: 700; }
.file-hint { font-size: .82rem; color: var(--muted); }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .92rem; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input {
  min-height: 46px;
  padding: .6em .9em;
  font: 500 1rem var(--font-body);
  color: var(--cream);
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(224,176,79,.3);
  border-radius: 6px;
}
.field input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.maker-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.crop-tools { display: grid; gap: 6px; }
.crop-tools label { display: flex; justify-content: space-between; font-weight: 600; font-size: .92rem; }
.crop-tools output { font: 600 .85rem var(--font-mono); color: var(--gold-2); }
.crop-tools input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--gold); }
.crop-hint { margin: 0; font-size: .82rem; color: var(--muted); }
.p-photo.croppable { cursor: grab; touch-action: none; }
.p-photo.croppable.dragging { cursor: grabbing; }
.p-photo.croppable:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.maker-preview .poster:hover .p-photo img { transform: none; }
.maker-msg { min-height: 1.4em; margin: 0; font-size: .9rem; color: var(--gold-2); }
.maker-preview { position: sticky; top: 90px; }
.maker-preview .poster { cursor: default; }
.maker-preview .view-hint { display: none; }
.submit-box { max-width: 940px; margin: 70px auto 0; padding: 26px 28px; text-align: center; border: 1px solid rgba(224,176,79,.22); border-radius: 10px; background: rgba(11,20,32,.5); }
.submit-box h3 { text-wrap: balance; margin: 0 0 6px; font: 900 1.4rem var(--font-poster); color: var(--gold-2); }
.submit-box p { margin: 0 0 14px; color: var(--muted); text-wrap: pretty; }
.submit-box > :last-child, .submit-box p:has(+ [hidden]) { margin-bottom: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 24px; z-index: 200;
  width: fit-content; max-width: calc(100vw - 32px); margin-inline: auto;
  text-align: center;
  padding: .7em 1.2em;
  font-weight: 600; color: var(--ink);
  background: var(--gold-2);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  transform: translateY(220%);
  opacity: 0; visibility: hidden;
  transition: transform .35s var(--ease-spring), opacity .25s, visibility 0s .35s;
  pointer-events: none;
}
.toast.show { transform: none; opacity: 1; visibility: visible; transition: transform .35s var(--ease-out), opacity .2s; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .spot-inner { grid-template-columns: 1fr; gap: 40px; justify-items: center; text-align: center; }
  .spot-poster { width: min(300px, 78%); }
  .spot-story { margin-inline: auto; }
  .spot-actions { justify-content: center; }
  .maker-inner { grid-template-columns: 1fr; gap: 40px; }
  .maker-inner { display: grid; gap: 16px; }
  .maker-form { display: contents; }
  .file-drop { order: 1; }
  .maker-preview { order: 2; position: static; width: min(220px, 60%); margin: 4px auto 8px; }
  .crop-tools { order: 3; }
  .maker-form > .field, .maker-actions, .maker-msg { order: 4; }
  
  
  
  .modal-body { grid-template-columns: 1fr; padding: 28px 20px; gap: 28px; }
  .modal-body .poster { width: min(230px, 62%); margin: 0 auto; }
  .modal-bar { padding-left: 16px; }
  .dossier { display: flex; flex-direction: column; }
  .dossier > * { order: 3; }
  .dossier .case-name, .dossier .case-crime { order: 1; }
  .dossier .case-actions { order: 2; margin: 0 0 20px; }
  .case-actions .btn { flex: 1 1 auto; white-space: nowrap; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-grid; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 16px 16px;
    background: #0b1420;
    border-bottom: 1px solid rgba(224,176,79,.2);
    display: none;
  }
  .nav-links.open { display: flex; animation: rise .3s var(--ease-out); }
  .nav-links a { padding: 12px 0; }
  .nav-links a:not(.nav-cta)::after { display: none; }
  .nav-links .nav-cta { text-align: center; margin-top: 6px; }
  .nav.menu-open { background: #0b1420; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-wrap { flex: 0 0 auto; }
  .moon-wrap { top: 11%; right: 8%; }
  }
@media (max-width: 560px) {
  .scroll-cue { display: none; }
  .maker-actions .btn { flex: 1 1 100%; }
  .hero { min-height: 0; padding: 104px 16px 176px; }
  .spotlight, .board, .maker, .crew-wanted { padding-top: 76px; padding-bottom: 84px; }
  
  
  .poster-cap .view-hint { display: none; }
  .spot-actions .btn { flex: 1 1 100%; }
  .beam { width: 110vmax; height: 110vmax; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; -webkit-mask: linear-gradient(90deg, #000 85%, transparent); mask: linear-gradient(90deg, #000 85%, transparent); }
  .chip { flex: none; scroll-snap-align: start; }
  .posters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 16px; }
  .poster-cap { flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 12px; font-size: .75rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  
}

@media (max-width: 370px) {
  .modal-nav { gap: 4px; }
  .modal-bar .icon-btn { width: 40px; height: 40px; }
  .modal-bar { padding-left: 12px; }
  .cw-sub { letter-spacing: .2em; }
  .moon-wrap { top: 6%; }
  .nav-logo span { display: none; }
  .hero-wanted { display: none; }
}
.nav-logo span { white-space: nowrap; }

/* Sàn cỡ chữ khi desktop thu 80% — đặt cuối file để không bị luật sau đè */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  /* sau khi thu 80%, chữ phụ vẫn ≥ ~12px hiển thị */
  .section-sub { font-size: 1.15rem; }
  .cap-crime { font-size: 1rem; }
  .cap-date, .view-hint, .result-count, .modal-count, .cw-count, .crop-hint, .file-hint, .tick-item, .footer .fine { font-size: .95rem; }
  .chip, .field label, .dossier dt, .footer { font-size: 1rem; }
  .case-story, .spot-story, .hero-lead { font-size: 1.15rem; }
  .ticker-label { font-size: .95rem; }
  .cw-sub { font-size: max(.95rem, 2.1cqw); }
  .cw-meta { font-size: max(.95rem, 1.8cqw); }
  .cw-secret { font-size: 1.05rem; }
  .cw-count { font-size: .95rem; }
  .dossier .sub-h, .cwbox-year h3 { font-size: .95rem; }
  .case-actions .btn { font-size: 1rem; }
  .icon-btn { width: 50px; height: 50px; }
  .chip, .search, .sort { min-height: 50px; }
}

@media (max-width: 359px) { .posters { grid-template-columns: minmax(0, 290px); justify-content: center; } }

/* ---------- Reduced motion (OS setting or in-page toggle) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation: none !important; transition-duration: .01ms !important; }
html.reduce-motion { scroll-behavior: auto; }
html.reduce-motion .reveal { opacity: 1; transform: none; }
