/* Landing menu, join flow, phone player screens, host remote, local-mode setup/panel. */

.page {
  position: relative;
  min-height: 100dvh;
  padding: calc(1rem + var(--safe-top)) calc(1rem + var(--safe-right)) calc(1.5rem + var(--safe-bottom)) calc(1rem + var(--safe-left));
}
.page-inner {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}
.hero {
  text-align: center;
  padding: 2.5rem 0 0.5rem;
}
.hero-sm {
  padding-top: 0.75rem;
}
.hero-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.8rem;
  color: var(--blush);
}
.hero-sub {
  margin: 0.4rem 0 0;
  font-size: 1.15rem;
  color: var(--muted);
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  margin: 0.25rem 0 0;
}
.game-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.25rem;
}
.game-card {
  position: relative;
  padding: 1.6rem 1.4rem 1.4rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(90, 33, 96, 0.75), rgba(42, 11, 46, 0.85));
  border: 1px solid rgba(244, 213, 141, 0.4);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 0.8rem;
  overflow: hidden;
}
.game-card::before {
  content: '';
  position: absolute;
  inset: -40% -40% auto auto;
  width: 70%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(244, 213, 141, 0.25), transparent 65%);
  pointer-events: none;
}
.game-card-bog::before {
  background: radial-gradient(circle, rgba(255, 111, 165, 0.3), transparent 65%);
}
.gc-emoji {
  font-size: 2.6rem;
}
.gc-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.15;
}
.gc-blurb {
  margin: 0;
  color: var(--muted);
}
.gc-actions {
  display: grid;
  gap: 0.6rem;
}
.quick-join {
  text-align: center;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(244, 213, 141, 0.35);
}
.quick-join h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
}
.code-form {
  display: flex;
  gap: 0.6rem;
  max-width: 420px;
  margin: 0 auto;
}
.code-form .btn {
  flex: none;
}
.foot {
  text-align: center;
  color: var(--muted);
  opacity: 0.8;
  font-size: 0.9rem;
}

/* join */
.join-form {
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  background: rgba(42, 11, 46, 0.7);
  border: 1px solid rgba(244, 213, 141, 0.35);
}
.field {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--muted);
}
.page-inner > .btn-ghost {
  justify-self: center;
}

/* hosted */
.big-code {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(4rem, 22vw, 8rem);
  letter-spacing: 0.15em;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.steps {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  gap: 0.6rem;
  color: var(--muted);
  line-height: 1.45;
}
.hosted-actions {
  display: grid;
  gap: 0.7rem;
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
}
.host-qr-box {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
}
.host-qr-box summary {
  cursor: pointer;
  min-height: 48px;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.host-qr {
  width: min(70vw, 260px);
  margin: 0.8rem auto;
}
.host-qr svg {
  width: 100%;
  border-radius: 12px;
}
.host-url {
  font-size: 0.75rem;
  word-break: break-all;
  opacity: 0.8;
}

/* ---------------------------------------------------------------- phone player */
.player-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}
.player-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
  padding: 0.5rem 0.8rem;
  background: rgba(18, 6, 15, 0.6);
  border-bottom: 1px solid rgba(244, 213, 141, 0.25);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 3;
}
.pb-name {
  font-weight: 800;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pb-code {
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  color: var(--champagne);
  font-weight: 800;
}
.pb-score {
  font-weight: 800;
  color: var(--blush);
}
.player-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.8rem;
}
.phone-scene {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: stretch;
  justify-content: center;
  text-align: center;
  animation: fadeUp 0.35s ease both;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
.phone-big {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  font-weight: 800;
}
.phone-game {
  color: var(--champagne);
  font-weight: 700;
}
.phone-sub {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.85rem;
}
.phone-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 1.1rem;
}
.phone-rank {
  font-family: var(--font-display);
  font-size: clamp(4rem, 26vw, 7rem);
  font-weight: 900;
  line-height: 1;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.phone-move.up {
  color: var(--ok);
  font-weight: 800;
}
.phone-move.down {
  color: var(--bad);
  font-weight: 800;
}
.phone-crowd {
  font-weight: 700;
  color: var(--blush);
}
.phone-question {
  justify-content: flex-start;
}
.phone-q-meta {
  color: var(--champagne);
  font-weight: 800;
  letter-spacing: 0.1em;
}
.phone-q-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 5.5vw, 1.8rem);
  line-height: 1.25;
}
.phone-lead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-size: 1.4rem;
  font-weight: 800;
  padding: 2rem 0;
}
.phone-question.game-trivia:not(.is-open) .answer-grid {
  visibility: hidden;
}
.timebar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.timebar-fill {
  height: 100%;
  background: var(--grad-gold);
  transform-origin: left;
  transition: transform 0.2s linear;
}
.timebar.is-urgent .timebar-fill {
  background: linear-gradient(90deg, #ff6b6b, #ff6fa5);
}

/* answer buttons (shared look with stage tiles) */
.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  flex: 1;
  max-height: 62vh;
}
.answer-grid.n2,
.answer-grid.n3 {
  grid-template-columns: 1fr;
}
.answer-btn,
.vote-btn {
  position: relative;
  min-height: 88px;
  border: 0;
  border-radius: var(--radius);
  padding: 0.8rem;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.25rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.1s, filter 0.2s, opacity 0.2s;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.answer-btn:active,
.vote-btn:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}
.answer-btn .choice-shape {
  font-size: 1.6rem;
}
.answer-btn .choice-letter {
  position: absolute;
  top: 0.4rem;
  left: 0.7rem;
  font-size: 0.9rem;
  opacity: 0.85;
}
.answer-btn .choice-text {
  line-height: 1.2;
}
.answer-btn.is-picked,
.vote-btn.is-picked {
  outline: 4px solid #fff;
  filter: brightness(1.15);
}
.answer-grid:has(.is-picked) .answer-btn:not(.is-picked),
.vote-grid:has(.is-picked) .vote-btn:not(.is-picked) {
  opacity: 0.35;
}
.c-rose { background: linear-gradient(160deg, #f06a92, #c23a63); }
.c-gold { background: linear-gradient(160deg, #e9b949, #a8841f); }
.c-teal { background: linear-gradient(160deg, #36b5a8, #1f7d74); }
.c-violet { background: linear-gradient(160deg, #8f6fe0, #5b3fb0); }
.c-coral { background: linear-gradient(160deg, #ff8a65, #d4553a); }
.c-sky { background: linear-gradient(160deg, #5fb4ff, #2f74c9); }
.v-bride { background: linear-gradient(160deg, #ff8fb8, var(--bride-deep)); }
.v-groom { background: linear-gradient(160deg, #f4cf6a, var(--groom-deep)); }
.v-neither { background: linear-gradient(160deg, #b9a8f0, var(--neither-deep)); }
.vote-grid {
  display: grid;
  gap: 0.8rem;
  flex: 1;
}
.vote-btn {
  min-height: 96px;
  grid-auto-flow: column;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.6rem;
  font-family: var(--font-display);
}
.vote-btn .vs-icon {
  font-size: 2.2rem;
}
.locked-panel {
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  padding: 1.5rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(244, 213, 141, 0.35);
  animation: popIn 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.locked-check {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  background: var(--grad-gold);
  color: var(--plum-900);
  font-weight: 900;
}
.locked-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
}
.locked-choice {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 800;
}
.locked-sub {
  color: var(--muted);
}
.phone-reveal .result-icon,
.phone-final .result-icon {
  font-size: 4.5rem;
  animation: popIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.result-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 11vw, 3.4rem);
  font-weight: 900;
}
.phone-reveal.is-correct .result-title {
  color: var(--ok);
}
.phone-reveal.is-wrong .result-title {
  color: var(--blush);
}
.result-points {
  font-size: 2rem;
  font-weight: 900;
  color: var(--champagne);
}
.result-answer,
.result-truth {
  align-self: center;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.2rem;
}
.result-truth {
  font-family: var(--font-display);
  font-size: 2rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  animation: popIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.result-streak {
  font-weight: 800;
  color: #ffb36b;
}
.result-rank {
  color: var(--muted);
  font-weight: 700;
}
.phone-wait.drum {
  flex-direction: column;
  font-size: 1.6rem;
  font-weight: 800;
}
.drum-emoji {
  font-size: 4rem;
  animation: drum 0.18s ease-in-out infinite alternate;
}
@keyframes drum {
  from {
    transform: rotate(-8deg) scale(1);
  }
  to {
    transform: rotate(8deg) scale(1.08);
  }
}

/* ---------------------------------------------------------------- host remote */
.host-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(0.6rem + var(--safe-top)) calc(0.8rem + var(--safe-right)) calc(1.2rem + var(--safe-bottom)) calc(0.8rem + var(--safe-left));
  display: grid;
  gap: 0.9rem;
}
.host-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.host-head .wordmark.small {
  font-size: 1.8rem;
  justify-content: flex-start;
}
.host-code {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--champagne);
  display: grid;
  text-align: center;
  line-height: 1;
}
.host-code small {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.host-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(42, 11, 46, 0.75);
  border: 1px solid rgba(244, 213, 141, 0.3);
  display: grid;
  gap: 0.6rem;
}
.host-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}
.host-phase {
  font-weight: 800;
  color: var(--champagne);
}
.host-q {
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.host-peek {
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: rgba(79, 209, 165, 0.14);
  border: 1px solid rgba(79, 209, 165, 0.5);
  font-weight: 700;
}
.host-count {
  color: var(--muted);
  font-weight: 700;
}
.host-controls {
  display: grid;
  gap: 0.6rem;
}
.host-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.host-row .btn[hidden] + .btn,
.host-row .btn:only-child {
  grid-column: 1 / -1;
}
.host-players {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.host-players li {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.hp-name {
  flex: 1;
}
.hp-score {
  font-weight: 800;
  color: var(--champagne);
}
.host-links code {
  word-break: break-all;
}
.host-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ---------------------------------------------------------------- local mode */
.mode-pick {
  border: 1px solid rgba(244, 213, 141, 0.35);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}
.mode-pick label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  font-weight: 600;
}
.mode-pick input {
  width: 22px;
  height: 22px;
  accent-color: var(--gold);
}
.local-players {
  display: grid;
  gap: 0.6rem;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}
.name-list {
  display: grid;
  gap: 0.5rem;
}
.name-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.page-inner > .btn-xl {
  max-width: 520px;
  margin: 0 auto;
}
.local-shell {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}
.local-panel {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
  margin: 0 auto;
  width: 100%;
  max-width: 760px;
  background: rgba(18, 6, 15, 0.75);
  border-top: 1px solid rgba(244, 213, 141, 0.35);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  backdrop-filter: blur(10px);
}
.panel-note {
  margin: 0;
  color: var(--muted);
  text-align: center;
}
.panel-row {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.panel-more summary {
  text-align: center;
  cursor: pointer;
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.pass-to {
  text-align: center;
  font-size: 1.3rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}
.pass-to strong {
  color: var(--champagne);
  font-family: var(--font-display);
  font-size: 1.6rem;
}
.answer-grid.compact,
.vote-grid.compact {
  max-height: none;
}
.vote-grid.compact {
  grid-template-columns: repeat(3, 1fr);
}
.vote-grid.compact .vote-btn {
  grid-auto-flow: row;
  font-size: 1.15rem;
  min-height: 84px;
}
.tally-panel {
  display: grid;
  gap: 0.5rem;
}
.tally-row {
  display: grid;
  grid-template-columns: auto 1fr auto 3ch auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  font-weight: 800;
}
.tally-row .vs-icon {
  font-size: 1.6rem;
}
.tally-count {
  text-align: center;
  font-size: 1.6rem;
}
.tally-row .icon-btn {
  font-size: 1.6rem;
}
