/* ============================================================
   WEEP WORLD — landing (the live city)
   ============================================================
   The title screen is a scrolling page over a live voxel render of the
   board (js/landing/). The canvas is fixed; chapters scroll over it and the
   camera follows. Type and colour come from skin.css's tokens so the landing
   and the game still read as one product. */

.title-screen.ww {
  display: block;
  padding: 0;
  background: #06050b;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 200, 60, 0.35) transparent;
}
.ww-canvas, .ww-poster, .ww-shade, .ww-labels {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.ww-canvas { z-index: 0; display: block; opacity: 0; transition: opacity 1.4s ease; }
body.ww-live .ww-canvas { opacity: 1; }
/* Until the city stands (and for good, without WebGL): a dusk poster. */
.ww-poster {
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 70% 78%, rgba(255, 120, 90, 0.35), transparent 70%),
    linear-gradient(180deg, #1c2458 0%, #5a3a78 45%, #ff8a6a 78%, #2a1a2a 100%);
  transition: opacity 1.4s ease;
}
.ww-poster::after {
  content: ''; position: absolute; inset: 0;
  background: url('../assets/landing/ww_poster.jpg') center 40% / cover no-repeat;
  opacity: 0.95;
}
body.ww-live .ww-poster { opacity: 0; }
.ww-shade {
  z-index: 1;
  background:
    linear-gradient(100deg, rgba(6, 5, 11, 0.78) 0%, rgba(6, 5, 11, 0.5) 30%, rgba(6, 5, 11, 0) 56%),
    linear-gradient(180deg, rgba(6, 5, 11, 0.45) 0%, transparent 18%, transparent 80%, rgba(6, 5, 11, 0.55) 100%);
  transition: opacity 0.6s ease;
}

/* ---- the HUD strip ---------------------------------------------------- */
.ww-hud {
  position: fixed; top: 18px; right: 20px; z-index: 4;
  display: flex; gap: 0;
  background: var(--ww-glass);
  border: 1px solid var(--ww-line);
  border-left: 3px solid var(--ww-pink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.33);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0; transform: translateY(-8px);
  transition: opacity 0.8s ease 0.6s, transform 0.8s ease 0.6s;
}
body.ww-live .ww-hud { opacity: 1; transform: none; }
.ww-hud-cell { padding: 7px 14px 8px; border-left: 1px solid rgba(255, 255, 255, 0.07); min-width: 72px; }
.ww-hud-cell:first-child { border-left: 0; }
.ww-hud-cell span { display: block; font-family: var(--ww-ui); font-weight: 700; font-size: 10px; letter-spacing: 0.24em; color: var(--ww-dim); }
.ww-hud-cell b { display: block; font-family: 'Press Start 2P', monospace; font-weight: 400; font-size: 13px; color: var(--ww-cream); margin-top: 5px; white-space: nowrap; }
.ww-hud-cash b { color: #7dff9a; }
.ww-stars { --lit: 0; display: flex !important; gap: 3px; }
.ww-stars i { width: 12px; height: 12px; background: rgba(255, 255, 255, 0.13); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); transition: background 0.25s ease; }
.ww-stars i:nth-child(1) { background: rgba(255, 200, 60, calc(0.13 + 0.87 * min(1, var(--lit)))); }
.ww-stars i:nth-child(2) { background: rgba(255, 200, 60, calc(0.13 + 0.87 * clamp(0, var(--lit) - 1, 1))); }
.ww-stars i:nth-child(3) { background: rgba(255, 200, 60, calc(0.13 + 0.87 * clamp(0, var(--lit) - 2, 1))); }
.ww-stars i:nth-child(4) { background: rgba(255, 200, 60, calc(0.13 + 0.87 * clamp(0, var(--lit) - 3, 1))); }
.ww-stars i:nth-child(5) { background: rgba(255, 200, 60, calc(0.13 + 0.87 * clamp(0, var(--lit) - 4, 1))); }

/* ---- district labels (the board chapters) ------------------------------ */
.ww-labels { z-index: 2; opacity: 0; }
/* The crew stands in front of the board on the hero, like key art. Over the
   shade so it isn't darkened, under the words. On phones js/landing/crew.js
   sets --crew-bottom so their feet land on the headline. */
.ww-crew {
  position: fixed; z-index: 2; pointer-events: none; display: block;
  right: 0; bottom: 0; width: min(58vw, 1060px); height: calc(var(--vh, 1vh) * 56);
  opacity: 0; transition: opacity 0.8s ease;
}
body.ww-static .ww-crew, body.cs-picking .ww-crew { display: none; }
.ww-label {
  position: absolute; left: 0; top: 0;
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--ww-display); font-size: 13px; letter-spacing: 0.08em;
  color: var(--ww-cream); white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 4px 12px rgba(0, 0, 0, 0.35);
  will-change: transform;
}
.ww-label b { font-weight: 400; padding: 2px 8px; background: rgba(6, 5, 11, 0.62); border: 1px solid rgba(255, 200, 60, 0.28); }
.ww-label::after { content: ''; width: 1px; height: 22px; background: linear-gradient(rgba(255, 200, 60, 0.8), transparent); }
.ww-label i { font-style: normal; font-family: var(--ww-ui); font-weight: 700; font-size: 10px; letter-spacing: 0.22em; color: #14030a; background: var(--ww-gold); padding: 1px 6px; margin-top: 3px; }
.ww-label-home b { color: var(--ww-gold); border-color: var(--ww-pink); font-size: 17px; animation: ww-pulse 2.4s ease-in-out infinite; }
@keyframes ww-pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 47, 106, 0.18), 0 0 30px rgba(255, 47, 106, 0.35); } }

/* ---- scrolling chapters ---------------------------------------------- */
.ww-scroll { position: relative; z-index: 3; }
.ww-sec {
  position: relative;
  min-height: calc(var(--vh, 1vh) * 150);
  display: flex;
  align-items: center;
  padding: 0 clamp(20px, 5vw, 72px);
}
.ww-hero {
  min-height: calc(var(--vh, 1vh) * 100);
  flex-direction: column; align-items: flex-start; justify-content: center;
  padding-top: 56px; padding-bottom: 90px;
}
.ww-hero-copy { width: min(560px, 100%); flex: 0 0 auto; max-width: none; }
/* style.css shrinks every .btn on a phone; the front door keeps its size. */
body.mobile .ww .btn-play-now { font-size: 30px; padding: 15px 18px; }
body.mobile .ww #btnStart { font-size: 20px; padding: 12px 18px; }
.ww-hero .hero-kicker { opacity: 0; animation: ww-rise 0.9s ease 0.15s forwards; }
.ww-hero .hero-tag { font-family: var(--ww-display); font-weight: 400; font-size: clamp(30px, 3.6vw, 52px); line-height: 1.02; letter-spacing: 0.01em; color: var(--ww-cream); text-transform: uppercase; max-width: 13ch; margin: 0 0 26px; opacity: 0; animation: ww-rise 0.9s ease 0.3s forwards; text-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 0 40px rgba(0, 0, 0, 0.6); }
.ww-hero .gate-card-hero { opacity: 0; animation: ww-rise 0.9s ease 0.45s forwards; background: rgba(8, 6, 12, 0.66); }
.ww-hero .hero-reassure { opacity: 0; animation: ww-rise 0.9s ease 0.6s forwards; }
@keyframes ww-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* The rooftop sign in the live city is the wordmark; the type version stays
   for screen readers, and comes back when the city cannot load. */
.ww-wordmark { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.ww-static .ww-wordmark { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; margin-bottom: 14px; opacity: 0; animation: ww-rise 0.9s ease 0.2s forwards; }
.ww-cue {
  /* Under the words, not centred: the crew stands at the bottom middle. */
  position: absolute; left: clamp(20px, 5vw, 72px); bottom: 26px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  font-family: var(--ww-ui); font-weight: 700; font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(239, 232, 218, 0.72);
  opacity: 0; animation: ww-rise 1s ease 2.4s forwards;
}
.ww-cue i { width: 14px; height: 14px; border-right: 2px solid var(--ww-gold); border-bottom: 2px solid var(--ww-gold); transform: rotate(45deg); animation: ww-bob 1.6s ease-in-out infinite; }
@keyframes ww-bob { 50% { transform: translateY(6px) rotate(45deg); } }

.ww-card {
  width: min(460px, 100%);
  padding: 26px 28px 24px;
  background: rgba(8, 6, 12, 0.72);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(255, 200, 60, 0.18);
  border-left: 4px solid var(--ww-pink);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), 0 12px 36px rgba(0, 0, 0, 0.33);
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ww-card.in { opacity: 1; transform: none; }
.ww-right { margin-left: auto; }
.ww-num { font-family: 'Press Start 2P', monospace; font-size: 12px; color: var(--ww-gold); margin-bottom: 12px; }
.ww-num span { color: var(--ww-dim); }
.ww-card h2 { font-family: var(--ww-display); font-weight: 400; font-size: clamp(30px, 3.2vw, 44px); line-height: 1; color: var(--ww-cream); margin: 0 0 14px; text-transform: uppercase; text-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.ww-card p { font-family: var(--ww-ui); font-weight: 600; font-size: 18px; line-height: 1.42; color: #d8d1c2; margin: 0 0 12px; }
.ww-card .ww-note { font-size: 15px; color: var(--ww-amber); margin: 14px 0 0; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.ww-ballot-label { font-family: var(--ww-ui); font-weight: 700; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ww-dim); margin-top: 16px; }
.ww-ballot { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 7px; }
.ww-ballot li { display: grid; grid-template-columns: 118px 1fr 40px; align-items: center; gap: 10px; font-family: var(--ww-ui); font-weight: 700; font-size: 15px; color: var(--ww-cream); }
.ww-ballot span { height: 8px; background: rgba(255, 255, 255, 0.08); position: relative; overflow: hidden; }
.ww-ballot span::after { content: ''; position: absolute; inset: 0; width: calc(var(--v) * 100%); background: linear-gradient(90deg, var(--ww-pink), var(--ww-gold)); transform-origin: left; transform: scaleX(0); transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s; }
.ww-card.in .ww-ballot span::after { transform: scaleX(1); }
.ww-ballot li:first-child b { color: var(--ww-gold); }
.ww-ballot em { font-style: normal; font-family: 'Press Start 2P', monospace; font-size: 10px; color: var(--ww-dim); text-align: right; }

.ww-cta { justify-content: center; text-align: center; min-height: calc(var(--vh, 1vh) * 120); }
.ww-cta-inner { display: flex; flex-direction: column; align-items: center; }
.ww-cta .hero-kicker { border-left: 0; padding-left: 0; }
.ww-cta-title { font-family: var(--ww-display); font-weight: 400; font-size: clamp(54px, 8vw, 120px); line-height: 0.9; color: var(--ww-gold); text-transform: uppercase; margin: 6px 0 26px; text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 60px rgba(255, 200, 60, 0.35); }
.ww-cta-btn { width: min(420px, 86vw); }

/* ---- more from the studio: a quiet strip under the last chapter ------- */
.ww-family { position: relative; margin: 0 auto; width: min(760px, 100%); padding: 28px clamp(20px, 5vw, 72px) 40px; border-top: 1px solid rgba(255, 200, 60, 0.18); font-family: var(--ww-ui); text-align: center; background: rgba(6, 5, 11, 0.72); }
.ww-family-head { font-weight: 700; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ww-dim); margin-bottom: 14px; }
.ww-family-head a { color: var(--ww-gold); text-decoration: none; }
.ww-family ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; }
.ww-family li { display: flex; flex-direction: column; gap: 2px; max-width: 220px; }
.ww-family li a { font-weight: 700; font-size: 15px; color: var(--ww-cream); text-decoration: none; letter-spacing: 0.04em; }
.ww-family li a:hover, .ww-family-head a:hover { color: var(--ww-gold); text-decoration: underline; }
.ww-family li span { font-weight: 500; font-size: 13px; color: var(--ww-dim); line-height: 1.3; }

/* ---- character select over the running city -------------------------- */
body.cs-picking .ww-sec:not(.ww-hero), body.cs-picking .ww-family, body.cs-picking .ww-cue, body.cs-picking .ww-hud,
body.cs-picking .ww-hero .hero-kicker, body.cs-picking .ww-hero .hero-tag { display: none !important; }
body.cs-picking .title-screen.ww { overflow: hidden; }
body.cs-picking .ww-hero { min-height: calc(var(--vh, 1vh) * 100); justify-content: center; padding-top: 28px; padding-bottom: 28px; }
body.cs-picking .ww-hero-copy { width: min(1040px, 100%); }
body.cs-picking .ww-wordmark { position: static; width: auto; height: auto; clip: auto; overflow: visible; font-size: clamp(40px, 5vw, 64px); flex-direction: row; gap: 0.18em; animation: none; opacity: 1; }
body.cs-picking #csStepChar { background: rgba(8, 6, 12, 0.62); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255, 200, 60, 0.16); border-left: 4px solid var(--ww-pink); padding: 20px 22px 22px; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5); }
body.cs-picking .char-stage { background: radial-gradient(ellipse at 50% 30%, rgba(255, 200, 60, 0.14), transparent 62%), linear-gradient(180deg, rgba(12, 9, 16, 0.15), rgba(12, 9, 16, 0.6)); }
body.cs-picking .char-card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.45)); }

/* ---- no WebGL / still mode --------------------------------------------- */
body.ww-static .ww-canvas, body.ww-static .ww-labels, body.ww-static .ww-hud { display: none; }
body.ww-static .ww-card { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .ww-card { transition: opacity 0.3s ease; transform: none; }
  .ww-hero .hero-kicker, .ww-hero .hero-tag, .ww-hero .gate-card-hero, .ww-hero .hero-reassure, .ww-wordmark, .ww-cue { animation-duration: 0.01s; animation-delay: 0s; }
  .ww-cue i, .ww-label-home b { animation: none; }
}

/* ---- phones and portrait tablets: the city on top, the words underneath */
@media (max-width: 760px), (max-aspect-ratio: 9/10) {
  .ww-shade { background: linear-gradient(180deg, rgba(6, 5, 11, 0.25) 0%, transparent 22%, transparent 42%, rgba(6, 5, 11, 0.82) 68%, rgba(6, 5, 11, 0.94) 100%); }
  .ww-hud { top: 10px; right: 10px; left: 10px; justify-content: space-between; }
  .ww-hud-cell { padding: 5px 9px 6px; min-width: 0; }
  .ww-hud-cell b { font-size: 10px; }
  .ww-hero { justify-content: flex-end; padding: 60px 16px 22px; }
  .ww-hero .hero-kicker { font-size: 10px; margin-bottom: 8px; }
  .ww-hero .hero-tag { font-size: 27px; margin-bottom: 12px; max-width: 16ch; }
  .ww-hero .play-now-sub { font-size: 13px; }
  .ww-hero .hero-reassure { display: none; }
  .ww-cue { display: none; }
  .ww-hero .gate-card-hero { padding: 16px 16px 14px; }
  .ww-crew { left: 0; right: 0; width: 100%; bottom: var(--crew-bottom, 34vh); height: calc(var(--vh, 1vh) * 26); }
  .ww-sec:not(.ww-hero) { align-items: flex-end; padding: 0 16px calc(var(--vh, 1vh) * 10); min-height: calc(var(--vh, 1vh) * 130); }
  .ww-card { padding: 20px 18px 18px; }
  .ww-card h2 { font-size: 30px; }
  .ww-card p { font-size: 16px; }
  .ww-ballot li { grid-template-columns: 96px 1fr 34px; font-size: 14px; }
  .ww-cta { align-items: center; }
  .ww-label { font-size: 10px; }
  .ww-label-home b { font-size: 13px; }
  .ww-label i { font-size: 8px; }
  body.cs-picking .ww-hero { justify-content: flex-start; padding: 16px 12px; }
  body.cs-picking #csStepChar { padding: 12px; background: rgba(8, 6, 12, 0.7); }
  body.cs-picking .char-pick .char-section { flex: 0 0 auto; }
  body.cs-picking .ww-shade { background: linear-gradient(180deg, rgba(6, 5, 11, 0.2), rgba(6, 5, 11, 0.55)); }
}

/* ---- the crew picker ---------------------------------------------------
   Cards carry a rendered portrait of the voxel model and each character's
   signature colour (--c). The stage beside them is a live 3D plinth
   (js/voxel/stage.js); its portrait <img> is the fallback. */
.ww .char-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ww .char-card {
  --c: #ffc83c;
  position: relative;
  padding: 0 0 12px;
  gap: 2px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(ellipse 80% 60% at 50% 72%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.5));
  transition: transform 160ms cubic-bezier(.2, .8, .2, 1), border-color 160ms, box-shadow 160ms;
}
.ww .char-card::before {           /* a floor line the figure stands on */
  content: ''; position: absolute; left: 12%; right: 12%; top: calc(100% - 64px); height: 2px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c) 70%, transparent), transparent);
  opacity: 0.55;
}
.ww .char-card img {
  width: 100%; height: 150px;
  object-fit: contain; object-position: 50% 100%;
  image-rendering: auto;
  margin-top: 6px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
  transition: transform 220ms cubic-bezier(.2, .9, .3, 1.3);
}
.ww .char-card .char-name { font-size: 24px; color: var(--ww-cream); margin-top: 4px; }
.ww .char-card .char-tag { font-size: 11px; letter-spacing: 2.5px; color: color-mix(in srgb, var(--c) 70%, var(--ww-cream)); }
.ww .char-card:hover, .ww .char-card.previewing, .ww .char-card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c) 75%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent), 0 12px 30px color-mix(in srgb, var(--c) 25%, transparent), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.ww .char-card:hover img, .ww .char-card.previewing img { transform: translateY(-4px) scale(1.05); }
.ww .char-card.picked { border-color: var(--c); box-shadow: 0 0 0 2px var(--c), 0 0 34px color-mix(in srgb, var(--c) 40%, transparent), 0 8px 24px rgba(0, 0, 0, 0.35); }

.ww .char-stage {
  --c: #ffc83c;
  background:
    radial-gradient(ellipse 70% 55% at 50% 62%, color-mix(in srgb, var(--c) 26%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(12, 9, 16, 0.25), rgba(12, 9, 16, 0.75));
  border-left-color: var(--c);
  transition: border-color 300ms;
  min-height: 460px;
}
.ww .char-stage::before { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, transparent), transparent 85%); }
.ww .char-stage .stage-sprite { width: 220px; height: 293px; image-rendering: auto; object-fit: contain; }
.ww .char-stage.live .stage-sprite, .ww .char-stage.live .stage-floor { display: none; }
.ww .stage-canvas { position: relative; display: block; width: 100%; height: 340px; margin-bottom: 4px; }
.ww .char-stage.live.empty .stage-canvas { visibility: visible; }
.ww .stage-role { color: var(--c); transition: color 300ms; }

@media (max-width: 860px) {
  .ww .char-grid { gap: 8px; }
  .ww .char-card img { height: 96px; margin-top: 4px; }
  .ww .char-card::before { top: calc(100% - 50px); }
  .ww .char-card .char-name { font-size: 18px; }
  .ww .char-card .char-tag { font-size: 9px; letter-spacing: 1.2px; }
  .ww .char-stage { min-height: 0; }
  .ww .char-stage .stage-sprite { width: 84px; height: 112px; }
  .ww .stage-canvas { width: 124px; height: 168px; flex: 0 0 124px; margin: -8px 0 -8px -8px; }
}
.ww-guides + .ww-family { border-top: 0; padding-top: 4px; }
