/* ============================================================
   SHARED BASE — design system common to all Impostor games.
   Extracted from dance.css / word.css (#26): every rule here was
   byte-for-byte identical in both. Load this BEFORE the game's own
   stylesheet; game files keep only their game-specific rules and
   may override anything below.
   ============================================================ */


/* Design tokens live in shared/tokens.css, which every page must link
   BEFORE this file. See that file's header for why (#128). */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
    user-select: none;
    -webkit-user-select: none;
  }

body { position: relative; }

.blob { display: none; }

#app {
    position: relative;
    z-index: 1;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }

.screen {
    display: none;
    flex-direction: column;
    flex: 1;
    animation: screenIn 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
  }

.screen.active { display: flex; }

@keyframes screenIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

.logo {
    text-align: center;
    margin: 20px 0 36px;
  }

.logo .headphones {
    display: block;
    margin: 0 auto 8px;
    width: 160px;
    height: auto;
    max-width: 60%;
  }

.logo h1 {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--ink);
  }

/* The game's own name, on its home screen only. Scoped to .home-fold
     because .logo h1 is also Lobby, Round Over, Setup Needed and the dance
     game's Find the Impostor, and those stay --ink. */
.home-fold .logo h1 { color: var(--ink-warm); }

.logo .sub {
    margin-top: 14px;
    font-size: 15px;
    color: var(--ink-soft);
    font-weight: 400;
    letter-spacing: 0.2px;
  }

.logo .icon { display: inline-block; vertical-align: middle; margin-right: 8px; }

.tile {
    touch-action: manipulation;
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    color: var(--ink);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, color 0.2s;
  }

.tile:active:not(:disabled),
  .tile.is-pressed:not(:disabled),
  .tile:hover:not(:disabled) {
    background: var(--card-active);
    color: var(--ink-on-dark);
  }

.tile:active:not(:disabled),
  .tile.is-pressed:not(:disabled) {
    transform: scale(0.965);
    transition: transform 0.06s ease, background 0.2s, color 0.2s;
  }

/* Reduced-motion: no scaling, but keep the non-motion press feedback. */
@media (prefers-reduced-motion: reduce) {
  .btn:active:not(:disabled),
  .btn.is-pressed:not(:disabled),
  .tile:active:not(:disabled),
  .tile.is-pressed:not(:disabled),
  .vote-row:active,
  .vote-row.is-pressed {
    transform: none;
  }
}

.tile-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

.tile-icon img {
    width: 60px;
    height: 60px;
    object-fit: contain;
  }

.tile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 186px));
    justify-content: center;
    gap: 14px;
  }

.tile-stack {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px 24px;
    gap: 4px;
  }

.tile-stack .tile-icon {
    width: 80px;
    height: 80px;
  }

.tile-stack .tile-icon img {
    width: 80px;
    height: 80px;
  }

.tile-stack .tile-body { width: 100%; }

.tile-stack .tile-title { font-size: 20px; }

.tile:hover .tile-icon,
  .tile:active .tile-icon { background: transparent; }

.tile-body { flex: 1; min-width: 0; }

.tile-title {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 22px;
    line-height: 1.1;
  }

.tile-sub {
    color: var(--ink-soft);
    font-size: 14px;
    margin-top: 8px;
    transition: color 0.2s;
  }

.tile:hover .tile-sub,
  .tile:active .tile-sub { color: var(--ink-on-dark-soft); }

.tile-chevron {
    color: var(--ink-faint);
    flex-shrink: 0;
    transition: color 0.2s;
  }

.tile:hover .tile-chevron,
  .tile:active .tile-chevron { color: rgba(255,255,255,0.5); }

/* touch-action: manipulation is not cosmetic. iOS Safari ignores
   user-scalable=no, so double-tap-to-zoom stays live and every tap waits to
   see whether a second one is coming. Right after another gesture that wait
   can eat the tap entirely, which reads as "I had to press it twice". Opting
   out of double-tap zoom on the controls themselves makes the first tap
   count. Pinch zoom elsewhere on the page is untouched. */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 17px 24px;
    touch-action: manipulation;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, filter 0.2s ease, opacity 0.2s;
    font-family: inherit;
    box-shadow: var(--shadow);
  }

.btn:active:not(:disabled),
  .btn.is-pressed:not(:disabled) {
    transform: scale(0.95);
    box-shadow: 0 1px 6px rgba(42, 37, 32, 0.10);
    filter: brightness(0.97);
    transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.06s ease;
  }

.btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }

.btn-primary {
    background: var(--card-active);
    color: var(--ink-on-dark);
  }

.btn-secondary {
    background: var(--card);
    color: var(--ink);
  }

/* Ready-button nudge: a soft squash and stretch that pulls the eye to
   "I'm Ready" without moving the button off its spot. It animates a
   wrapper rather than the button, so the button's own :active transform
   is left free. Widths are 1/sqrt(height), which is what makes the
   compression read as a squash instead of a resize.
   Six loops, not infinite: the lobby holds a screen wake lock, so an
   endless animation would run for the whole wait. The class is only
   applied while the player is unready — see each game's renderLobby(). */
.ready-nudge { transform-origin: 50% 100%; }

.ready-nudge.is-nudging {
    animation: readyNudge 4.5s ease-out 1s 6;
  }

@keyframes readyNudge {
    0%, 100% { transform: scale(1, 1); }
    5%  { transform: scale(1.014, 0.972); }
    12% { transform: scale(0.991, 1.018); }
    19% { transform: scale(1.002, 0.995); }
    26% { transform: scale(1, 1); }
  }

@media (prefers-reduced-motion: reduce) {
  .ready-nudge.is-nudging { animation: none; }
}

.btn-ghost {
    background: transparent;
    color: var(--ink-soft);
    box-shadow: none;
    font-weight: 500;
    font-size: 15px;
    padding: 12px 20px;
  }

.btn-danger {
    background: var(--accent-red);
    color: #fff;
  }

.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
  }

.stack > * + * { margin-top: 14px; }

.stack-lg > * + * { margin-top: 16px; }

.stack-sm > * + * { margin-top: 10px; }

.input {
    width: 100%;
    background: var(--bg-soft);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 16px 18px;
    color: var(--ink);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
  }

.input:focus {
    outline: none;
    border-color: var(--accent-teal);
    background: #fff;
  }

.input::placeholder { color: var(--ink-faint); }

.input.code {
    text-align: center;
    font-family: 'Literata', Georgia, serif;
    font-size: 32px;
    letter-spacing: 14px;
    font-weight: 400;
    text-transform: uppercase;
  }

select.input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8' fill='none'%3E%3Cpath d='M1 1L7 7L13 1' stroke='%238a7e6f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 44px;
  }

.label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
  }

.field-label {
    display: block;
    font-family: 'Literata', Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--ink);
    margin-bottom: 14px;
    letter-spacing: -0.2px;
  }

.code-boxes {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 28px 0;
  }

.code-box {
    width: 56px;
    height: 70px;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    text-align: center;
    font-family: 'Literata', Georgia, serif;
    font-size: 32px;
    font-weight: 400;
    color: var(--ink);
    text-transform: uppercase;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    caret-color: var(--accent-teal);
    transition: border-color 0.2s, opacity 0.2s;
  }

.code-box:focus { outline: none; border-color: var(--accent-teal); }

.code-box::placeholder { color: var(--ink-faint); font-weight: 400; }

.code-box:disabled { opacity: 0.5; }

.join-title { text-align: center; }

.join-title h2 {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 38px;
    color: var(--ink);
    letter-spacing: -0.3px;
  }

.join-title .sub {
    margin-top: 12px;
    font-size: 17px;
    color: var(--ink-soft);
  }

.input-line {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid var(--ink);
    border-radius: 0;
    padding: 6px 0 14px;
    color: var(--ink);
    font-family: 'Literata', Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    transition: border-color 0.2s;
  }

.input-line:focus {
    outline: none;
    border-color: var(--accent-teal);
  }

.input-line::placeholder {
    color: var(--ink-faint);
    font-weight: 500;
  }

.input-line.code {
    text-align: center;
    font-size: 38px;
    letter-spacing: 14px;
    font-weight: 400;
    text-transform: uppercase;
    padding-left: 14px;
  }

/* ---- Two-way choice ------------------------------------------------
   A compact outlined switch, left aligned like the field above it. The two
   halves sit edge to edge at the width of the longer one, and the picked half
   fills black, clipped round on its outer side only. The line under it says
   what the picked side means and changes with it. First used for Private or
   Online on the word game's create screen (#262).

   The same switch is the Play / Online games tabs on /online (#270) and on the
   word game's home screen (#272). There the halves are a link and a span
   rather than two radio buttons, because they navigate, and the current page
   is the filled half. */
.choice-toggle {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #d5c7b4;
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg);
  }

.choice-toggle button,
.choice-toggle > a,
.choice-toggle > span {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 34px;
    padding: 0 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }

.choice-toggle button[aria-checked="true"],
.choice-toggle > [aria-current="page"] {
    background: #000;
    color: var(--ink-on-dark);
    cursor: default;
  }

/* Inset, because the track clips anything drawn outside a half. */
.choice-toggle button:focus-visible,
.choice-toggle > a:focus-visible { outline: 2px solid var(--accent-teal); outline-offset: -3px; }

.choice-toggle svg { width: 16px; height: 16px; flex: none; }

/* The Play / Online games tabs: the switch above, centred at the top of the
   word game's home screen and of /online, with more room in each half. */
.page-tabs { display: flex; justify-content: center; }
.page-tabs .choice-toggle > a,
.page-tabs .choice-toggle > span { padding: 0 20px; }

/* The Beta tag, in the lobby's YOU tag colours: above the /online title
   (#280) and above the Online hint on the create screen (#283). */
.beta-tag {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 8px;
    border-radius: 8px;
    background: #fae6a0;
    color: #8a6b1f;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.2;
    text-transform: uppercase;
  }

.setup-beta { margin-top: 12px; line-height: 0; }
.setup-beta:not([hidden]) + .choice-hint { margin-top: 0; }

.choice-hint {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--ink-soft);
  }

.stepper-line {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1.5px solid var(--ink-faint);
    border-radius: 999px;
    padding: 4px 12px;
    gap: 4px;
  }

.stepper-line button {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 26px;
    font-weight: 400;
    color: var(--ink);
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity 0.15s;
  }

.stepper-line button:disabled { opacity: 0.25; cursor: not-allowed; }

.stepper-line .value {
    font-family: 'Literata', Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    min-width: 50px;
    text-align: center;
    color: var(--ink);
  }

.tile-action .tile-title { font-size: 20px; }

/* Bottom-slot action tiles (Create Room, Enter room, Go to Lobby) sit in
   the same place as the pill .btn and match its radius. The .tile-stack
   cards on the home screen stay on --radius-lg; they are too tall to
   read as pills. */
.tile-action { padding: 22px 24px; border-radius: 999px; }

.tile-dark {
    background: var(--card-active);
    color: var(--ink-on-dark);
  }

.tile-dark .tile-sub { color: var(--ink-on-dark-soft); }

.tile-dark .tile-chevron { color: rgba(255,255,255,0.5); }

.tile-dark:hover:not(:disabled),
  .tile-dark:active:not(:disabled) { background: var(--card-active); color: var(--ink-on-dark); }

.eyebrow {
    text-align: center;
    color: var(--ink-soft);
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 16px;
  }

.divider {
    display: flex;
    align-items: center;
    color: var(--ink-faint);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 4px 0;
    font-weight: 600;
  }

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
  }

.divider::before { margin-right: 12px; }

.divider::after { margin-left: 12px; }

.room-code {
    text-align: center;
    padding: 28px 20px;
    border-radius: var(--radius-lg);
    background: var(--card-active);
    color: #fff;
  }

.room-code .label-sm {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 600;
  }

.room-code .code-text {
    font-family: 'Literata', Georgia, serif;
    font-size: 52px;
    font-weight: 400;
    letter-spacing: 12px;
    color: #fff;
  }

.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-soft);
    border-radius: 16px;
    padding: 6px;
  }

.stepper button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: #fff;
    color: var(--ink);
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: background 0.15s;
  }

.stepper button:active:not(:disabled) { background: var(--bg-soft); }

.stepper button:disabled { opacity: 0.3; box-shadow: none; }

.stepper .value {
    flex: 1;
    text-align: center;
    font-family: 'Literata', Georgia, serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--ink);
  }

/* Header of the Players card: the card's name on the left, the head count on
   the right, on one line. Same label-left / value-right rhythm as the settings
   rows above, but the count keeps its quiet .small styling because it reports
   something rather than setting it.

   The two count lines are mutually exclusive, one for the room game and one
   for Pass the Phone, so only ever one of them is beside the label. Baselines
   rather than centres, because both children are text at different sizes. */
.players-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
  }

.players-head .label { margin-bottom: 0; }

.players-head .small { margin-left: auto; }

.players { display: flex; flex-direction: column; gap: 10px; }

.player-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-radius: 18px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    transition: background 0.3s, color 0.3s;
  }

.player-row.ready {
    background: #d6efdc;
    color: var(--ink);
  }

.player-row.just-joined {
    animation: row-in 0.3s ease-out;
  }

.player-row.just-joined .player-avatar {
    animation: avatar-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

@keyframes row-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

@keyframes avatar-pop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
  }

@media (prefers-reduced-motion: reduce) {
    .player-row.just-joined,
    .player-row.just-joined .player-avatar { animation: none; }
  }

.player-ghost {
    position: fixed;
    margin: 0 !important;
    pointer-events: none;
    z-index: 6;
    animation: row-out 0.28s ease forwards;
  }

@keyframes row-out {
    to { opacity: 0; transform: translateX(10px) scale(0.96); }
  }

.confetti-bit {
    position: fixed;
    width: 5px; height: 9px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 999;
    animation: confetti-fly 0.65s ease-out forwards;
  }

@keyframes confetti-fly {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.55) rotate(var(--rot)); }
  }

.player-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
    font-size: 14px;
    flex-shrink: 0;
    color: #fff;
    font-family: 'Literata', Georgia, serif;
  }

img.player-avatar {
    object-fit: cover;
  }

.player-name {
    flex: 1;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: inherit;
  }

.player-tag {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 6px;
  }

.tag-host { background: #c8e8d9; color: #2a8055; }

.tag-you  { background: #fae6a0; color: #8a6b1f; }

.player-row.ready .tag-host { background: #c8e8d9; color: #2a8055; }

.player-row.ready .tag-you  { background: #fae6a0; color: #8a6b1f; }

.player-status {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ink-faint);
  }

.player-row.ready .player-status { color: #2a8045; }

.sticky-actions {
    position: sticky;
    /* Cancel #app's 48px bottom padding on both the sticky constraint and
       the flow position so the bar hugs the viewport edge at all times. */
    bottom: -48px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 -24px -48px;
    /* The bottom value is the gap under the primary button on every screen that
       has one, so it moves 14 bars across the three games, not just one. The
       env() keeps it clear of the iOS home indicator on top of that. */
    padding: 12px 24px calc(16px + env(safe-area-inset-bottom));
    background: var(--bg);
  }

#screen-lobby .stack-lg {
    display: flex;
    flex-direction: column;
    flex: 1;
  }

#screen-lobby .sticky-actions { margin-top: auto; }

.countdown {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg);
  }

.countdown.active { display: flex; }

.countdown .num {
    font-family: 'Literata', Georgia, serif;
    font-size: 200px;
    font-weight: 400;
    color: var(--ink);
    animation: pop 1s ease-out;
  }

@keyframes pop {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }

/* The role pill, in two colourways: red for the impostor, in all three games,
   and teal for dance's Game Master, who is not playing. Everything but the hue
   is shared, because it was already shared in fact and only duplicated in
   source: .gm-banner sat in dance.css as a copy of this block with eight of
   its twelve declarations character-for-character identical (#148).

   Hidden is the component's own default, and .shown is the only way to reveal
   either of them (#147). It used to default to visible, which left each game to
   arrange its own hiding: word and draw overrode the display inside .word-card,
   dance carried an inline style:none in the markup and set style.display from
   JS. Three mechanisms for one pill, and the inline one could not be restyled
   from CSS at all. */
.imposter-banner,
.gm-banner {
    display: none;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
  }

.imposter-banner.shown,
.gm-banner.shown { display: inline-flex; }

.imposter-banner {
    background: rgba(208, 74, 47, 0.08);
    border: 1.5px solid rgba(208, 74, 47, 0.5);
    color: var(--accent-red);
  }

/* Dance only, and it lives here beside its twin rather than in dance.css,
   because keeping the two apart is exactly how they drifted. The host sits
   out in Host Picks mode, so this one reads calm teal, not alarm red. */
.gm-banner {
    background: rgba(47, 158, 148, 0.08);
    border: 1.5px solid rgba(47, 158, 148, 0.5);
    color: var(--accent-teal);
  }

.reveal-card {
    background: var(--card-active);
    color: #fff;
    text-align: center;
    padding: 56px 28px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

.reveal-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    font-weight: 600;
    margin-bottom: 14px;
  }

.imp-pill {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1.5px solid rgba(255, 122, 92, 0.7);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ff7a5c;
  }

.reveal-name {
    font-family: 'Literata', Georgia, serif;
    font-size: 44px;
    font-weight: 400;
    color: #fff;
    animation: revealPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    line-height: 1.05;
  }

@keyframes revealPop {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
  }

.track-section:first-of-type { margin-top: 0; }

.track-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
  }

.track-label.crew { color: var(--accent-teal); }

.track-label.imp  { color: var(--accent-red); }

.track-row {
    display: flex;
    align-items: center;
    gap: 14px;
  }

.track-icon {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    background: var(--card-active);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
  }

.track-info { flex: 1; min-width: 0; }

.track-title {
    font-family: 'Literata', Georgia, serif;
    font-size: 20px;
    font-weight: 400;
    color: var(--ink);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

.track-artist {
    font-size: 14px;
    color: var(--ink-soft);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: var(--card-active);
    color: #fff;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    z-index: 200;
    transition: transform 0.3s ease;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  }

.toast.show { transform: translateX(-50%) translateY(0); }

.row { display: flex; gap: 10px; }

.row > * { flex: 1; }

.center { text-align: center; }

.small { font-size: 13px; color: var(--ink-soft); }

.you-pill {
    display: inline-block;
    background: #fae6a0;
    color: #8a6b1f;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    margin-left: 6px;
    letter-spacing: 1px;
    text-transform: uppercase;
  }

.player-row.ready .you-pill { background: #fae6a0; color: #8a6b1f; }

.back-btn {
    background: none;
    border: none;
    color: var(--ink-soft);
    font-size: 15px;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 12px;
    align-self: flex-start;
    font-family: inherit;
    font-weight: 500;
    text-decoration: none;
  }

.back-btn:active { color: var(--ink); }

/* Home top bar: back link (left), language switcher or account button
   (right). Shared by the word and dance home screens; the hub carries its
   own copy of the switcher rules in its inline block, as it does for every
   shared component (#128). */

.home-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

.home-topbar .back-btn { margin-bottom: 0; }

/* The right-hand cluster, for a topbar carrying more than the back link and
   one control. Only dance needs it: the language switcher alone can sit as
   the second child of a space-between bar, but dance also has the account
   hamburger, and three children of a space-between bar spread evenly instead
   of grouping (#167). Word and draw keep the two-child form. */

.home-topbar-end {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

/* Below 360px the cluster costs 40px more than word's and draw's do, which is
   exactly enough to wrap "← Impostor Games" onto a second line. The globe and
   the chevron alone still read as a language control, and the menu underneath
   still names both languages in full, so the label is what gives way. Scoped
   to .home-topbar-end so the switcher keeps its label everywhere else. */

@media (max-width: 360px) {
  .home-topbar-end .lang-switch > summary .lang-current { display: none; }
}

/* Language switcher (#139). A <details> dropdown: the summary is a pill
   matching .code-chip's shape and hairline, the menu is a card below it.
   A row of options fits two languages and breaks at four, which is why this
   is a menu and not a segmented control. */

.lang-switch {
    position: relative;
    flex-shrink: 0;
  }

.lang-switch > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
    white-space: nowrap;
  }

.lang-switch > summary::-webkit-details-marker { display: none; }

.lang-switch > summary:active { background: var(--bg-soft); }

.lang-switch[open] > summary { color: var(--ink); background: var(--bg-soft); }

.lang-globe { flex-shrink: 0; opacity: 0.75; }

/* The chevron, same construction as the FAQ's so the two rotate alike. */
.lang-switch > summary::after {
    content: '';
    width: 6px; height: 6px;
    border-right: 1.8px solid var(--ink-soft);
    border-bottom: 1.8px solid var(--ink-soft);
    transform: rotate(45deg) translate(-1px, -1px);
    transition: transform 0.2s;
    flex-shrink: 0;
  }

.lang-switch[open] > summary::after { transform: rotate(-135deg) translate(-1px, -1px); }

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    min-width: 100%;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

/* On a game home screen the switcher is the RIGHT-hand item, so its menu
   opens against that edge instead of running off the screen. */
.home-topbar .lang-menu { left: auto; right: 0; }

/* The last row of a page that has the tabs at the top in place of a top bar:
   the word game's home screen and /online (#272). The language menu sits at
   its right, at the bottom of the page, so it opens upwards against that edge. */
.page-foot {
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-soft);
    font-size: 14px;
  }

.page-foot .back-btn { margin-bottom: 0; }

.page-foot .lang-menu {
    top: auto;
    bottom: calc(100% + 6px);
    left: auto;
    right: 0;
  }

.lang-opt {
    display: block;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-soft);
    text-decoration: none;
    white-space: nowrap;
  }

.lang-opt.is-current {
    background: var(--bg-soft);
    color: var(--ink);
  }

a.lang-opt:active { background: var(--bg-soft); color: var(--ink); }

.lobby-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

.code-chip {
    touch-action: manipulation;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 7px 16px;
    font-family: 'Literata', Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--ink);
    cursor: pointer;
    letter-spacing: 2px;
    margin-top: 10px;
    transition: background 0.2s;
  }

.code-chip:active { background: var(--bg-soft); }

.code-chip .copy-icon { color: var(--ink-soft); opacity: 0.7; }

.code-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
  }

.code-row .code-chip { margin-top: 0; }

.qr-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.2s;
  }

.qr-btn:active { background: var(--bg-soft); }

.lobby-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0 16px;
  }

/* With no code chip beside it (Pass the Phone), the title has the row to
   itself and centres rather than hugging the left edge. */

.lobby-head.solo { justify-content: center; }

.lobby-head-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

.lobby-head-icon {
    height: 56px;
    width: auto;
    flex-shrink: 0;
  }

.lobby-head-title h1 {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 26px;
    line-height: 1.1;
    letter-spacing: -0.5px;
    color: var(--ink);
    margin: 0;
  }

.lobby-head .code-row { margin-top: 0; flex-shrink: 0; }

.cat-trigger {
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--bg-soft);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 14px 18px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: var(--ink);
    transition: background 0.15s;
  }

.cat-trigger > span {
    font-family: 'Literata', Georgia, serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.2;
  }

.cat-trigger:active { background: #e8e0d0; }

.cat-trigger-chevron { color: var(--ink-soft); flex-shrink: 0; }

/* Modals are inset by a fixed amount and take whatever height is left, so a
     taller screen shows more rows rather than more empty space. The inset lives
     in these two custom properties, which both the backdrop's padding and the
     sheet's max-height read, so the two can never drift apart. The max() keeps
     the sheet clear of the notch and home indicator in the native shell. */

.cat-modal-backdrop {
    --modal-inset-top: max(20px, env(safe-area-inset-top));
    --modal-inset-bottom: max(20px, env(safe-area-inset-bottom));
    position: fixed;
    inset: 0;
    z-index: 150;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgb(222 208 191 / 40%);
    padding: var(--modal-inset-top) 20px var(--modal-inset-bottom);
  }

.cat-modal-backdrop.open { display: flex; }

.cat-modal {
    position: relative;
    background: #fff;
    border-radius: 26px;
    width: 100%;
    max-width: 460px;
    /* vh first as a fallback; dvh wins where supported so mobile browser
       chrome sliding in and out doesn't clip the sheet. */
    max-height: calc(100vh - var(--modal-inset-top, 20px) - var(--modal-inset-bottom, 20px));
    max-height: calc(100dvh - var(--modal-inset-top, 20px) - var(--modal-inset-bottom, 20px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.22);
    animation: catModalIn 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
  }



@keyframes catModalIn {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

.cat-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 0;
    flex-shrink: 0;
  }

/* A header holding nothing but the close button leaves space-between with
   nothing to space, so the button parks on the left. Push it to the right,
   where a close control belongs and where the two-button headers already put
   theirs.
   This was scoped to the mode picker when it shipped, on the grounds that
   moving every close button was a separate decision. #197 took that decision:
   the feedback popup, the QR sheet and the dance song picker share this
   header, and three sheets built from one component should not disagree about
   which corner closes them. */

.cat-modal-header > :only-child { margin-left: auto; }

.cat-select-btn {
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 8px 18px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }

.cat-select-btn:active { background: var(--bg-soft); }

.cat-select-btn.active {
    background: var(--card-active);
    border-color: var(--card-active);
    color: var(--ink-on-dark);
  }

.cat-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    padding: 0;
    border-radius: 10px;
    transition: background 0.15s;
  }

.cat-modal-close:active { background: var(--bg-soft); }

.cat-modal-title {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 20px;
    color: var(--ink);
    margin: 0;
  }

#howto-modal-body { padding: 4px 16px 16px; }

.cat-modal-list {
    overflow-y: auto;
    padding: 0 0 8px;
    flex: 1;
    -webkit-overflow-scrolling: touch;
  }

/* "Talk to creator", sitting between How to Play and the FAQ.
   Deliberately the same pill as the hub's "New Game" flag, including its
   #6b5334 verbatim, so the two read as one family. Note that brown is a near
   duplicate of --ink-warm (#5c432c); unifying them is still open.

   The difference from the hub's flag is that this one is a control, so it is
   set larger than that badge and gets a press state. The ::after tops its hit
   area up past the visible pill without changing the look. */
.howto-cta { text-align: center; margin-top: 44px; }

/* Same pill as .howto-cta, but placed just past the fold so the other games
   are the first thing a scroll reveals, and nothing of it shows at rest.
   .home-fold reserves 120px of the viewport below itself as a scroll hint, so
   the pill has to clear whatever is left of that reserve: 120px minus the
   fold's own top offset. Dance is the tightest of the three at 38px, because
   its topbar sits 12px higher than word's and draw's. 56px clears it with
   room to spare on all three. */
.more-games-cta { text-align: center; margin-top: 56px; }

.pill-btn {
    position: relative;
    display: inline-block;
    text-decoration: none;
    background: #6b5334;
    color: #fff;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 11px 22px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
    transition: filter 0.15s ease, transform 0.12s ease;
  }

.pill-btn::after {
    content: '';
    position: absolute;
    inset: -5px -8px;
  }

.pill-btn:active,
.pill-btn.is-pressed { transform: scale(0.96); filter: brightness(0.9); }

/* Small brown badge, sibling to .pill-btn — same #6b5334 family, one weight
   lighter because it reads as a label, not a control. Standalone by default;
   consumers that pin one inside a card frame add their own position rules on
   top (the hub's "New Game" flag used position: absolute over the artwork).
   Kept in the design system so a future call for a "flag on a card" reaches
   for this rather than reinventing the look. */
.new-pill {
    display: inline-block;
    background: #6b5334;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 6px 13px;
    border-radius: 999px;
    white-space: nowrap;
  }


@media (prefers-reduced-motion: reduce) {
  .pill-btn:active,
  .pill-btn.is-pressed { transform: none; }
}

.feedback-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: var(--ink-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 8px;
  }

.feedback-link:active { color: var(--ink); }

.fbp-card { max-width: 340px; }

.fbp-body { padding: 0 24px 28px; text-align: center; }

.fbp-title {
    font-family: 'Literata', Georgia, serif;
    font-size: 24px;
    color: var(--ink);
  }

.fb-emojis { display: flex; justify-content: center; gap: 4px; margin-top: 10px; }

.fb-emoji {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
    padding: 8px;
    border-radius: 12px;
    transition: transform 0.12s ease;
  }

.fb-emoji:active { transform: scale(1.3); }

.fbp-body .feedback-link { font-size: 13px; margin-top: 6px; }

/* The popup's text box (#197). It borrows .chat-composer, .chat-field and
   .send-btn from chat.css rather than restyling a second composer, because
   what it sends goes into the same thread as the chat panel and a control
   that behaves the same should look the same. Only the width and the height
   cap are ours: the panel's field flexes inside a full-height column, this
   one sits in a card. */
.fbp-say { margin-top: 16px; text-align: left; }

/* The ask above the box. The thanks title answers the rating that was just
   given, so without a line here the box below it reads as decoration rather
   than a question. Left-aligned with the field it introduces, against the
   centred prose above. */
.fbp-say-lead {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
  }

/* Taller than the chat panel's 120px: there is no thread above this one
   for a long message to eat into, and the card can afford the room. The
   auto-grow in each game reads this value back, so the cap lives here
   only. */
.fbp-say .chat-field { width: 100%; box-sizing: border-box; max-height: 200px; }

/* The support popup (#203). It reuses .fbp-card and .fbp-body wholesale: it
   is the same card, at the same moment, one milestone later, and a second
   card shape here would read as a different site asking. Only the prose
   block and the two controls below are its own. */
.coffee-text {
    margin: 12px 0 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-soft);
  }

/* .btn is written for <button>, which is not an inline box; as an <a> it
   needs the underline off and the inherited link colour overridden, or the
   label comes through blue and underlined on top of the dark pill. */
.coffee-cta {
    margin-top: 18px;
    text-decoration: none;
    color: var(--ink-on-dark);
  }

/* Deliberately the quiet control: same treatment as the feedback link, so
   declining costs one tap and no hunting, but the coffee stays the button. */
#coffee-later { margin-top: 4px; }

/* "fb" is short for feedback, and both the form it was named after and the
   home-screen link that opened it are gone: the way in is now the .pill-btn
   above the FAQ. The two rules below survive because the dance game's song
   picker and Song Group builder borrowed them, so the names outlived what
   they described. Renaming them is a tidy-up of dance's markup. */

.fb-title {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 22px;
    color: var(--ink);
    margin: 0;
  }

.fb-field {
    width: 100%;
    border: 1.5px solid var(--bg-soft);
    border-radius: 14px;
    background: var(--bg);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    padding: 13px 15px;
    box-sizing: border-box;
    transition: border-color 0.15s;
  }

.fb-field:focus { outline: none; border-color: var(--accent-teal); }

/* The block sits centred in whatever room is left between the back button and
   the sticky action bar, using auto margins on the outer children rather than
   justify-content: center.
   That is not a style preference. Centred flex pushes overflow ABOVE the
   scroll origin, so on a short phone the "Room Created!" title would scroll
   off the top and be unreachable. Auto margins split the free space the same
   way when there is room and collapse to zero when there is not, so a short
   screen simply scrolls.
   Bottom padding only. It is the floor gap that keeps the last line off the
   action bar once a short screen starts scrolling; the top needs none because
   the back button already separates the block from the edge.
   One-sided padding does skew the centring in principle, since the auto margins
   centre within the padding box. In practice it very nearly cancels: the back
   button's own 12px bottom margin offsets most of the 16px here, leaving the
   content 2px high on dance, the only variant with room to spare. Word and draw
   have none, so they are unaffected either way. Measured, not assumed. */
.share-wrap {
    /* One measure for the whole screen. The card, the title and both hints all
       line up against this single edge, so widths cannot drift apart the way
       four separate max-widths did. Change it here and everything follows.
       It bounds the children rather than being repeated on them: the column is
       centred and capped, and align-items keeps each child inside it. */
    --share-measure: 240px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: center;
    width: 100%;
    max-width: var(--share-measure);
    flex: 1;
    padding: 0 0 16px;
  }

.share-wrap > :first-child { margin-top: auto; }

.share-wrap > :last-child { margin-bottom: auto; }

.share-title {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 26px;
    color: var(--ink);
    margin: 0;
  }

/* Width comes from --share-measure on .share-wrap, so this wraps wherever that
   measure puts it: two lines at the current 240px. The small top margin is
   deliberate, pairing it tightly with the title as one heading block. */
.share-hint {
    font-size: 15px;
    color: var(--ink-soft);
    line-height: 1.5;
    margin: 4px 0 0;
  }

.qr-card {
    margin-top: 22px;
    background: #fff;
    border-radius: 20px;
    padding: 16px;
    width: 168px;
    height: 168px;
    box-shadow: 0 2px 14px rgba(42, 37, 32, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
  }

.qr-card svg { width: 100%; height: 100%; display: block; }

.qr-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px 30px;
  }

.qr-modal-hint {
    font-size: 15px;
    color: var(--ink-soft);
    margin: 0 0 18px;
  }

.qr-modal-code {
    margin-top: 16px;
    font-family: 'Literata', Georgia, serif;
    font-size: 26px;
    letter-spacing: 6px;
    color: var(--ink);
    padding-left: 6px;
  }

/* Host share-code screen: one card holding the QR, the code and the copy
   button. It replaced a floating QR card sitting above four separate code
   tiles, which read as three unrelated objects rather than one thing to hand
   round. The shadow is the same as .qr-card's, not a new value. */
.share-card {
    margin-top: 18px;
    width: 100%;
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 18px 18px 20px;
    box-shadow: 0 2px 14px rgba(42, 37, 32, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

/* One class for both "Scan code" and "or enter code": they are the same label
   doing the same job, so two rules would only drift apart later.
   --ink-soft rather than --ink-faint on purpose. The faint grey lands at
   2.13:1 against the page, which is the thing the contrast ticket exists to
   fix; there is no sense adding new text to the pile. */
.share-card-label {
    font-size: 15px;
    color: var(--ink-soft);
    line-height: 1.3;
    margin: 0;
  }

.share-card-label + .share-qr { margin-top: 10px; }

.share-qr + .share-card-label { margin-top: 14px; }

/* A bare QR box, deliberately NOT .qr-card. That class brings its own white
   background, padding and shadow for the lobby QR modal, all of which would
   have to be unset inside a card that is already white. The modal keeps it. */
.share-qr {
    width: 152px;
    height: 152px;
  }

.share-qr svg { width: 100%; height: 100%; display: block; }

/* The code as plain letters. The four white tiles are gone; the join screen's
   input tiles are a separate unscoped .code-box rule and are unaffected.
   letter-spacing pads the right of the last glyph, so padding-left of the same
   size puts the row back on the centre line. Still clickable to copy, which is
   what the title attribute on the element is for. */
.share-code {
    margin-top: 8px;
    font-family: 'Literata', Georgia, serif;
    font-size: 36px;
    line-height: 1.1;
    letter-spacing: 11px;
    padding-left: 11px;
    color: var(--ink);
    cursor: pointer;
  }

.share-card .share-copy-btn { margin-top: 12px; }

/* The alternative route out of this screen, on word and draw only. Dance has
   no Pass the Phone mode to point at. Static text by decision: making it a
   link would have to tear down the room whose QR is on screen, and the room
   listener is not even attached yet at this point, so the screen cannot tell
   whether anyone has already joined. */
.share-or {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin-top: 20px;
  }

.share-or::before,
  .share-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
  }

.share-or span { font-size: 14px; color: var(--ink-soft); }

.share-alt-hint {
    font-size: 15px;
    color: var(--ink-soft);
    line-height: 1.5;
    margin: 12px 0 0;
  }

.share-alt-hint strong { color: var(--ink); font-weight: 600; }

.share-copy-btn {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.2s;
  }

.share-copy-btn:active { background: var(--bg-soft); }

.cat-group-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 16px 24px 14px;
    border-bottom: 1px solid var(--border);
  }

.cat-row {
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 18px 56px 18px 24px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
    color: var(--ink);
  }

.cat-row:last-child { border-bottom: none; }

.cat-row.selected {
    background: var(--card-active);
    color: var(--ink-on-dark);
    border-bottom-color: var(--card-active);
  }

.cat-row-title {
    font-family: 'Literata', Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 8px;
  }

.cat-row-desc {
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.35;
  }

.cat-row.selected .cat-row-desc { color: var(--ink-on-dark-soft); }

.cat-check {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    background: transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }

.cat-row.selected .cat-check {
    border-color: var(--ink-on-dark);
    background: var(--ink-on-dark);
    color: var(--card-active);
  }

.cat-check svg { width: 14px; height: 14px; display: block; }

.cat-modal-footer {
    flex-shrink: 0;
    padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: #fff;
  }

.cat-done {
    width: 100%;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink-on-dark);
    background: var(--card-active);
    border-radius: 16px;
    padding: 15px 20px;
    transition: opacity 0.15s;
  }

.cat-done:active { opacity: 0.85; }

.cat-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--ink-soft);
    text-transform: uppercase;
    margin-bottom: 12px;
  }

.cat-label svg { opacity: 0.65; }

/* .cat-display is gone. All three games used it to show a player the chosen
   category as static text in place of the host's trigger; the settings rows
   below show the same value to both, so there is nothing left to swap in. */

/* The impostor count. It used to be a small uppercase badge in the corner of
   the Players card, where a badge was the right shape: it was reporting a fact
   about the round. Now it sits in the settings card as the last row, beside
   Rounds, so it takes the rounds control's shape instead: same 999px pill,
   same 26px round buttons, same 13px sentence case. Next to a real control, a
   10px letterspaced badge reads as a label rather than something to tap.

   The amber is what does not change. It is the colour of the "You're the
   Impostor" banner and the impostor card, so the row is recognisably about the
   impostor rather than being a second copy of the rounds stepper.

   All three lobbies carry this row; the rounds stepper just below it is worn
   by two of them. */
.imposter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fae6a0;
    color: #8a6b1f;
    border-radius: 999px;
    padding: 4px 6px;
    font-size: 13px;
    font-weight: 600;
    user-select: none;
  }

/* The 26px floor is the height of the +/- buttons beside it, so a pill with
   no buttons (draw, until #123) still lines up with the rounds row above
   instead of sitting visibly shorter. */
.imposter-pill .imp-label {
    display: inline-flex;
    align-items: center;
    /* The count and the word are separate spans so JS can pluralise one of
       them, and inline-flex eats the whitespace between them. The gap puts
       the space back, matching the literal space in the rounds label. */
    gap: 4px;
    min-height: 26px;
    padding: 0 6px;
    white-space: nowrap;
  }

.imposter-pill button {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    color: inherit;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
  }

.imposter-pill button:active:not(:disabled) { background: rgba(255, 255, 255, 0.95); }

.imposter-pill button:disabled { opacity: 0.35; cursor: default; }

/* Pushed to the right edge of its settings row, exactly as the rounds control
   is. Draw has no stepper yet (#123), so its pill is the label alone and the
   same rule still right-aligns it. */
.set-row .imposter-pill { margin-left: auto; }

/* ---- Lobby: rounds stepper ----------------------------------------
   How many times the order goes round: each player draws once per round in
   the drawing game, and writes one clue per round on the clue board. Same
   outlined-pill shape as the impostor pill above, in teal to read as a
   setting rather than a warning. Host-only: players see the value with the
   buttons hidden.

   Moved here from draw.css when the clue board gained rounds (#258). Two
   games wear this control, so one of them owning the stylesheet it lives in
   is how the two drift apart. */
.rounds-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(47, 158, 148, 0.12); /* --accent-teal at 12% */
    color: var(--ink);
    border-radius: 999px;
    padding: 4px 6px;
    font-size: 13px;
    font-weight: 600;
  }

.rounds-pill .rounds-label { padding: 0 6px; white-space: nowrap; }

.rounds-pill button {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

.rounds-pill button:disabled { opacity: 0.35; cursor: default; }

.avatar-c1 { background: #fae6a0; color: var(--ink); }

.avatar-c2 { background: #bfe5c8; color: var(--ink); }

.avatar-c3 { background: #f4c4b7; color: var(--ink); }

.avatar-c4 { background: #f9d8aa; color: var(--ink); }

.avatar-c5 { background: #d2c2e8; color: var(--ink); }

.avatar-c6 { background: #b8e8c1; color: var(--ink); }

.avatar-c7 { background: #bfd7f0; color: var(--ink); }

.avatar-c8 { background: #f3c5d1; color: var(--ink); }

.home-fold {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 120px);
  }

/* The character and title sit centred in whatever room the fold has left
     between the topbar and the eyebrow, rather than hanging from the top.
     The auto margins collect the free space and split it evenly, which only
     works because nothing else in the fold grows.
     The padding is the floor for short viewports. The heavier bottom value
     is deliberate: it lifts the block 12px above true centre, which is
     where a heading optically wants to sit, and it keeps the title off the
     eyebrow when the margins collapse to nothing on a short screen.
     Scoped to .home-fold: the .logo blocks on the lobby and round screens
     keep the plain top margin from the rule above. */
.home-fold > .logo {
    margin: auto 0;
    padding: 24px 24px 48px 24px;
  }

.howto-anchor {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink-soft);
    padding: 14px 16px;
    margin: 16px auto 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    letter-spacing: 0.3px;
    align-self: center;
    transition: color 0.2s, transform 0.2s;
  }

.howto-anchor:hover { color: var(--ink); }

.howto-anchor:active { transform: translateY(2px); }

.howto-anchor .arrow { animation: anchorBob 2.4s ease-in-out infinite; }

@keyframes anchorBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
  }

.how-to-play {
    padding: 56px 0 32px;
    scroll-margin-top: 24px;
  }

/* Left-aligned, unlike the eyebrow and hero above it. Everything from here
   down the page is prose rather than app furniture, and centred prose gives
   the eye a new left edge to find on every line. The section eyebrows and the
   hero stay centred: those are labels, not reading. */
.howto-header { text-align: left; margin-bottom: 30px; }

.howto-header h2 {
    font-family: 'Literata', Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.3px;
  }

.howto-header .howto-sub {
    margin-top: 10px;
    color: var(--ink-soft);
    font-size: 16px;
  }

.howto-def {
    max-width: 560px;
    margin: 0 auto 34px;
    color: var(--ink-soft);
    font-size: 14.5px;
    line-height: 1.65;
    text-align: left;
  }

.howto-def strong { color: var(--ink); font-weight: 600; }

/* Lead illustration for the how-to section.

   The artwork is characters only, on a transparent ground. Everything above
   their heads (music notes for dance, word cards for word) is a .howto-lead-mark
   positioned over the top, because words baked into a picture cannot be
   translated. See components/howto-lead.njk.

   The figure is a container, and the marks size themselves in cqw, so they
   hold their proportion against the art at 375px and at full width alike.
   Give the figure a width and the marks stop tracking; they key off the
   container, not the viewport.

   width/height on the <img> are each file's own. They are there to
   reserve the box before it arrives, not to size it: the rule below overrides
   both. Drop them and the whole section jumps as the image lands. */
.howto-lead {
    /* The one dial for how large a lead renders. A max width rather than a
       percentage: on a phone the column is already narrower than this, so the
       art stays full width there and only steps down where there is slack.

       Because the figure is the query container for the marks over it, this
       scales the notes and cards along with the drawing. Size the <img> instead
       and the marks stay behind at the old size. */
    --howto-lead-max: 370px;

    position: relative;
    container-type: inline-size;
    width: min(100%, var(--howto-lead-max));
    margin: 0 auto 30px;
  }

.howto-lead img {
    display: block;
    width: 100%;
    height: auto;
  }

/* `left` is set inline per mark, as the centre of that character's head. */
.howto-lead-mark {
    position: absolute;
    top: 20%;
    transform: translate(-50%, -50%);
    line-height: 1;
  }

.howto-lead-mark svg {
    display: block;
    width: 4.7cqw;
    height: auto;
  }

.howto-lead-card {
    font-size: 4.9cqw;
    font-weight: 600;
    letter-spacing: -0.01em;
    padding: 0.34em 0.72em;
    border-radius: 0.46em;
    white-space: nowrap;
  }

/* Taken from the accent strokes in the artwork itself, so the marks read as
   part of the drawing rather than as something laid on top of it. The
   impostor is a different SHAPE too, a single flagged note against the crew's
   beamed pair, because green against red is the one pairing a red-green
   colour-blind reader cannot separate. The two squads differ by shape for the
   same reason, and neither of them is the odd one out. */
.howto-lead-mark.tone-crew,
.howto-lead-mark.tone-squad-1 { color: #2d9552; }
.howto-lead-mark.tone-impostor,
.howto-lead-mark.tone-squad-2 { color: #d0492a; }
.howto-lead-card.tone-crew { background: rgba(45, 149, 82, 0.13); }
.howto-lead-card.tone-impostor { background: rgba(224, 84, 47, 0.15); }

.howto-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    margin: 0;
  }

.howto-step {
    display: flex;
    gap: 18px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 20px 20px;
    box-shadow: var(--shadow);
  }

.step-num {
    font-family: 'Literata', Georgia, serif;
    font-size: 30px;
    font-weight: 400;
    color: var(--accent-teal);
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    line-height: 1;
    padding-top: 2px;
  }

.step-body { flex: 1; min-width: 0; }

.step-body h3 {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 20px;
    color: var(--ink);
    margin: 0 0 6px;
    line-height: 1.2;
  }

.step-body p {
    color: var(--ink-soft);
    font-size: 14.5px;
    line-height: 1.5;
    margin: 0;
  }

/* Steps that split into two cases (e.g. word's "online" vs "one phone")
     need the lines apart; a single-paragraph step is unaffected. */
.step-body p + p { margin-top: 6px; }

.faq-list { display: flex; flex-direction: column; gap: 10px; }

.faq-item {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 4px 20px;
  }

.faq-item summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 15.5px;
    color: var(--ink);
    padding: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '';
    width: 9px; height: 9px;
    border-right: 2px solid var(--ink-soft);
    border-bottom: 2px solid var(--ink-soft);
    transform: rotate(45deg);
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-right: 4px;
  }

.faq-item[open] summary::after { transform: rotate(-135deg); }

.faq-item p {
    color: var(--ink-soft);
    font-size: 14.5px;
    line-height: 1.55;
    margin: 0;
    padding: 0 0 18px;
  }

/* Links out to the content pages (/party-games/, /games-like-among-us/),
   sitting under the FAQ on each game's home screen. Every game page used to
   carry exactly one internal link, href="/", which left the content pages
   reachable only from the hub footer.

   It shipped as a single quiet line of 13.5px text, on the reasoning that it
   should not compete with Create and Join. That was the wrong read: it sits
   below the FAQ at the very bottom of the screen, where there is nothing left
   to compete with, and a link nobody notices is worth about as much as no
   link. It now gets its own heading, reusing .howto-header so it reads as a
   sibling of the FAQ above it rather than as leftover footer text. */
.more-reading-header {
    margin-top: 44px;
    margin-bottom: 18px;
  }

.more-reading {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

/* Set as prose, not as UI: Literata at 18px with the teal underline that
   /party-games/ and /games-like-among-us/ use on their own body links, so a
   link looks like the page it leads to. No horizontal padding, so the text
   sits flush with the heading's left edge. */
.more-reading a {
    display: inline-block;
    padding: 4px 0;
    font-family: 'Literata', Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--accent-teal);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
  }

/* ------------------------------------------------------------
   MORE GAMES
   Two cross-links at the very bottom of the how-to section, one per game the
   reader is not currently on. Until now the only route between the three
   games was back out to the hub, which a player who arrived on /draw/ from
   search never sees.

   Deliberately not the hub's .game-card: that one is a 380px illustration, a
   title, a blurb and a wide Play button, sized to be the only thing on the
   screen. Here it is a footer, under the FAQ, so it is a row instead: icon,
   name, Play. Same parts, a tenth of the height.

   The heading is short on purpose. It was chosen against a 38px .howto-header
   h2, where every longer candidate ("More Impostor Games", "You might also
   like") wrapped to two lines and put a heavier heading on the page than the
   two small rows under it deserve. The section headings are 28px now, so a
   longer one would fit; "More games" stays because it reads as a sibling of
   "More to read" directly above it.
   ------------------------------------------------------------ */

.alt-games-header {
    margin-top: 44px;
    margin-bottom: 18px;
  }

.alt-games { display: flex; flex-direction: column; gap: 12px; }

/* One <a> per game, not a card containing a link: the whole row is the tap
   target and the Play pill is an affordance inside it, which is also why the
   pill is a <span>. A nested <button> would be an invalid tap target inside a
   link and would swallow the tap that the card wants.
   aria-label carries "Play <game>", so a screen reader hears the action and
   not just a name sitting next to a Play pill it cannot associate. The
   visible names are the games' own, which is why one of them wraps to two
   lines where its siblings do not (#198). */
.alt-game {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 12px 14px 12px 12px;
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

.alt-game:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(42, 37, 32, 0.10); }

/* Same two-part press as the hub's cards: the card settles into the page by
   flattening its shadow, the pill does the visible click. .is-pressed comes
   from shared/press.js, which carries .alt-game in its selector list. */
.alt-game:active,
  .alt-game.is-pressed {
    box-shadow: 0 1px 5px rgba(42, 37, 32, 0.10);
    transition: box-shadow 0.06s ease;
  }

.alt-game:active .alt-game-play,
  .alt-game.is-pressed .alt-game-play {
    transform: scale(0.96);
    filter: brightness(0.9);
    transition: transform 0.06s ease, filter 0.06s ease;
  }

@media (prefers-reduced-motion: reduce) {
  .alt-game:active .alt-game-play,
  .alt-game.is-pressed .alt-game-play { transform: none; }
}

/* A fixed square well, so two cards whose artwork is shaped differently still
   line their names up on one left edge. Same warm fill as the hub's art
   frame. */
.alt-game-icon {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    background: var(--bg);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

/* Optical sizing, not geometric. The three characters fill their viewBoxes by
   different amounts, so giving them equal heights makes them look unequal.
   These are the lobby's own ratios, scaled down: draw is capped on width
   because its art is 441x326 and would otherwise push the name right, and
   dance gets 4px more because that figure fills about 81% of its box against
   word's 95%. The same three adjustments live in base.css, draw.css and
   dance.css for .lobby-head-icon; they are repeated rather than shared
   because there they are split across three files, one per game, and this
   block needs all three in one place: every game page shows two characters
   that are not its own. */
.alt-game-icon img {
    display: block;
    width: auto;
    height: 50px;
  }

.alt-game.draw .alt-game-icon img {
    height: 50px;
    max-width: 50px;
    object-fit: contain;
  }

.alt-game.dance .alt-game-icon img { height: 54px; }

/* "Dance Game", not "Impostor Dance Game". The heading above already says
   games, the page around it says Impostor about thirty times, and the short
   name holds one line at every width, which drops the row from 97px to 78px
   and keeps the two cards from reading as a wall. */
.alt-game-name {
    flex: 1;
    min-width: 0;
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 19px;
    line-height: 1.25;
    letter-spacing: -0.2px;
  }

.alt-game-play {
    flex: 0 0 auto;
    background: var(--card-active);
    color: var(--ink-on-dark);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.2px;
    border-radius: 999px;
    padding: 10px 20px;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
  }

/* Narrow phones. At 320px the row has 82px left for the name once the well
   and the pill have taken their share, and "Dance Game" needs 112. Trimming
   the well, the gaps and the pill buys back 30px and holds it to one line.
   Measured at 320, not guessed. draw.css already plays the same trick on the
   lobby header at this width. */
@media (max-width: 360px) {
  .alt-game { gap: 10px; padding: 12px; }
  .alt-game-icon { width: 52px; height: 52px; border-radius: 15px; }
  .alt-game-icon img { height: 42px; }
  .alt-game.draw .alt-game-icon img { height: 42px; max-width: 42px; }
  .alt-game.dance .alt-game-icon img { height: 45px; }
  .alt-game-name { font-size: 17px; }
  .alt-game-play { padding: 10px 16px; }
}

::-webkit-scrollbar { width: 0; display: none; }

/* ============================================================
   GAME MODE PICKER
   Shared by the dance and word games. These lived in dance.css until the
   word game picked up the same picker; the dance-only pieces (the compact
   player card, the "coming soon" badge and the interest button) stayed
   behind. Declared after .cat-row on purpose, since .mode-row restyles the
   category picker's flat rows into spaced cards.
   ============================================================ */

/* Stacked sections inside one card, separated by thin dividers. Two names for
   the same thing: dance's card carries the music picker below the mode, the
   word game's carries the mode's own settings. */

.mode-card,
  .mode-music-card { display: flex; flex-direction: column; gap: 16px; }

.section-divider {
    height: 1px;
    background: var(--border);
    /* Has to match .card's padding exactly, or the rule stops short of the
       edges. Every divider in all three games sits in a .settings-card, whose
       sides pad the same 20px. */
    margin: 0 -20px;
  }

/* The trigger is deliberately light: no background, no chevron box, snug
   padding, so the picker below it is the only "button-shaped" control. The
   opacity dip on tap keeps the affordance so it doesn't feel dead. */

.mode-trigger {
    background: transparent;
    padding: 4px 0;
    transition: opacity 0.15s;
  }

.mode-trigger:active {
    background: transparent;
    opacity: 0.6;
  }

.mode-trigger .mode-trigger-inner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
  }

.mode-trigger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--ink-soft);
    flex-shrink: 0;
  }

.mode-trigger-icon svg { width: 100%; height: 100%; }

.mode-trigger-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Breathing room around the mode-picker card tiles. Scoped to the id, not
   the shared .cat-modal-list class, so the category picker's flat list
   keeps its full-bleed dividers. */

#mode-modal-list { padding: 24px; }

.mode-row {
    /* Card layout: icon + text sit side-by-side in a rounded, bordered tile
       with space between cards, overriding .cat-row's flat list look. */
    display: flex !important;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border) !important;
    border-radius: 20px;
    /* !important so this wins over .cat-row regardless of which stylesheet
       the two end up in. */
    padding: 16px 16px 16px 12px !important;
    margin-bottom: 18px;
  }

.mode-row:last-child { margin-bottom: 0; }

.mode-row.selected { border-color: var(--card-active) !important; }

.mode-row .mode-row-icon {
    width: 80px;
    height: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    flex-shrink: 0;
    align-self: center;
  }

.mode-row.selected .mode-row-icon { color: var(--ink-on-dark); }

.mode-row-icon svg { width: 100%; height: 100%; }

.mode-row-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }

.mode-row-body { flex: 1; min-width: 0; }

.mode-row-titrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   PASS THE PHONE ROSTER
   The rows are the same .player-row as a real lobby; these add the per-row
   edit controls and the add row. Only the word game uses them today.
   ============================================================ */

.roster-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
  }

/* 44px square, which is the smallest target a fingertip hits reliably. The
   icon inside stays 18px; the extra is invisible until the button is pressed,
   so the row looks the same and is far easier to hit. */

.roster-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    min-width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    line-height: 0;
    color: var(--ink-faint);
    touch-action: manipulation;
  }

.roster-btn.roster-del { color: var(--ink); }

.roster-btn:active:not(:disabled) { background: rgba(42, 37, 32, 0.07); }

/* At the three-player floor the trash is inert, so say so rather than
   letting a tap silently do nothing. */

.roster-btn:disabled { opacity: 0.3; cursor: default; }

/* Editing borrows the row itself rather than swapping in a different
   control, so the name does not jump when it becomes a field. The 1px of
   padding given back keeps the row the same height as the thicker border
   comes in. */

.player-row.editing {
    border-color: var(--ink);
    border-width: 2px;
    padding: 11px 15px;
  }

.roster-input {
    flex: 1;
    min-width: 0;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    background: transparent;
    border: none;
    outline: none;
    padding: 0;
  }

.add-player-row {
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 15px 16px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
  }

.add-player-row:active:not(:disabled) { background: var(--bg-soft); }

.add-player-row:disabled { opacity: 0.45; cursor: default; }

/* ============================================================
   LOBBY SETTINGS CARD
   Shared by all three games. Game mode keeps a heading and a full-size
   trigger, because it is the one setting that decides what the whole sitting
   is and the only one a player might not know exists. Everything under it is
   one setting per line: what it is on the left, what it is set to on the
   right.

   This replaced a taller layout where every setting had its own heading, its
   own full-width control and a line of prose underneath, which cost over half
   the screen before the player list even started.
   ============================================================ */

/* Narrower side padding than a plain .card, because the rows are label-and-
   value pairs that want the width, not prose that wants a margin.

   gap:0 because the word and dance cards are flex columns with a 16px gap of
   their own, which would push the rows away from the rules they are meant to
   sit flush against. All the spacing in here is the rows' own padding. */
.settings-card { padding: 18px 20px 8px; gap: 0; }

/* Pulled in so the mode block sits with the rows rather than floating above
   them. Both halves of the first gap are set, because adjacent margins
   collapse to the larger of the two and .cat-label carries a 12px
   margin-bottom of its own: trimming only the trigger's margin-top would
   change nothing. */
.mode-block { padding-bottom: 10px; }

.mode-block .cat-label { margin-bottom: 6px; }

.mode-block > * + * { margin-top: 6px; }

.set-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 0;
    background: none;
    border: 0;
    font: inherit;
    color: var(--ink);
    text-align: left;
  }

.set-row .cat-label { flex: none; margin: 0; }

/* Pushed to the right edge, ahead of the chevron. Several categories at once
   summarise to "Food, Animals +2", which is the longest this ever gets. */
.set-row-value {
    margin-left: auto;
    min-width: 0;
    font-family: 'Literata', Georgia, serif;
    font-size: 18px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

.set-row .rounds-pill { margin-left: auto; }

.set-row:active:not(.readonly) .set-row-value { opacity: 0.55; }

/* A player can change none of these, so their controls lose the chevron and
   the tap affordance. Previously this class was applied by the word and draw
   lobbies with no styles behind it anywhere, leaving a control that looked
   tappable and did nothing; only dance had ever styled it. */
.cat-trigger.readonly {
    border-color: transparent;
    background: transparent;
    pointer-events: none;
    padding-left: 0;
  }

.cat-trigger.readonly,
.set-row.readonly { cursor: default; }

.cat-trigger.readonly .cat-trigger-chevron,
.set-row.readonly .cat-trigger-chevron { display: none; }

/* Very narrow phones. Four categories summarise to "Food, Animals +2", and
   against a "CATEGORY" label that is the one combination with no room at
   320px: it would ellipsise away the "+2", which is the part carrying how
   many were left out. Tightening the label's tracking, the gaps and the card
   padding buys back the thirty-odd pixels it needs, and 361px up is
   untouched, so the phones almost everyone has keep the full-size type. */
@media (max-width: 360px) {
  .set-row { gap: 10px; }
  .set-row .cat-label { letter-spacing: 0.5px; }
  .set-row-value { font-size: 16px; }
  /* "5 Impostors" with both steppers is the widest this row ever gets, and at
     320px it overhangs the card by a few pixels. The padding gives those back
     rather than the button size, which is what a thumb aims at. */
  .imposter-pill { padding: 4px 3px; }
  .imposter-pill .imp-label { gap: 3px; padding: 0 3px; }
}

/* ============================================================
   THE ROLE CARD (#324)
   What a player is dealt for the round: dark with the secret word for the
   crew, red for the impostor. Word and draw deal it on the round screen and
   on the back of the Pass the Phone card, and word lays it flat above the
   clue board. Dance lays it flat above the song, for the impostor only: a
   crewmate would have nothing to put on it but the song, and the header
   already shows that.

   It lived in word.css and draw.css as two copies identical to the byte, and
   dance loads neither, which is why it lives here now. What only one game
   needs stays with that game: word's padding on short phones, draw's
   positioning on its word screen, the sizes of what word puts on the flat
   card.
   ============================================================ */

.word-card {
    background: var(--card-active);
    color: var(--ink-on-dark);
    border-radius: var(--radius-lg);
    padding: 104px 28px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(42, 37, 32, 0.18);
  }

.word-card .role {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink-on-dark-soft);
    margin-bottom: 14px;
    font-weight: 600;
  }

.word-card .word-big {
    font-family: 'Literata', Georgia, serif;
    font-size: 34px;
    line-height: 1.25;
    overflow-wrap: break-word;
  }

.word-card.is-imposter { background: var(--accent-red); }

.word-card.is-imposter .role { color: rgba(255, 255, 255, 0.75); }

/* Laid flat. Up for the whole round rather than a few seconds, so it gives
   back the 104px of air that would otherwise cost the screen under it most
   of its height. A full card pins the badge into that top padding (below);
   a flat card has none, so the badge sits in the flow above whatever
   follows it. Three classes, so the pin loses wherever the two rules sit. */
.word-card.is-flat {
    padding: 16px 20px;
    border-radius: var(--radius);
  }

.word-card.is-flat .imposter-banner {
    position: static;
    transform: none;
    margin-bottom: 10px;
  }

/* ============================================================
   PASS THE PHONE — the handover card between players.
   Shared by the word and draw games, which deal an identical card and must
   not drift apart on how it looks or how it turns. The face itself is the
   role card above.

   Deliberately the plain light card rather than the dark .word-card, so
   nobody glancing across the table mistakes it for someone's secret word.
   ============================================================ */

.pass-step {
    text-align: center;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ink-faint);
    min-height: 16px;
  }

.pass-avatar .player-avatar {
    width: 104px;
    height: 104px;
    font-size: 34px;
  }

.pass-avatar:empty { display: none; }

.pass-name {
    font-family: 'Literata', Georgia, serif;
    font-size: 30px;
    line-height: 1.2;
    color: var(--ink);
    overflow-wrap: break-word;
  }

.pass-note { margin-top: -6px; }

/* The card has two sides and turns under the finger. Both faces are
     absolutely placed, so the card's own square is what gives the pair a
     size. */

/* The impostor badge rides ON the card, in word (#144) and draw (#145). Above it
   it had to be kept in step with whichever face was showing, and Pass the
   Phone turned it on at 45 degrees of the swipe, which is before the face
   that says the same thing is anywhere near visible. On the card there is
   nothing to keep in step: it turns because it is part of what turns.

   Pinned rather than stacked, at the same inset as the countdown at the foot,
   so the card reads as three zones AND the hint stays optically centred. In
   flow it would push the word down by the height of the pill, on the
   impostor's card only, leaving one player's word sitting lower than
   everyone else's on a taller card.

   The cream-backed pill is unreadable on the red card, so on that ground it
   becomes a light pill on the tint. Word (#144) and draw (#145) pin it to a
   full card; a flat card has no padding to pin it into and puts it back in
   the flow (the role card above, #324). Showing and hiding is NOT here: that
   is the component's own .shown switch above, which all three games use. */
.word-card .imposter-banner {
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--ink-on-dark);
  }


.flip-scene {
    perspective: 1400px;
    transition: opacity 0.16s ease;
  }

/* Between players the card fades out, is turned back and refilled while
   nobody can see it, then fades in wearing the next name. */
.flip-scene.swapping { opacity: 0; }

/* Square whichever side is up, so nothing about the shape of a card hints at
   what it says. Capped against the viewport height as well as the width:
   left to grow with the width alone it would push Pass to Next Player below
   the fold on a short phone. */
.flip-card {
    position: relative;
    width: 100%;
    max-width: min(100%, 58vh);
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 1 / 1;
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
    touch-action: pan-y;  /* horizontal is ours, vertical stays the page's */
    cursor: grab;
  }

.flip-card.revealed { cursor: default; }

.flip-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

/* Both faces are written with two classes on purpose. Each one also carries a
   one-class card (.card on the front, .word-card on the back), and a single
   .flip-front / .flip-back would be left to source order to beat it. Two
   classes win outright, which is what keeps .word-card's 104px out of a
   fixed square face wherever the rules happen to sit. */
.flip-face.flip-front {
    width: 100%;
    padding: 28px;
    gap: 18px;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    font: inherit;
    color: inherit;
    cursor: inherit;
  }

.flip-face.flip-back {
    transform: rotateY(180deg);
    padding: 28px;
  }

.flip-back .role { margin-bottom: 14px; }

/* Fades in once the card has been turned, and is the only way onward.
   Opacity only, deliberately: an id selector setting transform outranks
   .btn.is-pressed, which killed the press feedback on the one button
   players tap most, and it slid the target 6px for 300ms exactly when a
   thumb was arriving. Fading alone still reads as appearing. */
#btn-pass-next {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

#btn-pass-next.shown {
    opacity: 1;
    pointer-events: auto;
  }

/* No rotation for anyone who has asked for less movement: the faces
   cross-fade in place instead. The back sits after the front in the DOM,
   so its opacity alone decides which one is on top. */
@media (prefers-reduced-motion: reduce) {
  .flip-scene { transition: none; }
  .flip-card { transform: none !important; transition: none; }
  .flip-face { backface-visibility: visible; -webkit-backface-visibility: visible; }
  /* The card no longer turns, so the half-turn that normally un-mirrors this
     face has nothing to cancel it out. Drop it, or the word reads backwards.
     Two classes again, to outrank the rotateY above it. */
  .flip-face.flip-back { transform: none; opacity: 0; transition: opacity 0.2s ease; }
  .flip-card.revealed .flip-back { opacity: 1; }
}


/* ============================================================
   THE ONLINE CARD, AND THE ROUND RUNNING BEHIND IT  (#144)
   ------------------------------------------------------------
   On your own phone the card used to be dealt and then sit there,
   unchanged, for the whole round: no signal that the reveal was
   over, and nothing to distinguish "still looking at my word" from
   "playing". It now counts itself down and turns face down, and a
   swipe turns it back.

   The turning is Pass the Phone's, deliberately: the same scene,
   the same 3D card, the same 0.45s curve and the same 45/50 degree
   thresholds, so one gesture serves both modes. What is NOT reused
   is the square. This card keeps the rectangle it has always had,
   which is why the plate needs its own face rules rather than
   .flip-front / .flip-back.
   ============================================================ */

/* aspect-ratio and the vh cap belong to the square card. Here the word face
   is in flow and its height is the card's, so a long word grows the card
   instead of shrinking the type. */
.flip-card.is-plate {
    aspect-ratio: auto;
    max-width: none;
  }

.flip-card.is-plate.is-covered { transform: rotateY(180deg); }

.plate-face {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

/* In flow, and the positioning context for the badge and the countdown. */
.plate-up { position: relative; }

/* Overlaid on the word face, turned away until the card is. */
.plate-down {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--ink-soft);
  }

.plate-down svg { color: var(--ink-faint); }

/* Blanked rather than emptied, which is where this parts company with
   blankBackFace() next door. Pass the Phone can empty its back face because
   that card is a fixed square; here the word is what gives the card its
   height, so removing it would collapse the card mid-swipe. The badge blanks
   with it: it names the role, so an abandoned swipe must not leave it up
   either. */
.plate-up.blanked .role,
.plate-up.blanked .word-big,
.plate-up.blanked .imposter-banner { visibility: hidden; }

/* The countdown at the foot of the card, mirroring the role label at its
   head. Absolutely placed on the same 32px inset as the badge, so the word
   stays exactly where it has always been and nothing moves when the line
   goes. */
.card-countdown {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 32px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ink-on-dark-soft);
    font-variant-numeric: tabular-nums;
  }

.word-card.is-imposter .card-countdown { color: rgba(255, 255, 255, 0.75); }

/* "Game on" and the clock. Quiet on purpose: it says the round is running,
   not that it is running out. Counting UP, with no bar and no target, so
   nobody feels played against a limit. Its box is reserved from the first
   paint, so the card does not shift when it appears. */
.game-status {
    margin-top: 18px;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

.game-status.shown { visibility: visible; opacity: 1; }

.status-line {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
  }

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-teal);
    animation: livePulse 2.4s ease-in-out infinite;
  }

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.78); }
  }

.game-timer {
    margin-top: 3px;
    font-size: 15px;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
  }

/* The shared-phone round screens carry the clock under the heading instead of
   in a status line: the heading IS the "game is on" line, so there is nothing
   for it to sit beside. A size up on the in-hand one, because this phone is
   lying on the table and every face in the group is further from it. */
.logo .game-timer { margin-top: 12px; font-size: 17px; }

/* Two lines is the common case, so the box is two lines tall and the button
   under it does not hop when the wording changes at the turn. */
.game-hint { min-height: 38px; }

/* The foot sets its own two gaps rather than taking .stack-sm's flat 10px,
   because the two pieces of text are not the same kind of thing. The caption
   belongs to the button, so it sits under it; the instruction is separate
   guidance, so the button clears it by more than twice as much. Both stay
   --ink-soft: a fainter grey would read as hierarchy but would also be the
   contrast problem #44 is open to fix. */
.game-foot {
    display: flex;
    flex-direction: column;
  }

.game-foot .btn { margin-top: 20px; }

.game-foot .reveal-note { margin-top: 8px; }

/* Same reason as the card's padding next door: on a short screen every one of
   these gaps is spent keeping the host's button above the fold. */
@media (max-height: 700px) {
  .game-status { margin-top: 12px; }
  .game-foot .btn { margin-top: 14px; }
}

/* The confirm sheet, for quitting mid-round. Sits in .cat-modal-backdrop,
   which every other sheet here already uses; only this box is new, because a
   confirm is a question and two buttons rather than a scrolling list.

   Shared by word and draw, down to the element ids, so openQuitConfirm() is
   the same function in both (#146). Draw used to carry its own dialog with
   three of these class names meaning different things, which is how
   `.confirm-actions button` came to outrank the `.btn` on draw's buttons and
   quietly shrink them by 10px. One definition, one markup shape, no ranking
   contest. Dance has no quit dialog at all. */
.confirm-sheet {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 340px;
    padding: 24px 22px 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: catModalIn 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
  }

.confirm-title {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 21px;
    color: var(--ink);
    margin: 0;
  }

.confirm-body {
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink-soft);
    margin: 0;
  }

.confirm-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
  }

.confirm-actions button {
    flex: 1;
    border-radius: 999px;
    padding: 13px 16px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
  }

.confirm-cancel {
    background: none;
    border: 1.5px solid var(--border);
    color: var(--ink);
  }

.confirm-cancel:active { background: var(--bg-soft); }

.confirm-go {
    background: var(--accent-red);
    border: none;
    color: #fff;
  }

/* Same bargain as the square card: no rotation, the faces cross-fade in
   place. The swipe still works, it simply does not turn. */
@media (prefers-reduced-motion: reduce) {
  .flip-card.is-plate { transform: none !important; transition: none; }
  .plate-face { backface-visibility: visible; -webkit-backface-visibility: visible; }
  .plate-down { transform: none; opacity: 0; transition: opacity 0.2s ease; }
  .flip-card.is-plate.is-covered .plate-down { opacity: 1; }
  .live-dot { animation: none; }
  .confirm-sheet { animation: none; }
}

/* ============================================================
   TURN ORDER: THE TOP BAR, THE PILL AND THE STRIP
   ------------------------------------------------------------
   Whose go it is, how long they have, and who is after them. Shared by
   the drawing game's canvas and the word game's clue board, which take
   turns the same way and must not drift apart on how a turn looks.

   Draw's own ink dot stays in draw.css: a chip there also has to tie a
   line on the canvas back to a name, and a clue board has no ink.
   ============================================================ */

/* ---- Play screen: top bar -----------------------------------------
   Leave on the left, the clock's mute on the right. */
.play-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: none;
}

/* Pill + mute button ride together on the right. min-width:0 lets the pill's
   label ellipsis instead of shoving the mute button off the edge when a
   drawer has a long name. */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* The pill may shrink; the back button must not wrap onto two lines to make
   room for it. */
.play-topbar .back-btn {
  flex: none;
  white-space: nowrap;
}

/* Waiting state: a muted clay pill, deliberately quiet. Sized for the header
   row now, sitting next to the mute button. */
.turn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  background: #d5c7b4;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 5px 4px 16px;
  font-size: 15px;
  font-weight: 600;
}

.turn-pill.no-timer { padding-right: 16px; }

.turn-pill .turn-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Your turn: the pill goes green. This is the only green on the screen,
   so it reads from across a room without anyone reading the words. */
.turn-pill.is-mine {
  background: var(--accent-teal);
  color: var(--ink-on-dark);
}

.turn-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.turn-timer:empty { display: none; }

.turn-pill.is-mine .turn-timer { background: rgba(255, 255, 255, 0.92); }

/* Last ten seconds: the only moment in the round worth alarming anyone about. */
.turn-timer.urgent { color: var(--accent-red); }

/* ---- Phase clock (#275) -------------------------------------------
   The online game's countdown on the lobby, the ballot and the result
   screen. One component for all three. The time sits in the turn pill's
   own tan, so a clock reads as a clock on every screen of the round. */
.phase-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
}

.phase-clock[hidden] { display: none; }

/* On the result screen it sits straight under the reveal card, so it is on
   the first screenful of a phone. */
.phase-clock.over-clock { margin-top: 16px; }

/* The host's, over Play Again in the sticky bar, where the bar's gap spaces
   it the way the lobby's clock is spaced over Start Game (#292). */
.sticky-actions .phase-clock.over-clock { margin-top: 0; }

/* On the vote screen it sits straight under the title (#279). */
.phase-clock.vote-clock { margin-top: 8px; }

.phase-clock-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #d5c7b4;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.phase-clock.urgent .phase-clock-time { color: var(--accent-red); }

/* The vote clock is green, and red for its last ten seconds (#278). */
.phase-clock.vote-clock .phase-clock-time {
  background: var(--accent-teal);
  color: var(--ink-on-dark);
}
.phase-clock.vote-clock.urgent .phase-clock-time { background: var(--accent-red); }

/* The next round clock on the result screen is red the whole time (#278). */
.phase-clock.over-clock .phase-clock-time,
.phase-clock.over-clock.urgent .phase-clock-time {
  background: var(--accent-red);
  color: var(--ink-on-dark);
}

/* The host's +1 min beside the lobby clock (#287): the time pill's shape in
   Start Game's dark, faded while a tap would take the clock past ten. */
.phase-clock-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--card-active);
  color: var(--ink-on-dark);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.phase-clock-add:disabled { opacity: 0.3; cursor: default; }
.phase-clock-add:focus-visible { outline: 2px solid var(--card-active); outline-offset: 2px; }

/* ---- Turn order strip ---------------------------------------------
   Everyone in play order. Scrolls sideways rather than wrapping, which
   would cost the board or the canvas under it a row of height. Draw
   gives each chip the ink its owner draws with, so a line can be traced
   back to a name; the clue board has no ink and names its author on the
   row itself instead (#242). */
.turn-strip {
  display: flex;
  gap: 6px;
  flex: none;
  align-self: stretch;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.turn-strip::-webkit-scrollbar { display: none; }

.pchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  /* Even, because a chip with no dot in it would sit lopsided. Draw pulls
     the left side back in to make room for its dot. */
  padding: 5px 13px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.pchip.is-active {
  border-color: var(--accent-teal);
  background: #e9f6f1;
}

/* Left the room. Their slot still exists and still shows, it just gets
   skipped, and a faded chip explains why the turn jumped past them. */
.pchip.is-gone { opacity: 0.4; }

/* Mutes the turn clock. Shared with the button itself (shared/clock.js): the
   drawing game's round and the word game's clue board run the same clock, so
   they wear the same control (#254). */
.sound-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--ring-icon-bg);
  color: var(--ink);
  cursor: pointer;
}

.sound-btn[aria-pressed='true'] { color: var(--ink-soft); }

.sound-btn:active { transform: scale(0.94); }

.sound-btn[hidden] { display: none; }

/* On the lobby it sits beside How to play (#288). The back button's own
   bottom margin moves to the pair, so the text and the round button share a
   centre line. */
.lobby-topbar .topbar-right { margin-bottom: 12px; }
.lobby-topbar .topbar-right .back-btn { margin-bottom: 0; }
/* The back buttons are 34px and sit at the top of the row; the round button
   is 38px. Trimmed 2px each way in the layout only, so its centre meets
   theirs without shrinking the button. */
.lobby-topbar .sound-btn { margin: -2px 0; }

/* ============================================================
   THE BALLOT  (#245)
   Shared by the drawing game and the word game's clue board. Two games
   that ask the same question in the same words should ask it on the same
   screen, and the rows below were the drawing game's until the clue board
   needed them.

   What is NOT here is the ink: .pdot, the drawing that travels to the vote,
   and the colour legend all stay in draw/draw.css, because only that game
   ties a name to a colour.
   ============================================================ */

/* Handover card. Borrows the countdown overlay's shell, swapping the giant
   numeral for a line of type. */
.vote-intro-text {
  font-family: 'Literata', Georgia, serif;
  font-size: 32px;
  line-height: 1.25;
  color: var(--ink);
  text-align: center;
  padding: 0 32px;
  animation: pop 0.9s ease-out;
}

.vote-head { text-align: center; margin: 14px 0 22px; }

.vote-title {
  font-family: 'Literata', Georgia, serif;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 8px;
}

/* The instruction, as the first line inside the ballot card, in both games
   (#279). Centred, under the centred title and clock above the card (#290). */
.vote-cue {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  text-align: center;
  padding: 6px 6px 4px;
}

/* Who is in the round on the left, how many have voted on the right, under
   the instruction in both games (#293). Set like the word game's clue board
   meta line, in tabular figures so the count does not twitch as it climbs. */
.vote-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0 8px 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.vote-meta-count { margin-left: auto; text-align: right; }

.vote-list { display: flex; flex-direction: column; gap: 12px; }

/* A ballot line: face, name, the ink they drew in, and whether they have
   voted. Roomy, because on a phone this is the one thing being tapped. */
.vote-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--card);
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.vote-row:active,
.vote-row.is-pressed {
  transform: scale(0.97);
  box-shadow: 0 1px 6px rgba(42, 37, 32, 0.10);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}

.vote-row .player-avatar { width: 32px; height: 32px; flex: none; }

.vote-row .vote-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Your pick. The only bordered row, so it reads at a glance which one is
   yours rather than which ones are merely in the list. */
.vote-row.is-picked {
  border-color: #3f8f3f;
  background: #e8f4e6;
}

/* They have voted. Says nothing about who for, and stays quiet grey so it
   never competes with the pick. */
.vote-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-faint);
  flex: none;
}

.vote-row.is-gone { opacity: 0.55; }

.vote-row.is-gone .vote-name::after {
  content: ' (left)';
  font-weight: 500;
  color: var(--ink-soft);
}

/* ---- The boxed ballot ----------------------------------------------
   The list becomes one card and every name becomes a bordered box inside
   it, rather than a column of small cards each lifting off the page.

   Inside a card a lifted row would be a card on a card, so the shadow
   gives way to an edge. The press state keeps its scale: that is about
   the thumb, not about the elevation.

   Written for the word game's ballot (#245) and worn by the drawing game
   too (#261). What is NOT here is what each game's row actually holds:
   the drawing game carries the ink a player drew in and the word game
   does not, so how the name and the voted tag share the rest of the row
   stays in each game's own stylesheet. */
.vote-list.is-boxed {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 10px;
  gap: 8px;
}

.vote-list.is-boxed .vote-row {
  background: none;
  box-shadow: none;
  border: 1.5px solid var(--border);
  border-radius: 14px;
}

.vote-list.is-boxed .vote-row.is-picked {
  border-color: #3f8f3f;
  border-width: 2px;
  background: #e8f4e6;
}

/* A box at the end of every row, filled in when the name is yours. The two
   ends of the row now say two different things: the left is who they are and
   whether they have finished, the right is only ever about your own ballot. */
.vote-list.is-boxed .tickbox {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid var(--ink-faint);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.vote-list.is-boxed .tickbox svg {
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

/* The same green the picked row wears, so the two read as one state and not
   as two things that happened to agree. */
.vote-list.is-boxed .is-picked .tickbox {
  background: #3f8f3f;
  border-color: #3f8f3f;
}

.vote-list.is-boxed .is-picked .tickbox svg { opacity: 1; transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  .vote-list.is-boxed .tickbox svg { transition: none; }
}

/* ---- Reveal countdown ---------------------------------------------
   Three seconds holding one question and one numeral. Deliberately empty:
   anything else to read here would be read instead of felt. */
.screen-suspense {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.suspense-line {
  font-family: 'Literata', Georgia, serif;
  font-size: 26px;
  color: var(--ink-soft);
}

.suspense-num {
  font-family: 'Literata', Georgia, serif;
  font-size: 130px;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}

/* ---- One online game, as a card (#271) ----------------------------
   On /online and on the word game's waiting screen, drawn by
   shared/game-card.js. Faces and the language on top; whose game, how many
   and when below, with the button on the right. A game in a round is the
   same card with a dashed edge and no fill, so it reads as not joinable now
   without looking switched off. */
.game-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 14px 16px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  text-align: left;
}

.game-card-top { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }

.game-card-faces { display: flex; align-items: center; }
.game-card-faces > * + * { margin-left: -7px; }
.game-card-faces .player-avatar { width: 28px; height: 28px; box-shadow: 0 0 0 2px var(--card); }

.game-card-more {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 28px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--bg-soft);
  box-shadow: 0 0 0 2px var(--card);
  color: var(--ink-warm);
  font-size: 12px;
  font-weight: 600;
}

.game-card-lang {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.game-card-bottom { display: flex; align-items: center; gap: 12px; }
.game-card-text { flex: 1; min-width: 0; }

.game-card-name {
  font-family: 'Literata', Georgia, serif;
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.game-card-meta { margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
/* The countdown ticks every second; even-width digits keep the line still (#299). */
.game-card-starts { font-variant-numeric: tabular-nums; }

.game-card-join {
  flex: none;
  width: auto;
  padding: 10px 16px;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: none;
}

.game-card.is-playing { background: transparent; box-shadow: none; border: 1.5px dashed var(--ink-faint); }
.game-card.is-playing .game-card-name { color: var(--ink-soft); }
.game-card.is-playing .game-card-faces > * { opacity: 0.75; box-shadow: 0 0 0 2px var(--bg); }
.game-card-next { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }

/* ---- Waiting for the next round (#271) -----------------------------
   The word game, for somebody who picked an online game in the middle of a
   round. Three dots while it waits; if the game closes instead, the same
   screen says so and offers the list. */
.screen-wait { text-align: center; }
.screen-wait [hidden] { display: none; }

.wait-body { flex: 1; display: flex; flex-direction: column; padding-top: 96px; }
.wait-state { display: flex; flex-direction: column; align-items: center; }

.wait-dots { display: flex; gap: 8px; height: 12px; }
.wait-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-teal);
  animation: waitBlink 1.2s ease-in-out infinite;
}
.wait-dots i:nth-child(2) { animation-delay: 0.2s; }
.wait-dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes waitBlink {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .wait-dots i { animation: none; opacity: 0.7; }
}

.wait-ended-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--ink-warm);
}

.wait-title {
  margin-top: 22px;
  font-family: 'Literata', Georgia, serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
  color: var(--ink-warm);
  text-wrap: balance;
}

.wait-text { max-width: 300px; margin: 8px auto 0; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.wait-card { width: 100%; margin-top: 28px; }
.wait-as { margin-top: 14px; font-size: 14px; color: var(--ink-soft); }
.wait-as b { font-weight: 600; color: var(--ink); }
.wait-actions { display: flex; flex-direction: column; }
.wait-actions .btn-primary { text-decoration: none; }

/* ---- Final screen sections -----------------------------------------
   The reveal, then the counts, then the ballot: how it ended, then by how
   much, then exactly who did it. */
.over-section { margin-top: 28px; }

.over-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

/* ---- Ballot list ---------------------------------------------------
   Every vote, in the open: who picked whom. One row per player, in play
   order, so the same list appears on every screen in the room.

   ONE CARD, NOT ONE PER ROW (#260). Each row used to carry its own edge and
   its own shadow, which gave the eye six objects to start and stop on for
   what is a single list read top to bottom, and left the tally above it
   looking less finished than the detail underneath. Both lists are cards
   now, and the rows inside are parted by a hairline.

   Worn by the word game and the drawing game alike. They report the same
   ballot on the same screen and should not be told apart by it. */
.ballot-list {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 4px 16px;
  box-shadow: var(--shadow);
}

.ballot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.ballot-row + .ballot-row { border-top: 1px solid var(--line); }

.ballot-row .player-avatar { width: 32px; height: 32px; flex: none; }

/* The voter's name + ink take the slack so every arrow lines up down the list;
   the dot rides right after the name rather than drifting to the arrow. */
.ballot-row .ballot-voter {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ballot-row .ballot-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ballot-row .ballot-arrow { color: var(--ink-faint); flex: none; }

.ballot-row .ballot-target {
  flex: none;
  max-width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A ballot holds one pick per impostor (#250), so the right-hand side is a
   column: one accusation per line, right-aligned, with the arrow pointing at
   the first of them. Letting them wrap along the row instead would drop the
   second name underneath the voter's own, which reads as a self-vote. */
.ballot-row .ballot-picks {
  flex: none;
  min-width: 0;
  max-width: 52%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.ballot-row .ballot-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

/* The width cap moved up to .ballot-picks, so the name inside a pick can take
   what is left of it and truncate there rather than against a percentage of
   its own shrink-wrapped box. */
.ballot-row .ballot-pick .ballot-target { flex: 0 1 auto; max-width: none; }

/* Only possible when the host reveals early, so it should read as an absence
   rather than as a choice. */
.ballot-row.is-blank { opacity: 0.6; }

.ballot-row .ballot-target.is-none {
  font-weight: 500;
  font-style: italic;
  color: var(--ink-soft);
}

/* ---- Tally --------------------------------------------------------
   The count is the more important of the two lists and used to be the only
   one with nothing under it. Same card as the ballot below (#260). */
.tally {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 4px 16px;
  box-shadow: var(--shadow);
}

.tally-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--ink);
}

.tally-row + .tally-row { border-top: 1px solid var(--line); }

.tally-row .tally-name { flex: 1; }

.tally-row .tally-count {
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  flex: none;
}

.tally-row.is-imposter .tally-name { font-weight: 700; color: var(--accent-red); }

.tally-empty { font-size: 14px; color: var(--ink-soft); text-align: center; padding: 10px 0; }

/* The tally names a face rather than a colour for the same reason. */
.tally-row .player-avatar { width: 24px; height: 24px; flex: none; font-size: 10px; }
