/*
 * Halftime: the marquee, the game offer, the game screens and the medal.
 * Mobile first, 48px targets. Reduced motion: lit bulbs that stay still, and
 * no slides, shuffles or flickers.
 */

.halftime-host[hidden] {
  display: none;
}

.halftime {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 24px;
}

/* ---------- Marquee ---------- */

.marquee {
  position: relative;
  margin: 10px 4px 0;
  padding: 26px 20px 22px;
  border: 4px solid var(--bg-sunk);
  border-radius: 20px;
  background: linear-gradient(180deg, #24204A, #16142F);
  box-shadow: var(--shadow-pop), inset 0 0 0 3px rgba(255, 214, 10, 0.25);
  text-align: center;
}

.marquee-bulbs {
  position: absolute;
  inset: 8px;
  pointer-events: none;
}

.bulb {
  position: absolute;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border: 2px solid var(--bg-sunk);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow);
  animation: ht-chase 1.2s linear infinite;
  animation-delay: calc(var(--i) * -0.1s);
}

.bulb.is-alt {
  background: var(--magenta);
  box-shadow: 0 0 8px var(--magenta);
}

@keyframes ht-chase {
  0%, 60%, 100% { opacity: 1; }
  30% { opacity: 0.25; box-shadow: none; }
}

.marquee.is-still .bulb {
  animation: none;
}

.marquee-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 12vw, 4rem);
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cream);
  text-shadow: 0 4px 0 var(--bg-sunk), 0 0 18px rgba(255, 214, 10, 0.45);
}

.marquee-sub {
  margin: 8px 0 0;
  color: var(--yellow);
  font-weight: 700;
}

/* ---------- Chip and his bubble ---------- */

.ht-host {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ht-chip {
  flex: none;
  width: 88px;
}

.ht-line {
  flex: 1;
  margin: 0;
  min-height: 3.2em;
}

.ht-say {
  display: block;
}

.ht-say + .ht-say {
  margin-top: 4px;
}

/* ---------- Stage, offer cards ---------- */

.ht-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ht-prompt {
  margin: 0;
  font-weight: 700;
  text-align: center;
}

.ht-offer {
  display: grid;
  gap: 10px;
}

@media (min-width: 720px) {
  .ht-offer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ht-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: 'icon name' 'icon blurb';
  align-items: center;
  gap: 2px 14px;
  min-height: 84px;
  padding: 14px 16px 14px 14px;
  border: 3px solid var(--bg-sunk);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--cream);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
}

.ht-card:hover,
.ht-card:focus-visible {
  border-color: var(--yellow);
}

.ht-card-key {
  position: absolute;
  top: 8px;
  right: 10px;
  color: var(--cream-dim);
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.ht-card-icon {
  grid-area: icon;
  width: 44px;
  height: 44px;
  color: var(--yellow);
}

.ht-card-name {
  grid-area: name;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.ht-card-blurb {
  grid-area: blurb;
  color: var(--cream-dim);
  font-size: 0.92rem;
}

/* ---------- A game ---------- */

.ht-game {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 3px solid var(--bg-sunk);
  border-radius: var(--radius);
  background: var(--bg-raised);
  box-shadow: var(--shadow-pop);
}

.ht-game-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.ht-game-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--yellow);
}

.ht-round {
  margin: 0;
  flex: none;
  white-space: nowrap;
  color: var(--cream-dim);
  font-weight: 700;
}

.ht-play {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ht-icon {
  width: 22px;
  height: 22px;
  flex: none;
}

.ht-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ht-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  border: 3px solid var(--bg-sunk);
  background: var(--bg);
  color: var(--cream);
  font-weight: 700;
  font-size: 1.05rem;
}

.ht-choice:not(:disabled):hover,
.ht-choice:focus-visible {
  border-color: var(--yellow);
}

.ht-choice:disabled {
  cursor: default;
  opacity: 0.6;
}

.ht-choice.is-picked {
  opacity: 1;
  border-color: var(--yellow);
  background: #2A2754;
}

.ht-pips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ht-pip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 6px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.ht-pip .ht-icon {
  width: 16px;
  height: 16px;
}

.ht-pip.is-win {
  background: rgba(255, 214, 10, 0.16);
  color: var(--yellow);
}

.ht-pip.is-loss {
  background: rgba(255, 246, 229, 0.08);
  color: var(--cream-dim);
}

.ht-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.ht-result-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.ht-result.is-win .ht-result-text {
  color: var(--yellow);
}

.ht-result.is-loss .ht-result-text {
  color: var(--cream-dim);
}

.ht-cheat {
  padding: 3px 12px;
  border: 2px dashed var(--magenta);
  border-radius: 999px;
  color: var(--magenta);
  font-weight: 700;
  font-size: 0.9rem;
}

.ht-cheat.is-backfire {
  border-color: var(--yellow);
  color: var(--yellow);
}

.ht-next {
  min-width: 200px;
}

/* ---------- Higher or Lower ---------- */

.hl-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hl-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  border: 3px solid var(--bg-sunk);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.hl-label {
  color: var(--cream-dim);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hl-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1.1;
  color: var(--cream);
}

.hl-next.is-hidden .hl-num {
  color: var(--cream-dim);
}

.hl-next.is-flicker .hl-num {
  animation: ht-flicker 0.18s steps(2) infinite;
  color: var(--magenta);
}

@keyframes ht-flicker {
  0% { transform: translateX(-3px) rotate(-3deg); opacity: 1; }
  100% { transform: translateX(3px) rotate(3deg); opacity: 0.55; }
}

/* ---------- Number Guess ---------- */

.ng-numbers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.ng-num {
  min-height: 56px;
  padding: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.ng-guesses {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.ng-guesses .hl-label {
  flex-basis: 100%;
  text-align: center;
}

.ng-guess {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  padding: 6px 12px;
  border: 3px solid var(--bg-sunk);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.1;
}

.ng-guess-tag {
  font: 700 0.75rem/1.4 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ng-guess.is-hit {
  border-color: var(--magenta);
  color: var(--magenta);
}

.ng-guess.is-miss {
  color: var(--cream-dim);
}

/* ---------- Shell Game ---------- */

.sg-table {
  --swap-ms: 500ms;
  position: relative;
  height: 150px;
  margin: 4px 0;
  border-bottom: 4px solid var(--bg-sunk);
}

.sg-cup {
  position: absolute;
  bottom: 0;
  width: calc(100% / 3);
  height: 132px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cream);
  cursor: pointer;
  transition: left var(--swap-ms) ease-in-out;
}

.sg-cup:disabled {
  cursor: default;
}

.sg-cup-art {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: 80px;
  height: 72px;
  margin-left: -40px;
  transition: transform 0.35s ease;
}

.sg-cup.is-up .sg-cup-art {
  transform: translateY(-46px);
}

.sg-cup-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cream-dim);
}

.sg-cup:not(:disabled):hover .sg-cup-art,
.sg-cup:focus-visible .sg-cup-art {
  filter: drop-shadow(0 0 6px var(--yellow));
}

.sg-cup:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: -3px;
  border-radius: 12px;
}

.sg-table.is-shuffling .sg-cup-name {
  visibility: hidden;
}

.sg-cup.is-picked .sg-cup-name {
  color: var(--yellow);
}

.sg-ball {
  position: absolute;
  bottom: 30px;
  width: calc(100% / 3);
  height: 26px;
  pointer-events: none;
}

.sg-ball::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  border: 3px solid var(--bg-sunk);
  border-radius: 50%;
  background: var(--yellow);
}

.sg-ball.is-dropped::after {
  animation: ht-drop 0.5s ease-out;
}

@keyframes ht-drop {
  from { transform: translate(60px, -60px); }
  to { transform: none; }
}

.sg-table.is-instant .sg-cup,
.sg-table.is-instant .sg-cup-art {
  transition: none;
}

.sg-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--cream-dim);
  font-weight: 600;
  text-align: center;
}

/* ---------- Don't Press It ---------- */

.dp-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

.dp-button {
  position: relative;
  width: 150px;
  height: 150px;
  padding: 0;
  border: 6px solid var(--bg-sunk);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 70%, #3A2F6B, #1C1C3D);
  box-shadow: 0 10px 0 var(--bg-sunk);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.dp-cap {
  position: absolute;
  inset: 14px;
  border: 4px solid var(--bg-sunk);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #FF7AB5, var(--magenta) 60%);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.25);
}

.dp-label {
  position: relative;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--cream);
  text-shadow: 0 3px 0 var(--bg-sunk);
}

.dp-button:not(:disabled):hover,
.dp-button:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
}

.dp-button.is-down {
  transform: translateY(8px);
  box-shadow: 0 2px 0 var(--bg-sunk);
}

.dp-button:disabled,
.dp-pass:disabled {
  cursor: default;
}

.dp-pass {
  min-width: 160px;
  min-height: 52px;
  font-weight: 700;
}

.dp-pass.is-picked {
  border-color: var(--yellow);
  color: var(--yellow);
}

.dp-reveal {
  min-height: 1.4em;
  margin: 0;
  font-weight: 700;
  text-align: center;
}

.dp-reveal.is-trap { color: var(--magenta); }
.dp-reveal.is-safe { color: var(--cream); }
.dp-reveal.is-prize { color: var(--yellow); }

.dp-stage.is-trap .dp-cap {
  background: radial-gradient(circle at 40% 35%, #6A6A8E, #3A3A5E 60%);
}

/* ---------- Briefcase Bluff ---------- */

.bb-cases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bb-case {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 3px solid var(--bg-sunk);
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-align: center;
}

.bb-case-art {
  width: 64px;
  height: 48px;
}

.bb-case-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.bb-owner {
  color: var(--cream-dim);
  font-size: 0.85rem;
  font-weight: 600;
}

.bb-content {
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bb-content.is-prize {
  background: var(--yellow);
  color: var(--bg);
}

.bb-content.is-empty {
  border: 2px dashed var(--cream-dim);
  color: var(--cream-dim);
}

.bb-secret {
  margin: 0;
  text-align: center;
}

.bb-pitches {
  grid-template-columns: 1fr;
}

@media (min-width: 480px) {
  .bb-pitches {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Medal ---------- */

.ht-medal-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 16px;
  border: 3px solid var(--bg-sunk);
  border-radius: var(--radius);
  background: var(--bg-raised);
  box-shadow: var(--shadow-pop);
  text-align: center;
}

.ht-medal-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--cream);
}

.ht-medal-score {
  margin: 0;
  color: var(--cream-dim);
  font-weight: 700;
}

.ht-continue {
  margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .bulb {
    animation: none;
  }

  .hl-next.is-flicker .hl-num,
  .sg-ball.is-dropped::after {
    animation: none;
  }

  .sg-cup,
  .sg-cup-art,
  .dp-button {
    transition: none;
  }
}

/* ---------- Results page summary and share card ---------- */

.results-halftime {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 560px;
  padding: 14px 16px;
  border: 3px solid var(--bg-sunk);
  border-radius: var(--radius);
  background: var(--bg-raised);
  box-shadow: var(--shadow-pop);
}

.results-halftime-medal {
  flex: none;
}

.results-halftime-medal .ht-medal {
  display: block;
  width: 72px;
  height: 96px;
}

.results-halftime-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  text-align: left;
}

.results-halftime-body .ht-pips {
  justify-content: flex-start;
}

.results-halftime-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--yellow);
}

.results-halftime-what {
  margin: 0;
}

.share-medal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
}

.share-medal .ht-medal {
  width: 30px;
  height: 40px;
}

/* ---------- Stats page ---------- */

.medal-tally {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.medal-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-align: center;
  font-size: 0.8rem;
  color: var(--cream-dim);
}

.medal-tile .ht-medal {
  width: 36px;
  height: 48px;
}

.medal-tile strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--cream);
}

.ht-game-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.ht-game-stat:last-child {
  border-bottom: 0;
}
