/* Logical properties only (inline/block, start/end): the page mirrors by dir="rtl|ltr" with no overrides.
   tests/RepoRulesTest.php refuses physical left/right here. Components (buttons, sheets, code field) come from
   game-ui (gu-); this file lays out the pages. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-family: "Tajawal", "Poppins", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-block-size: 100vh;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a {
  color: var(--brand-ink);
}

.muted {
  color: var(--muted);
}

/* ---- Header ------------------------------------------------------------------------------------------------- */
.site-head {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-block-size: 64px;
  padding-inline: 16px;
  background: var(--brand);
  color: var(--on-brand);
}

.site-brand,
.site-link {
  color: var(--on-brand);
  text-decoration: none;
  font-weight: 700;
}

.site-brand {
  margin-inline-end: auto;
}

.site-mark {
  font-size: 1.4em;
}

.site-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.head-btn {
  display: inline-grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--on-brand);
  font-size: 20px;
  cursor: pointer;
  list-style: none;
}

.head-btn::-webkit-details-marker {
  display: none;
}

.menu {
  position: relative;
}

.menu-pop {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: calc(100% + 6px);
  inline-size: min(360px, calc(100vw - 24px));
  padding: 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
}

.menu-who,
.menu-title {
  margin: 4px 8px;
  font-weight: 700;
}

.menu-pill {
  display: inline-block;
  margin: 0 8px 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
}

.menu-empty {
  margin: 8px;
  color: var(--muted);
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  inline-size: 100%;
  min-block-size: 44px;
  padding-inline: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--bg);
}

.menu-aside {
  color: var(--muted);
}

.menu-danger {
  color: var(--bad);
}

.menu-line {
  border: 0;
  border-block-start: 1px solid var(--line);
}

/* ---- Public and auth pages ---------------------------------------------------------------------------------- */
.site-main {
  padding: 20px 16px;
}

.site-foot {
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.home-card,
.auth-card {
  max-inline-size: 420px;
  margin-inline: auto;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.home-card {
  text-align: center;
}

.home-title,
.auth-title {
  margin-block: 0 8px;
  font-size: 22px;
}

.home-line,
.auth-sub {
  margin-block: 0 16px;
  color: var(--muted);
}

.home-soon {
  margin: 0;
  font-weight: 700;
}

.auth-icon {
  margin: 0;
  font-size: 40px;
  line-height: 1;
  color: var(--brand);
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-block-end: 12px;
}

.auth-note {
  padding: 12px;
  border-radius: 9px;
  background: var(--bg);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block: 16px 12px;
  color: var(--muted);
  font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-block-start: 1px solid var(--line);
}

.auth-back {
  display: block;
  text-align: center;
}

.field-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.field-label {
  font-size: 14px;
  font-weight: 500;
}

.field-aside {
  font-size: 14px;
}

.field {
  inline-size: 100%;
  min-block-size: 46px;
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.field:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.field-help {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.form-error {
  margin-block: 0 12px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--bad);
  color: var(--bad);
}

.form-saved {
  max-inline-size: 760px;
  margin: 0 auto 12px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--ok);
  color: var(--ok);
}

/* ---- Coordinator shell -------------------------------------------------------------------------------------- */
.shell {
  display: flex;
  justify-content: center;
}

.shell-main {
  flex: 1;
  max-inline-size: 760px;
  padding: 16px 16px 96px;
}

.nav-side {
  display: none;
}

.nav-bottom {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-inline-size: 760px;
  margin-inline: auto;
  padding-block: 6px;
  padding-block-end: calc(6px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-block-start: 1px solid var(--line);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-block-size: 48px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.nav-item[aria-current="page"] {
  color: var(--brand-ink);
  font-weight: 700;
}

.nav-icon {
  font-size: 20px;
  line-height: 1;
}

.nav-new .nav-icon {
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  margin-block-start: -18px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
}

.nav-group {
  margin: 16px 12px 4px;
  color: var(--muted);
  font-size: 12px;
}

@media (min-width: 1024px) {
  .nav-bottom {
    display: none;
  }

  .nav-side {
    display: block;
    flex: 0 0 240px;
    padding: 16px 8px;
    border-inline-end: 1px solid var(--line);
    background: var(--surface);
    min-block-size: calc(100vh - 64px);
  }

  .nav-side .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding-inline: 12px;
    border-radius: 9px;
    font-size: 15px;
  }

  .nav-side .nav-new .nav-icon {
    inline-size: auto;
    block-size: auto;
    margin: 0;
    background: transparent;
    color: inherit;
  }

  .shell {
    justify-content: flex-start;
  }

  .shell-main {
    margin-inline: auto;
    padding-block-end: 32px;
  }
}

.page-title {
  margin-block: 0 16px;
  font-size: 22px;
}

.card {
  margin-block-end: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.card-title {
  margin-block: 0 8px;
  font-size: 17px;
}

.welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.welcome-title {
  margin-block: 0 4px;
  font-size: 22px;
}

.welcome-line {
  margin-block: 0 12px;
  color: var(--muted);
}

.welcome-mascot {
  font-size: 64px;
  color: var(--brand);
  line-height: 1;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-block-end: 12px;
}

@media (min-width: 600px) {
  .tiles {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-weight: 500;
}

.tile-icon {
  display: grid;
  place-items: center;
  inline-size: 40px;
  block-size: 40px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--brand-ink);
  font-size: 20px;
}

.tile-soon {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.steps {
  margin: 0;
  padding-inline-start: 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-block-end: 12px;
}

@media (min-width: 600px) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.account-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-initial {
  display: grid;
  place-items: center;
  inline-size: 48px;
  block-size: 48px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 22px;
  font-weight: 700;
}

.account-name {
  margin: 0;
  font-size: 20px;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
  border-block-start: 1px solid var(--line);
}

.detail-row:first-of-type {
  border-block-start: 0;
}

.detail-text {
  display: flex;
  flex-direction: column;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
}

.detail-value {
  font-weight: 500;
}

.detail-value.is-empty {
  color: var(--muted);
  font-weight: 400;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  text-decoration: none;
}

.list {
  padding-block: 8px;
}

.list form {
  margin: 0;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  inline-size: 100%;
  min-block-size: 48px;
  padding-inline: 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.list-row .tile-soon,
.list-row .menu-aside {
  margin-inline-start: auto;
}

.list-icon {
  display: grid;
  place-items: center;
  inline-size: 32px;
  block-size: 32px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--brand-ink);
}

.list-danger {
  color: var(--bad);
}

.soon-line {
  margin: 0;
  font-weight: 700;
}

/* ---- Join, lobby and the game panel ------------------------------------------------------------------------- */
.join-locked {
  margin-block-start: 6px;
}

.player-brand { display: flex; flex: none; }
.error-card .logo { display: block; margin: 0 auto 12px; }

.player-me {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-end: auto;
  font-weight: 700;
}

.player-avatar {
  display: grid;
  place-items: center;
  inline-size: 40px;
  block-size: 40px;
  border-radius: 50%;
  background: var(--surface);
  font-size: 22px;
}

.net {
  font-size: 14px;
}

.lobby,
.panel {
  max-inline-size: 760px;
  margin-inline: auto;
}

.lobby-status {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}

.player-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.player-chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}

.is-absent {
  opacity: 0.55;
}

/* Two-team modes (D39): the player's team in the lobby: a chip on the coordinator panel, the colour on phones and TV. */
.team-chip {
  flex: none;
  padding: 2px 10px;
  border: 1px solid var(--team-a);
  border-radius: 999px;
  background: var(--team-a-soft);
  color: var(--ink);
  font-size: 0.85em;
  font-weight: 700;
}

/* A row with a team wraps its buttons under the name on a phone instead of squeezing them. */
.row-item.has-team {
  flex-wrap: wrap;
}

.row-item.has-team .gu-btn {
  white-space: nowrap;
}

.team-chip-b {
  border-color: var(--team-b);
  background: var(--team-b-soft);
}

.player-chip.is-team-a,
.tv-chip.is-team-a {
  border-color: var(--team-a);
  background: var(--team-a-soft);
}

.player-chip.is-team-b,
.tv-chip.is-team-b {
  border-color: var(--team-b);
  background: var(--team-b-soft);
}

.chat-list {
  max-block-size: 260px;
  margin: 0 0 12px;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.chat-line {
  padding-block: 4px;
  overflow-wrap: anywhere;
}

.chat-form {
  display: flex;
  gap: 8px;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-block-end: 8px;
}

.card-row .card-title {
  margin: 0;
}

.row-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-block: 8px;
  border-block-start: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.row-item:first-child {
  border-block-start: 0;
}

.row-item > span:first-child {
  margin-inline-end: auto;
}

.inline-form {
  display: inline;
  margin: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head .page-title {
  margin-block-end: 4px;
}

.panel-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--ink);
  text-decoration: none;
}

.panel-qr img,
.share-qr {
  background: #ffffff;
  border-radius: 8px;
}

.panel-code {
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 700;
}

.share {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.share-code {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.share-link {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.game-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-block-size: 48px;
  color: var(--ink);
  text-decoration: none;
  border-block-start: 1px solid var(--line);
}

.game-list li:first-child .game-row {
  border-block-start: 0;
}

.game-name {
  margin-inline-end: auto;
  font-weight: 500;
}

.game-code {
  color: var(--muted);
  font-family: "Poppins", system-ui, sans-serif;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-block-size: 44px;
}

details.card > summary {
  cursor: pointer;
}

/* ---- The TV (1920×1080; nothing smaller than 28px there, GAMES_PHASE2_SPEC §1) ---------------------------- */
.is-screen {
  background: var(--bg);
}

.tv {
  display: grid;
  min-block-size: 100vh;
  padding: 2vw;
  font-size: clamp(18px, 1.6vw, 40px);
}

.tv-idle,
.tv-waiting,
.tv-playing {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1vw;
  text-align: center;
}

.tv-brand {
  margin: 0;
  font-weight: 700;
  color: var(--brand-ink);
}

.tv-brand-big {
  font-size: 3em;
}

.tv-qr {
  inline-size: min(32vh, 320px);
  block-size: auto;
  padding: 12px;
  background: #ffffff;
  border-radius: 16px;
}

.tv-code {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 2.4em;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.tv-line,
.tv-status {
  margin: 0;
  color: var(--muted);
}

.tv-manual {
  font-size: 28px;
}

.tv-manual summary {
  cursor: pointer;
  min-block-size: 44px;
}

.tv-key-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-block-start: 8px;
}

.tv-key {
  inline-size: 14em;
  text-transform: uppercase;
}

.tv-steps {
  margin: 1vw 0 0;
  padding-inline-start: 1.4em;
  text-align: start;
}

.tv-screen,
.tv-waiting,
.tv-playing,
.tv-lobby {
  min-block-size: calc(100vh - 4vw);
}

.tv-lobby {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  grid-template-rows: 1fr auto;
  gap: 2vw;
}

.tv-join {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.6vw;
}

.tv-link {
  margin: 0;
  color: var(--muted);
}

.tv-count {
  margin: 0 0 1vw;
  font-weight: 700;
}

.tv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8vw;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tv-chip {
  padding: 0.4em 0.9em;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.tv-status {
  grid-column: 1 / -1;
  text-align: center;
}

.tv-net {
  position: fixed;
  inset-block-end: 12px;
  inset-inline-end: 12px;
  margin: 0;
  font-size: 28px;
}

.screen-key {
  margin: 0 0 8px;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* ---- The hex board (board.js): one SVG, scaled to its box, never mirrored ------------------------------------- */
.board-wrap {
  inline-size: 100%;
}

.hex-board {
  display: block;
  inline-size: 100%;
  block-size: auto;
  max-block-size: 70vh;
}

.hex-cell polygon {
  fill: var(--cell);
  stroke: var(--line);
  stroke-width: 2;
}

.hex-cell.owner-a polygon {
  fill: var(--team-a);
}

.hex-cell.owner-b polygon {
  fill: var(--team-b);
}

.hex-cell.on-path polygon {
  stroke: var(--path);
  stroke-width: 6;
}

/* The marks live in <symbol>s drawn through <use>: CSS cannot reach inside, so colours are set on the <use> element
   and inherited by the symbol's path. */
.owner-a .hex-mark {
  fill: none;
  stroke: var(--team-a-mark);
  stroke-width: 3;
}

.owner-b .hex-mark {
  fill: var(--team-b-mark);
  stroke: none;
}

.hex-label {
  fill: var(--ink);
  font-size: 24px;
  font-weight: 700;
  text-anchor: middle;
}

.hex-cell[role="button"] {
  cursor: pointer;
}

.hex-cell[role="button"]:focus-visible polygon,
.hex-cell[role="button"]:hover polygon {
  stroke: var(--brand);
  stroke-width: 5;
}

.board-counts {
  display: flex;
  gap: 16px;
  margin: 8px 0 0;
}

.chip-a,
.chip-b {
  padding-inline-start: 10px;
  border-inline-start: 6px solid var(--team-a);
}

.chip-b {
  border-inline-start-color: var(--team-b);
}

.tv-bar {
  margin: 0;
  font-weight: 700;
  text-align: center;
}

.tv-playing {
  justify-content: stretch;
  align-content: center;
}

.tv-board-row {
  display: grid;
  inline-size: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 2vw;
}

.tv-board .hex-board {
  max-block-size: 82vh;
}

.tv-side {
  margin: 0;
  font-size: 1.4em;
  text-align: center;
}

/* ---- The approved design (D20, docs/DESIGN_UI.md, prototype/assets/proto.css) ------------------------------------ */
/* The header: the brand bar, round 44px buttons, and the two teams' line under it (the identity's signature). */
.site-head { min-block-size: 64px; }
.site-head::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: -3px; block-size: 3px; background: linear-gradient(90deg, var(--team-b), var(--team-a)); }
.site-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 900; }
.head-btn { border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); }
.logo { inline-size: 36px; block-size: 36px; flex: none; }
.logo-tile { fill: #191c45; }
.logo-a { fill: #e5177a; }
.logo-y { fill: #f5c518; }
.logo-b { fill: #0a84d6; }
/* The mark keeps its own colours in both themes (D28); on a dark page a hairline keeps the navy tile apart. */
:root[data-theme="dark"] .logo-tile, .tv .logo-tile { stroke: rgba(255, 255, 255, .16); stroke-width: 1.5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-tile { stroke: rgba(255, 255, 255, .16); stroke-width: 1.5; } }
.logo-md { inline-size: 60px; block-size: 60px; }
.logo-xl { inline-size: 96px; block-size: 96px; }
.welcome-mascot .logo { inline-size: 72px; block-size: 72px; }
/* Cards and type */
.card, .auth-card, .home-card, .panel { border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.page-title, .auth-title, .home-title, .welcome-title { font-weight: 900; }
/* The TV: always dark, with the identity's glow (prototype tv-*). */
.is-screen { background: var(--tv-bg); color: var(--tv-ink); }
.is-screen .tv { background: radial-gradient(900px 600px at 85% -10%, rgba(229, 23, 122, .28), transparent 70%),
  radial-gradient(900px 600px at 10% 110%, rgba(10, 132, 214, .30), transparent 70%), linear-gradient(160deg, var(--tv-bg-2), var(--tv-bg) 60%); }
.is-screen .tv-brand { display: inline-flex; align-items: center; gap: 14px; font-weight: 900; }
.is-screen .tv-brand { color: var(--tv-ink); font-size: 44px; }
.gu-accent { box-shadow: var(--shadow-cta); font-weight: 900; }
/* The lobby's welcome (prototype hero-card): the brand gradient, the logo, the status. */
.lobby-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 22px 16px 18px; margin-block-end: 14px; border-radius: var(--r-lg); background: linear-gradient(160deg, var(--brand), var(--brand-2)); color: var(--on-brand); box-shadow: var(--shadow-2); }
.lobby-hero .lobby-status { font-size: 24px; font-weight: 900; margin: 0; }
.lobby-hero .lobby-code { margin: 0; opacity: .85; }
.lobby-hero .num { display: inline-block; unicode-bidi: isolate; direction: ltr; font-family: var(--font-num); font-weight: 800; color: var(--accent); letter-spacing: .06em; }
/* ---- Stage mode (D18, D21): the board in the approved layout, the question, the buzzer, the judge buttons ------ */
.stage { display: flex; flex-direction: column; gap: 12px; }
.stage-player { margin-block-end: 14px; }
.stage .score { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stage .score-team { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface); border: 1.5px solid var(--line); }
.stage .score-team em { margin-inline-start: auto; font-style: normal; font-family: var(--font-num); font-weight: 800; font-size: 22px; }
.stage .score-a em { color: var(--team-a); }
.stage .score-b em { color: var(--team-b); }
.stage .score-a.is-turn { border-color: var(--team-a); box-shadow: 0 0 0 3px var(--team-a-soft); }
.stage .score-b.is-turn { border-color: var(--team-b); box-shadow: 0 0 0 3px var(--team-b-soft); }
.stage .sw { inline-size: 14px; block-size: 14px; border-radius: 4px; flex: none; }
.stage .sw-a { background: repeating-linear-gradient(45deg, var(--team-a) 0 3px, var(--team-a-2) 3px 6px); }
.stage .sw-b { background: radial-gradient(circle, rgba(255, 255, 255, .55) 0 1.4px, transparent 1.8px) 0 0 / 5px 5px, var(--team-b); }
.stage .chip { align-self: flex-start; display: inline-flex; padding: 4px 12px; border-radius: var(--r-pill); font-weight: 800; margin: 0; }
.stage .chip.chip-a { background: var(--team-a-soft); color: var(--team-a); }
.stage .chip.chip-b { background: var(--team-b-soft); color: var(--team-b); }
.st-status { margin: 0; font-size: 20px; font-weight: 900; text-align: center; }
.stage .board-card { padding: 8px; border-radius: var(--r-lg); background: var(--board-bg); border: 1px solid var(--line); }
.stage .board { display: block; inline-size: 100%; block-size: auto; border-radius: 18px; }
/* The tiles (wesh-app#183, «اللمسة الفنية»; stage.js skinDefs/tile/motion): a solid edge under each cell, a face lit from
   above, a bevel (light on the upper edges, shade on the lower) and a gloss once coloured. Team patterns stay. */
.stage { --hx-empty: var(--cell); --hx-empty-lip: var(--cell-lip); --hx-empty-ink: var(--cell-ink); }
.stage .bed-0 { stop-color: var(--bed-top); }
.stage .bed-1 { stop-color: var(--bed-bottom); }
.stage .lit-0 { stop-color: #fff; stop-opacity: .16; }
.stage .lit-1 { stop-color: #fff; stop-opacity: 0; }
.stage .lit-2 { stop-color: #000; stop-opacity: .08; }
.stage .bev-0 { stop-color: #fff; stop-opacity: .6; }
.stage .bev-1 { stop-color: #fff; stop-opacity: 0; }
.stage .bev-2 { stop-color: #000; stop-opacity: .1; }
.stage .gls-0 { stop-color: #fff; stop-opacity: .16; }
.stage .gls-1 { stop-color: #fff; stop-opacity: 0; }
.stage .shn-0 { stop-color: #fff; stop-opacity: 0; }
.stage .shn-1 { stop-color: #fff; stop-opacity: .6; }
.stage .hx-lit, .stage .hx-bevel, .stage .hx-gloss, .stage .hx-pat, .stage .hx-l, .stage .hx-rim, .stage .hx-halo, .stage .hx-ripple,
.stage .hx-flood, .stage .hx-flash, .stage .hx-shine, .stage .hx-spark, .stage .hx-gold, .stage .hx-gold-glow { pointer-events: none; }
.stage .hx-body, .stage .hx-ripple, .stage .hx-flood, .stage .hx-spark { transform-box: fill-box; transform-origin: center; }
.stage .hx-shape { fill: var(--cell); }
.stage .hx-edge { fill: var(--cell-lip); }
.stage .hx-bevel { opacity: .75; }
.stage .hx-open .hx-bevel { opacity: 1; }
.stage .hx-open .hx-gloss { display: none; }
.stage .hx-l { font-family: var(--font); font-weight: 900; font-size: 30px; fill: var(--cell-ink); filter: drop-shadow(0 1.5px 1.5px rgba(0, 0, 0, .3)); }
.stage .hx-open .hx-l { filter: drop-shadow(0 1.5px 1.5px rgba(0, 0, 0, .08)); }
.stage-screen .hx-open .hx-l { filter: drop-shadow(0 1.5px 1.5px rgba(0, 0, 0, .3)); }
.stage .hx-a .hx-shape, .stage .hx-frame-a .hx-shape, .stage .hx-a .hx-flood, .stage .hx-a .hx-spark { fill: var(--team-a); }
.stage .hx-b .hx-shape, .stage .hx-frame-b .hx-shape, .stage .hx-b .hx-flood, .stage .hx-b .hx-spark { fill: var(--team-b); }
.stage .hx-a .hx-edge, .stage .hx-frame-a .hx-edge { fill: color-mix(in srgb, var(--team-a), #000 var(--lip)); }
.stage .hx-b .hx-edge, .stage .hx-frame-b .hx-edge { fill: color-mix(in srgb, var(--team-b), #000 var(--lip)); }
.stage .hx-a .hx-l, .stage .hx-b .hx-l { fill: #fff; }
.stage .pat-a { fill: rgba(255, 255, 255, .2); }
.stage .pat-b { fill: rgba(255, 255, 255, .34); }
/* The picked cell rises, gold, with a soft halo. */
.stage .hx-pick .hx-shape { fill: var(--cell-pick); }
.stage .hx-pick .hx-edge { fill: var(--accent-2); }
.stage .hx-pick .hx-l { fill: var(--on-accent); }
.stage .hx-pick .hx-body { transform: translateY(-6.4px) scale(1.08); }
.stage .hx-halo { fill: var(--accent); opacity: .24; }
.stage .hx-ripple { fill: none; stroke: var(--accent); stroke-width: 3.5; opacity: 0; }
/* The cells this player may pick wear a gold rim. */
.stage .hx-free { cursor: pointer; }
.stage .hx-rim { fill: none; stroke: var(--accent); stroke-width: 2.6; opacity: .85; }
.stage .hx-free:hover .hx-rim, .stage .hx-free:focus-visible .hx-rim { stroke-width: 5; opacity: 1; }
.stage .hx-free:focus { outline: none; }
/* A claim's moving parts rest hidden; a won path is gold. */
.stage .hx-flash { fill: #fff; opacity: 0; }
.stage .hx .hx-spark.hx-spark-1, .stage .hx .hx-spark.hx-spark-3, .stage .hx .hx-spark.hx-spark-5 { fill: var(--accent); }
.stage .hx-socket { fill: rgba(0, 0, 0, .3); }
.stage .hx-lock { font-size: 15px; }
.stage .hx-shine, .stage .hx-spark { opacity: 0; }
.stage .hx-gold { fill: none; stroke: var(--accent); stroke-width: 5; }
.stage .hx-gold-glow { fill: none; stroke: var(--accent); stroke-width: 6; stroke-opacity: .4; }
.stage .board-won .hx-a:not(.hx-win), .stage .board-won .hx-b:not(.hx-win) { opacity: .45; }
.hx-win-0 { --o: 0; } .hx-win-1 { --o: 1; } .hx-win-2 { --o: 2; } .hx-win-3 { --o: 3; } .hx-win-4 { --o: 4; } .hx-win-5 { --o: 5; } .hx-win-6 { --o: 6; } .hx-win-7 { --o: 7; }
.hx-win-8 { --o: 8; } .hx-win-9 { --o: 9; } .hx-win-10 { --o: 10; } .hx-win-11 { --o: 11; } .hx-win-12 { --o: 12; } .hx-win-13 { --o: 13; } .hx-win-14 { --o: 14; } .hx-win-15 { --o: 15; }
.hx-win-16 { --o: 16; } .hx-win-17 { --o: 17; } .hx-win-18 { --o: 18; } .hx-win-19 { --o: 19; } .hx-win-20 { --o: 20; } .hx-win-21 { --o: 21; } .hx-win-22 { --o: 22; } .hx-win-23 { --o: 23; }
.hx-win-24 { --o: 24; } .hx-win-25 { --o: 25; } .hx-win-26 { --o: 26; } .hx-win-27 { --o: 27; } .hx-win-28 { --o: 28; } .hx-win-29 { --o: 29; } .hx-win-30 { --o: 30; } .hx-win-31 { --o: 31; }
.hx-win-32 { --o: 32; } .hx-win-33 { --o: 33; } .hx-win-34 { --o: 34; } .hx-win-35 { --o: 35; } .hx-win-36 { --o: 36; } .hx-win-37 { --o: 37; } .hx-win-38 { --o: 38; } .hx-win-39 { --o: 39; }
.hx-d-0 { --w: 0; } .hx-d-1 { --w: 1; } .hx-d-2 { --w: 2; } .hx-d-3 { --w: 3; } .hx-d-4 { --w: 4; } .hx-d-5 { --w: 5; } .hx-d-6 { --w: 6; } .hx-d-7 { --w: 7; } .hx-d-8 { --w: 8; } .hx-d-9 { --w: 9; }
.hx-spark-0 { --dx: .866; --dy: .5; } .hx-spark-1 { --dx: 0; --dy: 1; } .hx-spark-2 { --dx: -.866; --dy: .5; }
.hx-spark-3 { --dx: -.866; --dy: -.5; } .hx-spark-4 { --dx: 0; --dy: -1; } .hx-spark-5 { --dx: .866; --dy: -.5; }
.hx-ph-0 { --ph: 0; } .hx-ph-1 { --ph: 1; } .hx-ph-2 { --ph: 2; } .hx-ph-3 { --ph: 3; } .hx-ph-4 { --ph: 4; } .hx-ph-5 { --ph: 5; } .hx-ph-6 { --ph: 6; } .hx-ph-7 { --ph: 7; } .hx-ph-8 { --ph: 8; } .hx-ph-9 { --ph: 9; } .hx-ph-10 { --ph: 10; } .hx-ph-11 { --ph: 11; }
/* The motion (none under «reduce motion»: the cells keep their final look). */
@media (prefers-reduced-motion: no-preference) {
  .stage .hx-free .hx-rim { animation: hx-breathe .925s ease-in-out calc(var(--ph, 0) * -147ms) infinite alternate; }
  .stage .hx-halo { animation: hx-halo .75s ease-in-out infinite alternate; }
  .stage .hx-flip .hx-body { animation: hx-flip .8s ease-in-out; }
  .stage .hx-flip .hx-pat { animation: hx-half .5s step-end; }
  .stage .hx-from-a .hx-shape { animation: hx-was-a .25s step-end; }
  .stage .hx-from-b .hx-shape { animation: hx-was-b .25s step-end; }
  .stage .hx-from-c .hx-shape { animation: hx-was-c .25s step-end; }
  .stage .hx-from-d .hx-shape { animation: hx-was-d .25s step-end; }
  .stage .hx-ripple { animation: hx-ripple .8s ease-out; }
  .stage .hx-ripple ~ .hx-body { animation: hx-rise .6s cubic-bezier(.34, 1.56, .64, 1) backwards; }
  .stage .hx-claim .hx-body { animation: hx-press 1.1s ease-out backwards; }
  .stage .hx-claim .hx-shape { animation: hx-was .5s; }
  .stage .hx-claim .hx-edge { animation: hx-was-lip .4s; }
  .stage .hx-claim .hx-l { animation: hx-was-ink .3s; }
  .stage .hx-claim .hx-flood { animation: hx-flood 1.1s backwards; }
  .stage .hx-claim .hx-flash { animation: hx-flash 1.1s; }
  .stage .hx-claim .hx-shine { animation: hx-shine 1.1s ease-in-out; }
  .stage .hx-claim .hx-spark { animation: hx-spark 1.1s ease-out; }
  .stage .hx-claim .hx-pat, .stage .hx-claim .hx-gloss { animation: hx-late 1.1s backwards; }
  .stage .hx-win .hx-gold, .stage .hx-win .hx-gold-glow { animation: hx-shimmer 1s ease-in-out calc(var(--o, 0) * 130ms) infinite alternate; }
  .stage .hx-lighting .hx-gold, .stage .hx-lighting .hx-gold-glow { animation: hx-gold-in .52s ease-out calc(var(--o, 0) * 130ms) backwards,
    hx-shimmer 1s ease-in-out calc(var(--o, 0) * 130ms + 520ms) infinite alternate; }
  .stage .hx-lighting .hx-body { animation: hx-gold-pop .52s ease-in-out calc(var(--o, 0) * 130ms) backwards; }
  .stage .board-intro .hx-body { animation: hx-pop .52s linear calc(var(--w, 0) * 70ms) backwards; }
}
@keyframes hx-breathe { from { stroke: var(--accent-2); opacity: .55; } to { stroke: var(--accent); opacity: 1; } }
@keyframes hx-halo { from { opacity: .12; } to { opacity: .3; } }
@keyframes hx-ripple { from { transform: scale(1); opacity: .9; stroke-width: 3.5; } to { transform: scale(1.95); opacity: 0; stroke-width: 0; } }
@keyframes hx-rise { from { transform: none; } to { transform: translateY(-6.4px) scale(1.08); } }
@keyframes hx-press { 0% { transform: scale(1); } 14.5% { transform: scale(.88); } 30% { transform: scale(1.05); } 42% { transform: scale(.97); }
  54% { transform: scale(1.015); } 64%, 100% { transform: scale(1); } }
@keyframes hx-was { 0%, 100% { fill: var(--hx-empty); } }
@keyframes hx-was-lip { 0%, 100% { fill: var(--hx-empty-lip); } }
@keyframes hx-was-ink { 0%, 100% { fill: var(--hx-empty-ink); } }
@keyframes hx-flood { 0%, 14.5% { transform: scale(0); } 45%, 100% { transform: scale(1); } }
@keyframes hx-flash { 0%, 14% { opacity: 0; } 15% { opacity: .55; } 42%, 100% { opacity: 0; } }
@keyframes hx-shine { 0%, 58% { transform: translateX(0); opacity: 0; } 61% { opacity: 1; } 96% { transform: translateX(124px); opacity: 1; } 100% { transform: translateX(124px); opacity: 0; } }
@keyframes hx-spark { 0%, 14% { transform: translate(calc(var(--dx) * 28px), calc(var(--dy) * 28px)); opacity: 0; } 16% { opacity: 1; }
  78%, 100% { transform: translate(calc(var(--dx) * 72px), calc(var(--dy) * 72px)) rotate(60deg) scale(.5); opacity: 0; } }
@keyframes hx-flip { 0% { transform: scaleX(1); } 31% { transform: scaleX(.04); } 62% { transform: scaleX(1); } 81% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes hx-half { 0%, 100% { opacity: 0; } }
@keyframes hx-was-a { 0%, 100% { fill: var(--team-a); } }
@keyframes hx-was-b { 0%, 100% { fill: var(--team-b); } }
@keyframes hx-was-c { 0%, 100% { fill: var(--team-c); } }
@keyframes hx-was-d { 0%, 100% { fill: var(--team-d); } }
@keyframes hx-late { 0%, 30% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes hx-gold-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes hx-shimmer { from { opacity: 1; } to { opacity: .55; } }
@keyframes hx-gold-pop { 0%, 100% { transform: none; } 50% { transform: scale(1.16); } }
@keyframes hx-pop { 0% { transform: scale(.001); } 45% { transform: scale(1.1); } 65% { transform: scale(.96); } 82% { transform: scale(1.02); } 100% { transform: scale(1); } }
.st-question { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.st-question .letter-badge { inline-size: 48px; block-size: 48px; display: inline-grid; place-items: center; flex: none; background: var(--accent); color: var(--on-accent); font-weight: 900; font-size: 28px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.st-q-text { flex: 1; margin: 0; font-size: 20px; font-weight: 800; }
.st-answer { flex-basis: 100%; margin: 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--ok-soft); }
.st-count { margin: 0; text-align: center; font-family: var(--font-num); font-size: 40px; font-weight: 900; color: var(--accent); }
.st-last { margin: 0; text-align: center; }
.st-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.st-actions .muted { margin: 0; text-align: center; }
.st-right { background: var(--ok); border-color: var(--ok); color: #fff; }
.st-buzz { inline-size: min(280px, 80vw); block-size: min(280px, 80vw); border: 0; border-radius: 50%; font-family: var(--font); font-size: 48px; font-weight: 900; color: #fff; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, var(--team-a-2), var(--team-a) 60%, var(--team-a-mark)); box-shadow: 0 10px 0 var(--team-a-mark), 0 0 0 14px var(--team-a-soft); }
.st-buzz:active { transform: translateY(6px); box-shadow: 0 4px 0 var(--team-a-mark), 0 0 0 14px var(--team-a-soft); }
.st-buzz:disabled { opacity: .6; }
/* On the TV: big type; the board fills the height on one side, the status, question and countdown on the other. */
.stage-screen { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-auto-rows: min-content; column-gap: 40px; row-gap: 20px; align-items: start; }
.stage-screen .score { grid-column: 1 / -1; }
.stage-screen .board-card { grid-column: 1; grid-row: 2 / span 6; }
.stage-screen > :not(.score):not(.board-card) { grid-column: 2; }
.stage-screen .st-status { font-size: 44px; }
.stage-screen .score-team { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: var(--tv-ink); font-size: 26px; }
.stage-screen .score-team em { font-size: 40px; }
.stage-screen .board-card { background: transparent; border: 0; }
.stage-screen .board { block-size: min(calc(100dvh - 210px), 860px); inline-size: auto; max-inline-size: 100%; margin-inline: auto; }
.stage-screen { --hx-empty: var(--tv-cell); --hx-empty-lip: var(--tv-cell-lip); --hx-empty-ink: var(--tv-cell-ink); --lip: 55%; }
.stage-screen .bed-0 { stop-color: var(--tv-bed-top); }
.stage-screen .bed-1 { stop-color: var(--tv-bed-bottom); }
.stage-screen .hx-open .hx-shape { fill: var(--tv-cell); }
.stage-screen .hx-open .hx-edge { fill: var(--tv-cell-lip); }
.stage-screen .hx-open .hx-l { fill: var(--tv-cell-ink); }
.stage-screen .st-question { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: var(--tv-ink); }
.stage-screen .st-q-text { font-size: 44px; line-height: 1.4; }
.stage-screen .st-question { padding: 24px; }
.stage-screen .letter-badge { inline-size: 72px; block-size: 72px; font-size: 40px; }
.stage-screen .st-count { font-size: 96px; }
.stage-screen .st-last { font-size: 28px; color: var(--tv-ink); }
/* «عرض السؤال على الشاشة» off (an oral quiz): one column, the scores in a bar on top, the board large in the middle. */
.stage-screen.st-oral { grid-template-columns: minmax(0, 1fr); justify-items: center; row-gap: 14px; }
.stage-screen.st-oral > *, .stage-screen.st-oral > :not(.score):not(.board-card) { grid-column: 1; grid-row: auto; }
.stage-screen.st-oral .score { inline-size: min(1100px, 100%); }
.stage-screen.st-oral .score-team { font-size: 32px; padding-block: 14px; }
.stage-screen.st-oral .score-team em { font-size: 56px; }
.stage-screen.st-oral .st-status { order: -1; font-size: 40px; margin: 0; text-align: center; }
.stage-screen.st-oral .score { order: -2; }
.stage-screen.st-oral .board-card { inline-size: 100%; }
.stage-screen.st-oral .board { block-size: min(calc(100dvh - 320px), 940px); filter: drop-shadow(0 18px 50px rgba(245, 197, 24, .18)); animation: st-oral-in .6s ease-out both; }
.stage-screen.st-oral .st-count { order: -1; font-size: 56px; margin: 0; }
@keyframes st-oral-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .stage-screen.st-oral .board { animation: none; } }
/* ---- Phone mode (D19): four players a–d (pink lines, blue dots, amber bars, green grid), numbers, vote, options --- */
.stage .score-4 { grid-template-columns: 1fr 1fr; }
.stage .score-team.is-me { font-weight: 900; }
.stage .score-c em { color: var(--team-c); }
.stage .score-d em { color: var(--team-d); }
.stage .score-c.is-turn { border-color: var(--team-c); box-shadow: 0 0 0 3px var(--team-c-soft); }
.stage .score-d.is-turn { border-color: var(--team-d); box-shadow: 0 0 0 3px var(--team-d-soft); }
.stage .sw-c { background: repeating-linear-gradient(0deg, var(--team-c) 0 3px, rgba(255, 255, 255, .45) 3px 5px); }
.stage .sw-d { background: linear-gradient(90deg, rgba(255, 255, 255, .45) 1px, transparent 1px) 0 0 / 5px 5px, linear-gradient(rgba(255, 255, 255, .45) 1px, transparent 1px) 0 0 / 5px 5px, var(--team-d); }
.stage .chip.chip-c { background: var(--team-c-soft); color: var(--team-c); }
.stage .chip.chip-d { background: var(--team-d-soft); color: var(--team-d); }
.stage .hx-c .hx-shape, .stage .hx-c .hx-flood, .stage .hx-c .hx-spark { fill: var(--team-c); }
.stage .hx-d .hx-shape, .stage .hx-d .hx-flood, .stage .hx-d .hx-spark { fill: var(--team-d); }
.stage .hx-c .hx-edge { fill: color-mix(in srgb, var(--team-c), #000 var(--lip)); }
.stage .hx-d .hx-edge { fill: color-mix(in srgb, var(--team-d), #000 var(--lip)); }
.stage .hx-c .hx-l, .stage .hx-d .hx-l { fill: #fff; }
.stage .pat-c { fill: rgba(255, 255, 255, .28); }
.stage .pat-d { fill: rgba(255, 255, 255, .24); }
.stage .hx-n { font-family: var(--font-num); font-weight: 800; font-size: 26px; }
.ph-turns { margin: 0; text-align: center; font-size: 14px; }
.ph-capture { align-self: center; background: var(--accent); color: var(--on-accent); padding: 4px 12px; border-radius: var(--r-pill); font-weight: 800; margin: 0; }
.ph-list { display: flex; flex-direction: column; gap: 8px; flex-basis: 100%; }
.ph-choice { inline-size: 100%; min-block-size: 52px; justify-content: flex-start; text-align: start; white-space: normal; }
.ph-option-static { margin: 0; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.ph-note { margin: 0; text-align: center; }
.ph-host-list { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.stage-screen .score-4 { grid-template-columns: repeat(4, 1fr); }
.stage-screen .ph-option-static { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); font-size: 28px; }
.stage-screen .ph-turns { font-size: 22px; color: var(--tv-ink); }
/* ---- The join page's avatar row (GAMES_UNIFIED §2, Nasser 2026-11-21): one row of square tiles with a light frame,
   4 to 6 by width with no sideways scroll, then «المزيد» as a tile of the same size at the end of the row. ---------- */
.join-card .gu-avatars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 6px 4px; }
.join-card .gu-avatars.gu-all { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.join-card .gu-avatar { inline-size: auto; block-size: auto; aspect-ratio: 1; border-radius: 12px; }
.join-card .gu-avatar span { border-radius: 12px; border: 1.5px solid var(--line); font-size: 28px; }
.join-card .gu-avatar input:checked + span { border: 3px solid var(--brand); box-shadow: 0 0 0 3px var(--brand-soft, rgba(0, 0, 0, .08)); }
.gu-avatar-more { order: 99; aspect-ratio: 1; min-inline-size: 0; min-block-size: 44px; overflow: hidden; white-space: nowrap; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); font-family: inherit; font-size: 12px; font-weight: 800; cursor: pointer; padding: 0; }
.gu-avatar-more[hidden] { display: none; }
.gu-avatar-more:hover, .gu-avatar-more:focus-visible { border-color: var(--brand); }
/* A narrow row holds four avatars and «المزيد»; the fifth is hidden unless it is the chosen one. */
@media (max-width: 359px) {
  .join-card .gu-avatars:not(.gu-all) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .join-card .gu-avatars:not(.gu-all) .gu-avatar:not(.gu-extra):nth-child(5):not(:has(input:checked)) { display: none; }
}
.site-brand { white-space: nowrap; }
.host-link { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.host-link-qr svg { inline-size: min(240px, 70vw); block-size: auto; border-radius: 12px; }
/* The public home (GAMES_UNIFIED §2.3): «انضم للعبة» first, then the coordinator's doors. */
.home-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.home-hero .home-join { margin-block-start: 6px; }
.home-hint { margin: 0; color: var(--muted); font-size: 14px; }
.home-coordinator { display: flex; flex-direction: column; gap: 10px; margin-block-start: 14px; }
.home-coordinator .card-title, .home-coordinator p { margin: 0; }
/* End-of-game results (ROADMAP 2). */
.res-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 2px solid var(--accent); }
.res-title { margin: 0; font-size: 20px; font-weight: 900; text-align: center; }
.res-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.res-list li { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
ol.res-list li { justify-content: flex-start; }
.stage-screen .res-card { background: rgba(255, 255, 255, .06); color: var(--tv-ink); }
.stage-screen .res-title { font-size: 36px; }
.stage-screen .res-list { font-size: 26px; }
/* «لعبة جديدة» › الأسئلة (suggestion 1): difficulty chips and a scrolling category list. */
.new-questions { display: flex; flex-direction: column; gap: 10px; }
.level-pick { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.level-pick legend { margin-block-end: 6px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; min-block-size: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--r-pill); cursor: pointer; }
.chip-check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); font-weight: 800; }
.cat-pick summary { cursor: pointer; }
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; max-block-size: 320px; overflow-y: auto; padding: 4px; }
/* Spectators and reactions (ROADMAP 8). */
.react-bar { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-block-end: 14px; }
.react-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.react-btn { inline-size: 48px; block-size: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); font-size: 24px; cursor: pointer; }
.react-btn:disabled { opacity: .4; }
.viewer-badge { margin: 0; }
.join-viewer { margin-block: 8px; }
.tv-reactions { position: fixed; inset-inline-end: 4vw; inset-block-end: 0; inline-size: 30vw; block-size: 60vh; pointer-events: none; overflow: hidden; }
.tv-react { position: absolute; inset-block-end: -60px; font-size: 64px; animation: tv-float 4s ease-out forwards; }
.tv-react-0 { inset-inline-start: 5%; } .tv-react-1 { inset-inline-start: 25%; } .tv-react-2 { inset-inline-start: 45%; }
.tv-react-3 { inset-inline-start: 65%; } .tv-react-4 { inset-inline-start: 85%; }
@keyframes tv-float { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-55vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tv-react { animation: none; inset-block-end: 10px; } }
/* «البطولة» (ROADMAP 9): the match line above the board. */
.st-match { margin: 0; text-align: center; font-weight: 800; }
.st-match-a { color: var(--team-a); }
.st-match-b { color: var(--team-b); }
.stage-screen .st-match { font-size: 28px; color: var(--tv-ink); }

/* A candidate mode at «لعبة جديدة» (ROADMAP §2): shown only where the server lists it, marked until Nasser approves. */
.mode-preview { display: inline-block; margin-inline-start: 6px; padding: 1px 10px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand); font-size: 0.8em; font-weight: 800; vertical-align: middle; }

/* The owner's internal coordinator account (nhmsv ADMIN_OWNER_COORDINATOR.md §4): a thin line under the header. */
.internal-strip {
  margin: 0;
  padding: 4px 16px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 13px;
  text-align: center;
}

.auth-owner {
  margin-block: 12px 0;
  text-align: center;
  font-size: 14px;
}
/* Sound (docs/SOUND_MAP.md, sound-cues.js): this device's 🔊 switch, and the screen's tap to let the browser play. */
.sound-toggle { display: inline-flex; align-items: center; gap: 6px; min-block-size: 40px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.sound-toggle[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.tv-sound { position: fixed; inset-block-end: 16px; inset-inline-start: 16px; opacity: 0.7; }
.tv-sound:hover, .tv-sound:focus-visible { opacity: 1; }
.sound-tap { position: fixed; inset-block-start: 16px; inset-inline-end: 16px; min-block-size: 48px; padding: 0 20px; border: 0; border-radius: var(--r-pill); background: var(--brand); color: var(--on-brand, #fff); font: inherit; font-weight: 800; cursor: pointer; }

/* «الخلايا المخفية» (docs/MODE_HIDDEN.md): a revealed surprise on its cell, and the golden question's chip. */
.hx-mark { font-size: 18px; font-weight: 800; fill: #ffffff; stroke: #171a3a; stroke-width: 3px; paint-order: stroke; pointer-events: none; }
.hx-mark-bomb, .hx-mark-gold { font-size: 20px; }
.hd-gold { display: inline-block; margin-block-start: 8px; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
/* The coordinator's direct call (Stage::award): a team-coloured button per team, under the question. */
.st-award { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; inline-size: 100%; margin-block-start: 8px; }
.st-award-hint { grid-column: 1 / -1; margin: 0; text-align: center; }
.st-award-btn { min-block-size: 52px; color: #ffffff; font-weight: 800; border: 0; }
.st-award-a { background: var(--team-a, #e11d74); }
.st-award-b { background: var(--team-b, #1e88e5); }
.st-award-none { grid-column: 1 / -1; }
/* «تلوين خلية»: the coordinator's brush (a colour, then any cell). */
.st-paint { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; inline-size: 100%; margin-block-start: 8px; }
.st-paint-toggle, .st-paint-hint { grid-column: 1 / -1; }
.st-paint-hint { margin: 0; text-align: center; }
.st-brush { min-block-size: 44px; font-weight: 800; border: 2px solid transparent; }
.st-brush-a { background: var(--team-a, #e11d74); color: #ffffff; }
.st-brush-b { background: var(--team-b, #1e88e5); color: #ffffff; }
.st-brush.is-on { outline: 3px solid var(--ink); outline-offset: 2px; }
.st-painting .hx-free { cursor: crosshair; }
.panel-players > summary { cursor: pointer; list-style-position: inside; }
.card-row-end { justify-content: flex-end; margin-block: 8px; }

/* «حمّل تطبيق وش؟» (nhmsv GAMES_UNIFIED.md §5): icon, text and button, QR at the end. */
/* «حمّل تطبيق وش؟» (assets/wesh/card.css is a copy of wesh-app docs/brand/download-card): the card follows the
   site's own light/dark choice (theme.js sets data-theme), not only the device's. */
:root[data-theme="dark"] .wesh-dl--auto { --dl-surface: #151a33; --dl-line: #262c4f; --dl-ink: #eef0ff; --dl-muted: #a4aacd; --dl-chip: #1d2342; --dl-cta: #ffb800; --dl-on-cta: #0b1d51; }
:root[data-theme="light"] .wesh-dl--auto { --dl-surface: #ffffff; --dl-line: #e3e6f0; --dl-ink: #13183a; --dl-muted: #5d6385; --dl-chip: #f4f6fb; --dl-cta: #0b1d51; --dl-on-cta: #ffffff; }
.wesh-dl { margin-block: 16px; }

/* D27: the capture warning before the vote, hard to miss on the TV and the phones. */
.ph-alert { margin: 8px 0; padding: 12px 16px; border-radius: var(--r-pill); background: #b42318; color: #ffffff; font-weight: 800; text-align: center; animation: ph-alert-pulse 0.9s ease-in-out 3; }
@keyframes ph-alert-pulse { 50% { transform: scale(1.04); box-shadow: 0 0 0 6px rgba(180, 35, 24, 0.25); } }
@media (prefers-reduced-motion: reduce) { .ph-alert { animation: none; } }
/* D29: a phone-mode player left with no cell. */
.score-team.is-out { opacity: .55; }
.score-team.is-out b { text-decoration: line-through; }
/* D31 (Nasser 2026-11-26): on a player's phone the vote and the question float as a card over the dimmed board; the
   fold button turns it into a pill to look at the board, and back. */
.has-pop .board-card { opacity: .35; transition: opacity .2s; }
.ph-pop { position: fixed; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; max-block-size: 72vh; overflow-y: auto;
  padding: 12px 14px 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 -8px 30px rgba(11, 13, 34, .28); }
.ph-pop-fold { display: block; margin: 0 auto 8px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.ph-pop.is-folded { max-block-size: none; padding: 6px; inset-inline: auto; inset-inline-end: 12px; border-radius: 999px; }
.ph-pop.is-folded .ph-pop-body { display: none; }
.ph-pop.is-folded .ph-pop-fold { margin: 0; background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
@media (min-width: 720px) { .ph-pop { inset-inline: auto; inset-inline-end: 24px; inline-size: 420px; } }
/* D32 «الحلقة تضيق»: the ring about to fall is cracked and blinks (still once the user asks for less motion). */
.hx-falling .hx-shape { stroke: var(--bad); stroke-width: 3; stroke-dasharray: 6 4; }
@media (prefers-reduced-motion: no-preference) { .hx-falling { animation: hx-fall-warn 1s ease-in-out infinite; } }
@keyframes hx-fall-warn { 50% { opacity: .55; } }
.ph-ring { margin: 4px 0; padding: 6px 10px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 700; text-align: center; }
.ph-ring.is-soon { background: var(--bad); color: #fff; }
/* D33 «السور»: a wall's cells (a chain touching two edges) wear a gold rim; nobody can capture them while it stands. */
.hx-wall .hx-shape { stroke: var(--accent); stroke-width: 4; }
/* «فك الارتباط» on the TV: a small corner line that opens to the button. */
.tv-link-info { position: fixed; inset-block-end: 12px; inset-inline-end: 12px; z-index: 20; max-inline-size: 360px; color: var(--tv-ink, #fff); font-size: 14px; opacity: .75; }
.tv-link-info[open] { opacity: 1; padding: 12px; border-radius: 12px; background: rgba(11, 13, 34, .92); border: 1px solid rgba(255, 255, 255, .16); }
.tv-link-info summary { cursor: pointer; }
.tv-unlink p { margin: 8px 0; }


/* ---- The coordinator's stage panel at the thumb (UX review S1, S2; Nasser Q1 2026-11-26) ---------------------------- */
/* S2: while a stage game plays, the head card gives way to the teams' bar; the join code is a pill in the app bar. */
.head-code { display: inline-flex; align-items: center; min-block-size: 32px; padding: 2px 12px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .14);
  color: #ffffff; font-family: var(--font-num); font-weight: 800; font-size: 14px; letter-spacing: .04em; text-decoration: none; white-space: nowrap; unicode-bidi: isolate; }
.head-code:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .site-head.has-code .site-name { display: none; } }
.stage-docked .st-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-docked .score-team.is-turn::after { content: "◀"; order: 1; margin-inline-start: auto; color: var(--accent); font-size: 12px; }
[dir="ltr"] .stage-docked .score-team.is-turn::after { content: "▶"; }
.stage-docked .score-team.is-turn em { order: 2; margin-inline-start: 0; }
.st-host-hint { margin: 0; text-align: center; font-size: 14px; }
/* S1: the dock holds the phase's step; its sheet, tray and error line stand on top of it (out of the flow), so the
   board above never moves or resizes when they open or fold, and nothing dims the page. */
.gu-dock.st-dock { max-width: 760px; }
.gu-dock.st-dock.has-above { border-start-start-radius: 0; border-start-end-radius: 0; border-top-color: transparent; }
.st-above { position: absolute; inset-inline: 0; inset-block-end: 100%; display: flex; flex-direction: column; pointer-events: none; }
.st-above > * { pointer-events: auto; }
.st-dock .gu-dock-main > .muted { margin: 0; align-self: center; text-align: center; }
.st-dock .gu-btn.st-big { min-height: 56px; font-size: 19px; font-weight: 900; }
.st-dock .st-dock-note { font-weight: 800; }
.st-dock .gu-dock-main > .st-undo:has(+ .st-big) { flex: 0 0 auto; }
.st-dock .gu-btn.st-big { white-space: nowrap; }
.st-sheet { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; border: 1px solid var(--line); border-block-end: 0;
  box-shadow: 0 -10px 30px rgba(10, 12, 40, .22); }
.st-sheet.is-folded { align-self: center; background: transparent; border: 0; box-shadow: none; }
.st-handle { display: block; margin: 6px auto 4px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: var(--r-pill);
  padding: 6px 16px; min-block-size: 36px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.st-sheet.is-folded .st-handle { background: var(--surface); color: var(--ink); box-shadow: 0 4px 14px rgba(10, 12, 40, .2); }
.st-handle:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.st-sheet-body { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 8px; max-block-size: 52dvh; overflow-y: auto; overscroll-behavior: contain; }
.st-sheet .st-question { padding: 8px 10px; gap: 6px 10px; }
.st-sheet .st-q-text { font-size: 17px; }
.st-sheet .st-question .letter-badge { inline-size: 40px; block-size: 40px; font-size: 24px; }
.st-sheet .st-count { font-size: 28px; }
/* The sheet sits inside the dock: its small tools keep the small size, not the dock's 52px step buttons. */
.st-dock .st-above .gu-btn { min-height: 40px; }
.st-dock .st-above .gu-btn.gu-small { padding: 6px 12px; font-size: 14px; }
.st-dock .st-above .st-award-btn { min-height: 48px; }
.st-sheet .st-award, .st-sheet .st-paint, .st-tray .st-paint { margin-block-start: 0; }
.st-tray { background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; border: 1px solid var(--line); border-block-end: 0; padding: 10px 12px 6px;
  box-shadow: 0 -10px 30px rgba(10, 12, 40, .16); }
.st-dock-error { margin: 0 12px 6px; }

/* S4: the tools as chips with their state (one row under the question) and as tiles in «المزيد», not sentences. */
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.st-chip { display: inline-flex; align-items: center; gap: 5px; min-block-size: 36px; padding: 4px 11px; border: 1.5px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.st-chip-state { font-size: 12px; font-weight: 700; color: var(--muted); }
.st-chip.is-on, .st-tile.is-on { border-color: var(--ok); }
.st-chip.is-on .st-chip-state, .st-tile.is-on .st-chip-state { color: var(--ok); }
.st-chip.is-off, .st-tile.is-off { border-color: var(--bad); }
.st-chip.is-off .st-chip-state, .st-tile.is-off .st-chip-state { color: var(--bad); }
.st-chip:focus-visible, .st-tile:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.st-chip:disabled, .st-tile:disabled { opacity: .6; }
.st-tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.st-tiles-slot { display: contents; }
.st-tile { justify-content: center; min-block-size: 72px; padding: 8px 4px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.st-tile[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); }
.st-tile.is-on[aria-pressed="true"] { background: var(--surface); border-color: var(--ok); }
/* S3: the oral award in one row (two teams and «لا أحد»), only in «reading» and «steal». */
.st-award.st-award-row { grid-template-columns: 1fr 1fr auto; gap: 6px; }
.st-dock .st-above .st-award-row .st-award-btn { min-height: 44px; }
.st-award-row .st-award-none { grid-column: auto; min-height: 44px; }
.st-award-row .st-award-hint { font-size: 13px; }
.st-tile.sound-toggle { display: flex; flex-direction: column; border-width: 1px; border-radius: 14px; padding: 8px 4px; min-block-size: 72px; }
.st-sheet .st-count.st-auto { font-size: 20px; }

/* S6: «المزيد» in three groups of tiles; a paused game says so on phones and the room screen. */
.more-group { display: flex; flex-direction: column; gap: 6px; }
.more-group-title { margin: 0; font-size: 13px; font-weight: 800; color: var(--muted); }
.st-tiles .inline-form { display: contents; }
.st-tile.is-danger { color: var(--bad); border-color: var(--bad); }
a.st-tile { display: flex; }
.st-paused { margin: 0; align-self: center; padding: 6px 16px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-weight: 900; text-align: center; }
.stage-screen .st-paused { font-size: 32px; padding: 10px 28px; }

/* S9 (Nasser Q2): iPad landscape and laptop, two panes and the thumb dock. At 1000px and wider a stage game in play
   puts the controls (teams' bar, status, players) in the start column and the board, large, in the end column, at the
   top and out of the flow so no phase can move it; the dock (and the question sheet standing on it) sits under the
   controls column at most 760px wide, so the sheet never covers the board. iPad portrait (820) keeps the phone layout. */
@media (min-width: 1000px) {
  :root { --st-nav: 0px; --st-board: .54; --st-gap: 20px; }
  .shell-main:has(> .panel-stage) { max-inline-size: none; margin-inline: 0; }
  /* The controls column keeps a readable width (at most 760px); the board's column takes the rest, and the board
     grows to the height of the screen, centred in its column (big screens: 1920, 2560). */
  .panel.panel-stage { --st-ctl: min(calc(46% - var(--st-gap)), 760px); --st-col: calc(100% - var(--st-ctl) - var(--st-gap));
    --st-card: min(var(--st-col), calc((100dvh - 120px) / 1.12 + 18px));
    max-inline-size: none; position: relative; min-block-size: calc(100dvh - 96px); padding-inline-end: calc(100% - var(--st-ctl)); }
  .panel-stage .stage-docked .board-card { position: absolute; inset-block-start: 0; inset-inline-end: calc((var(--st-col) - var(--st-card)) / 2);
    inline-size: var(--st-card); margin: 0; }
  .panel-stage .stage-docked .board { max-block-size: calc(100dvh - 120px); }
  .gu-dock.st-dock { inset-inline-start: calc(var(--st-nav) + 16px); inset-inline-end: auto; margin: 0;
    inline-size: min(760px, calc((100% - var(--st-nav) - 32px) * .46 - var(--st-gap))); }
  /* The lobby by team (S8) uses the width too: the share card and the chat at the start, the teams beside them. */
  .panel:has(> .lobby-teams) { max-inline-size: 1400px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); column-gap: var(--st-gap); align-items: start; }
  .panel:has(> .lobby-teams) > * { grid-column: 1; }
  .panel:has(> .lobby-teams) > .lobby-teams { grid-column: 2; grid-row: 1 / span 8; }
  .shell-main:has(> .panel > .lobby-teams) { max-inline-size: 1400px; }
}
@media (min-width: 1024px) { :root { --st-nav: 240px; } }
/* ---- UX review 2026-11 (player and room screen) ----------------------------------------------------------------- */
/* While a game runs, the player's welcome card is one line: the status, the code and the sound (the board and the
   buzzer must fit a 390×844 phone without a scroll). */
.lobby.is-playing .lobby-hero { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; padding: 8px 12px; margin-block-end: 10px; }
.lobby.is-playing .lobby-hero .logo { display: none; }
.lobby.is-playing .lobby-hero .lobby-status { font-size: 16px; }
.lobby.is-playing .lobby-hero .lobby-code { font-size: 14px; }
/* The buzzer inside the question sheet: big, but the sheet stays under ~72vh. */
.ph-pop .st-buzz { margin-inline: auto; inline-size: min(220px, 60vw); block-size: min(220px, 60vw); font-size: 40px; }
/* The room screen: team chips readable on the dark screen (white text on a pale chip was unreadable). */
.is-screen .tv-chip { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: var(--tv-ink); }
.is-screen .tv-chip.is-team-a { background: rgba(255, 255, 255, .08); border: 2px solid var(--team-a); }
.is-screen .tv-chip.is-team-b { background: rgba(255, 255, 255, .08); border: 2px solid var(--team-b); }
/* The room screen fits 720p: beside a question with choices (phones, race) the countdown and the texts are smaller. */
.stage-screen .ph-question ~ .st-count { font-size: 64px; }
@media (max-height: 800px) {
  .stage-screen .st-status { font-size: 34px; }
  .stage-screen .st-q-text { font-size: 34px; }
  .stage-screen .st-question { padding: 16px; }
  .stage-screen .ph-option-static { font-size: 22px; padding-block: 6px; }
  .stage-screen .ph-question ~ .st-count { font-size: 52px; }
  .stage-screen .st-count { font-size: 72px; }
}
/* R1 (Nasser 2026-11-26): the buzzer in the player's own team colour (the blue team pressed a pink button). */
.lobby.is-team-b .st-buzz { background: radial-gradient(circle at 35% 30%, var(--team-b-2), var(--team-b) 60%, var(--team-b-mark)); box-shadow: 0 10px 0 var(--team-b-mark), 0 0 0 14px var(--team-b-soft); }
.lobby.is-team-b .st-buzz:active { box-shadow: 0 4px 0 var(--team-b-mark), 0 0 0 14px var(--team-b-soft); }
/* R4: what the locked cells mean, on the room screen while a wall stands (D36). */
.tv-wall-chip { position: fixed; inset-block-end: 16px; inset-inline: 0; margin: 0 auto; inline-size: max-content; padding: 8px 18px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); color: var(--tv-ink); font-weight: 800; font-size: 22px; }
.tv-wall-chip[hidden] { display: none; }
/* R2: the player's 🔊 in the header stays hidden on a page without sounds (head-btn sets a display). */
.head-btn[hidden] { display: none; }

/* S8: the lobby by team (D39): a column per team in its colour, a row per player; mute and remove open from a tap. */
.lobby-teams .card-row { align-items: center; }
.lobby-teams-hint { margin: 0 0 10px; font-size: 13px; }
.team-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.team-col { display: flex; flex-direction: column; gap: 6px; min-inline-size: 0; padding: 8px; border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.team-col-a { border-color: var(--team-a); }
.team-col-b { border-color: var(--team-b); }
.team-col-title { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 15px; font-weight: 900; }
.team-col-title .sw { inline-size: 14px; block-size: 14px; border-radius: 4px; flex: none; }
.team-col-a .sw-a { background: repeating-linear-gradient(45deg, var(--team-a) 0 3px, var(--team-a-2) 3px 6px); }
.team-col-b .sw-b { background: radial-gradient(circle, rgba(255, 255, 255, .55) 0 1.4px, transparent 1.8px) 0 0 / 5px 5px, var(--team-b); }
.team-col-count { margin-inline-start: auto; font-family: var(--font-num); color: var(--muted); font-size: 13px; }
.lp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lp-row { display: flex; align-items: flex-start; gap: 4px; padding: 4px 6px; border-radius: 10px; background: var(--surface-2); }
.lp-row.is-absent { opacity: .6; }
.lp-menu { flex: 1 1 auto; min-inline-size: 0; }
.lp-who { display: block; min-block-size: 36px; padding-block: 7px; font-weight: 800; font-size: 14px; cursor: pointer; list-style: none; overflow-wrap: anywhere; }
.lp-who::-webkit-details-marker { display: none; }
.lp-who:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-block-end: 6px; }
.lp-move { min-inline-size: 36px; min-block-size: 36px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; font-weight: 900; cursor: pointer; }
.lp-move:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.settings-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; }
.settings-list dt { color: var(--muted); }
.settings-list dd { margin: 0; font-weight: 800; }

/* S7: who pressed, under the answer in the coordinator's question card; the app bar's connection dot and room screen mark. */
.st-buzz-line { flex-basis: 100%; margin: 0; font-size: 14px; }
.net-menu { display: inline-flex; align-items: center; }
.net-menu > summary { list-style: none; }
.net-menu > summary::-webkit-details-marker { display: none; }
.net-dot { display: inline-block; inline-size: 12px; block-size: 12px; border-radius: 50%; cursor: pointer; background: var(--ok); box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); }
.net-dot.is-slow { background: var(--accent); }
.net-dot.is-off { background: var(--bad); }
.net-dot:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.net-menu .menu-pop { min-inline-size: 180px; }
.head-tv { display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: var(--r-pill); color: #ffffff; text-decoration: none; font-size: 13px; font-weight: 800; opacity: .75; white-space: nowrap; }
.head-tv.is-on { opacity: 1; }
.head-tv-mark { font-size: 11px; }
.head-tv:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .site-head.has-code { gap: 8px; padding-inline: 12px; } }
.net-menu .menu-pop { z-index: 1; inset-inline-end: auto; inset-inline-start: -12px; inline-size: max-content; max-inline-size: min(280px, calc(100vw - 24px)); min-inline-size: 0; }

/* S10: the end of a game at the thumb (play again), the report and closing above the dock; the printable report. */
.st-dock .gu-dock-main > .inline-form { display: flex; }
.st-dock .gu-dock-main > .inline-form > .gu-btn { inline-size: 100%; }
.st-end { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.st-end > *, .st-end .gu-btn { flex: 1 1 auto; }
.table-wrap { overflow-x: auto; }
.report-table { inline-size: 100%; border-collapse: collapse; font-size: 14px; }
.report-table th, .report-table td { padding: 8px 6px; border-block-end: 1px solid var(--line); text-align: start; }
.report-table th { color: var(--muted); font-weight: 800; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media print {
  .site-head, .nav-side, .nav-bottom, .report-actions, .report-print, .internal-strip { display: none !important; }
  .report .card { box-shadow: none; border: 0; }
}

/* D42: «إنهاء الجولة»: who would win now, before the confirmation. */
.end-board-verdict { margin: 0; font-size: 18px; text-align: center; }
