/* CastAway — minimal UI (sharp edges, light type) */
@font-face {
  font-family: "Aktiv Grotesk";
  src:
    url("fonts/AktivGrotesk-Medium.woff2") format("woff2"),
    url("fonts/AktivGrotesk-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0a0a0a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.12);
  --text: #ececec;
  --muted: rgba(255, 255, 255, 0.5);
  --muted2: rgba(255, 255, 255, 0.28);
  --accent: #c4c4c4;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --green: #86efac;
  --green-soft: rgba(134, 239, 172, 0.12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-castaway: "Inter", var(--font);
  --font-display: "Inter", var(--font);
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 0;
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --radius-pill: 0;
  --ca-ease-out: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ca-ease-spring: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ca-header-clearance: calc(env(safe-area-inset-top, 0px) + 0.75rem);
}

@keyframes ca-screen-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
  background-attachment: fixed;
}

body::before {
  display: none;
}

.app {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
}

.ca-newgame-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: #f5f5f5;
  color: #0a0a0a;
  font-family: var(--font);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.ca-newgame-btn:hover {
  background: #fff;
}
.ca-newgame-btn:active {
  opacity: 0.85;
}

.ca-newgame-icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  margin-left: 0.05rem;
}

.ca-btn {
  padding: 0.55rem 1.15rem;
  font-size: 0.75rem;
  font-family: var(--font);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}
.ca-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ─── Main: full viewport scroll area ─── */
.ca-main {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
  background: transparent;
}
.ca-main::-webkit-scrollbar {
  width: 6px;
}
.ca-main::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 139, 122, 0.35), rgba(139, 92, 246, 0.25));
  border-radius: 999px;
}

/* Home: single viewport — no extra document height (footer is fixed) */
.ca-main:has(.start-screen) {
  overflow-y: hidden;
  overscroll-behavior: none;
}

.start-screen,
.genre-pick-screen,
.game-screen,
.result-screen,
.loading-screen,
.error-screen {
  animation: ca-screen-in 0.5s var(--ca-ease-out) both;
}

/* ─── START SCREEN (hero + genre entry) ─────────────────────────────────── */
.start-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  font-family: var(--font-castaway);
}

/* ─── Section 1: logo bar on top, card centered in remaining space ─ */
.start-hero-cover {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
  background-color: var(--bg);
}

/* Deepest: posters → dots → light scrim → UI (above) */
.start-hero-posters {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.start-hero-dots-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
  background-attachment: fixed;
}

.start-hero-poster-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(1, 1, 4, 0.78) 0%,
    rgba(3, 3, 7, 0.72) 42%,
    rgba(1, 1, 5, 0.84) 100%
  );
}

.start-hero-posters--fallback {
  opacity: 0;
}

.start-hero-poster-float {
  transform-style: preserve-3d;
  opacity: 1;
}

.start-hero-poster-tile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center 18%;
  background-repeat: no-repeat;
  border-radius: 1px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.start-hero-logo-bar {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding:
    calc(env(safe-area-inset-top, 0px) + 0.55rem)
    clamp(1.25rem, 5vw, 2rem)
    0.65rem;
  box-sizing: border-box;
}

.start-hero-inner {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2rem) 0;
  text-align: center;
}

/* Home card — description + actions centered as one block (no glass chrome) */
.start-hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  margin: 0 auto;
  width: 100%;
  max-width: min(100%, 26rem);
  height: 400px;
  min-height: 0;
  padding: 0 0 4rem;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Logo — CASTAWAY.svg (vector marks are black; invert for dark UI) */
.start-hero-brand-logo {
  display: block;
  width: clamp(5.5rem, 30vw, 8.25rem);
  height: auto;
  max-width: 100%;
  margin: 6px auto 0;
  filter: brightness(0) invert(1) drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
  opacity: 0.97;
}

/* Title + description */
.start-hero-panel-mid {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0.15rem clamp(0.85rem, 3.25vw, 1.15rem) 1.1rem;
}

.start-hero-panel-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0.9rem clamp(0.85rem, 3.25vw, 1.15rem) clamp(0.85rem, 2.5vw, 1.15rem);
}

.start-hero-play-btn.ca-newgame-btn {
  width: auto;
  max-width: min(100%, 16rem);
  align-self: center;
  justify-content: center;
  box-sizing: border-box;
  padding-inline: 1.35rem;
  transition:
    background 0.2s var(--ca-ease-out),
    transform 0.2s var(--ca-ease-out),
    box-shadow 0.2s var(--ca-ease-out),
    border-color 0.2s ease;
}
.start-hero-play-btn.ca-newgame-btn:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
  border-color: #fff;
}
.start-hero-play-btn.ca-newgame-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.start-hero-play-btn.ca-newgame-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 3px;
}

/* Title + description */
.start-hero-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: min(100%, 24rem);
  margin: 0 auto;
  gap: 0.75rem;
  font-size: clamp(0.6875rem, 1.85vw, 0.8125rem);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.start-hero-about {
  margin: 0;
  max-width: 100%;
  font-family: var(--font-castaway);
  font-size: inherit;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: inherit;
  color: inherit;
  text-align: center;
  text-shadow: none;
}

.start-hero-credit {
  margin: 0.95rem 0 0;
  max-width: 100%;
  font-family: var(--font-castaway);
  font-size: clamp(0.5rem, 0.75vw, 0.5625rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.42);
  text-align: center;
  text-shadow: none;
}

.start-hero-inline-link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  border: none;
  transition: color 0.2s ease;
}
.start-hero-inline-link:hover {
  color: var(--text);
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.4rem;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

@media (max-width: 480px) {
  .category-grid:not(.genre-pick-grid) {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.15rem 0 0.35rem;
    margin: 0 -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .category-grid:not(.genre-pick-grid)::-webkit-scrollbar {
    display: none;
  }
  .category-grid:not(.genre-pick-grid) .cat-card {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
}

.cat-card {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem 0.45rem 0.85rem;
  margin: 0;
  font: inherit;
  text-align: center;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.cat-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.cat-card:active {
  transform: translateY(0);
}

.cat-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.cat-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: rgba(255, 255, 255, 0.78);
}

.cat-icon-wrap .cat-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.cat-name {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.2;
}

@media (prefers-reduced-motion: reduce) {
  .start-screen,
  .genre-pick-screen,
  .game-screen,
  .result-screen,
  .loading-screen,
  .error-screen {
    animation: none !important;
  }
  .loading-spinner-rotate {
    animation: none !important;
  }
  .start-hero-play-btn.ca-newgame-btn:hover,
  .start-hero-play-btn.ca-newgame-btn:active {
    transform: none;
  }
}

/* Home: thin bar — pinned to bottom of viewport on start screen */
.start-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  flex-shrink: 0;
  width: 100%;
  font-family: var(--font-castaway);
  box-sizing: border-box;
}

.start-footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.4rem 0.85rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 1.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.5625rem;
  line-height: 1.25;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.01em;
}

.start-footer-copy {
  margin: 0;
  justify-self: start;
  text-align: left;
}

.start-footer-tmdb {
  margin: 0;
  justify-self: end;
  text-align: right;
  color: rgba(255, 255, 255, 0.4);
}

.start-footer-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 1px;
  text-decoration-color: currentColor;
}
.start-footer-link:hover {
  color: inherit;
}

@media (max-width: 720px) {
  .start-footer-inner {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .start-footer-tmdb {
    text-align: left;
  }
}

/* ─── Genre pick — setup (genre + years + dock-style Play) ───────────────── */
.genre-pick-screen {
  position: relative;
  min-height: 100%;
  min-height: 100dvh;
  padding:
    calc(var(--ca-header-clearance) + 2.85rem)
    clamp(1.25rem, 4vw, 2rem)
    calc(7.25rem + env(safe-area-inset-bottom, 0px));
  font-family: var(--font-castaway);
  box-sizing: border-box;
}

.genre-pick-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  max-width: min(400px, 100%);
  margin: 0 auto;
}

.genre-pick-kicker {
  font-size: clamp(0.625rem, 1.2vw, 0.6875rem);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin: 0 0 0.9rem;
}

.genre-pick-title {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 clamp(1.85rem, 5.5vw, 2.75rem);
}

.genre-pick-section-label {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin: 0 0 0.75rem;
  text-align: left;
}

.genre-pick-section-label--after-years {
  margin-top: clamp(1.65rem, 4.5vw, 2.35rem);
}

.genre-pick-year-panel {
  width: 100%;
  margin-bottom: 0.25rem;
  text-align: left;
}

.genre-pick-year-modes {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.65rem;
}

.genre-pick-year-mode {
  flex: 1;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-castaway);
  font-size: clamp(0.78rem, 2vw, 0.875rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(8, 8, 8, 0.65);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.genre-pick-year-mode:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(20, 20, 20, 0.85);
}

.genre-pick-year-mode.is-selected {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.genre-pick-decade-wrap {
  position: relative;
  padding: 0.75rem 0.6rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
}

.genre-pick-decade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
}

.genre-pick-decade-btn {
  box-sizing: border-box;
  min-width: 0;
  padding: 0.5rem 0.4rem;
  font-family: var(--font-castaway);
  font-size: clamp(0.65rem, 2.4vw, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(8, 8, 8, 0.65);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.genre-pick-decade-btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(20, 20, 20, 0.85);
}

.genre-pick-decade-btn.is-selected {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.genre-pick-decade-btn:active {
  opacity: 0.92;
}

/* 2-column — sharp tiles */
.genre-pick-grid.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  align-self: stretch;
  margin-bottom: clamp(2rem, 7vw, 3.5rem);
}

.genre-pick-grid .cat-card {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
  width: 100%;
  min-height: 0;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
  background: rgba(8, 8, 8, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.genre-pick-grid .cat-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(20, 20, 20, 0.85);
}

.genre-pick-grid .cat-card.is-selected {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.genre-pick-grid .cat-card:active {
  opacity: 0.92;
}

.genre-pick-grid .cat-icon-wrap {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.85);
}

.genre-pick-grid .cat-name {
  flex: 1;
  min-width: 0;
  font-size: clamp(0.78rem, 2vw, 0.875rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1.2;
  text-align: left;
  color: rgba(255, 255, 255, 0.88);
}

/* Bottom Play — white bar (matches Guess CTA), max 400px */
.genre-pick-play-wrap {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: calc(2.35rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 1rem;
  box-sizing: border-box;
}

.genre-pick-play {
  pointer-events: auto;
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 400px;
  height: 48px;
  padding: 0 1.5rem;
  font-family: var(--font-castaway);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: none;
  color: #0a0a0a;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  transition: background 0.15s ease, filter 0.15s ease;
}

.genre-pick-play-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #0a0a0a;
}

.genre-pick-play-text {
  line-height: 1;
  color: #0a0a0a;
}

.genre-pick-play:hover {
  background: #fff;
}

.genre-pick-play:active {
  filter: brightness(0.96);
}

.genre-pick-play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ─── GAME SCREEN — tries top / focus centre / dock bottom ──────────────── */
.game-screen {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: calc(11rem + env(safe-area-inset-bottom, 0px));
}

.game-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 1.15rem) 1.25rem 0.75rem;
  background: transparent;
  pointer-events: none;
}

.game-tries {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  pointer-events: auto;
}

.game-tries .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  flex-shrink: 0;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    opacity 0.25s ease;
}

.game-tries .dot.used-wrong {
  background: #fff;
  border-color: #fff;
}

.game-tries .dot.used-correct {
  background: #fff;
  border-color: #fff;
}

.game-tries .dot.current {
  background: #fff;
  border-color: #fff;
  box-shadow: none;
}

.game-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2.65rem;
  min-height: calc(100dvh - 5rem);
  /* Below attempt dots; extra top padding + gap sit orbit + focus lower on screen */
  padding:
    calc(env(safe-area-inset-top, 0px) + 4.05rem)
    0.5rem
    2rem;
}

/* Secondary cast: single horizontal row above the focus actor */
.game-orbit-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  padding: 0 0.75rem;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.game-orbit-row::-webkit-scrollbar {
  display: none;
}

.game-orbit-row:empty {
  display: none;
}

.game-orbit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  width: 96px;
  min-width: 72px;
  max-width: 112px;
  opacity: 0.92;
}

/* Current focus also appears in the strip — read as the active slot */
.game-orbit-card--focus {
  opacity: 1;
}

.game-orbit-card--focus .cast-orbit-clip {
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* Circle mask: blur stays inside the avatar — no rectangular “crop” from the scroll row */
.cast-orbit-clip {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-sizing: border-box;
  isolation: isolate;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Veil on locked faces — light edge darkening only (blend modes were washing out chroma) */
.cast-orbit-clip:has(.blurred)::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at 50% 75%, transparent 40%, rgba(0, 0, 0, 0.2) 100%);
}

.cast-orbit-clip .cast-photo-orbit,
.cast-orbit-clip .cast-initials-orbit {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  display: block;
}

.cast-orbit-clip .cast-initials-orbit {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cast-photo-orbit,
.cast-initials-orbit {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--surface2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  transition: filter 0.5s ease, opacity 0.5s ease;
}

/* Locked faces: blur reads as hidden, but keep skin tones / color (avoid crushing luminance) */
.cast-photo-orbit.blurred,
.cast-initials-orbit.blurred {
  position: relative;
  z-index: 0;
  filter: blur(13px) brightness(0.82) saturate(1.38) contrast(1.02);
  opacity: 0.92;
  transform: scale(1.12);
  transform-origin: center center;
}

.cast-initials-orbit {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted2);
}

.cast-info-orbit {
  width: 100%;
  text-align: center;
}

.cast-name-orbit {
  font-size: 0.625rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.35;
  text-align: center;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

.cast-info-orbit.is-hidden .cast-name-orbit {
  opacity: 0.35;
  filter: blur(3px);
}

.game-focus {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  margin-top: 1.1rem;
}

.game-focus-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 88vw;
}

.game-focus-card.is-just-revealed {
  animation: game-focus-in 0.45s var(--ca-ease-out);
}

@keyframes game-focus-in {
  from {
    opacity: 0.65;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.cast-photo-focus,
.cast-initials-focus {
  width: min(58vw, 240px);
  height: min(58vw, 240px);
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--surface2);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.cast-initials-focus {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.5rem, 8vw, 2rem);
  font-weight: 400;
  color: var(--muted);
}

.cast-name-focus {
  font-size: clamp(0.875rem, 3.2vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  line-height: 1.4;
  max-width: min(92vw, 22rem);
  margin-left: auto;
  margin-right: auto;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

/* Floating dock — no single “card” around the row: three separate controls + optional prev */
.game-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(2.85rem + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  width: calc(100% - 2rem);
  max-width: min(100%, 56rem);
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  padding: 0 1rem;
  box-sizing: border-box;
  overflow: visible;
  background: none;
  border: none;
  box-shadow: none;
}

.game-dock-actions {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(2.25rem, 5vw, 3.5rem);
  width: 100%;
  min-width: 0;
}

/* Guess field column (max 500px) */
.game-dock-center {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 500px;
  width: 100%;
}

.game-dock-hint-wrap {
  position: relative;
  flex: 0 0 auto;
  overflow: visible;
}

.hint-main-btn {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 0;
  height: 48px;
  box-sizing: border-box;
  padding: 0 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.hint-main-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(20, 20, 20, 0.92);
}

.hint-main-btn[aria-expanded='true'] {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.hint-main-btn[aria-expanded='true']:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.hint-main-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hint-lamp-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.hint-main-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1;
}

.hint-count {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(42%, -42%);
  z-index: 2;
  pointer-events: none;
  font-size: 0.625rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1;
  padding: 0.12rem 0.28rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: rgba(12, 12, 12, 0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.hint-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 13.5rem;
  max-width: min(18rem, 85vw);
  padding: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  z-index: 160;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.hint-popover[hidden] {
  display: none !important;
}

.hint-popover-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  padding: 0.5rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.hint-popover-opt:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.hint-popover-opt:disabled {
  cursor: default;
  opacity: 0.85;
}

.hint-popover-k {
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted2);
}

.hint-popover-hint {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.45);
}

.hint-popover-v {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.35;
  word-break: break-word;
}

.game-dock-input-wrap {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
  height: 48px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  overflow: hidden;
}

.game-dock-input-wrap .guess-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0 0.5rem 0 calc(0.5rem + 6px);
  margin: 0;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 46px;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s ease;
}

.game-dock-input-wrap .guess-input:focus {
  background: rgba(255, 255, 255, 0.06);
}

.game-dock-input-wrap .guess-input.shake {
  animation: shake 0.35s ease;
}

.game-dock-input-wrap .guess-input::placeholder {
  color: var(--muted2);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

.game-dock-input-wrap .guess-submit {
  min-width: 4.75rem;
  height: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 0 0.75rem;
  border: none;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  color: #0a0a0a;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 46px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.game-dock-input-wrap .guess-submit:hover {
  background: #fff;
}

.game-dock-input-wrap .guess-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.game-dock .guess-skip {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 0;
  height: 48px;
  box-sizing: border-box;
  padding: 0 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.guess-skip-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.95;
}

.guess-skip-text {
  line-height: 1;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.78);
}

.game-dock .guess-skip:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(20, 20, 20, 0.92);
}

/* ─── RESULT SCREEN ──────────────────────────────────────────────────────── */
.result-screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding-top: var(--ca-header-clearance);
}

/* Outcome banner */
.outcome-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.outcome-banner.win {
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.12), rgba(34, 197, 94, 0.06));
  color: #86efac;
  text-shadow: 0 0 24px var(--green-soft);
}
.outcome-banner.lose {
  background: linear-gradient(90deg, rgba(251, 113, 133, 0.14), rgba(225, 29, 72, 0.06));
  color: #fda4af;
  text-shadow: 0 0 24px var(--red-soft);
}

/* Hero */
.movie-hero {
  position: relative;
  box-sizing: border-box;
  width: calc(100% - 2 * clamp(0.75rem, 3vw, 1.5rem));
  max-width: 1560px;
  height: clamp(220px, 40vh, 520px);
  display: flex;
  align-items: flex-end;
  background: var(--surface);
  margin: 0.75rem auto 0;
  border-radius: var(--radius);
  isolation: isolate;
  overflow: visible;
}

/* Full-bleed strip: image + gradient only (content layers separately below) */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center 22%;
  background-repeat: no-repeat;
  transform: scale(1.02);
  transition: transform 8s ease;
}
.movie-hero:hover .hero-backdrop { transform: scale(1); }

.hero-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 100%;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.1) 18%,
    rgba(0, 0, 0, 0.28) 38%,
    rgba(0, 0, 0, 0.48) 54%,
    rgba(0, 0, 0, 0.68) 70%,
    rgba(0, 0, 0, 0.82) 82%,
    rgba(10, 10, 10, 0.94) 94%,
    var(--bg) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  gap: 1.35rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  padding: clamp(1.25rem, 4.5vh, 2.5rem) 2rem 1.5rem;
  /* Modest overlap into the body — less than half the block so poster/title stay in the banner */
  transform: translateY(20%);
}
.hero-poster {
  width: clamp(120px, 32vw, 172px);
  height: auto;
  flex-shrink: 0;
  display: block;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  align-self: flex-end;
}
.hero-meta    { flex: 1; min-width: 0; }
.movie-title  {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.2vw, 2.35rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}
.movie-tagline {
  font-size: 0.875rem; font-style: italic;
  color: rgba(255,255,255,0.55);
  margin-top: 0.3rem;
}
.movie-badges {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
  margin-top: 0.55rem;
}
.badge {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.22rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
}
.badge-score {
  color: var(--green);
  border-color: rgba(74,222,128,0.35);
  background: rgba(74,222,128,0.08);
}

/* Movie body */
.movie-body {
  box-sizing: border-box;
  padding: 0 2rem calc(6rem + env(safe-area-inset-bottom, 0px));
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Room for hero poster/title overlapping from above (matches .hero-content translateY) */
.result-screen .movie-body {
  position: relative;
  z-index: 1;
  padding-top: clamp(2rem, 9vh, 4.75rem);
}

.cf-section {
  padding: 1.75rem 0;
}
.cf-section--credits {
  padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px));
}
.cf-section:first-child {
  padding-top: 1rem;
}

.overview-para {
  font-size: 0.9375rem;
  line-height: 1.52;
  color: rgba(240,240,240,0.78);
}

.director-line {
  margin-top: 0.85rem;
  font-size: 0.8125rem; color: var(--muted);
}
.overview-para + .director-line {
  margin-top: 1.35rem;
}
.director-line strong { color: var(--text); font-weight: 500; }

/* Section label — small caps row (genres, cast, credits, etc.) */
.result-section-label {
  margin: 0 0 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted2);
  line-height: 1.25;
}

.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0;
}
.detail-chip {
  font-size: 0.75rem;
  padding: 0.22rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.result-extras {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-extra-line {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: rgba(240, 240, 240, 0.78);
}

.result-extra-k {
  display: inline-block;
  margin-right: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted2);
  vertical-align: baseline;
}

/* Result cast — wraps to new rows (full billing list from TMDB) */
.result-cast-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.result-cast-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.75rem, 1fr));
  gap: 1.1rem 0.65rem;
  align-items: start;
}

.result-cast-row--extra {
  margin-top: 1.1rem;
}

/* [hidden] must win over .result-cast-row { display: grid } (same specificity) */
.result-cast-row--extra[hidden] {
  display: none !important;
}

.result-cast-show-more {
  align-self: flex-start;
  margin-top: 1rem;
  padding: 0.4rem 0;
  font-family: var(--font-castaway);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  transition: color 0.15s ease;
}

.result-cast-show-more:hover {
  color: rgba(255, 255, 255, 0.88);
}

.result-cast-show-more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.result-cast-card {
  min-width: 0;
  max-width: 8rem;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.result-cast-avatar-wrap {
  position: relative;
  width: 72px;
  margin: 0 auto 0.45rem;
  box-sizing: content-box;
}

.result-cast-photo {
  width: 72px; height: 72px;
  border-radius: 50%; margin: 0 auto;
  object-fit: cover;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  display: block;
}
.result-cast-initials {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--surface2); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem; font-weight: 700; color: var(--muted);
  margin: 0 auto;
}
.result-cast-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}
.result-cast-char {
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 0.12rem;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

/* Result — sticky action dock (icons + labels) */
.result-actions-wrap {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: calc(2.35rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 1rem;
  box-sizing: border-box;
}

.result-actions {
  pointer-events: auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  max-width: min(760px, 100%);
}

.result-action-btn {
  flex: 1;
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0 0.85rem;
  font-family: var(--font-castaway);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: var(--radius);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    filter 0.15s ease;
}

.result-action-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.result-action-label {
  line-height: 1.15;
  white-space: nowrap;
}

.result-action-btn--primary {
  color: #0a0a0a;
  background: rgba(255, 255, 255, 0.96);
}

.result-action-btn--primary:hover {
  background: #fff;
}

.result-action-btn--primary:active {
  filter: brightness(0.96);
}

.result-action-btn--secondary {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(8, 8, 8, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}

.result-action-btn--secondary:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(20, 20, 20, 0.92);
}

.result-action-btn--secondary:active {
  opacity: 0.94;
}

.result-action-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ─── Loading / Error ────────────────────────────────────────────────────── */
.loading-screen {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: var(--ca-header-clearance) 1rem 1rem;
  font-family: var(--font-castaway);
  color: var(--muted);
}
.loading-spinner {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}
.loading-spinner-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.loading-spinner-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1.25;
}
.loading-spinner-arc {
  fill: none;
  stroke: rgba(255, 255, 255, 0.52);
  stroke-width: 1.25;
  stroke-linecap: butt;
  stroke-dasharray: 26.5 90;
}
.loading-spinner-rotate {
  transform-origin: 20px 20px;
  animation: loading-spin 1.05s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.loading-text {
  margin: 0;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}
@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.error-screen {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: calc(var(--ca-header-clearance) + 0.5rem) 2rem 2rem;
  text-align: center;
}
.error-msg {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.55;
  color: #fda4af;
  max-width: 360px;
  text-shadow: 0 0 40px var(--red-soft);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero-content  { padding: clamp(0.85rem, 3.25vh, 1.65rem) 1rem 1.15rem; }
  .movie-body    { padding: 0 1rem calc(6rem + env(safe-area-inset-bottom, 0px)); }
  .result-screen .movie-body {
    padding-top: clamp(1.65rem, 8vh, 4rem);
  }

  /* CastAway game — full-bleed cast strip (scroll when overflow); focus sits lower */
  .game-screen {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: calc(13rem + env(safe-area-inset-bottom, 0px));
  }

  .game-stage {
    align-items: stretch;
    gap: 2.45rem;
    min-height: 0;
    padding:
      calc(env(safe-area-inset-top, 0px) + 3.85rem)
      0
      1.25rem;
    overflow-x: visible;
  }

  .game-orbit-row {
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-self: stretch;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 0;
    padding-left: max(0px, env(safe-area-inset-left, 0px));
    padding-right: max(0px, env(safe-area-inset-right, 0px));
    gap: 0.4rem;
    scroll-padding-left: max(0px, env(safe-area-inset-left, 0px));
    scroll-padding-right: max(0px, env(safe-area-inset-right, 0px));
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  .game-orbit-card {
    width: 76px;
    min-width: 68px;
    max-width: 92px;
    gap: 0.28rem;
  }

  .cast-orbit-clip,
  .cast-photo-orbit,
  .cast-initials-orbit {
    width: 44px;
    height: 44px;
  }

  .cast-name-orbit {
    font-size: 0.5625rem;
    line-height: 1.3;
    max-height: 2.75em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .game-focus {
    align-self: center;
    margin-top: 0;
    padding: 0.5rem clamp(0.75rem, 4vw, 1.25rem);
  }

  .cast-photo-focus,
  .cast-initials-focus {
    width: min(42vw, 188px);
    height: min(42vw, 188px);
  }

  .cast-initials-focus {
    font-size: clamp(1.1rem, 5.5vw, 1.6rem);
  }

  .cast-name-focus {
    font-size: clamp(0.78rem, 2.85vw, 0.95rem);
    max-width: min(96vw, 20rem);
  }

  /* Hint + Skip in one row above the guess field */
  .game-dock-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    align-items: stretch;
    gap: 0.5rem 0.55rem;
    flex-wrap: unset;
    justify-content: stretch;
    justify-items: stretch;
  }

  .game-dock-hint-wrap {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .game-dock-hint-wrap .hint-main-btn {
    width: 100%;
    height: 38px;
    padding: 0 0.4rem;
    gap: 0.32rem;
  }

  .game-dock .guess-skip {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    height: 38px;
    padding: 0 0.4rem;
    gap: 0.32rem;
    font-size: 0.625rem;
  }

  .hint-lamp-icon,
  .guess-skip-icon {
    width: 15px;
    height: 15px;
  }

  .hint-main-label {
    font-size: 0.625rem;
    letter-spacing: 0.06em;
  }

  .game-dock-center {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    width: 100%;
  }

  .game-dock-hint-wrap .hint-popover {
    left: 0;
    right: auto;
    transform: none;
    min-width: 0;
    width: min(18rem, calc(100vw - 2.5rem));
    max-width: min(18rem, calc(100vw - 2.5rem));
  }

  .game-dock-input-wrap {
    height: 44px;
  }

  .game-dock-input-wrap .guess-input {
    font-size: 0.8125rem;
    line-height: 42px;
  }

  .game-dock-input-wrap .guess-submit {
    min-width: 4.25rem;
    font-size: 0.75rem;
    line-height: 42px;
  }
}
