/* Sketch race on the phones and the TV (web/games/sketch.js). The drawing is on cream paper, in the four pens'
   colours, the same on every phone and on the TV; widths are in the drawing's own 0–1000 units, so it looks the same
   at any size. The guessers' phones are a small TV: the drawing big, the hint, the guesses. */

/* Drawings, everywhere. */
.sk-svg { display: block; width: 100%; height: 100%; }
.sk-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sk-svg .pen-0 { stroke: var(--background); stroke-width: 7; }
.sk-svg .pen-1 { stroke: var(--background); stroke-width: 20; }
.sk-svg .pen-2 { stroke: var(--accent); stroke-width: 13; }
.sk-svg .pen-3 { stroke: var(--crown); stroke-width: 13; }
.sk-paper { position: relative; aspect-ratio: 1; background: var(--paper); overflow: hidden; }
/* "Kai is drawing…" until the first line arrives. */
.sk-paper-wait {
  position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; padding: 24px;
  text-align: center; color: var(--background); opacity: 0.45; font-weight: 600; pointer-events: none;
}
.sk-paper svg:not(:empty) ~ .sk-paper-wait { display: none; }

/* The hint: a box per hidden letter. */
/* Words wrap as wholes; a word longer than the line still wraps inside. */
.sk-hint { margin: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.18em 0.86em; font-family: var(--mono); font-weight: 500; line-height: 1; }
.sk-word { display: inline-flex; flex-wrap: wrap; align-items: flex-end; gap: 0.18em; }
.sk-slot { display: inline-block; width: 0.8em; height: 1.1em; border-bottom: 0.12em solid var(--text-soft); }
.sk-letter { display: inline-block; width: 0.8em; text-align: center; text-transform: uppercase; color: var(--accent); border-bottom: 0.12em solid var(--accent); padding-bottom: 0.08em; }

/* The phones. */
.page .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.page .sk-head .timer { font-size: 13px; }

.sk-choices { display: flex; flex-direction: column; gap: 10px; }
.sk-choice {
  min-height: 74px; padding: 0 22px; border-radius: var(--radius-tile); border: 2px solid var(--line-strong); background: var(--paper);
  color: var(--background); font-size: 28px; font-weight: 800; letter-spacing: -0.01em; text-align: left;
  transition: transform 0.45s cubic-bezier(0.3, 1.8, 0.4, 1), border-color 0.2s ease;
}
.sk-choice:active { transform: scale(0.96); transition-duration: 0.08s; border-color: var(--accent); }

.sk-wait { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 28px; }
.sk-wait .me-critter { width: 112px; margin-bottom: 8px; }

.sk-word-card {
  padding: 14px 16px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.sk-word-card strong { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.sk-they-see { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.sk-hint.small { font-size: 16px; }

.sk-pad { position: relative; }
.sk-canvas {
  width: 100%; height: auto; aspect-ratio: 1; border-radius: 20px; background: var(--paper);
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; box-shadow: 0 0 0 1px var(--line-strong);
}
.sk-pad-hint {
  position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; padding: 24px;
  text-align: center; color: var(--background); opacity: 0.4; font-size: 15px; pointer-events: none;
}
.sk-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sk-pens { display: flex; gap: 10px; }
.sk-pen {
  width: 44px; height: 44px; padding: 0; border-radius: 9999px; border: 0; background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.45s cubic-bezier(0.3, 1.8, 0.4, 1), box-shadow 0.2s ease;
}
.sk-pen i { display: block; border-radius: 9999px; }
.sk-pen.pen-0 i { width: 8px; height: 8px; background: var(--background); }
.sk-pen.pen-1 i { width: 20px; height: 20px; background: var(--background); }
.sk-pen.pen-2 i { width: 15px; height: 15px; background: var(--accent); }
.sk-pen.pen-3 i { width: 15px; height: 15px; background: var(--crown); }
.sk-pen[aria-checked="true"] { transform: scale(1.12); box-shadow: 0 0 0 3px var(--background), 0 0 0 5px var(--accent); }
.sk-pen:active { transform: scale(0.92); transition-duration: 0.08s; }
.sk-edit { display: flex; gap: 8px; }
.sk-edit .btn { width: auto; min-height: 40px; padding: 0 14px; font-size: 14px; }

/* The guessers: the drawing, live, with who's drawing it. */
.page .sk-paper { border-radius: 20px; box-shadow: 0 0 0 1px var(--line-strong); }
.page .sk-paper.small { width: min(100%, 260px); align-self: center; }
.sk-drawer {
  position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px;
  border-radius: 9999px; background: var(--background); color: var(--text); font-size: 13px; font-weight: 600;
}
.sk-drawer svg { width: 14px; height: 14px; color: var(--accent); }
.sk-drawer-critter { width: 24px; }
.sk-hint-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.sk-hint-row .sk-hint { font-size: 26px; }
.sk-guess { display: flex; gap: 8px; }
.sk-guess input { flex: 1; min-width: 0; }
.btn.sk-guess-go { width: auto; min-height: 52px; padding: 0 20px; }
.sk-got-it {
  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);
}
.sk-got-it .turn-critter { width: 60px; }
.sk-got-it h2 .accent { color: var(--accent); }

/* The guesses. */
.sk-feed-box, .sk-strip { display: flex; flex-direction: column; gap: 8px; }
.sk-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sk-row {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 8px 6px 6px; border-radius: 12px;
  background: var(--surface); font-size: 15px; min-width: 0;
}
.sk-row-name { font-weight: 700; white-space: nowrap; }
.sk-row-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.sk-row.got { background: var(--accent-soft-bg); }
.sk-row.got .sk-row-text { color: var(--accent); font-weight: 700; }
.sk-row.close .sk-row-text { color: var(--crown); font-weight: 600; }
.sk-feed-critter { width: 26px; }
.sk-feed.strip .sk-row { min-height: 34px; font-size: 14px; }
.sk-feed-empty { margin: 0; font-size: 14px; color: var(--text-muted); }
.sk-accept {
  flex-shrink: 0; min-height: 30px; padding: 0 12px; border-radius: 9999px; border: 1px solid var(--accent-soft-border);
  background: transparent; color: var(--accent); font-size: 13px; font-weight: 600;
  transition: transform 0.45s cubic-bezier(0.3, 1.8, 0.4, 1);
}
.sk-accept:active { transform: scale(0.94); transition-duration: 0.08s; }

/* The reveal on a phone. */
.sk-word { color: var(--accent); }
.sk-got-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sk-got-list li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px 6px 8px; border-radius: var(--radius-row); background: var(--surface); }
.sk-got-list .detail { flex: 1; }
.sk-got-list .row-name { font-weight: 600; }
.sk-got-list li.none { justify-content: center; }
.sk-got-list li.drawer { background: transparent; border: 1px dashed var(--line-strong); }
.sk-plus { font-weight: 800; color: var(--accent); }

@media (min-width: 820px) {
  .page .sk-paper:not(.small), .sk-pad { max-width: 560px; }
}

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

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

.sk-stage { flex: 1; min-height: 0; display: flex; align-items: center; gap: calc(40 * var(--u)); }
.tv .sk-paper.big {
  width: calc(372 * var(--u)); height: calc(372 * var(--u)); flex-shrink: 0; align-self: center; border-radius: calc(26 * var(--u));
  box-shadow: 0 0 0 calc(3 * var(--u)) var(--line-strong);
}
.tv .sk-paper.big.small { width: calc(320 * var(--u)); height: calc(320 * var(--u)); }
.tv .sk-paper-wait { font-size: calc(26 * var(--u)); padding: calc(30 * var(--u)); }
.sk-side { flex: 1; min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: flex-start; gap: calc(16 * var(--u)); overflow: hidden; }
.sk-stage.reveal .sk-side { justify-content: center; }
.tv .sk-hint.big { font-size: calc(54 * var(--u)); gap: calc(10 * var(--u)) calc(47 * var(--u)); }
.tv .sk-hint.big .sk-word { gap: calc(10 * var(--u)); }
/* Newest at the bottom; when they don't fit, the oldest go off the top. */
.tv .sk-feed.board { flex: 1; min-height: 0; gap: calc(8 * var(--u)); overflow: hidden; justify-content: flex-end; }
.tv .sk-row { 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(22 * var(--u)); }
.tv .sk-feed-critter { width: calc(34 * var(--u)); }
.tv .sk-feed-empty { font-size: calc(20 * var(--u)); }

/* The reveal on the TV: the drawing, the word, who got it; the scores along the bottom. */
.sk-stage.reveal { align-items: center; }
.sk-got-tv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: calc(8 * var(--u)); }
.sk-got-tv li { display: flex; align-items: center; gap: calc(14 * var(--u)); font-size: calc(26 * var(--u)); font-weight: 600; }
.sk-got-tv li b { color: var(--accent); font-weight: 800; }
.sk-got-tv li.none { color: var(--text-muted); font-weight: 400; }
.sk-got-tv li.drawer { color: var(--text-soft); }
.sk-got-critter { width: calc(42 * var(--u)); }
.sk-scores { display: flex; justify-content: center; flex-wrap: wrap; gap: calc(12 * var(--u)); }
.sk-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);
}
.sk-score-critter { grid-row: span 2; width: calc(46 * var(--u)); box-shadow: 0 0 0 calc(3 * var(--u)) var(--background); }
.sk-score-name { font-size: calc(18 * var(--u)); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-score-n { font-size: calc(30 * var(--u)); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
