/* ==========================================================================
 * PHASE 8F -- MANUAL TEAM ADMINISTRATION ON A PHONE
 *
 * Loaded AFTER phase8.css, so these rules extend the admin panel rules that
 * sheet defines by ordinary cascade order rather than by !important -- the same
 * arrangement phase8c.css has, and for the same reason.
 *
 * ---------------------------------------------------------------------------
 * EVERY var() CARRIES A FALLBACK, AND THAT IS NOT DECORATION
 * ---------------------------------------------------------------------------
 * Phase 8B shipped a sheet that read four tokens which did not exist. CSS does
 * not warn: a colour read from an undefined custom property with no fallback is
 * simply no declaration at all, so the element inherited whatever was above it
 * -- which presented as white cards and pale
 * mint text on a television, hours after the gate had passed, because no test
 * reads colours and no build step resolves them.
 *
 * So every token below is one of the names defined in app.css (`--text`,
 * `--text-dim`, `--text-faint`, `--bg-elev`, `--bg-elev-2`, `--line`,
 * `--line-soft`, `--accent`, `--danger`, `--radius-sm`) or phase8.css
 * (`--ev-gap`, `--ev-radius`), and every one is written with the literal it
 * resolves to today. A typo then degrades to the right colour instead of to
 * none, and `tests/phase8f-team-management.test.js` asserts that every custom
 * property this file READS is a property some sheet DEFINES.
 *
 * ---------------------------------------------------------------------------
 * THE WIDTHS THIS IS BUILT FOR
 * ---------------------------------------------------------------------------
 * 320, 375, 390 and 430 (Part 12 and Part 35). The layout is a single column of
 * blocks at every one of them: a team is a block, a person is a row inside it,
 * and nothing is laid out side by side except a name and the control that acts
 * on it. There is no horizontal scroll at 320 because there is no row that has
 * to be wider than the screen -- the name truncates and the control does not.
 * ======================================================================== */

/* --------------------------------------------------------------------------
 * HOW THE TEAMS ARE MADE, AND HOW MANY
 *
 * Two labelled selects. `flex-wrap` rather than a media query: at 320 they
 * stack because they do not both fit, and at 430 they sit side by side because
 * they do. One rule, no breakpoint to keep in step with a number.
 * ----------------------------------------------------------------------- */

.aev-teams__setup {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ev-gap, 0.75rem);
}

.aev-teams__field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 8.5rem;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--text-dim, #9fb8b2);
}

.aev-teams__field > span {
  flex: 0 0 auto;
  white-space: nowrap;
}

/*
 * EVERY CONTROL IS AT LEAST 44px TALL. phase8.css states the rule for
 * `.aev-actions .btn` and `.aev-controls .btn`; a select is pressed in exactly
 * the same hurry, and these are not inside either container.
 *
 * `font-size: 1rem` is load-bearing on iOS: a form control below 16px makes
 * Safari zoom the whole page when it gains focus, which on this screen scrolls
 * the team the administrator was looking at off the side.
 */
.aev-teams__field select,
.aev-teams__picker,
.aev-teams__rename input {
  min-height: 44px;
  font: inherit;
  font-size: 1rem;
  color: var(--text, #eaf3f0);
  background: var(--bg-elev-2, #16302c);
  border: 1px solid var(--line, #22413c);
  border-radius: var(--radius-sm, 10px);
  padding: 0.35rem 0.5rem;
  min-width: 0;
}

.aev-teams__field select { flex: 1 1 0; }

/* --------------------------------------------------------------------------
 * ONE BLOCK PER TEAM
 * ----------------------------------------------------------------------- */

.aev-teams__team {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem;
  border: 1px solid var(--line-soft, #1b332f);
  border-radius: var(--ev-radius, 14px);
  background: var(--bg-elev, #112220);
  min-width: 0;
}

/* The rename form: the field takes the room, Save takes what it needs. */
.aev-teams__rename {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
  min-width: 0;
}

.aev-teams__rename input {
  flex: 1 1 0;
  font-weight: 600;
}

.aev-teams__rename .btn {
  flex: 0 0 auto;
  min-height: 44px;
}

/* A locked round shows the name as text, in the same place and weight. */
.aev-teams__name {
  color: var(--text, #eaf3f0);
  font-size: 1rem;
}

.aev-teams__size {
  color: var(--text-faint, #6d8882);
  font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
 * THE PEOPLE
 * ----------------------------------------------------------------------- */

.aev-teams__people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.aev-teams__person {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--text, #eaf3f0);
  font-size: 0.9rem;
  min-width: 0;
}

/*
 * A LONG NAME TRUNCATES; THE CONTROL BESIDE IT DOES NOT SHRINK.
 *
 * `min-width: 0` on the flex item is what makes `text-overflow` work at all --
 * a flex item's default minimum is its content, so without it the row grows
 * wider than 320px and the page scrolls sideways, which is the one thing Part
 * 12 and Part 34 both forbid.
 */
.aev-teams__person-name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aev-teams__picker {
  flex: 0 1 9.5rem;
  max-width: 55%;
}

.aev-teams__empty {
  color: var(--text-faint, #6d8882);
  font-size: 0.82rem;
  margin: 0;
}

/* --------------------------------------------------------------------------
 * THE UNASSIGNED POOL
 *
 * Visually a team block with no name field, because that is what it is: a place
 * people are, from which they can be moved. Accented on the leading edge so an
 * administrator scanning the screen can tell at a glance that somebody is still
 * waiting to be dealt -- the only state on this screen that is an unfinished
 * job rather than a decision.
 * ----------------------------------------------------------------------- */

.aev-teams__pool {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem;
  border: 1px solid var(--line-soft, #1b332f);
  border-left: 3px solid var(--accent, #4fd1a5);
  border-radius: var(--radius-sm, 10px);
  background: var(--bg-elev, #112220);
  min-width: 0;
}

.aev-teams__pool h6 {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim, #9fb8b2);
}

/* ==========================================================================
 * LIGHT MODE
 *
 * The one place this sheet names a colour of its own. app.css defines the
 * tokens for both schemes, so the blocks above follow the theme without
 * restating anything -- but `--accent` on a light background is the Festivus
 * mint, which at 3px against white is too faint to be the signal it is there
 * to be. `--accent-dim` is the token for exactly that case and it is already
 * defined for both schemes.
 *
 * Guarded the way every sheet in this project guards its scheme block, so an
 * explicit light choice wins over the OS preference and vice versa.
 * ======================================================================== */

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .aev-teams__pool {
    border-left-color: var(--accent-dim, #2f8f72);
  }
}

:root[data-theme="light"] .aev-teams__pool {
  border-left-color: var(--accent-dim, #2f8f72);
}

/* ==========================================================================
 * STOP THE CLOCK, AND REACTION ATTACK
 *
 * Two games whose entire presentation is ONE ENORMOUS NUMBER or ONE ENORMOUS
 * WORD, on a phone and on a television. So almost everything here is type
 * scale, and the two rules that are not are the ones that have broken before:
 * a flex item with no min-width of 0 (a long name widens the row past the
 * viewport) and a fixed-width track beside a name (rank, name and score
 * overlapping, which was the playtest's first Phase 8B report).
 * ======================================================================== */

/* --------------------------------------------------------------------------
 * PLAYER -- STOP THE CLOCK
 *
 * The target is the biggest thing on the screen. The button is the second
 * biggest, and it is the full width of the phone because it is pressed in a
 * hurry by somebody who is counting in their head and not looking at it.
 * ----------------------------------------------------------------------- */

.ev-stopclock,
.ev-reaction {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--ev-gap, 0.75rem);
  min-width: 0;
}

.ev-stopclock__position,
.ev-reaction__position {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim, #9fb8b2);
}

.ev-stopclock__target {
  margin: 0;
  text-align: center;
  /* clamp rather than a media query: 320 to 430 is a 34% range and the number
   * should grow smoothly across it, not in one step. */
  font-size: clamp(3rem, 22vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text, #eaf3f0);
}

.ev-stopclock__caption,
.ev-reaction__caption {
  margin: 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-dim, #9fb8b2);
}

/*
 * THE BUTTON IS 96px TALL, not the 44px minimum.
 *
 * 44px is the floor for a control somebody aims at. This one is pressed on an
 * instinct, without looking, while they count -- so it is as large as the
 * layout can afford, and it spans the full gutter-to-gutter width.
 */
.ev-stopclock__button {
  min-height: 96px;
  width: 100%;
  font-size: clamp(1.5rem, 8vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.08em;
}

/*
 * THE STOP VARIANT IS TALLER THAN THE START.
 *
 * Not decoration. START is pressed deliberately, while looking at the phone;
 * STOP is pressed on an instinct, without looking, by somebody counting in
 * their head. The bigger target is for the second gesture, and the danger
 * colouring the button already carries from `btn--danger` is what makes the two
 * states unmistakable at a glance.
 */
.ev-stopclock__button--stop {
  min-height: 120px;
  letter-spacing: 0.14em;
}

.ev-stopclock__blind {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-faint, #6d8882);
}

.ev-stopclock__result {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  min-width: 0;
}

.ev-stopclock__elapsed {
  margin: 0;
  font-size: clamp(2.25rem, 16vw, 4rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent, #4fd1a5);
}

.ev-stopclock__error {
  margin: 0;
  font-size: 1rem;
  color: var(--text-dim, #9fb8b2);
}

.ev-stopclock__late {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  color: var(--warn, #f0b429);
}

.ev-stopclock__others,
.ev-stopclock__between,
.ev-reaction__between {
  margin: 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-dim, #9fb8b2);
}

/* --------------------------------------------------------------------------
 * A FINISHED TARGET'S BOARD, on a phone
 *
 * Name then time, with the name truncating. NO fixed-width track for the
 * position: an ordered list numbers itself, and a 3.5em rank track beside a
 * name is exactly what overlapped in Phase 8B.
 * ----------------------------------------------------------------------- */

.ev-stopclock__board {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.ev-stopclock__board h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-dim, #9fb8b2);
}

.ev-stopclock__rows {
  list-style: decimal;
  margin: 0;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.ev-stopclock__rows li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  font-size: 0.9rem;
  color: var(--text, #eaf3f0);
}

.ev-stopclock__name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ev-stopclock__time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
 * PLAYER -- REACTION ATTACK
 *
 * The pad fills the screen. It changes COLOUR and TEXT in place at the GO --
 * the element is never replaced, because the player's thumb is on it.
 * ----------------------------------------------------------------------- */

.ev-reaction__pad {
  min-height: 160px;
  width: 100%;
  font-size: clamp(1.75rem, 11vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: var(--ev-radius, 14px);
  /* The one transition in this file, and it is 80ms: long enough to look
   * deliberate, short enough that it cannot be mistaken for the signal. */
  transition: background-color 80ms linear, color 80ms linear;
}

.ev-reaction__pad--wait {
  background: var(--bg-elev-2, #16302c);
  color: var(--text-faint, #6d8882);
  border: 2px solid var(--line, #22413c);
}

.ev-reaction__pad--go {
  background: var(--accent, #4fd1a5);
  /*
   * A LITERAL, NOT A TOKEN. This is text ON the accent colour, and there is no
   * token for that -- --bg is the page BEHIND the accent, which happens to be
   * right in dark mode and is wrong in light. Written out, it is correct in
   * both, and the contrast against #4fd1a5 is 9.6:1.
   */
  color: #0b1614;
  border: 2px solid var(--accent, #4fd1a5);
}

.ev-reaction__value {
  margin: 0;
  text-align: center;
  font-size: clamp(2.5rem, 18vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent, #4fd1a5);
}

.ev-reaction__false {
  margin: 0;
  text-align: center;
  font-size: clamp(1.1rem, 5vw, 1.5rem);
  font-weight: 600;
  color: var(--warn, #f0b429);
}

.ev-reaction__mean {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--text, #eaf3f0);
}

/* ==========================================================================
 * THE TELEVISION
 *
 * 1280x720, 1366x768 and 1920x1080 (Part 33). Every size below is a clamp on
 * vw, so there is NO MEDIA QUERY to lose a rule inside -- which is the fourth
 * failure tests/phase8e-responsive.test.js names: a host rule that only exists
 * inside a narrow query, so the television loses it at 1280 and nobody notices
 * until the room is full.
 * ======================================================================== */

.host__stopclock,
.host__reaction {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  width: 100%;
}

/*
 * BOARD MODE: the same container, showing a list instead of one huge number.
 *
 * The list is left-aligned -- a column of names centred as a block reads as
 * ragged from across a room -- while the kicker and the caption above and below
 * it stay centred, which is what `align-items` on the container would otherwise
 * prevent.
 */
.host__stopclock--board,
.host__reaction--board {
  justify-content: center;
  gap: 0.9rem;
}

.host__stopclock-kicker,
.host__reaction-kicker {
  margin: 0;
  font-size: clamp(0.9rem, 1.8vw, 1.4rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim, #9fb8b2);
}

.host__stopclock-target {
  margin: 0;
  font-size: clamp(5rem, 20vw, 14rem);
  font-weight: 700;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  color: var(--text, #eaf3f0);
}

.host__stopclock-caption,
.host__stopclock-progress,
.host__reaction-progress {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.8rem);
  letter-spacing: 0.06em;
  color: var(--text-dim, #9fb8b2);
}

.host__reaction-word {
  margin: 0;
  font-size: clamp(5rem, 22vw, 16rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.06em;
}

.host__reaction-word--wait { color: var(--text-faint, #6d8882); }
.host__reaction-word--go   { color: var(--accent, #4fd1a5); }

.host__reaction-false {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: var(--warn, #f0b429);
}

/* --------------------------------------------------------------------------
 * THE BOARDS, on a television
 *
 * grid with a 1fr auto template rather than flex, so every row's time column
 * lines up with every other -- a column of times that jitters by name length
 * is unreadable from across a room. min-width of 0 on the name cell is what
 * lets it truncate instead of pushing the time off the screen.
 * ----------------------------------------------------------------------- */

.host__stopclock-rows,
.host__reaction-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  width: min(100%, 44rem);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.host__stopclock-rows li,
.host__reaction-rows li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 1rem;
  min-width: 0;
  font-size: clamp(1.1rem, 2.4vw, 2rem);
  color: var(--text, #eaf3f0);
}

.host__stopclock-name,
.host__reaction-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host__stopclock-time,
.host__reaction-time {
  font-variant-numeric: tabular-nums;
  color: var(--accent, #4fd1a5);
}

/* --------------------------------------------------------------------------
 * THE ADMIN SCREEN'S PROGRESS LINE AND BOARDS
 *
 * Part 32: current state, progress, who has not acted, and the next logical
 * action. The progress line is the one an administrator reads first, so it is
 * the one piece of this that is not the body size.
 * ----------------------------------------------------------------------- */

.aev-game__progress {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text, #eaf3f0);
}

.aev-game__rows {
  margin: 0;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--text-dim, #9fb8b2);
}

.aev-game__rows li {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ==========================================================================
 * REDUCED MOTION
 *
 * The 80ms colour change on the reaction pad is the only animation these two
 * games have, and it is INFORMATION rather than decoration -- so it is not
 * removed under prefers-reduced-motion, it is made instant. The pad still
 * changes colour; it simply does not fade.
 * ======================================================================== */

@media (prefers-reduced-motion: reduce) {
  .ev-reaction__pad { transition: none; }
}

/* ==========================================================================
 * PHASE 8F -- THE FIVE PROMPT GAMES (Parts 18 to 21 and 23)
 *
 * Higher / Lower, Price Is Close, Color Clash, Rapid Categories, Don't Press
 * It. One shared skeleton (`.ev-prompt*` on the phone, `.host__prompt*` on the
 * television, `.aev-prompt*` on the control strip) and a few rules per game.
 *
 * Same discipline as the rest of this sheet: every var() names a token that
 * app.css or phase8.css defines and carries the literal it resolves to today,
 * every rule that changes a background also sets `color`, and nothing is wider
 * than a 320px screen -- the long things (an item name, a typed answer, a
 * person's name) wrap or truncate and the controls do not.
 * ======================================================================== */

.ev-prompt {
  display: flex;
  flex-direction: column;
  gap: var(--ev-gap, 0.75rem);
  min-width: 0;
}

.ev-prompt__progress,
.ev-prompt__count,
.ev-prompt__between {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim, #9fb8b2);
  text-align: center;
}

.ev-prompt__between { font-size: 0.95rem; }

/* The five games' own roots: a hook for each, and the place a game-wide rule goes. */
.ev-hl,
.ev-price,
.ev-clash,
.ev-cat,
.ev-press { text-align: left; }

.ev-prompt__choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ev-gap, 0.75rem);
}

.ev-prompt__choices--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.ev-prompt__choice {
  min-height: 88px;
  font-size: clamp(1.1rem, 6vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: var(--ev-radius, 14px);
  background: var(--bg-elev-2, #16302c);
  color: var(--text, #eaf3f0);
  border: 2px solid var(--line, #22413c);
  overflow-wrap: anywhere;
}

.ev-prompt__locked {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--ev-radius, 14px);
  background: var(--bg-elev, #10241f);
  color: var(--text, #eaf3f0);
  border: 1px solid var(--line-soft, #1a3330);
  text-align: center;
  overflow-wrap: anywhere;
}

/* THE TYPED ANSWER. 16px or more, or iOS zooms the page into the box. */
.ev-prompt__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ev-prompt__input {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 48px;
  padding: 0 0.85rem;
  font-size: 1.1rem;
  border-radius: var(--radius-sm, 10px);
  background: var(--bg-elev-2, #16302c);
  color: var(--text, #eaf3f0);
  border: 2px solid var(--line, #22413c);
}

.ev-prompt__submit {
  flex: 0 0 auto;
  min-height: 48px;
  min-width: 6rem;
}

.ev-prompt__reveal {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--ev-radius, 14px);
  background: var(--bg-elev, #10241f);
  color: var(--text, #eaf3f0);
  border: 1px solid var(--line-soft, #1a3330);
  text-align: center;
}

.ev-prompt__right { margin: 0; font-weight: 700; color: var(--ev-win, #7fe3b0); }
.ev-prompt__wrong { margin: 0; font-weight: 700; color: var(--ev-urgent-text, #f2706b); }
.ev-prompt__mine  { margin: 0; color: var(--text, #eaf3f0); }

.ev-prompt__leaders {
  margin: 0;
  padding-left: 1.4rem;
  text-align: left;
}

.ev-prompt__leader {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.2rem 0;
}

.ev-prompt__leader-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ev-prompt__leader-value { flex: 0 0 auto; font-variant-numeric: tabular-nums; }

/* ---- Higher / Lower ---------------------------------------------------- */
.ev-hl__measure { margin: 0; text-align: center; font-weight: 700; color: var(--text-dim, #9fb8b2); }

.ev-hl__pair {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}

.ev-hl__card {
  padding: 0.85rem 1rem;
  border-radius: var(--ev-radius, 14px);
  background: var(--bg-elev, #10241f);
  color: var(--text, #eaf3f0);
  border: 1px solid var(--line, #22413c);
  text-align: center;
  min-width: 0;
}

.ev-hl__card--hidden { border-style: dashed; }
.ev-hl__label { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.ev-hl__value { margin: 0.2rem 0 0; font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ev-hl__vs { margin: 0; text-align: center; font-size: 0.8rem; color: var(--text-faint, #6d8882); }
.ev-hl__choice { min-height: 100px; }
.ev-hl__choice--higher { border-color: var(--accent, #4fd1a5); }
.ev-hl__choice--lower  { border-color: var(--ev-score-text, #8cc8ff); }

/* ---- The Price Is Close ------------------------------------------------ */
.ev-price__label { margin: 0; font-size: 1.25rem; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.ev-price__note, .ev-price__rule { margin: 0; text-align: center; font-size: 0.85rem; color: var(--text-dim, #9fb8b2); }
.ev-price__value { margin: 0; font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ev-win, #7fe3b0); }

/* ---- Color Clash ------------------------------------------------------- *
 *
 * THE WORD SITS ON A FIXED DARK PANEL, in both themes, and that is the one
 * deliberate exception to theming in this section. The six inks are the GAME:
 * they must look the same on every phone and on the television, and yellow ink
 * on a light page is unreadable. A dark panel makes all six legible in both.
 */
.ev-clash__question { margin: 0; text-align: center; font-weight: 700; letter-spacing: 0.04em; }

.ev-clash__word,
.host__clash-word {
  margin: 0;
  padding: 0.75rem;
  border-radius: var(--ev-radius, 14px);
  background: #101317;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ev-clash__word { font-size: clamp(2.6rem, 16vw, 4.5rem); }
.ev-clash__answer { margin: 0; font-size: 1.4rem; font-weight: 700; }
.ev-clash__option { font-size: 1.05rem; }

.ev-clash__ink--red    { color: #e53935; }
.ev-clash__ink--blue   { color: #1e88e5; }
.ev-clash__ink--green  { color: #43a047; }
.ev-clash__ink--yellow { color: #fdd835; }
.ev-clash__ink--purple { color: #b45bd6; }
.ev-clash__ink--orange { color: #fb8c00; }
.ev-clash__ink--none   { color: #eaf3f0; }

/* ---- Rapid Categories -------------------------------------------------- */
.ev-cat__category { margin: 0; font-size: 1.35rem; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.ev-cat__letter { margin: 0; text-align: center; font-size: 2.4rem; font-weight: 800; color: var(--accent, #4fd1a5); }
.ev-cat__hint { margin: 0; text-align: center; font-size: 0.82rem; color: var(--text-faint, #6d8882); }

.ev-cat__board {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.ev-cat__row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) auto;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line-soft, #1a3330);
}

.ev-cat__row--invalid { color: var(--text-faint, #6d8882); }
.ev-cat__name, .ev-cat__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-cat__points { font-variant-numeric: tabular-nums; }

/* ---- Don't Press It ---------------------------------------------------- */
.ev-press__say {
  margin: 0;
  text-align: center;
  font-size: clamp(1.6rem, 9vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ev-press__pad {
  min-height: 180px;
  width: 100%;
  font-size: clamp(1.5rem, 9vw, 2.4rem);
  font-weight: 800;
  border-radius: 999px;
  background: var(--danger, #f2706b);
  /* A literal for text ON the button colour, for the reason .ev-reaction__pad--go gives. */
  color: #1a0b0a;
  border: 3px solid var(--danger, #f2706b);
  /* A hold is a long press: no text selection, no callout menu, no scrolling. */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.ev-press__pad[data-phase="wait"] {
  background: var(--bg-elev-2, #16302c);
  color: var(--text-dim, #9fb8b2);
  border-color: var(--line, #22413c);
}

.ev-press__hint { margin: 0; text-align: center; font-size: 0.85rem; color: var(--text-dim, #9fb8b2); }

/* ---- The television ---------------------------------------------------- */
.host__prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
  min-width: 0;
  text-align: center;
}

.host__prompt-kicker {
  margin: 0;
  font-size: clamp(0.9rem, 1.8vw, 1.4rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim, #9fb8b2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host__prompt-big {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 1.05;
  overflow-wrap: anywhere;
  color: var(--text, #eaf3f0);
}

.host__prompt-count, .host__prompt-note {
  margin: 0;
  font-size: clamp(1.1rem, 2.4vw, 2rem);
  color: var(--text-dim, #9fb8b2);
}

.host__prompt-leaders, .host__cat-board {
  list-style: none;
  margin: 0;
  padding: 0;
  width: min(100%, 60rem);
}

.host__prompt-leader, .host__cat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 0.4rem 0;
  font-size: clamp(1.1rem, 2.4vw, 2rem);
  border-bottom: 1px solid var(--line-soft, #1a3330);
}

.host__cat-row { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) auto; }
.host__cat-row--invalid { color: var(--text-faint, #6d8882); }
.host__prompt-name, .host__cat-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.host__prompt-value { font-variant-numeric: tabular-nums; }

.host__hl-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  width: min(100%, 80rem);
}

.host__hl-card {
  padding: 1.5rem;
  border-radius: var(--ev-radius, 14px);
  background: var(--bg-elev, #10241f);
  color: var(--text, #eaf3f0);
  border: 2px solid var(--line, #22413c);
  min-width: 0;
}

.host__hl-card--hidden { border-style: dashed; }
.host__hl-label { margin: 0; font-size: clamp(1.3rem, 2.8vw, 2.4rem); overflow-wrap: anywhere; }
.host__hl-value { margin: 0.6rem 0 0; font-size: clamp(2rem, 5vw, 4.5rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.host__price-label { font-size: clamp(2rem, 5vw, 4.4rem); }
.host__clash-question { margin: 0; font-size: clamp(1.4rem, 3vw, 2.6rem); font-weight: 700; }
.host__clash-word { font-size: clamp(5rem, 16vw, 12rem); width: min(100%, 70rem); }
.host__cat-letter { margin: 0; font-size: clamp(5rem, 14vw, 11rem); font-weight: 800; color: var(--accent, #4fd1a5); }
.host__press-say { margin: 0; font-size: clamp(4rem, 13vw, 11rem); font-weight: 800; line-height: 1; }

/* ---- The control strip ------------------------------------------------- */
.aev-prompt__answers { list-style: none; margin: 0; padding: 0; }

.aev-prompt__answer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line-soft, #1a3330);
  min-width: 0;
}

.aev-prompt__answer--pending { background: var(--bg-elev-2, #16302c); color: var(--text, #eaf3f0); }
.aev-prompt__answer--auto,
.aev-prompt__answer--accepted,
.aev-prompt__answer--rejected { color: var(--text, #eaf3f0); }
.aev-prompt__who { flex: 0 1 8rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aev-prompt__what { flex: 1 1 8rem; min-width: 0; overflow-wrap: anywhere; }
.aev-prompt__verdict { font-size: 0.78rem; color: var(--text-dim, #9fb8b2); }
.aev-prompt__judge { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.aev-prompt__merge { min-height: 44px; max-width: 100%; }
.aev-prompt { gap: var(--ev-gap, 0.75rem); }
.aev-game__answer { margin: 0; font-weight: 700; color: var(--ev-win, #7fe3b0); overflow-wrap: anywhere; }
.aev-game__warn { margin: 0; font-weight: 700; color: var(--ev-paused-text, #f0b429); }

/* ==========================================================================
 * PHASE 8F -- MYSTERY ZOOM AND SPOT THE DIFFERENCE (Parts 17 and 22)
 *
 * Both draw server-rendered PNGs. A picture is square, never wider than its
 * column, and never upscaled past its 512 pixels on a phone. The Spot the
 * Difference overlay is an SVG whose circles are positioned by their own
 * `cx`/`cy` ATTRIBUTES in 0..1 units -- the sheet only stretches the overlay
 * over the picture, because `style-src 'self'` forbids an inline position.
 * ======================================================================== */

.ev-zoom,
.ev-spot { text-align: left; }

.ev-zoom__stage {
  margin: 0;
  text-align: center;
  font-weight: 700;
  color: var(--accent, #4fd1a5);
}

.ev-zoom__image,
.ev-spot__image,
.aev-zoom__image {
  display: block;
  width: 100%;
  max-width: 512px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: var(--ev-radius, 14px);
  border: 2px solid var(--line, #22413c);
  background: var(--bg-elev-2, #16302c);
  color: var(--text, #eaf3f0);
  image-rendering: auto;
  -webkit-user-drag: none;
  user-select: none;
}

.aev-zoom__image { max-width: 220px; }

.ev-zoom__option { font-size: 1rem; letter-spacing: 0.02em; }

.ev-zoom__answer {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
}

.ev-spot__title { margin: 0; text-align: center; font-weight: 700; overflow-wrap: anywhere; }
.ev-spot__found { margin: 0; text-align: center; color: var(--text-dim, #9fb8b2); }

.ev-spot__label {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint, #6d8882);
  text-align: center;
}

/* The frame holds a picture and, on top of it, the overlay of circles. */
.ev-spot__frame {
  position: relative;
  width: 100%;
  max-width: 512px;
  margin: 0 auto;
}

/* The tappable picture: no scrolling or zoom gesture steals the tap. */
.ev-spot__frame--tap { touch-action: manipulation; cursor: crosshair; }

.ev-spot__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ev-spot__ring {
  fill: none;
  stroke: #ff3d71;
  stroke-width: 0.012;
}

/* ---- The television ---------------------------------------------------- */
.host__zoom-image {
  display: block;
  width: min(62vh, 90vw);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: var(--ev-radius, 14px);
  border: 3px solid var(--line, #22413c);
  background: var(--bg-elev-2, #16302c);
  color: var(--text, #eaf3f0);
}

.host__spot-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  width: min(100%, 120vh);
}

.host__spot-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: var(--ev-radius, 14px);
  border: 3px solid var(--line, #22413c);
  background: var(--bg-elev-2, #16302c);
  color: var(--text, #eaf3f0);
}

.host__spot-reveal { width: min(60vh, 90vw); max-width: none; }

/* ==========================================================================
 * PHASE 8F -- THE SIX TEAM GAMES (Parts 24 to 29)
 *
 * Password, Charades Relay, Survey Steal, Team Stop the Clock, Team Reaction
 * Relay and the Festivus Heist. Same discipline as the rest of this sheet:
 * every var() is a defined token with its literal; a rule that sets a
 * background sets a colour; names truncate, controls do not; nothing is wider
 * than 320px. The relay and heist progress bars are eleven classes in tenths,
 * because `style-src 'self'` forbids an inline width -- the same reason
 * phase8.css's bar charts are.
 * ======================================================================== */

.ev-team {
  display: flex;
  flex-direction: column;
  gap: var(--ev-gap, 0.75rem);
  min-width: 0;
}

.ev-password,
.ev-charades,
.ev-survey,
.ev-relay,
.ev-heist { text-align: left; }

/* ---- The team scoreboard strip ----------------------------------------- */
.ev-teams__strip,
.host__teams-strip,
.aev-team__strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.host__teams-strip { justify-content: center; gap: 1.5rem; font-size: clamp(1.1rem, 2.4vw, 2rem); }

.ev-teams__chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-elev, #10241f);
  color: var(--text, #eaf3f0);
  border: 1px solid var(--line, #22413c);
}

.ev-teams__chip--yours { border-color: var(--accent, #4fd1a5); }
.ev-teams__chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-teams__chip-score { flex: 0 0 auto; font-variant-numeric: tabular-nums; }

.aev-team { gap: var(--ev-gap, 0.75rem); }

/* ---- Cards -------------------------------------------------------------- */
.ev-team__whose { margin: 0; text-align: center; font-weight: 700; color: var(--text-dim, #9fb8b2); overflow-wrap: anywhere; }
.ev-team__instruction { margin: 0; text-align: center; font-size: 0.9rem; color: var(--text-dim, #9fb8b2); }

.ev-team__card {
  padding: 1rem;
  border-radius: var(--ev-radius, 14px);
  background: var(--bg-elev, #10241f);
  color: var(--text, #eaf3f0);
  border: 1px solid var(--line, #22413c);
  text-align: center;
  min-width: 0;
}

/*
 * THE SECRET CARD -- the clue-giver's word, the actor's clue, a crew member's
 * fragments. Visually unmistakable, so a player never wonders whether what they
 * are looking at is something they may say out loud.
 */
.ev-team__card--secret {
  background: #2a1c3d;
  color: #f3e9ff;
  border: 2px dashed #b48ae0;
}

.ev-team__card--go { border-color: var(--accent, #4fd1a5); }
.ev-team__card--reveal { border-color: var(--ev-win, #7fe3b0); }
.ev-team__card-title { margin: 0; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; }
.ev-team__card-body { margin: 0.35rem 0 0; font-size: clamp(1.5rem, 9vw, 2.4rem); font-weight: 800; overflow-wrap: anywhere; }

/* ---- Survey Steal ------------------------------------------------------- */
.ev-survey__question { margin: 0; font-size: 1.2rem; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.ev-survey__control { margin: 0; text-align: center; font-weight: 700; color: var(--ev-paused-text, #f0b429); }

.ev-survey__board,
.host__survey-board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.host__survey-board { width: min(100%, 60rem); font-size: clamp(1.2rem, 2.6vw, 2.2rem); }

.ev-survey__entry {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm, 10px);
  background: var(--bg-elev-2, #16302c);
  color: var(--text, #eaf3f0);
}

.ev-survey__entry--hidden { color: var(--text-faint, #6d8882); }
.ev-survey__rank { font-weight: 800; color: var(--accent, #4fd1a5); }
.ev-survey__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-survey__votes { font-variant-numeric: tabular-nums; }

.host__survey-question { margin: 0; font-size: clamp(1.8rem, 4.5vw, 3.6rem); font-weight: 800; overflow-wrap: anywhere; }
.host__survey-control { margin: 0; font-size: clamp(1.2rem, 2.6vw, 2.2rem); font-weight: 700; color: var(--ev-paused-text, #f0b429); }
.host__charades-correct { margin: 0; font-size: clamp(3rem, 9vw, 7rem); font-weight: 800; color: var(--accent, #4fd1a5); }

/* ---- The race bars: relay legs and heist locks -------------------------- */
.ev-relay__bars,
.host__relay-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

.host__relay-bars { width: min(100%, 70rem); font-size: clamp(1.1rem, 2.4vw, 2rem); }

.ev-relay__team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name count"
    "bar bar"
    "meta meta";
  gap: 0.25rem 0.5rem;
  min-width: 0;
}

.ev-relay__name { grid-area: name; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ev-relay__count { grid-area: count; font-variant-numeric: tabular-nums; }
.ev-relay__meta { grid-area: meta; font-size: 0.8em; color: var(--text-dim, #9fb8b2); min-width: 0; overflow-wrap: anywhere; }

.ev-relay__bar {
  grid-area: bar;
  display: block;
  height: 0.9rem;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent, #4fd1a5) var(--relay-fill, 0%), var(--bg-elev-2, #16302c) var(--relay-fill, 0%));
}

.ev-relay__bar--0 {
  --relay-fill: 0%;
}
.ev-relay__bar--1 {
  --relay-fill: 10%;
}
.ev-relay__bar--2 {
  --relay-fill: 20%;
}
.ev-relay__bar--3 {
  --relay-fill: 30%;
}
.ev-relay__bar--4 {
  --relay-fill: 40%;
}
.ev-relay__bar--5 {
  --relay-fill: 50%;
}
.ev-relay__bar--6 {
  --relay-fill: 60%;
}
.ev-relay__bar--7 {
  --relay-fill: 70%;
}
.ev-relay__bar--8 {
  --relay-fill: 80%;
}
.ev-relay__bar--9 {
  --relay-fill: 90%;
}
.ev-relay__bar--10 {
  --relay-fill: 100%;
}

/* ---- The Heist ------------------------------------------------------------ */
.ev-heist__vault { margin: 0; text-align: center; font-weight: 800; letter-spacing: 0.04em; }
.ev-heist__lock { margin: 0; font-size: 1.2rem; font-weight: 800; overflow-wrap: anywhere; }
.ev-heist__briefing { margin: 0; color: var(--text-dim, #9fb8b2); overflow-wrap: anywhere; }

.ev-heist__clues,
.ev-heist__hints {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* The fragments sit on the secret card's own fixed panel, so they read in both themes. */
.ev-heist__clues {
  padding: 0.75rem 0.75rem 0.75rem 1.8rem;
  border-radius: var(--ev-radius, 14px);
  background: #2a1c3d;
  color: #f3e9ff;
  border: 2px dashed #b48ae0;
}

.ev-heist__clue { font-weight: 700; overflow-wrap: anywhere; }
.ev-heist__hint { overflow-wrap: anywhere; color: var(--ev-paused-text, #f0b429); }
.ev-heist__hint-button { min-height: 52px; font-size: 0.95rem; letter-spacing: 0; }
