/* Alphabet Roulette's table (docs/alphabet-roulette.md): drawn on the room's
   structure (games/room/room.css) from the tokens in alphabet-roulette.css. The head
   of the screen is the die's tray, the round and the letter, and the clock;
   under it the pad (the review, between rounds the scores); under that the
   buttons; beside it all on a wide screen, the scores. Everything keeps its
   place and size as play goes on: the clock in tabular figures, the pad's
   rows ruled to one height, the buttons in fixed slots. */

/* ── the frame ──────────────────────────────────────────────────────── */
/* The table is the window: nothing scrolls the page; the pad and the
   review scroll in their own place. */
.felt.argame { height: calc(100dvh - 2 * var(--frame)); overflow: hidden; }
.argame .tablemain { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 10px; }
.argame .bar .titlerow { flex: 1 1 auto; }
.argame .bar .tools { flex-wrap: nowrap; align-items: center; }
.argame .watchbar:empty { display: none; }
.argame .watchbar { font-size: var(--t-note); display: flex; align-items: center; gap: var(--s2); }
@media (max-width: 760px) {
  .argame .bar .tools { display: none; }
  .argame .bar .more { display: inline-flex; min-width: 44px; font-size: 22px; text-decoration: none; }
}

.arstage { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: var(--s4); }
.armain { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: var(--s2); }
.arsidewrap { display: none; }
@media (min-width: 900px) {
  .arstage { grid-template-columns: minmax(0, 1fr) clamp(240px, 24vw, 320px); }
  .arsidewrap { display: block; min-height: 0; overflow: auto; }
  .arstrip { display: none !important; }
}
.arscene { min-width: 0; min-height: 0; display: flex; flex-direction: column; flex: 1; position: relative; }

/* ── the scores (beside the table; a sheet on a phone) ──────────────── */
.arside { background: var(--panel); border: var(--panel-edge); border-radius: var(--panel-radius); padding: var(--panel-pad); }
.house-body .arside { background: none; border: 0; padding: 0; }
.house-body .arsidehead { display: none; }
.arsidehead { margin: 0 0 var(--s2); font: var(--display-weight) var(--t-heading)/var(--lh-heading) var(--display); letter-spacing: .02em; text-transform: uppercase; }
.arplayers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.arplayer { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 3ch; align-items: center; gap: var(--s2); min-height: 40px; padding: 2px 8px; border-radius: 10px; }
.arplayer.you { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.arplayer.gone .arpname { color: var(--soft); text-decoration: line-through; text-decoration-thickness: 1px; }
.arpname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.arpname .tag { flex: none; }
.arpn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arpstat { font-size: 13px; font-weight: 700; color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.arpstat.ok { color: var(--good); }
.arpstat.hot { color: var(--turn); }
.arpscore { font: 800 22px/1 var(--display); font-variant-numeric: tabular-nums; text-align: right; }
.arplayer.lead .arpscore { color: var(--turn); }
.arletters { margin: var(--s3) 0 0; font-size: var(--t-note); }
.arletters b { color: var(--ink); letter-spacing: .04em; }

/* On a phone: the leader and you, in one line at the top; tap for everyone. */
.arstrip {
  display: flex; align-items: center; gap: var(--s2); width: 100%; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; color: inherit; font: inherit;
}
.arsbit { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 2px 12px 2px 6px; border-radius: 999px; background: var(--panel); border: var(--panel-edge); font-weight: 600; min-width: 0; max-width: 42%; }
.arsbit > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arsbit b { font: 800 20px/1 var(--display); font-variant-numeric: tabular-nums; margin-left: 2px; }
.arswait { margin-left: auto; font-size: var(--t-note); font-weight: 700; color: var(--ink); white-space: nowrap; }
.arswait + .arsmore { margin-left: 8px; }
.arsmore { margin-left: auto; font-size: var(--t-note); font-weight: 700; color: var(--soft); white-space: nowrap; }
.arstrip:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 12px; }

/* ── the head: the tray, the round and the letter, the clock ────────── */
.arplay, .arreviewbox { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--s2); max-width: 880px; width: 100%; margin: 0 auto; }
.arhead { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s3); min-height: 120px; }
.arheadmid { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.arkicker { margin: 0; }
.arletterrow { display: flex; align-items: center; gap: var(--s3); min-height: 64px; }
.arletter {
  flex: none; width: 1.1ch; font: 900 64px/1 var(--display); color: var(--turn); text-align: center;
  opacity: 0; transform: scale(.6); transition: opacity 150ms, transform 200ms cubic-bezier(.3, .7, .2, 1.4);
}
.arletter.shown { opacity: 1; transform: none; }
.arletter:not(.shown) { opacity: .35; transform: none; color: var(--soft); }
.arline { margin: 0; font-size: 17px; line-height: 1.3; min-width: 0; }
.arline b { font-weight: 700; }

.artraybox { flex: none; }
.artray {
  display: block; width: 120px; height: 120px; padding: 0; border-radius: 22px; cursor: default;
  background: var(--tray); border: 2px solid var(--tray-edge); box-shadow: inset 0 6px 14px rgba(0, 0, 0, .45), 0 2px 0 rgba(255, 255, 255, .06);
}
.artray.ready { cursor: pointer; outline: 3px solid var(--turn); outline-offset: 3px; animation: artrayglow 1.6s ease-in-out infinite; }
.artray.ready:hover .die { transform: rotate(-6deg) scale(1.04); }
.artray:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@keyframes artrayglow { 50% { outline-color: color-mix(in srgb, var(--turn) 35%, transparent); } }
@media (prefers-reduced-motion: reduce) { .artray.ready { animation: none; } }
.die { display: block; width: 100%; height: 100%; overflow: visible; transition: transform 150ms; }
.dieface {
  fill: hsl(var(--die-hue) var(--die-sat) calc(var(--die-light) * var(--lit, 1)));
  stroke: var(--die-edge); stroke-width: 1.4; stroke-linejoin: round;
}
.dieletter { fill: var(--die-letter); font: 900 .9px/1 var(--display); }
.dieshadow { fill: rgba(0, 0, 0, .45); }

.arclock { display: grid; justify-items: end; gap: 6px; min-width: 5ch; }
.arclocktext { font: 800 clamp(44px, 9vw, 64px)/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: .01em; min-width: 3.4ch; text-align: right; }
.arclockbar { display: block; width: 100%; min-width: 96px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.arclockfill { display: block; height: 100%; background: var(--ink); transform-origin: left; }
.arclock.low .arclocktext { color: var(--bad); }
.arclock.low .arclockfill { background: var(--bad); }
.arclock.idle { opacity: .72; }

/* On a phone: the tray at the left; the round and the clock along the
   top, the letter and what's happening under them. */
@media (max-width: 640px) {
  .arplay .arhead { grid-template-columns: 88px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px var(--s3); min-height: 92px; }
  .arplay .artraybox { grid-row: 1 / span 2; }
  .arplay .arheadmid { display: contents; }
  .arplay .arkicker { grid-column: 2; grid-row: 1; align-self: center; }
  .arplay .arheadend { grid-column: 3; grid-row: 1; }
  .arplay .arletterrow { grid-column: 2 / span 2; grid-row: 2; gap: var(--s2); min-height: 48px; }
  .artray { width: 88px; height: 88px; border-radius: 18px; }
  .arletter { font-size: 48px; }
  .arline { font-size: 15px; }
  .arclock { gap: 3px; }
  .arclocktext { font-size: 44px; }
  .arclockbar { min-width: 56px; height: 4px; }
}

/* ── the pad ────────────────────────────────────────────────────────── */
.arpadbox { position: relative; flex: 1; min-height: 0; display: flex; }
.arpad, .arreviewpad > * {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
  background: var(--pad); color: var(--pad-ink); border-radius: 6px 6px 10px 10px;
  box-shadow: 0 2px 0 var(--pad-edge), 0 10px 24px rgba(0, 0, 0, .35);
}
/* the red margin, down the whole sheet */
.arpad { background-image: linear-gradient(90deg, transparent 47px, var(--pad-margin) 47px, var(--pad-margin) 49px, transparent 49px); background-attachment: local; }
.arlist { list-style: none; margin: 0; padding: 10px 0 18px; }
.arrow {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.25fr); align-items: end; gap: 0 var(--s3);
  min-height: 48px; padding: 2px var(--s3) 0 0; border-bottom: 1.5px solid var(--pad-rule);
}
.arcat { display: contents; }
.arno { align-self: center; justify-self: center; font: 700 14px/1 var(--ui-font); color: var(--pad-red); font-variant-numeric: tabular-nums; }
.arcatname { align-self: center; padding: 4px 0; font-weight: 600; font-size: 15px; line-height: 1.25; color: var(--pad-ink); }
.arline-in { position: relative; display: flex; align-items: flex-end; min-width: 0; }
.aranswer {
  width: 100%; min-width: 0; height: 44px; padding: 0 4px 2px; border: 0; border-radius: 4px; background: transparent;
  color: var(--pad-ink); font: 700 28px/1 var(--hand); caret-color: var(--pad-red);
}
.aranswer::placeholder { color: color-mix(in srgb, var(--pad-soft) 55%, transparent); }
.aranswer:focus { outline: none; background: color-mix(in srgb, #fff 55%, transparent); box-shadow: inset 0 -3px 0 var(--pad-ink); }
.aranswer:read-only { cursor: default; }
.aranswer:disabled { color: var(--pad-ink); opacity: 1; -webkit-text-fill-color: var(--pad-ink); }
.archeck { position: absolute; right: 2px; top: -2px; font-size: 12px; font-weight: 700; color: var(--pad-red); pointer-events: none; }
.arrow.off .aranswer { color: var(--pad-red); -webkit-text-fill-color: var(--pad-red); }
.arplay:not(.open) .aranswer:not(:disabled) { background: transparent; }
@media (max-width: 640px) {
  .arpad { background-image: linear-gradient(90deg, transparent 35px, var(--pad-margin) 35px, var(--pad-margin) 37px, transparent 37px); }
  .arrow { grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 10px; min-height: 0; padding: 6px 12px 0 0; }
  .arno { grid-row: 1 / span 2; align-self: start; padding-top: 4px; }
  .arcatname { padding: 0; font-size: 14px; }
  .arline-in { grid-column: 2; }
  .aranswer { height: 42px; font-size: 26px; }
}

/* "Ready, set, go" and Paused, over the pad */
.arcountdown, .arpaused {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; pointer-events: none;
}
.arcountdown { font: 900 clamp(110px, 30vw, 200px)/1 var(--display); color: var(--pad-red); text-shadow: 0 0 0 var(--pad), 0 0 24px var(--pad), 0 0 48px var(--pad); }
.arcountdown.pop { animation: arpop 600ms cubic-bezier(.3, .7, .2, 1) both; }
@keyframes arpop { from { transform: scale(1.5); opacity: 0; } 40% { opacity: 1; } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .arcountdown.pop { animation: none; } }
.arpaused { gap: 4px; background: color-mix(in srgb, var(--pad) 84%, transparent); color: var(--pad-ink); border-radius: 6px; font-size: 17px; }
.arpaused b { font: 900 48px/1 var(--display); }
.arpaused .soft { color: var(--pad-soft); }
.arcountdown[hidden], .arpaused[hidden] { display: none; }

/* ── the buttons under it ───────────────────────────────────────────── */
.aractions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); min-height: 56px; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
.ardone, .arnext { min-width: 168px; }
.arnote, .arwaiting { margin: 0; font-size: var(--t-note); flex: 1 1 14em; }
.arwaiting:empty { display: none; }

/* ── the review: one category, everyone's answers ───────────────────── */
.arrhead { min-height: 96px; }
.arrletter {
  flex: none; width: 88px; height: 88px; display: grid; place-items: center; border-radius: 18px;
  background: var(--tray); border: 2px solid var(--tray-edge); font: 900 56px/1 var(--display); color: var(--turn);
}
.arcatbig { margin: 0; font: var(--display-weight) clamp(28px, 5vw, 40px)/1.05 var(--display); overflow-wrap: anywhere; }
.arpips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; gap: 4px; }
.arpips li { width: 18px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.arpips li.past { background: var(--soft); }
.arpips li.now { background: var(--turn); }
@media (max-width: 640px) {
  .arrletter { width: 64px; height: 64px; font-size: 40px; border-radius: 14px; }
  .arrhead { min-height: 72px; }
  .arpips li { width: 12px; }
}

.arreview { list-style: none; margin: 0; padding: 6px var(--s3) 14px; }
.aranswerrow {
  display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) 48px minmax(104px, auto); grid-template-areas: "who said pts btn" "votes votes votes votes";
  align-items: center; gap: 4px var(--s3); padding: 8px 0; border-bottom: 1.5px solid var(--pad-rule);
}
.aranswerrow:last-child { border-bottom: 0; }
.arwho { grid-area: who; display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; font-size: 15px; }
.arwhoname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arsaid { grid-area: said; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-height: 40px; align-content: center; }
.artext { font: 700 28px/1.1 var(--hand); overflow-wrap: anywhere; }
.artext .hit { font-weight: inherit; color: var(--pad-red); text-decoration: underline 2px; text-underline-offset: 3px; }
.artag { font-size: 12px; background: color-mix(in srgb, var(--pad-ink) 10%, transparent); color: var(--pad-ink); border: 0; }
.artag.bonus { background: color-mix(in srgb, var(--pad-good) 16%, transparent); color: var(--pad-good); }
.st-letter .artext, .st-out .artext { text-decoration: line-through 2px var(--pad-red); color: var(--pad-soft); }
.st-same .artext { color: var(--pad-soft); }
.st-blank .arsaid .soft { color: var(--pad-soft); }
.aranswerrow.you .arwhoname { font-weight: 800; }
.arpoints { grid-area: pts; justify-self: center; display: grid; place-items: center; min-width: 40px; height: 32px; padding: 0 6px; border-radius: 999px; font: 700 17px/1 var(--ui-font); color: var(--pad-soft); font-variant-numeric: tabular-nums; }
.arpoints.scores { background: var(--pad-good); color: #fff; }
.archallenge { grid-area: btn; justify-self: end; }
.aranswerrow .btn.quiet { color: var(--pad-ink); }
.aranswerrow .btn.quiet:focus-visible { outline-color: var(--pad-ink); }
@media (max-width: 640px) {
  .arreview { padding: 4px 12px 12px; }
  .aranswerrow { grid-template-columns: minmax(0, 1fr) 44px auto; grid-template-areas: "who pts btn" "said said said" "votes votes votes"; gap: 2px 8px; }
  .artext { font-size: 26px; }
}

/* a challenge and its vote, under its answer */
.arvotes { grid-area: votes; display: flex; flex-direction: column; gap: 6px; }
.arvote { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s3); padding: 8px 12px; border-radius: 10px; font-size: 15px; color: var(--pad-ink); }
.arvote.open { background: #fff; box-shadow: inset 0 0 0 2px var(--turn), 0 1px 0 var(--pad-edge); }
.arvote.decided { background: color-mix(in srgb, var(--pad-ink) 7%, transparent); }
.arruled { font-weight: 800; }
.arvote.decided.no .arruled { color: var(--pad-red); }
.arvote.decided.yes .arruled { color: var(--pad-good); }
.artally { flex: 1 1 100%; font-size: 13px; color: var(--pad-soft); }
.arseg { --seg-ink: var(--pad-ink); color: var(--pad-ink); }
.arseg button { min-height: 40px; color: var(--pad-ink); }

/* the challenge sheet */
.archallenges { display: flex; flex-direction: column; gap: var(--s3); }
.arcfor { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.arcfor .artext.big { font-size: 34px; margin-top: 4px; }
.arcitem { display: grid; grid-template-columns: minmax(150px, auto) minmax(0, 1fr); align-items: center; gap: var(--s2) var(--s3); }
.arcitem small { font-size: var(--t-note); }
.arcsame { display: flex; flex-direction: column; gap: var(--s2); }
.arcsamehead { margin: 0; }
.arcsamebtn { display: flex; align-items: center; gap: 8px; justify-content: flex-start; text-align: left; height: auto; min-height: 48px; }
.arcsamebtn .artext { font-size: 24px; }
.arcnote { margin: 0; font-size: var(--t-note); }
@media (max-width: 560px) { .arcitem { grid-template-columns: minmax(0, 1fr); } }

/* ── between rounds, and the end ────────────────────────────────────── */
.arscored { padding: var(--s3); }
.arscores { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.arscores th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: var(--kicker-spacing); color: var(--pad-soft); padding: 6px 8px; }
.arscores td { padding: 8px; border-top: 1.5px solid var(--pad-rule); font-size: 17px; }
.arscores td:nth-child(n+2), .arscores th:nth-child(n+2) { text-align: right; width: 6em; }
.arscores td b { font: 800 24px/1 var(--display); }
.arscores tr.you td { font-weight: 700; }
.arscores .arwho { font-size: 16px; }

.arover, .argone { justify-content: center; align-items: center; text-align: center; gap: var(--s3); }
.arwinner { margin: 0; font: var(--display-weight) clamp(32px, 7vw, 48px)/1.05 var(--display); color: var(--turn); }
.arfinal { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2) var(--s4); }
.arfinal li { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.arfinal b { font: 800 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.ar-result .arfinal { justify-content: flex-start; }

.arresult { display: flex; flex-direction: column; gap: var(--s2); }
.arround { border: var(--panel-edge); border-radius: 12px; padding: 0; }
.arround summary { cursor: pointer; padding: 12px 14px; min-height: 44px; font-size: 16px; }
.arroundscroll { overflow-x: auto; padding: 0 0 8px; }
.arsheet { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.arsheet th, .arsheet td { padding: 6px 10px; text-align: left; border-top: 1px solid rgba(255, 255, 255, .12); vertical-align: top; }
.arsheet thead th { white-space: nowrap; font-weight: 600; }
.arsheet thead th span { margin-left: 6px; }
.arsheet tbody th { font-weight: 600; color: var(--soft); min-width: 10em; }
.arsheet td { font: 700 19px/1.15 var(--hand); min-width: 7em; }
.arsheet td.st-letter, .arsheet td.st-out, .arsheet td.st-same, .arsheet td.st-blank { color: var(--soft); }
.arsheet td.st-letter, .arsheet td.st-out { text-decoration: line-through 1.5px; }
.arsheetpts { font: 700 12px/1 var(--ui-font); color: var(--good); }
.arsheet tfoot td, .arsheet tfoot th { font: 700 15px/1.2 var(--ui-font); }

/* the front door's picture */
.arlobbyart { display: grid; place-items: center; width: 100%; padding: var(--s3) 0; }
.arlobbyart .die { width: min(220px, 60vw); height: auto; aspect-ratio: 1; }
.arvote .artext { font-size: 22px; }

/* A banner with a line under it ("Time!", "Pencils down."), as Fictionary's. */
.arbanner { display: grid; justify-items: center; gap: 6px; text-align: center; }
.arbanner b { font-weight: inherit; }
.arbanner small { font: 600 var(--t-note)/1.3 var(--ui-font); color: var(--soft); }
