/* Reveal lower third (plan bubble, subtitles, stamp, points) and intro title cards. */

.reveal-dock {
  height: min(40%, 330px);
  max-height: none;
  display: flex;
  justify-content: center;
  padding: 30px max(16px, var(--safe-r)) calc(var(--reactions-h) + 8px + var(--safe-b)) max(16px, var(--safe-l));
  background: linear-gradient(180deg, rgba(6, 6, 15, 0) 0, rgba(6, 6, 15, 0.82) 34px, rgba(6, 6, 15, 0.94) 100%);
  pointer-events: none;
}
.reveal-inner {
  width: min(100%, 860px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.reveal-head { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.reveal-progress {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-faint);
}
.speaker {
  --seat: var(--c-cyan);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 3px 14px 3px 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--seat) 22%, rgba(9, 11, 28, 0.9));
  border: 1.5px solid var(--seat);
  box-shadow: 0 0 18px color-mix(in srgb, var(--seat) 45%, transparent);
}
.speaker.is-in { animation: lower-third-in 0.34s cubic-bezier(0.2, 0.9, 0.3, 1) backwards; }
@keyframes lower-third-in {
  from { clip-path: inset(0 100% 0 0 round 999px); transform: translateX(-10px); }
  to { clip-path: inset(0 0 0 0 round 999px); transform: none; }
}
.speaker-avatar {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  font-size: 1.1rem;
  line-height: 1;
}
.speaker-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reveal-skip { margin-left: auto; color: var(--c-text); border: 1px solid rgba(255, 255, 255, 0.25); }

.plan-bubble {
  --seat: var(--c-cyan);
  position: relative;
  align-self: flex-start;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 4px 16px 16px 16px;
  background: color-mix(in srgb, var(--seat) 16%, rgba(9, 11, 28, 0.92));
  border-left: 3px solid var(--seat);
  font-size: clamp(1rem, 4.2vw, 1.25rem);
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
  animation: bubble-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
  transition: font-size 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
}
.plan-bubble.is-empty { font-style: italic; color: var(--c-dim); }
.plan-bubble.is-compact {
  /* The robot has the microphone, but the plan is the joke: it shrinks out of the way and keeps three clamped lines,
     which holds the whole 150-character limit at phone width, instead of collapsing to one ellipsized line.
     max-height pins the clip to the text box so a fourth line cannot peek through the bottom padding. */
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.8;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  max-height: calc(3.9em + 10px);
  overflow: hidden;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px) scale(0.92); transform-origin: 0 0; } }

.subtitle {
  font-size: clamp(1.02rem, 4.4vw, 1.4rem);
  font-weight: 600;
  line-height: 1.32;
  text-wrap: balance;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  animation: line-in 0.28s ease-out both;
}
.subtitle:empty { display: none; }
.subtitle.is-drumroll {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 4vw, 1.2rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-yellow);
  animation: drum-shake 0.12s linear infinite;
}
.subtitle.is-quip { font-style: italic; color: #ffd0e4; }
.subtitle.is-quip::before { content: '🤖 '; font-style: normal; }
@keyframes line-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes drum-shake { 0%, 100% { transform: translateX(-1px); } 50% { transform: translateX(1px); } }

.points-row { display: flex; flex-wrap: wrap; gap: 6px; }
.point-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--c-dim);
  white-space: nowrap;
  animation: chip-pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.5) both;
  animation-delay: calc(0.35s + var(--i) * 0.12s);
}
.point-chip b { font-family: var(--font-display); font-size: 0.74rem; color: var(--c-text); }
.point-chip-survive b { color: var(--c-green); }
.point-chip-style b { color: var(--c-yellow); }
.point-chip-streak b, .point-chip-sole b { color: var(--c-cyan); }
.point-chip-final { border-color: var(--c-yellow); }
.point-chip-final b { color: var(--c-yellow); }
.point-chip-total { background: var(--c-text); border-color: var(--c-text); color: #0a0b1c; }
.point-chip-total b { color: #0a0b1c; font-size: 0.86rem; }
.point-chip-call.is-right { background: var(--c-yellow); border-color: var(--c-yellow); color: #140f00; box-shadow: 0 0 16px rgba(255, 204, 0, 0.5); }
.point-chip-call.is-right b { color: #140f00; }
@keyframes chip-pop { from { opacity: 0; transform: scale(0.5); } }

/* ── Stamp: icon + word, slammed onto the stage ────────────────────── */

.stamp {
  /* hud/captions.js parks it clear of the robot's face and the hot seat; the fallback is the lower band of the stage. */
  position: absolute;
  left: var(--stamp-x, calc(var(--safe-x) + var(--safe-w) / 2));
  top: var(--stamp-y, calc(var(--safe-y) + var(--safe-h) * 0.8));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: calc(var(--safe-w) - 24px);
  padding: 8px 20px 10px;
  border: 5px solid currentColor;
  border-radius: 14px;
  background: rgba(6, 6, 15, 0.72);
  font-family: var(--font-display);
  text-transform: uppercase;
  transform: translate(-50%, -50%) rotate(-9deg);
  animation: stamp-life 1.9s cubic-bezier(0.2, 0.8, 0.3, 1.2) both;
  pointer-events: none;
  z-index: 3;
}
.stamp[data-result="survived"] { color: var(--c-green); text-shadow: 0 0 26px rgba(0, 255, 136, 0.8); box-shadow: 0 0 40px rgba(0, 255, 136, 0.35), inset 0 0 24px rgba(0, 255, 136, 0.2); }
.stamp[data-result="death"] { color: var(--c-red); text-shadow: 0 0 26px rgba(255, 51, 85, 0.8); box-shadow: 0 0 40px rgba(255, 51, 85, 0.35), inset 0 0 24px rgba(255, 51, 85, 0.2); }
.stamp-icon { font-size: clamp(1.2rem, 5.5vmin, 2.2rem); line-height: 1; }
.stamp-word { font-weight: 900; font-size: clamp(1.4rem, 6.5vmin, 3rem); line-height: 1; letter-spacing: 0.04em; white-space: nowrap; }
.stamp-cause { font-weight: 500; font-size: clamp(0.6rem, 2.4vmin, 0.8rem); letter-spacing: 0.16em; color: var(--c-text); text-align: center; }
.stamp-cause:empty { display: none; }
/* Slam in (small overshoot so it never sweeps across the faces), hold, lift off. */
@keyframes stamp-life {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-9deg) scale(1.7); }
  12% { opacity: 1; transform: translate(-50%, -50%) rotate(-9deg) scale(0.94); }
  20% { transform: translate(-50%, -50%) rotate(-9deg) scale(1); }
  84% { opacity: 1; transform: translate(-50%, -50%) rotate(-9deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-9deg) scale(1.06); }
}
@keyframes stamp-still { 0%, 84% { opacity: 1; } 100% { opacity: 0; } }
/* A skipped verdict's stamp flashes over the next contestant's entrance. */
.stamp[data-brief="true"] { animation-duration: 0.9s; }

.point-chip-result { font-family: var(--font-display); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.reveal[data-result="survived"] .point-chip-result { background: rgba(0, 255, 136, 0.16); border-color: var(--c-green); color: var(--c-green); }
.reveal[data-result="death"] .point-chip-result { background: rgba(255, 51, 85, 0.16); border-color: var(--c-red); color: #ffb3c0; }
.point-chip-result b { color: inherit; }

/* ── Title card ────────────────────────────────────────────────────── */

.title-card {
  position: absolute;
  left: calc(var(--safe-x) + var(--safe-w) / 2);
  top: calc(var(--safe-y) + var(--safe-h) / 2);
  width: min(calc(var(--safe-w) - 32px), 900px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-family: var(--font-display);
  text-transform: uppercase;
  transform: translate(-50%, -50%);
  pointer-events: none;
  --accent: var(--c-cyan);
  animation: title-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.title-card[data-accent="yellow"] { --accent: var(--c-yellow); }
.title-card[data-accent="green"] { --accent: #b6ff3b; }
.title-card-kicker { font-size: clamp(0.6rem, 2.6vw, 0.85rem); font-weight: 500; letter-spacing: 0.3em; color: var(--c-dim); }
.title-card-main {
  /* Sized by the free stage area, not the window: a long Russian word must fit beside a desktop side panel. */
  font-size: clamp(1.3rem, calc(min(var(--safe-w), 932px) * 0.058), 6rem);
  font-weight: 900;
  overflow-wrap: anywhere;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 70%, transparent), 0 5px 0 rgba(0, 0, 0, 0.6);
}
.title-card-sub { font-size: clamp(0.7rem, 3.2vw, 1.1rem); font-weight: 700; letter-spacing: 0.12em; color: var(--c-text); }
.title-card-kicker:empty, .title-card-sub:empty { display: none; }
@keyframes title-in { from { opacity: 0; transform: translate(-50%, -50%) scale(1.6); filter: blur(8px); } }

/* Twist banner: hazard-tape frame under the round title (CONTRACTS §9.5). */
.title-card-twist {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin-top: 8px;
  padding: 10px 18px 12px;
  border-radius: 14px;
  background: rgba(8, 14, 4, 0.9);
  border: 3px solid transparent;
  border-image: repeating-linear-gradient(-45deg, #b6ff3b 0 10px, #0a0b1c 10px 20px) 3;
  box-shadow: 0 0 30px rgba(182, 255, 59, 0.3);
  text-transform: none;
  animation: twist-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) 0.35s both;
}
.title-card-twist-kicker { font-size: clamp(0.56rem, 2.4vw, 0.78rem); font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: #b6ff3b; }
.title-card-twist-title { font-size: clamp(1.05rem, 5vw, 2rem); font-weight: 900; line-height: 1.1; color: var(--c-text); overflow-wrap: anywhere; }
.title-card-twist-rule { font-family: var(--font-body); font-size: clamp(0.85rem, 3.6vw, 1.1rem); font-weight: 600; line-height: 1.3; color: var(--c-dim); text-wrap: balance; }
@keyframes twist-in { from { opacity: 0; transform: translateY(12px) rotate(-2deg) scale(0.9); } }

/* The host's line in the round intro (CONTRACTS §9.6): a robot lower third at the bottom of the stage. */
.robot-line {
  position: absolute;
  left: calc(var(--safe-x) + var(--safe-w) / 2);
  bottom: calc(18px + var(--safe-b));
  width: min(calc(var(--safe-w) - 28px), 620px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 16px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(40, 6, 30, 0.92), rgba(9, 8, 24, 0.92));
  border: 1.5px solid var(--c-pink);
  box-shadow: 0 0 28px rgba(255, 0, 110, 0.3);
  transform: translateX(-50%);
  pointer-events: none;
  animation: rules-in 0.36s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.robot-line-who { font-family: var(--font-display); font-size: 0.56rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #ffb3d2; }
.robot-line-text { font-size: clamp(0.98rem, 4vw, 1.25rem); font-weight: 700; font-style: italic; line-height: 1.3; text-wrap: balance; }

/* ── Rules explainer (first match): robot lower third over the stage; a tap anywhere skips it ── */

.rules { position: absolute; inset: 0; pointer-events: auto; }
.rules-catcher { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; cursor: pointer; }
.rules-box {
  /* Anchored to the screen, not the safe rect: the box is itself an occluder the camera frames above. */
  position: absolute;
  left: calc(var(--safe-x) + var(--safe-w) / 2);
  bottom: calc(18px + var(--safe-b));
  width: min(calc(var(--safe-w) - 28px), 640px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(40, 6, 30, 0.94), rgba(9, 8, 24, 0.94));
  border: 1.5px solid var(--c-pink);
  box-shadow: 0 0 34px rgba(255, 0, 110, 0.35), 0 18px 40px -16px rgba(0, 0, 0, 0.9);
  transform: translateX(-50%);
  pointer-events: none;
  animation: rules-in 0.36s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.rules-kicker {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffb3d2;
}
.rules-text {
  margin: 0;
  font-size: clamp(1.02rem, 4.3vw, 1.35rem);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
  animation: line-in 0.3s ease-out both;
}
.rules-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rules-dots { display: inline-flex; gap: 6px; }
.rules-dots i { width: 22px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.18); transition: background 0.3s ease; }
.rules-dots i.is-on { background: var(--c-pink); box-shadow: 0 0 8px var(--c-pink); }
.rules-skip { font-size: 0.72rem; font-weight: 600; color: var(--c-dim); }
@keyframes rules-in { from { opacity: 0; transform: translate(-50%, 16px); } }

@media (orientation: landscape) and (min-width: 700px) {
  .reveal-dock {
    height: min(34%, 270px);
    padding-bottom: calc(18px + var(--safe-b));
  }
  .reveal-inner { align-items: center; text-align: center; }
  .reveal-head { width: 100%; justify-content: center; }
  .reveal-head .reveal-skip { position: absolute; right: max(20px, var(--safe-r)); margin: 0; }
  .plan-bubble { align-self: center; border-left: 0; border-top: 3px solid var(--seat); border-radius: 16px; }
  .points-row { justify-content: center; }
}

/* Phone landscape: a 34 % band is ~125 px — too short for the plan, the robot's line, the calls and the points.
   The lower third becomes a sidebar like the panel docks; the camera frames the stage left of it. */
@media (orientation: landscape) and (min-width: 700px) and (max-height: 500px) {
  .dock.reveal-dock {
    top: 0;
    left: auto;
    width: var(--sidebar-w);
    height: auto;
    flex-direction: column;
    justify-content: center;
    justify-content: safe center;
    padding: calc(var(--topbar-h) + var(--safe-t) + 4px) max(16px, var(--safe-r)) calc(12px + var(--safe-b)) 18px;
    background: linear-gradient(90deg, rgba(6, 6, 15, 0) 0, rgba(6, 6, 15, 0.86) 26px, rgba(6, 6, 15, 0.95) 100%);
  }
  .reveal-inner { align-items: stretch; text-align: left; }
  .reveal-head { justify-content: flex-start; }
  .reveal-head .reveal-skip { position: static; margin-left: auto; }
  .plan-bubble { align-self: flex-start; border-top: 0; border-left: 3px solid var(--seat); border-radius: 4px 16px 16px 16px; font-size: 0.95rem; }
  .subtitle { font-size: 1rem; }
  .points-row { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  /* Same beat, no motion: fade in place (base.css leaves the stamp's timing alone). */
  .stamp { animation: stamp-still 1.9s linear both; }
  .stamp[data-brief="true"] { animation-duration: 0.9s; }
  .rules-box, .rules-text, .robot-line, .title-card-twist { animation: none; }
}
