/* ————————————————————————————————————————————————
   Guess the Slot — "Payout" build
   Casino-night palette · Big Win result banner · labeled board
   Display: Bricolage Grotesque · Body: Instrument Sans · Numbers: Spline Sans Mono
   ———————————————————————————————————————————————— */

:root {
  --bg: #121015;
  --panel: #1a171c;
  --panel-2: #211d24;
  --field: #151217;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);
  --text: #f4efe6;
  --soft: #cfc7b8;
  --muted: #948b7d;

  --gold: #e2b05b;
  --gold-deep: #c98f2d;
  --grad: linear-gradient(135deg, #f0c46a, #d89b33);
  --glow: 0 10px 36px rgba(216, 155, 51, 0.32);

  --ok: #58c988;
  --close: #e0a23e;
  --bad: #e25e6e;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ————— background: quiet, warm, static ————— */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 40% at 50% -5%, rgba(226, 176, 91, 0.11), transparent 70%),
    radial-gradient(45% 35% at 85% 100%, rgba(120, 60, 40, 0.1), transparent 70%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.4) 100%);
}

/* film grain: breaks digital flatness (redesign-skill: surface upgrade) */
.grain {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.fx-canvas {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ————— top bar ————— */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0 0.5rem;
}

.bar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.logo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(226, 176, 91, 0.7);
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bar-stat {
  padding: 0.3rem 0.4rem;
  font: 500 0.78rem var(--mono);
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.meta-pill.is-pulse {
  animation: meta-pop 0.45s ease;
}

@keyframes meta-pop {
  40% {
    transform: scale(1.12);
    border-color: var(--gold);
    color: var(--gold);
  }
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: 700 0.9rem var(--body);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.sound-btn.is-on {
  color: var(--gold);
  border-color: rgba(226, 176, 91, 0.45);
}

/* ————— mode tabs: left-aligned strip, not three cards ————— */
.modes {
  display: flex;
  gap: 1.6rem;
  padding: 0.5rem 0 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.mode-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0.45rem 2px 0.65rem;
  cursor: pointer;
  text-align: left;
  display: grid;
  gap: 1px;
  color: var(--muted);
  position: relative;
  transition: color 0.15s ease;
}

.mode-btn b {
  font: 700 1rem var(--display);
  color: var(--muted);
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.mode-btn span {
  font: 500 0.7rem var(--mono);
  letter-spacing: 0.03em;
}

.mode-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -1px;
  height: 2px;
  background: var(--grad);
  transition: right 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mode-btn:hover b {
  color: var(--soft);
}

.mode-btn.is-active b {
  color: var(--text);
}

.mode-btn.is-active span {
  color: var(--gold);
}

.mode-btn.is-active::after {
  right: 0;
}

/* ————— arena + stage ————— */
.arena {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 2rem;
}

/* cardless: the clue card / cover art IS the surface, no box-in-box */
.stage {
  position: relative;
  animation: stage-enter 0.5s ease both;
}

@keyframes stage-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ————— clue card ————— */
.clue-stage {
  margin: 0;
}

.clue-visual {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(175deg, var(--panel-2), var(--field) 70%);
  overflow: hidden;
  position: relative;
  perspective: 800px;
  box-shadow: 0 24px 60px rgba(10, 6, 2, 0.5);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.clue-visual .viz {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.8rem 0.85rem 1.1rem;
  width: 100%;
  min-height: 175px;
  overflow: hidden;
}

.clue-visual .viz .clue-body {
  margin: auto;
}

.viz-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-repeat: no-repeat;
}

.viz-photo.is-crop {
  background-size: 380%;
  filter: blur(5px) saturate(1.2);
  opacity: 0.8;
}

.viz-photo.is-crop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 35%, rgba(18, 16, 21, 0.9) 100%);
}

.clue-head {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.clue-count {
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.clue-nav {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(18, 16, 21, 0.7);
  color: var(--soft);
  font: 700 1.05rem var(--body);
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.clue-nav:hover:not(:disabled) {
  color: var(--gold);
  border-color: rgba(226, 176, 91, 0.55);
  transform: translateY(-1px);
}

.clue-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.clue-body {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0.3rem 0.4rem;
  max-width: 46ch;
}

.clue-kind {
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 176, 91, 0.55);
  background: rgba(226, 176, 91, 0.16);
  color: var(--gold);
  font: 700 0.78rem var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.clue-main {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.28rem, 4.2vw, 1.65rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
}

.viz.blur-heavy { background: radial-gradient(circle at 28% 30%, rgba(226, 176, 91, 0.09), transparent 62%); }
.viz.symbols    { background: radial-gradient(circle at 72% 38%, rgba(150, 110, 60, 0.12), transparent 62%); }
.viz.waveform   { background: radial-gradient(circle at 50% 62%, rgba(226, 130, 91, 0.09), transparent 62%); }
.viz.crop       { background: #0d0b0f; }
.viz.chat       { background: radial-gradient(circle at 74% 66%, rgba(88, 201, 136, 0.07), transparent 62%); }

.clue-visual.is-punch {
  animation: punch 0.35s ease;
}

@keyframes punch {
  40% {
    transform: scale(1.012);
  }
}

.clue-visual.is-shutter .viz {
  animation: shutter-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes shutter-in {
  0% {
    transform: scale(1.04);
    filter: brightness(1.25) blur(6px);
    opacity: 0.4;
  }
  100% {
    transform: scale(1);
    filter: none;
    opacity: 1;
  }
}

.clue-text {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
}

.clue-text.soft {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
  margin: 0.75rem 0 0.2rem;
}

/* ————— cover mode ————— */
.cover-stage {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0d0b0f;
  aspect-ratio: 640 / 487;
  max-height: 42vh;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.cover-media {
  position: absolute;
  inset: 0;
  transform: scale(1.07);
  transition: filter 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s ease;
  will-change: filter;
}

.cover-stage.is-solved .cover-media {
  transform: scale(1);
}

.cover-art,
.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-tiles {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  perspective: 900px;
  z-index: 2;
}

.cover-tile {
  position: relative;
  background: linear-gradient(150deg, #262028 0%, #16121a 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition:
    transform 0.55s cubic-bezier(0.35, 0, 0.2, 1),
    opacity 0.5s ease;
  transform-origin: center;
}

.cover-tile::after {
  content: "";
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 176, 91, 0.1), transparent 70%);
}

.cover-tile.is-clear {
  opacity: 0;
  transform: rotateY(80deg) scale(0.7);
  pointer-events: none;
}

.cover-shine {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 244, 214, 0.28) 48%,
    rgba(255, 244, 214, 0.07) 52%,
    transparent 70%
  );
  transform: translateX(-130%);
}

.cover-stage.is-finale .cover-shine {
  animation: cover-shine 1.1s ease 0.9s forwards;
}

@keyframes cover-shine {
  to {
    transform: translateX(130%);
  }
}

.cover-stage.is-finale {
  animation: cover-pop 0.6s cubic-bezier(0.3, 1.4, 0.4, 1) 0.75s;
}

@keyframes cover-pop {
  45% {
    transform: scale(1.02);
  }
}

.cover-stage.is-solved {
  border-color: rgba(226, 176, 91, 0.55);
  box-shadow:
    0 0 32px rgba(226, 176, 91, 0.2),
    0 18px 44px rgba(0, 0, 0, 0.5);
}

.cover-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
}

.cover-hud-pill {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font: 700 0.78rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1a1408;
  background: var(--gold);
  border: 1px solid rgba(255, 244, 214, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.cover-note {
  margin: 0.75rem 0 0 !important;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(226, 176, 91, 0.28);
  background: rgba(226, 176, 91, 0.08);
  color: var(--soft) !important;
  font-size: 0.95rem !important;
  line-height: 1.4;
}

/* ————— letters ————— */
.reelman-board {
  padding-top: 0.15rem;
}

.charge-meter {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.charge-fill {
  height: 100%;
  width: 100%;
  background: var(--grad);
  transition: width 0.35s ease;
}

.charge-meter.is-crit .charge-fill {
  background: linear-gradient(90deg, #a83a48, var(--bad));
}

.charge-meter #charge-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 600 0.6rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.charge-meter.is-drain {
  animation: drain-hit 0.35s ease;
}

@keyframes drain-hit {
  30% {
    transform: translateX(-3px);
  }
  60% {
    transform: translateX(3px);
  }
}

.letter-board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  min-height: 70px;
  margin: 1.1rem 0 0.4rem;
}

.letter-slot {
  width: 36px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
}

.letter-slot.is-space {
  width: 14px;
  border: 0;
  background: transparent;
}

.letter-slot.is-filled {
  border-color: rgba(226, 176, 91, 0.55);
  color: var(--gold);
  animation: flip-in 0.28s ease;
}

.letter-slot.is-just-filled {
  animation: letter-pop 0.4s cubic-bezier(0.3, 1.4, 0.4, 1);
}

@keyframes flip-in {
  from {
    transform: rotateX(-80deg);
    opacity: 0.2;
  }
}

@keyframes letter-pop {
  45% {
    transform: scale(1.18);
    box-shadow: 0 0 16px rgba(226, 176, 91, 0.45);
  }
}

.alpha-keys {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.32rem;
}

@media (max-width: 520px) {
  .alpha-keys {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

.alpha-keys button {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  min-height: 42px;
  font: 600 0.9rem var(--body);
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}

.alpha-keys button:hover:not(:disabled) {
  border-color: var(--gold);
}

.alpha-keys button:active:not(:disabled) {
  transform: scale(0.93);
}

.alpha-keys button.is-hit {
  background: rgba(88, 201, 136, 0.12);
  color: var(--ok);
  border-color: rgba(88, 201, 136, 0.4);
}

.alpha-keys button.is-miss {
  background: transparent;
  color: #57503f;
  border-color: rgba(255, 255, 255, 0.04);
}

.alpha-keys button:disabled {
  cursor: default;
}

/* ————— the board: labeled comparison grid (inside the stage) ————— */
.guess-log {
  margin-top: 0.9rem;
  display: grid;
  gap: 6px;
}

.guess-log:empty {
  display: none;
}

.log-empty {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.board-row {
  display: grid;
  grid-template-columns: 1.5fr 1.1fr 0.75fr 0.8fr 1.05fr;
  gap: 6px;
  perspective: 700px;
}

.board-head span {
  font: 600 0.64rem var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.2rem 0.2rem 0.1rem;
  text-align: center;
}

.board-head span:first-child {
  text-align: left;
  padding-left: 0.55rem;
}

.board-row .cell {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 48px;
  padding: 0.4rem 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.board-row .cell-name {
  justify-content: flex-start;
  text-align: left;
  padding-left: 0.6rem;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
}

.board-row .cell.is-yes {
  background: rgba(88, 201, 136, 0.13);
  border-color: rgba(88, 201, 136, 0.45);
  color: var(--ok);
}

.board-row .cell.is-close {
  background: rgba(224, 162, 62, 0.12);
  border-color: rgba(224, 162, 62, 0.42);
  color: var(--close);
}

.board-row .cell.is-no {
  background: rgba(226, 94, 110, 0.07);
  border-color: rgba(226, 94, 110, 0.22);
  color: #cfa3a6;
}

.board-row .cell.is-skip {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--line);
  color: var(--muted);
  font-style: italic;
}

.board-row.is-fresh .cell {
  opacity: 0;
  transform: rotateX(-90deg);
  animation: cell-flip 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 100ms);
}

@keyframes cell-flip {
  to {
    opacity: 1;
    transform: rotateX(0);
  }
}

.board-legend {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.5;
}

/* intro chips (how-to legend) */
.chip {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.chip.yes {
  background: rgba(88, 201, 136, 0.12);
  color: var(--ok);
  border-color: rgba(88, 201, 136, 0.35);
}

.chip.close {
  background: rgba(224, 162, 62, 0.1);
  color: var(--close);
  border-color: rgba(224, 162, 62, 0.32);
}

.chip.no {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-color: var(--line);
}

/* Collapsed guess history — keeps the playfield game-first on mobile */
.guess-history {
  margin-top: 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 16, 21, 0.45);
}

.guess-history[hidden] {
  display: none !important;
}

.guess-history-sum {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  font: 600 0.88rem var(--body);
  color: var(--soft);
  user-select: none;
}

.guess-history-sum::-webkit-details-marker {
  display: none;
}

.guess-history-count {
  min-width: 1.6rem;
  text-align: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(226, 176, 91, 0.14);
  color: var(--gold);
  font: 600 0.75rem var(--mono);
}

.guess-history[open] .guess-history-sum {
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.guess-history .guess-log {
  padding: 0.55rem 0.55rem 0.75rem;
}

.guess-form.is-done {
  display: none;
}

.round-result {
  margin: 0.75rem 0 0;
  padding: 1rem 1.05rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(226, 176, 91, 0.35);
  background: linear-gradient(165deg, rgba(226, 176, 91, 0.1), rgba(18, 14, 12, 0.95));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.round-result[hidden] {
  display: none !important;
}

.round-result-status {
  margin: 0 0 0.35rem;
  font: 600 0.78rem var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.round-result-title {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.round-result-meta {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.round-result-rank {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font: 600 0.82rem var(--mono);
}

.round-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.round-result-foot {
  margin: 0.75rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
}

/* Full-screen end flow + sticky bottom tab bar (thumb zone) */
.end-sheet {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: var(--bg, #121015);
  color: var(--text);
}

.end-sheet::backdrop {
  background: rgba(8, 6, 10, 0.92);
}

.end-sheet-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  background: var(--bg, #121015);
  animation: end-sheet-up 0.32s cubic-bezier(0.2, 0.9, 0.25, 1);
}

@keyframes end-sheet-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.end-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.end-view {
  padding: 0;
  flex: 1 1 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.end-view[hidden] {
  display: none !important;
}

/* Floating glass tab bar — inset, blur, filled active icon */
.end-nav {
  flex: 0 0 auto;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.2rem;
  margin: 0 0.7rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  padding: 0.35rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(28, 24, 30, 0.72);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.end-nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 0.7rem var(--body);
  letter-spacing: 0.01em;
  padding: 0.5rem 0.25rem 0.4rem;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  min-height: 52px;
  transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.end-nav-btn:active {
  transform: scale(0.96);
}

.end-nav-ico {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: inherit;
}

.end-nav-ico svg {
  width: 20px;
  height: 20px;
  display: block;
}

.end-nav-btn.is-active {
  color: #1a1408;
  background: linear-gradient(180deg, #f0c46a, #d89b33);
  box-shadow: 0 4px 14px rgba(216, 155, 51, 0.35);
}

.end-nav-btn.is-active .end-nav-ico {
  color: #1a1408;
}

.end-nav-btn[data-end-nav="games"]:not(.is-active):hover {
  color: var(--soft);
  background: rgba(255, 255, 255, 0.04);
}

body.is-round-over .dock-area {
  display: none;
}

body.is-round-over .modes {
  opacity: 0.55;
}

/* ————— Big Win banner (fills end-scroll height) ————— */
.result {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  background: linear-gradient(175deg, var(--panel-2), var(--panel) 55%, var(--bg) 100%);
  box-shadow: none;
  animation: result-in 0.5s cubic-bezier(0.2, 0.9, 0.25, 1);
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
}

.result.is-win-enter {
  animation: result-pop 0.6s cubic-bezier(0.3, 1.3, 0.4, 1);
}

@keyframes result-pop {
  0% {
    opacity: 0;
    transform: scale(1.04);
  }
  60% {
    transform: scale(0.995);
  }
}

.result.is-loss {
  border-color: var(--line-strong);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.55);
}

/* Art takes the flexible upper half; body spreads the rest */
.result-media {
  position: relative;
  margin: 0;
  flex: 1 1 42%;
  min-height: 180px;
  max-height: none;
  overflow: hidden;
  background: #0d0b0f;
}

.result-media[hidden] {
  display: none !important;
}

.result-blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(24px) saturate(1.25);
  transform: scale(1.2);
  opacity: 0.55;
}

.result-media img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

.result-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 62%, var(--panel-2) 100%);
}

.result-body {
  position: relative;
  flex: 1 1 58%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 1.35rem 1.5rem;
}

.result-copy {
  display: grid;
  gap: 0.35rem;
}

.result-cta-block {
  display: grid;
  gap: 0.65rem;
  margin-top: auto;
}

.result-status {
  margin: 0 0 0.25rem;
  font: 600 0.76rem var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.result.is-loss .result-status {
  color: var(--bad);
}

.result-title {
  margin: 0 0 0.15rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.8rem, 6.5vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #fff;
}

.result-meta {
  margin: 0;
  color: var(--soft);
  font-size: 0.94rem;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.result-foot {
  font: 500 0.78rem var(--mono);
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
}

/* the CTA */
.cta {
  appearance: none;
  border: 0;
  display: block;
  width: 100%;
  border-radius: 13px;
  background: var(--grad);
  color: #241b08;
  font: 700 1.08rem var(--display);
  letter-spacing: -0.01em;
  padding: 1.05rem 1.2rem;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}

.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

.cta:hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 44px rgba(216, 155, 51, 0.42);
}

.cta:hover::after {
  transform: translateX(120%);
}

.cta:active {
  transform: translateY(1px);
}

/* ————— record (stats + distribution) — inside end sheet ————— */
.record {
  border-top: 0;
  flex: 1;
  padding: 1.25rem 1.25rem 1.5rem;
}

.record-title {
  margin: 0 0 0.9rem;
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stats-row {
  display: flex;
  gap: 2.4rem;
}

.stat b {
  display: block;
  font: 600 1.7rem var(--mono);
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat span {
  font: 500 0.72rem var(--mono);
  color: var(--muted);
  letter-spacing: 0.04em;
}

.dist {
  margin-top: 1rem;
}

.dist-title {
  margin: 0 0 0.55rem !important;
  font: 600 0.68rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 5px;
}

.dist-key {
  width: 1.1rem;
  text-align: right;
  font: 500 0.8rem var(--mono);
  color: var(--muted);
}

.dist-track {
  flex: 1;
  height: 26px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.dist-bar {
  height: 100%;
  min-width: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0.5rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--soft);
  font: 500 0.78rem var(--mono);
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dist-bar.is-mine {
  background: var(--grad);
  color: #241b08;
  font-weight: 600;
}

.dist-bar.is-zero {
  background: transparent;
  color: var(--muted);
}

/* ————— dock (guess form) ————— */
.dock-area {
  position: sticky;
  bottom: 0.9rem;
  z-index: 9;
}

.dock {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem 0.75rem 0.6rem;
  border-radius: 18px;
  background: rgba(26, 22, 28, 0.92);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55);
}

.guess-form.is-done {
  display: none;
}

.typeahead-wrap {
  position: relative;
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

#guess-input {
  flex: 1;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.38);
  color: var(--text);
  font: 500 1rem var(--body);
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#guess-input::placeholder {
  color: var(--muted);
}

#guess-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226, 176, 91, 0.18);
}

#guess-input.is-locked {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226, 176, 91, 0.14);
}

#guess-input.is-shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.dock-actions {
  display: flex;
  gap: 0.4rem;
}

.dock-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.25rem;
}

.hint-line {
  margin: 0;
  color: var(--soft);
  font-size: 0.9rem;
  font-weight: 500;
}

#reelman-hint {
  margin: 0.75rem 0 0.5rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(226, 176, 91, 0.35);
  background: rgba(226, 176, 91, 0.1);
  color: var(--text) !important;
  font-family: var(--display);
  font-weight: 650;
  font-size: clamp(1rem, 3vw, 1.2rem) !important;
  line-height: 1.35;
}

.dock-count {
  font: 500 0.78rem var(--mono);
  letter-spacing: 0.04em;
  color: var(--soft);
  white-space: nowrap;
}

.dock-count.is-low {
  color: var(--close);
}

/* suggestions open upward from the dock */
.suggestions {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.5rem);
  z-index: 10;
  background: rgba(28, 24, 30, 0.97);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  max-height: 250px;
  overflow: auto;
  box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.5);
}

.suggestions li button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 500 0.95rem var(--body);
  padding: 0.7rem 0.75rem;
  border-radius: 11px;
  cursor: pointer;
}

.suggestions li button:hover,
.suggestions li button.is-active {
  background: rgba(226, 176, 91, 0.13);
}

.suggestions li button small {
  color: var(--muted);
  font-size: 0.76rem;
}

.suggestions li button mark {
  background: transparent;
  color: var(--gold);
  font-weight: 700;
}

/* ————— buttons ————— */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 600 0.92rem var(--body);
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn.slim {
  padding: 0.75rem 0.95rem;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--grad);
  color: #241b08;
  box-shadow: 0 4px 18px rgba(216, 155, 51, 0.3);
}

.btn.primary:hover {
  filter: brightness(1.05);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--soft);
}

.btn.ghost:hover {
  border-color: var(--muted);
  color: var(--text);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ————— panel flashes (on the visible surface, not an outer box) ————— */
.arena.is-miss-flash .clue-visual,
.arena.is-miss-flash .cover-stage {
  animation: miss-flash 0.5s ease;
}

@keyframes miss-flash {
  30% {
    border-color: var(--bad);
    box-shadow: inset 0 0 40px rgba(226, 94, 110, 0.1), 0 24px 60px rgba(10, 6, 2, 0.5);
  }
}

.arena.is-clue-flash .clue-visual,
.arena.is-clue-flash .cover-stage {
  animation: clue-flash 0.55s ease;
}

@keyframes clue-flash {
  35% {
    border-color: var(--gold);
    box-shadow: inset 0 0 36px rgba(226, 176, 91, 0.1), 0 24px 60px rgba(10, 6, 2, 0.5);
  }
}

.arena.is-win-glow .clue-visual,
.arena.is-win-glow .cover-stage {
  border-color: rgba(226, 176, 91, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(226, 176, 91, 0.12),
    0 0 40px rgba(226, 176, 91, 0.1),
    0 24px 60px rgba(10, 6, 2, 0.5);
}

/* ————— toast ————— */
.toast {
  position: fixed;
  top: 1.2rem;
  left: 50%;
  z-index: 50;
  transform: translate(-50%, -12px) scale(0.96);
  opacity: 0;
  padding: 0.62rem 1.15rem;
  border-radius: 999px;
  font: 500 0.82rem var(--mono);
  letter-spacing: 0.02em;
  border: 1px solid var(--line-strong);
  background: rgba(26, 22, 28, 0.96);
  backdrop-filter: blur(10px);
  color: var(--gold);
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.toast.is-in {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.toast[data-kind="miss"] {
  color: var(--bad);
  border-color: rgba(226, 94, 110, 0.4);
}

.toast[data-kind="clue"] {
  color: var(--close);
  border-color: rgba(224, 162, 62, 0.4);
}

.toast[data-kind="win"] {
  color: #241b08;
  background: var(--grad);
  border-color: transparent;
}

/* ————— intro splash ————— */
.intro {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100dvh;
  width: 100vw;
  height: 100dvh;
}

.intro::backdrop {
  background: rgba(10, 9, 12, 0.92);
  backdrop-filter: blur(8px);
}

.intro-inner {
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  text-align: center;
  padding: 2rem 1.25rem;
  color: var(--text);
  background:
    radial-gradient(50% 36% at 50% 14%, rgba(226, 176, 91, 0.16), transparent 70%),
    radial-gradient(42% 30% at 72% 84%, rgba(140, 70, 45, 0.14), transparent 70%),
    #121015;
}

.intro-kicker {
  margin: 0;
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  animation: intro-up 0.6s 0.05s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.intro-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 10vw, 4.4rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.intro-title span {
  display: inline-block;
  animation: intro-up 0.65s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.intro-title span:nth-child(1) { animation-delay: 0.12s; }
.intro-title span:nth-child(2) { animation-delay: 0.2s; }
.intro-title span:nth-child(3) { animation-delay: 0.28s; }

.intro-title .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(226, 176, 91, 0.4));
}

@keyframes intro-up {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
}

.intro-sub {
  margin: 0;
  color: var(--soft);
  font-size: 1.02rem;
  animation: intro-up 0.6s 0.36s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.intro-modes {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  width: min(100%, 380px);
  text-align: left;
  animation: intro-up 0.6s 0.44s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.intro-mode {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0 0 0.55rem;
  border-bottom: 1px solid var(--line);
}

.intro-mode:last-child {
  border-bottom: 0;
}

.intro-mode b {
  font: 700 1.02rem var(--display);
  min-width: 4.4rem;
}

.intro-mode span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.intro-chips {
  display: flex;
  gap: 0.4rem;
  animation: intro-up 0.6s 0.5s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.intro-nick-label {
  display: block;
  width: min(100%, 460px);
  margin: 0.35rem 0 0;
  text-align: left;
  font: 600 0.78rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  animation: intro-up 0.6s 0.54s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.intro-nick {
  width: min(100%, 460px);
  box-sizing: border-box;
  margin: 0.35rem 0 0;
  border-radius: 12px;
  border: 1px solid rgba(226, 176, 91, 0.45);
  background: rgba(18, 16, 21, 0.85);
  color: var(--text);
  font: 600 1.05rem var(--body);
  padding: 0.8rem 0.95rem;
  animation: intro-up 0.6s 0.56s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.intro-nick:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226, 176, 91, 0.2);
}

.nick-pill {
  appearance: none;
  border: 1px solid rgba(226, 176, 91, 0.4);
  cursor: pointer;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nick-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.intro-go {
  width: min(100%, 460px);
  margin-top: 0.5rem;
  animation: intro-up 0.6s 0.58s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.intro-foot {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
  animation: intro-up 0.6s 0.66s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

/* ————— footer / misc ————— */
.foot {
  padding: 0.5rem 0 1.2rem;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.fresh-btn {
  position: fixed;
  right: max(0.85rem, env(safe-area-inset-right));
  bottom: max(0.85rem, env(safe-area-inset-bottom));
  z-index: 40;
  margin: 0;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 176, 91, 0.45);
  background: rgba(22, 16, 12, 0.88);
  color: var(--gold);
  font: 650 0.78rem var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.fresh-btn:hover {
  background: rgba(36, 26, 18, 0.95);
  border-color: rgba(226, 176, 91, 0.7);
}

.fresh-btn:active {
  transform: translateY(1px);
}

body.is-round-over .fresh-btn {
  bottom: max(5.5rem, calc(env(safe-area-inset-bottom) + 4.5rem));
}

body.is-embed .fresh-btn {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.mode-ui[hidden],
#result-card[hidden],
#guess-area[hidden],
#record[hidden],
.modes[hidden],
.dock-count[hidden],
.toast[hidden],
.suggestions[hidden],
.cover-img[hidden],
.cover-art[hidden] {
  display: none !important;
}

/* ————— embed mode (?embed=1): compact widget chrome for iframe/modal ————— */
body.is-embed .foot,
body.is-embed .grain {
  display: none;
}

body.is-embed .app {
  max-width: none;
  min-height: 0;
  padding: 0 0.9rem 0.75rem;
}

body.is-embed .bar {
  padding: 0.65rem 0 0.35rem;
}

body.is-embed .arena {
  padding-bottom: 0.5rem;
}

body.is-embed .dock-area {
  bottom: 0.5rem;
}

/* ————— leaderboard + nickname ————— */
.leaderboard {
  margin: 0;
  flex: 1;
  padding: 1.25rem 1.25rem 1.5rem;
  border-top: 0;
}

.lb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.lb-tabs {
  display: flex;
  gap: 0.3rem;
}

.lb-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: 600 0.78rem var(--body);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}

.lb-tab.is-active {
  color: #1a1408;
  background: var(--gold);
  border-color: var(--gold);
}

.lb-nick-line {
  margin: 0 0 0.7rem;
  color: var(--soft);
  font-size: 0.88rem;
}

.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.lb-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid transparent;
}

.lb-row.is-you {
  border-color: rgba(226, 176, 91, 0.45);
  background: rgba(226, 176, 91, 0.1);
}

.lb-rank {
  font: 600 0.85rem var(--mono);
  color: var(--muted);
}

.lb-name {
  font-weight: 600;
  color: var(--text);
}

.lb-name small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.72rem;
}

.lb-pts {
  font: 600 0.9rem var(--mono);
  color: var(--gold);
}

.lb-foot {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.result-rank {
  margin: 0.7rem 0 0;
  color: var(--gold);
  font: 600 0.92rem var(--body);
}

.nick-dialog {
  border: 0;
  padding: 0;
  border-radius: 16px;
  width: min(92vw, 380px);
  background: var(--panel-2, #1c1612);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.nick-dialog::backdrop {
  background: rgba(10, 8, 12, 0.72);
}

.nick-inner {
  padding: 1.2rem 1.15rem 1.1rem;
  display: grid;
  gap: 0.65rem;
}

.nick-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
}

.nick-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

#nick-input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--line-strong, var(--line));
  background: var(--field, #121015);
  color: var(--text);
  font: 600 1rem var(--body);
  padding: 0.75rem 0.85rem;
}

#nick-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226, 176, 91, 0.18);
}

.nick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .bar-name {
    display: none;
  }

  .stage {
    padding: 0.8rem 0.8rem 1rem;
  }

  .modes {
    gap: 0.2rem;
    padding: 0.15rem;
  }

  .mode-btn {
    padding: 0.45rem 0.35rem;
  }

  .mode-btn span {
    display: none;
  }

  .typeahead-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .dock-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    width: 100%;
  }

  .dock-actions .btn {
    width: 100%;
    text-align: center;
  }

  .result-media {
    flex-basis: 38%;
    min-height: 160px;
  }

  .result-body {
    padding: 1rem 1.1rem 1.15rem;
    gap: 0.75rem;
  }

  .end-nav {
    margin-left: 0.55rem;
    margin-right: 0.55rem;
  }

  .end-nav-btn {
    font-size: 0.64rem;
  }

  .board-row {
    grid-template-columns: 1.4fr 1fr 0.7fr 0.7fr 1fr;
    gap: 4px;
  }

  .board-row .cell {
    font-size: 0.78rem;
    padding: 0.35rem 0.25rem;
  }
}

/* ————— reduced motion ————— */
@media (prefers-reduced-motion: reduce) {
  .end-sheet-panel {
    animation: none;
  }

  .stage,
  .result,
  .intro-kicker,
  .intro-title span,
  .intro-sub,
  .intro-modes,
  .intro-chips,
  .intro-go,
  .intro-foot {
    animation: none !important;
  }

  .cover-tile {
    transition: opacity 0.2s ease;
  }

  .cover-tile.is-clear {
    transform: none;
  }

  .cover-stage.is-finale,
  .cover-stage.is-finale .cover-shine {
    animation: none;
  }

  .clue-visual.is-shutter .viz,
  .clue-visual.is-punch,
  .board-row.is-fresh .cell {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
