/* Letter by letter on the phones and the TV (web/games/letters.js). The word is a row of boxes: empty while a letter
   is hidden, on paper once it shows (the letter pops in as it lands), every box in the accent at the reveal. The
   clues are cards like Guess the country's: the newest on paper, ringed; the ones before it back on the surface. */

/* The word. letters.js picks the box size (z0 biggest) so the word fits its lines; --bw is a box's width. The gaps
   (0.14 of a box between letters, 0.6 between words) are the ones letters.js reckons with. */
.lt-boxes {
  margin: 0; display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: calc(var(--bw) * 0.24) calc(var(--bw) * 0.6);
}
.page .lt-boxes { --bw: calc(var(--z) * 1px); }
.page .lt-boxes.z0 { --z: 46; }
.page .lt-boxes.z1 { --z: 40; }
.page .lt-boxes.z2 { --z: 35; }
.page .lt-boxes.z3 { --z: 31; }
.page .lt-boxes.z4 { --z: 27; }
.page .lt-boxes.z5 { --z: 24; }
.page .lt-boxes.z6 { --z: 21; }
.page .lt-boxes.z7 { --z: 19; }
.page .lt-boxes.z8 { --z: 17; }
.tv .lt-boxes { --bw: calc(var(--z) * var(--u)); }
.tv .lt-boxes.z0 { --z: 72; }
.tv .lt-boxes.z1 { --z: 64; }
.tv .lt-boxes.z2 { --z: 58; }
.tv .lt-boxes.z3 { --z: 52; }
.tv .lt-boxes.z4 { --z: 46; }
.tv .lt-boxes.z5 { --z: 41; }
.tv .lt-boxes.z6 { --z: 36; }
.tv .lt-boxes.z7 { --z: 31; }
.tv .lt-boxes.z8 { --z: 27; }

.lt-word { display: inline-flex; flex-wrap: wrap; gap: calc(var(--bw) * 0.24) calc(var(--bw) * 0.14); }
.lt-box {
  flex-shrink: 0; width: var(--bw); height: calc(var(--bw) * 1.2); border-radius: calc(var(--bw) * 0.2);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: max(1.5px, calc(var(--bw) * 0.045)) solid var(--line-strong);
  color: var(--background); font-family: var(--display); font-size: calc(var(--bw) * 0.7); font-weight: 800; line-height: 1;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.lt-box.on { background: var(--paper); border-color: var(--paper); }
.lt-ch { display: block; }
.lt-mark {
  flex-shrink: 0; width: calc(var(--bw) * 0.5); height: calc(var(--bw) * 1.2); display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: calc(var(--bw) * 0.7); font-weight: 800; line-height: 1; color: var(--text-soft);
}
.lt-boxes.lit .lt-box { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.lt-boxes.lit .lt-mark { color: var(--accent); }

/* The clue cards. */
.lt-clues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lt-clue {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--radius-card);
  background: var(--surface); border: 1px solid var(--line); color: var(--text-soft);
}
.lt-n {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.lt-clue-text { margin: 0; flex: 1; min-width: 0; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.lt-clue.now { background: var(--paper); border-color: var(--paper); color: var(--background); box-shadow: 0 0 0 2px var(--accent); }
.lt-clue.now .lt-n { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.lt-clue.now .lt-clue-text { font-size: 19px; font-weight: 700; line-height: 1.3; }
.lt-clue.soon { background: transparent; border-style: dashed; border-color: var(--line-strong); color: var(--text-muted); font-size: 15px; line-height: 1.35; }

/* The phones. */
.page .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lt-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; min-height: 30px; }
.lt-head-cat { min-width: 0; overflow-wrap: anywhere; }
.lt-head-n { color: var(--text-muted); }
.lt-head-end { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.lt-worth {
  padding: 4px 10px; border-radius: 9999px; border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); white-space: nowrap;
}
.page .lt-head .timer { font-size: 13px; }
/* The vote lasts ten seconds, so its timer would always be in its last ten: it keeps its calm look, the bar runs down. */
.timer.lt-timer.calm.low { background: var(--accent-soft-bg); color: var(--accent); }
.timer.lt-timer.calm.low i { background: var(--accent); }

/* The vote: a paper card per category, yours ringed, its votes so far on the right. */
.lt-choices { display: flex; flex-direction: column; gap: 12px; }
.lt-choice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; padding: 12px 14px 12px 20px;
  border-radius: var(--radius-tile); border: 0; background: var(--paper); color: var(--background); text-align: left;
  box-shadow: 0 0 0 3px transparent;
  transition: transform 0.45s cubic-bezier(0.3, 1.8, 0.4, 1), box-shadow 0.2s ease;
}
.lt-choice:active { transform: scale(0.96); transition-duration: 0.08s; transition-timing-function: ease-out; }
.lt-choice.picked { box-shadow: 0 0 0 3px var(--background), 0 0 0 6px var(--accent); }
.lt-choice-name { min-width: 0; font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.lt-choice-end { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; }
.lt-tag {
  padding: 5px 10px; border-radius: 9999px; background: var(--accent); color: var(--accent-text);
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.lt-choice-n {
  min-width: 40px; height: 40px; padding: 0 8px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--background); color: var(--paper); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums;
}

/* The word on a phone: the field, your last guess, the boxes, the clues. */
.lt-guess { display: flex; gap: 8px; }
.lt-guess input { flex: 1; min-width: 0; }
.btn.lt-guess-go { width: auto; min-height: 52px; padding: 0 20px; }
.lt-fb { margin: -6px 0 0; font-size: 15px; font-weight: 600; color: var(--text-muted); overflow-wrap: anywhere; }
.lt-fb.close { font-weight: 700; color: var(--crown); }
.lt-got {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-card);
  background: var(--accent-soft-bg); border: 1px solid var(--accent-soft-border);
}
.lt-got .turn-critter { width: 60px; }
.lt-got h2 .accent { color: var(--accent); }
.lt-word-row { padding: 2px 0; }

/* The guesses. */
.lt-feed-box { display: flex; flex-direction: column; gap: 8px; }
.lt-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lt-row {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px 6px 6px; border-radius: 12px;
  background: var(--surface); font-size: 15px; min-width: 0;
}
.lt-row-name { font-weight: 700; white-space: nowrap; }
.lt-row-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.lt-row.got { background: var(--accent-soft-bg); }
.lt-row.got .lt-row-text { color: var(--accent); font-weight: 700; }
.lt-row-pts { flex-shrink: 0; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.lt-row.close .lt-row-text { color: var(--crown); font-weight: 600; }
.lt-feed-critter { width: 26px; }
.lt-feed-empty { margin: 0; font-size: 14px; color: var(--text-muted); }

/* Who got it, on a phone. */
.lt-got-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lt-got-list li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px 6px 8px; border-radius: var(--radius-row); background: var(--surface); }
.lt-got-list li.none { justify-content: center; color: var(--text-soft); }
.lt-got-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-got-list b { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }

@media (min-width: 820px) {
  .page .lt-boxes { --bw: calc(var(--z) * 1.5px); } /* the step's column is 560 wide here, not a phone's 328 */
  .page .lt-choices, .page .lt-guess, .page .lt-fb, .page .lt-got, .page .lt-clues, .page .lt-feed-box { max-width: 560px; }
}

/* The TV. */
.lt-top { display: flex; align-items: center; gap: calc(18 * var(--u)); }
.tv .lt-top .timer { font-size: calc(22 * var(--u)); }

/* The couch, smaller, so the word gets the room. */
.lt-bench { --u: calc(100vw / 1280 * 0.7); }
@media (min-aspect-ratio: 16/9) { .lt-bench { --u: calc(100vh / 720 * 0.7); } }

/* The vote: three paper cards, the one ahead ringed in the accent. */
.lt-pick { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: calc(34 * var(--u)); }
.lt-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(26 * var(--u)); }
.lt-cat-card {
  min-height: calc(176 * var(--u)); padding: calc(22 * var(--u)) calc(28 * var(--u)) calc(18 * var(--u)); border-radius: calc(28 * var(--u));
  background: var(--paper); color: var(--background); display: flex; flex-direction: column; justify-content: space-between; gap: calc(14 * var(--u));
  box-shadow: 0 0 0 calc(5 * var(--u)) transparent; transition: box-shadow 0.3s ease;
}
.lt-cat-card.lead { box-shadow: 0 0 0 calc(5 * var(--u)) var(--accent), 0 0 calc(50 * var(--u)) var(--glow-lamp); }
.lt-cat-name { margin: 0; font-size: calc(40 * var(--u)); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.lt-cat-card.long .lt-cat-name { font-size: calc(32 * var(--u)); }
.lt-cat-votes { margin: 0; display: flex; align-items: baseline; justify-content: space-between; gap: calc(12 * var(--u)); }
.lt-cat-votes .tmeta { color: var(--paper-muted); }
.lt-cat-votes b { display: inline-block; font-size: calc(58 * var(--u)); font-weight: 800; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* The word: the category and the boxes on the left over the clues; what a right guess is worth and the guesses on
   the right. */
.lt-stage { flex: 1; min-height: 0; display: flex; align-items: stretch; gap: calc(36 * var(--u)); }
.lt-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: calc(14 * var(--u)); }
.tv .lt-cat { margin: 0; font-family: var(--mono); font-size: calc(22 * var(--u)); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
/* The clues stack under the word, the newest at the bottom. From the third, the ones before the newest keep to one
   line, and with all four the newest a size down, so they fit; if they still don't, the oldest go off the top. */
.tv .lt-clues {
  flex: 0 1 auto; min-height: 0; overflow: hidden; justify-content: flex-end; gap: calc(8 * var(--u));
  padding: calc(4 * var(--u)); margin: calc(-4 * var(--u));
}
.tv .lt-clue { flex-shrink: 0; align-items: center; gap: calc(14 * var(--u)); padding: calc(7 * var(--u)) calc(18 * var(--u)); border-radius: calc(18 * var(--u)); border-width: calc(2 * var(--u)); }
.tv .lt-n { width: calc(32 * var(--u)); height: calc(32 * var(--u)); font-size: calc(16 * var(--u)); border-width: calc(2 * var(--u)); }
.tv .lt-clue-text { font-size: calc(19 * var(--u)); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tv .lt-clue.now { padding: calc(12 * var(--u)) calc(18 * var(--u)); box-shadow: 0 0 0 calc(3 * var(--u)) var(--accent); }
.tv .lt-clue.now .lt-n { width: calc(36 * var(--u)); height: calc(36 * var(--u)); font-size: calc(18 * var(--u)); }
.tv .lt-clue.now .lt-clue-text { font-size: calc(24 * var(--u)); -webkit-line-clamp: 3; }
.tv .lt-clues.n3 .lt-clue:not(.now) .lt-clue-text, .tv .lt-clues.n4 .lt-clue:not(.now) .lt-clue-text { -webkit-line-clamp: 1; }
.tv .lt-clues.n4 .lt-clue.now .lt-clue-text { font-size: calc(22 * var(--u)); -webkit-line-clamp: 2; }
.tv .lt-clue.soon { font-size: calc(21 * var(--u)); padding: calc(14 * var(--u)) calc(20 * var(--u)); }

.lt-side { flex: 0 0 calc(340 * var(--u)); min-width: 0; display: flex; flex-direction: column; gap: calc(12 * var(--u)); overflow: hidden; }
.lt-worth-tv { margin: 0 0 calc(4 * var(--u)); display: flex; align-items: baseline; gap: calc(14 * var(--u)); }
.lt-worth-tv b { display: inline-block; font-size: calc(54 * var(--u)); font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--accent); font-variant-numeric: tabular-nums; }
/* Newest at the bottom; when they don't fit, the oldest go off the top. */
.tv .lt-feed.board { flex: 0 1 auto; min-height: 0; gap: calc(8 * var(--u)); overflow: hidden; justify-content: flex-end; }
.tv .lt-row { flex-shrink: 0; min-height: calc(46 * var(--u)); padding: calc(6 * var(--u)) calc(14 * var(--u)) calc(6 * var(--u)) calc(6 * var(--u)); border-radius: calc(14 * var(--u)); gap: calc(12 * var(--u)); font-size: calc(21 * var(--u)); }
.tv .lt-feed-critter { width: calc(34 * var(--u)); }
.tv .lt-feed-empty { font-size: calc(20 * var(--u)); }

/* The reveal on the TV: the word lit in the accent, who got it for how much; the scores along the bottom. */
.lt-reveal { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(24 * var(--u)); text-align: center; }
.lt-reveal .lt-boxes { justify-content: center; }
.tv .lt-boxes.lit .lt-box { box-shadow: 0 0 calc(var(--bw) * 0.6) var(--glow-lamp); }
.lt-got-tv { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: calc(10 * var(--u)) calc(14 * var(--u)); }
.lt-got-tv li {
  display: flex; align-items: center; gap: calc(12 * var(--u)); padding: calc(6 * var(--u)) calc(20 * var(--u)) calc(6 * var(--u)) calc(6 * var(--u));
  border-radius: 9999px; background: var(--surface); font-size: calc(24 * var(--u)); font-weight: 600;
}
.lt-got-tv .lt-got-name { flex: 0 1 auto; }
.lt-got-tv li b { color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; }
.lt-got-tv li.none { padding: 0; background: none; color: var(--text-muted); font-weight: 400; }
.lt-got-critter { width: calc(40 * var(--u)); }
.lt-scores { display: flex; justify-content: center; flex-wrap: wrap; gap: calc(12 * var(--u)); }
.lt-score {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: calc(10 * var(--u)); align-items: center;
  min-width: calc(150 * var(--u)); padding: calc(10 * var(--u)) calc(16 * var(--u)) calc(10 * var(--u)) calc(10 * var(--u));
  border-radius: calc(18 * var(--u)); background: var(--pc); color: var(--background);
}
.lt-score-critter { grid-row: span 2; width: calc(46 * var(--u)); box-shadow: 0 0 0 calc(3 * var(--u)) var(--background); }
.lt-score-name { font-size: calc(18 * var(--u)); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-score-n { font-size: calc(30 * var(--u)); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
