/* ---- Hero character ------------------------------------------------
   Juggles three cards, then holds them. One cycle is --wj-cycle, default 12s,
   the same as the dance and draw heroes: 4.19s of movement and 7.81s perfectly
   still.

   The run itself is a real three-card cascade. A throw every beat, hands
   alternating, 1.85 beats in the air and 1.15 in a hand. Six throws and six
   catches, which is what makes it close on itself: each card goes out twice
   and comes back twice, so every one lands in the hand it started from.

   The opening and the ending are not special-cased choreography. They fall out
   of starting and finishing with two cards in one hand: the left hand throws
   twice before its first catch, because it began holding two, and at the other
   end it catches twice without throwing, because the run is over. No card is
   ever thrown just to make a pose work.

   Three things here are load-bearing and easy to undo by accident.

   1. Every animation drives a wrapper <g> that has no transform of its own.
      Put these on the drawn elements and each card's own rotate() is silently
      discarded, which pulls the artwork apart. Same rule the dance character
      needed to keep its headphones on.

   2. The resting pose is the three transforms on #wj-card-* below, and the
      keyframes begin and end on exactly those values. That is what lets
      /Word.svg stay exactly as drawn - the file still has the red card in the
      air - and it means there is nothing to fill forwards: with no JS, before
      anything animates, or under reduced motion, the character just rests.

   3. The viewBox is cropped to the resting pose, not to the juggle, and the
      svg is overflow:visible. The layout box is therefore 150x150 rather than
      150x194, and the thrown cards spill 36px into the margin above instead of
      reserving room for themselves all the time. At the top of a throw the
      nearest fixed element, the back link, is still 60px clear horizontally.

   Two gates, not one, matching dance and draw:
     .wj-run    loops forever. Applied on load by app.js.
     .wj-once   plays a single cycle: one run, then the still stretch, then
                stops. Used when the visitor has asked for reduced motion, so
                nothing moves on its own but a deliberate tap still plays. */

.hero-juggler {
    display: block;
    margin: 0 auto 8px;
    width: 86px;
    height: auto;
    max-width: 42%;
    overflow: visible;
    /* No pointer cursor on purpose. Tapping is a small reward, not
       navigation, and a pointer cursor would promise a link that isn't
       there. */
  }

.hero-juggler #wj-shadow,
  .hero-juggler #wj-body,
  .hero-juggler #wj-eyes,
  .hero-juggler #wj-arm-l,
  .hero-juggler #wj-arm-r,
  .hero-juggler #wj-card-l,
  .hero-juggler #wj-card-a,
  .hero-juggler #wj-card-r { transform-box: fill-box; }

/* Arms pivot at the shoulder, so the origin sits at the edge nearest the
     body. The body pivots where the legs meet it, so the feet stay planted. */

.hero-juggler #wj-body   { transform-origin: 50% 100%; }
.hero-juggler #wj-shadow { transform-origin: 50% 50%; }
.hero-juggler #wj-eyes   { transform-origin: 50% 50%; }
.hero-juggler #wj-arm-l  { transform-origin: 100% 4%; }
.hero-juggler #wj-arm-r  { transform-origin: 0% 4%; }
.hero-juggler #wj-card-l,
  .hero-juggler #wj-card-a,
  .hero-juggler #wj-card-r { transform-origin: 50% 50%; }

/* The resting pose. Also the first and last frame of the animation. */
.hero-juggler #wj-card-l { transform: translate(6.85px, -7.22px) rotate(3.97deg); }
.hero-juggler #wj-card-a { transform: translate(-92.17px, 149.84px) rotate(-6.98deg); }
.hero-juggler #wj-card-r { transform: translate(-1.54px, 1.1px) rotate(-2.1deg); }

/* Linear on the cards, because the parabolas are already sampled into the
     keyframes and an easing curve on top would bend them back out of shape.
     The arms and body are plain angles, so they take the easing. */

.hero-juggler.wj-run #wj-card-l { animation: wjCardL var(--wj-cycle, 12s) linear infinite; }
.hero-juggler.wj-run #wj-card-a { animation: wjCardA var(--wj-cycle, 12s) linear infinite; }
.hero-juggler.wj-run #wj-card-r { animation: wjCardR var(--wj-cycle, 12s) linear infinite; }
.hero-juggler.wj-run #wj-arm-l  { animation: wjArmL var(--wj-cycle, 12s) ease-in-out infinite; }
.hero-juggler.wj-run #wj-arm-r  { animation: wjArmR var(--wj-cycle, 12s) ease-in-out infinite; }
.hero-juggler.wj-run #wj-body   { animation: wjBody var(--wj-cycle, 12s) ease-in-out infinite; }
.hero-juggler.wj-run #wj-shadow { animation: wjShadow var(--wj-cycle, 12s) ease-in-out infinite; }

.hero-juggler.wj-once #wj-card-l { animation: wjCardL var(--wj-cycle, 12s) linear 1; }
.hero-juggler.wj-once #wj-card-a { animation: wjCardA var(--wj-cycle, 12s) linear 1; }
.hero-juggler.wj-once #wj-card-r { animation: wjCardR var(--wj-cycle, 12s) linear 1; }
.hero-juggler.wj-once #wj-arm-l  { animation: wjArmL var(--wj-cycle, 12s) ease-in-out 1; }
.hero-juggler.wj-once #wj-arm-r  { animation: wjArmR var(--wj-cycle, 12s) ease-in-out 1; }
.hero-juggler.wj-once #wj-body   { animation: wjBody var(--wj-cycle, 12s) ease-in-out 1; }
.hero-juggler.wj-once #wj-shadow { animation: wjShadow var(--wj-cycle, 12s) ease-in-out 1; }

/* Blinking runs on its own 11s clock rather than the juggle's 12s, so the two
     drift and the character never blinks on the same beat twice running. Two
     per cycle, 4.7s apart and then 6.3s, deliberately uneven: evenly spaced
     blinks read as a metronome rather than a living thing. Same blink the
     dance and draw lobby characters use. */

.hero-juggler.wj-run #wj-eyes,
  .hero-juggler.wj-once #wj-eyes { animation: wjBlink 11s linear infinite; }

@keyframes wjBlink {
  0%, 19%  { transform: scaleY(1); }
  19.9%    { transform: scaleY(0.08); }
  20.9%    { transform: scaleY(1); }
  61.8%    { transform: scaleY(1); }
  62.6%    { transform: scaleY(0.08); }
  63.6%    { transform: scaleY(1); }
  100%     { transform: scaleY(1); }
}

@keyframes wjCardL {
  0% { transform: translate(6.85px, -7.22px) rotate(3.97deg); }
  0.83% { transform: translate(5.07px, -5.35px) rotate(2.94deg); }
  1.67% { transform: translate(1.78px, -1.87px) rotate(1.03deg); }
  2.5% { transform: none; }
  2.81% { transform: none; }
  3.78% { transform: translate(28.71px, -56.72px) rotate(5.78deg); }
  4.74% { transform: translate(55.09px, -97.13px) rotate(11deg); }
  5.7% { transform: translate(79.14px, -121.25px) rotate(15.2deg); }
  6.67% { transform: translate(100.85px, -129.06px) rotate(18.05deg); }
  7.63% { transform: translate(120.23px, -120.57px) rotate(19.46deg); }
  8.59% { transform: translate(137.28px, -95.79px) rotate(19.53deg); }
  9.56% { transform: translate(152px, -54.71px) rotate(18.58deg); }
  10.52% { transform: translate(164.39px, 2.68px) rotate(17.07deg); }
  12.12% { transform: translate(159.58px, 1.93px) rotate(18.6deg); }
  13.72% { transform: translate(150.66px, 0.53px) rotate(21.44deg); }
  15.31% { transform: translate(145.85px, -0.22px) rotate(22.97deg); }
  16.28% { transform: translate(129.36px, -56.92px) rotate(15.7deg); }
  17.24% { transform: translate(111.73px, -97.29px) rotate(8.99deg); }
  18.2% { transform: translate(92.95px, -121.34px) rotate(3.3deg); }
  19.17% { transform: translate(73.02px, -129.06px) rotate(-1.05deg); }
  20.13% { transform: translate(51.95px, -120.46px) rotate(-3.95deg); }
  21.09% { transform: translate(29.73px, -95.54px) rotate(-5.51deg); }
  22.06% { transform: translate(6.36px, -54.29px) rotate(-6.05deg); }
  23.02% { transform: translate(-18.15px, 3.28px) rotate(-6.03deg); }
  24.62% { transform: translate(-13.44px, 2.43px) rotate(-4.47deg); }
  26.22% { transform: translate(-4.71px, 0.85px) rotate(-1.56deg); }
  27.81% { transform: none; }
  31.35% { transform: none; }
  32.53% { transform: translate(1.78px, -1.87px) rotate(1.03deg); }
  33.72% { transform: translate(5.07px, -5.35px) rotate(2.94deg); }
  34.9% { transform: translate(6.85px, -7.22px) rotate(3.97deg); }
  100% { transform: translate(6.85px, -7.22px) rotate(3.97deg); }
}

@keyframes wjCardA {
  0% { transform: translate(-92.17px, 149.84px) rotate(-6.98deg); }
  2.81% { transform: translate(-92.17px, 149.84px) rotate(-6.98deg); }
  5.59% { transform: translate(-87.21px, 144.45px) rotate(-4.9deg); }
  8.37% { transform: translate(-77.98px, 134.45px) rotate(-1.03deg); }
  11.15% { transform: translate(-73.02px, 129.06px) rotate(1.05deg); }
  12.11% { transform: translate(-44.31px, 72.34px) rotate(6.83deg); }
  13.07% { transform: translate(-17.93px, 31.93px) rotate(12.05deg); }
  14.04% { transform: translate(6.12px, 7.81px) rotate(16.25deg); }
  15% { transform: translate(27.83px, 0px) rotate(19.11deg); }
  15.96% { transform: translate(47.21px, 8.49px) rotate(20.51deg); }
  16.93% { transform: translate(64.26px, 33.27px) rotate(20.58deg); }
  17.89% { transform: translate(78.98px, 74.35px) rotate(19.63deg); }
  18.85% { transform: translate(91.37px, 131.74px) rotate(18.12deg); }
  20.45% { transform: translate(86.56px, 130.99px) rotate(19.65deg); }
  22.05% { transform: translate(77.64px, 129.59px) rotate(22.49deg); }
  23.65% { transform: translate(72.83px, 128.84px) rotate(24.02deg); }
  24.61% { transform: translate(56.34px, 72.14px) rotate(16.75deg); }
  25.57% { transform: translate(38.71px, 31.77px) rotate(10.04deg); }
  26.54% { transform: translate(19.93px, 7.72px) rotate(4.35deg); }
  27.5% { transform: none; }
  28.46% { transform: translate(-21.07px, 8.6px) rotate(-2.9deg); }
  29.43% { transform: translate(-43.29px, 33.52px) rotate(-4.46deg); }
  30.39% { transform: translate(-66.66px, 74.77px) rotate(-5deg); }
  31.35% { transform: translate(-91.17px, 132.34px) rotate(-4.98deg); }
  32.53% { transform: translate(-91.43px, 136.88px) rotate(-5.5deg); }
  33.72% { transform: translate(-91.91px, 145.3px) rotate(-6.46deg); }
  34.9% { transform: translate(-92.17px, 149.84px) rotate(-6.98deg); }
  100% { transform: translate(-92.17px, 149.84px) rotate(-6.98deg); }
}

@keyframes wjCardR {
  0% { transform: translate(-1.54px, 1.1px) rotate(-2.1deg); }
  2.33% { transform: translate(-5.95px, 0.06px) rotate(-0.03deg); }
  4.65% { transform: translate(-14.13px, -1.86px) rotate(3.83deg); }
  6.98% { transform: translate(-18.54px, -2.9px) rotate(5.9deg); }
  7.94% { transform: translate(-35.03px, -59.6px) rotate(-1.37deg); }
  8.91% { transform: translate(-52.66px, -99.97px) rotate(-8.08deg); }
  9.87% { transform: translate(-71.44px, -124.02px) rotate(-13.77deg); }
  10.83% { transform: translate(-91.37px, -131.74px) rotate(-18.12deg); }
  11.8% { transform: translate(-112.44px, -123.14px) rotate(-21.02deg); }
  12.76% { transform: translate(-134.66px, -98.22px) rotate(-22.58deg); }
  13.72% { transform: translate(-158.03px, -56.97px) rotate(-23.12deg); }
  14.69% { transform: translate(-182.54px, 0.6px) rotate(-23.1deg); }
  16.28% { transform: translate(-177.83px, -0.25px) rotate(-21.54deg); }
  17.88% { transform: translate(-169.1px, -1.83px) rotate(-18.63deg); }
  19.48% { transform: translate(-164.39px, -2.68px) rotate(-17.07deg); }
  20.44% { transform: translate(-135.68px, -59.4px) rotate(-11.29deg); }
  21.41% { transform: translate(-109.3px, -99.81px) rotate(-6.07deg); }
  22.37% { transform: translate(-85.25px, -123.93px) rotate(-1.87deg); }
  23.33% { transform: translate(-63.54px, -131.74px) rotate(0.99deg); }
  24.3% { transform: translate(-44.16px, -123.25px) rotate(2.39deg); }
  25.26% { transform: translate(-27.11px, -98.47px) rotate(2.46deg); }
  26.22% { transform: translate(-12.39px, -57.39px) rotate(1.51deg); }
  27.19% { transform: none; }
  29.76% { transform: translate(-0.4px, 0.29px) rotate(-0.54deg); }
  32.33% { transform: translate(-1.14px, 0.81px) rotate(-1.56deg); }
  34.9% { transform: translate(-1.54px, 1.1px) rotate(-2.1deg); }
  100% { transform: translate(-1.54px, 1.1px) rotate(-2.1deg); }
}

@keyframes wjArmL {
  0% { transform: rotate(0deg); }
  1.56% { transform: rotate(3deg); }
  2.81% { transform: rotate(8deg); }
  4.27% { transform: rotate(0deg); }
  9.9% { transform: rotate(3deg); }
  11.15% { transform: rotate(8deg); }
  12.6% { transform: rotate(0deg); }
  13.65% { transform: rotate(-2deg); }
  14.69% { transform: rotate(-5deg); }
  16.35% { transform: rotate(-1deg); }
  17.81% { transform: rotate(0deg); }
  18.23% { transform: rotate(3deg); }
  19.48% { transform: rotate(8deg); }
  20.94% { transform: rotate(0deg); }
  21.98% { transform: rotate(-2deg); }
  23.02% { transform: rotate(-5deg); }
  24.69% { transform: rotate(-1deg); }
  26.15% { transform: rotate(0deg); }
  30.31% { transform: rotate(-2deg); }
  31.35% { transform: rotate(-5deg); }
  33.02% { transform: rotate(-1deg); }
  34.48% { transform: rotate(0deg); }
  34.9% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

@keyframes wjArmR {
  0% { transform: rotate(0deg); }
  5.73% { transform: rotate(-3deg); }
  6.98% { transform: rotate(-8deg); }
  8.44% { transform: rotate(0deg); }
  9.48% { transform: rotate(2deg); }
  10.52% { transform: rotate(5deg); }
  12.19% { transform: rotate(1deg); }
  13.65% { transform: rotate(0deg); }
  14.06% { transform: rotate(-3deg); }
  15.31% { transform: rotate(-8deg); }
  16.77% { transform: rotate(0deg); }
  17.81% { transform: rotate(2deg); }
  18.85% { transform: rotate(5deg); }
  20.52% { transform: rotate(1deg); }
  21.98% { transform: rotate(0deg); }
  22.4% { transform: rotate(-3deg); }
  23.65% { transform: rotate(-8deg); }
  25.1% { transform: rotate(0deg); }
  26.15% { transform: rotate(2deg); }
  27.19% { transform: rotate(5deg); }
  28.85% { transform: rotate(1deg); }
  30.31% { transform: rotate(0deg); }
  34.9% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

/* The body barely moves: a slow lean under the throws, well under a degree of
     shoulder travel. Any more and the cards stop reading as the thing that is
     actually moving. */

@keyframes wjBody {
  0% { transform: rotate(0deg); }
  6.67% { transform: rotate(-0.7deg); }
  12.92% { transform: rotate(0.7deg); }
  19.17% { transform: rotate(-0.7deg); }
  25.42% { transform: rotate(0.7deg); }
  31.67% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

@keyframes wjShadow {
  0% { transform: translateX(0px); }
  6.67% { transform: translateX(-1.96px); }
  12.92% { transform: translateX(1.96px); }
  19.17% { transform: translateX(-1.96px); }
  25.42% { transform: translateX(1.96px); }
  31.67% { transform: translateX(0px); }
  100% { transform: translateX(0px); }
}

/* Reduced motion kills .wj-run outright, so nothing moves on its own. It
     deliberately does NOT kill .wj-once: that class is only ever applied by a
     tap, and a tap is the visitor asking for the animation. The resting pose
     above is a plain transform, not an animation, so the character still holds
     its cards correctly with everything here switched off. */

@media (prefers-reduced-motion: reduce) {
  .hero-juggler.wj-run #wj-card-l,
  .hero-juggler.wj-run #wj-card-a,
  .hero-juggler.wj-run #wj-card-r,
  .hero-juggler.wj-run #wj-arm-l,
  .hero-juggler.wj-run #wj-arm-r,
  .hero-juggler.wj-run #wj-body,
  .hero-juggler.wj-run #wj-shadow,
  .hero-juggler.wj-run #wj-eyes { animation: none; }
}

/* The card itself, dark for the crew and red for the impostor, is the role
   card in shared/base.css (#324). */

/* Short phones. 104px of vertical padding is generous air on a tall screen,
   but the card now shares the screen with a status line, a two-line
   instruction and, for the host, a button and its caption. On a 568px
   viewport that pushed Reveal Impostor under the fold, which is the one
   control on this screen that has to be reachable without scrolling. The
   card keeps its proportions, it just breathes less (#144).

   One class, so it reaches neither the Pass the Phone card, which is
   .flip-face.flip-back and sets its own padding at two classes, nor the flat
   card on the clue board, whose .is-flat does the same. */
@media (max-height: 700px) {
  .word-card { padding: 72px 28px; }
}

/* The Pass the Phone card (.flip-*, .pass-*) is shared with the draw game
   and lives in shared/base.css. Both games deal the same card. */

.reveal-word {
    font-family: 'Literata', Georgia, serif;
    font-size: 40px;
    font-weight: 400;
    color: var(--ink);
    line-height: 1.1;
    margin-top: 10px;
    text-align: center;
  }

/* Reveal */

.reveal-extras { margin-top: 28px; text-align: center; }

.track-section { margin-top: 22px; text-align: center; }

/* ============================================================
   CLUE BOARD  (#244)
   ------------------------------------------------------------
   A round played by people who are not in the same place. The top bar,
   the turn pill and the chips are shared/base.css, the same three the
   drawing game uses; everything below them is this screen's. The strip
   is shared but its home is not: here it rides inside the board panel
   rather than standing on its own above it (#255).

   The screen itself never scrolls. The card and the composer are fixed
   height and the panel absorbs whatever is left, so the composer stays
   put while clues arrive under it.
   ============================================================ */

.screen-clues {
    gap: 12px;
    min-height: 0;
  }

/* The role card laid flat (.is-flat, shared/base.css), which dance deals
   too (#324). Its padding, corners and badge are the shared card's; what
   stays here is its place in this screen's column and the size of what it
   says. */
.clue-card { flex: none; }

.clue-card .role { margin-bottom: 4px; }

.clue-card .clue-word { font-size: 24px; }

/* 16px below the secret word, 8px between the field and the board (#256).
   The screen's own gap is 12px and the top bar keeps it, so the extra 4
   is taken here rather than by widening every gap on the screen. */
.clue-stage {
    flex: 1;
    min-height: 0;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

/* THE FIELD (#254)
   Not part of the board. It stands between the turn strip and the panel,
   edged exactly like the panel so it reads as a sibling rather than as
   something laid on top, and it is only on screen at all while the turn
   is yours. On everyone else's the board gets the whole stage. */

/* A 0fr row has no height and still holds its child, so animating it to
   1fr eases the board down instead of knocking it down. That matters:
   the board is what a player is reading at the moment this opens. */
.clue-dockwrap {
    flex: none;
    display: grid;
    grid-template-rows: 1fr;
    overflow: hidden;
  }

.clue-dockwrap[hidden] { display: none; }

.clue-dockwrap.is-arriving { animation: clueUnfold 0.28s cubic-bezier(0.3, 0, 0.2, 1); }

/* The box itself comes in over the second half of the unfold, so it is
   the space that opens first and the field that follows. */
.clue-dockwrap.is-arriving .clue-dock { animation: clueArrive 0.28s ease-out; }

@keyframes clueUnfold {
  from { grid-template-rows: 0fr; }
  to { grid-template-rows: 1fr; }
}

@keyframes clueArrive {
  0%, 45% { opacity: 0; }
  100% { opacity: 1; }
}

.clue-dock { min-height: 0; }

/* Wears the shared .card class, so it is shaped and lifted exactly like
   the board 8px below it and follows that rule if it ever changes. Only
   the padding is its own: .card's 20px would swallow the send button
   (#256). */
.clue-composer {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 7px 7px 14px;
  }

/* The countdown is a drawn stroke, not a border. A border cannot be
   emptied; a dashed stroke can, and evenly round the corners. The track
   underneath is the panel's own hairline, so as the countdown drains it
   hands the edge back rather than leaving a gap. */
.clue-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
  }

.clue-ring rect { fill: none; stroke-linecap: round; }

.clue-ring-track { stroke: var(--border); stroke-width: 1.5; }

/* Driven by the room clock rather than by a 30s CSS loop: the offset is
   written on every 250ms tick and this transition carries it between
   them. A client that picked the turn up late still shows the truth. */
.clue-ring-live {
    stroke: var(--accent-teal);
    stroke-width: 2;
    transition: stroke-dashoffset 250ms linear, stroke 200ms linear;
  }

/* Same last ten seconds the turn pill goes red for. */
.clue-ring-live.is-urgent { stroke: var(--accent-red); }

/* No border of its own. The ring around the box is the edge. */
.clue-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    color: var(--ink);
    padding: 10px 2px 10px 0;
    font-family: inherit;
    font-size: 16px;   /* 16px or iOS zooms the whole page on focus */
  }

.clue-input:focus { outline: none; }

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

/* Right up against the send button, which is where a thumb is already
   looking. Tabular so the box does not twitch as the number grows. */
.clue-count {
    flex: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
  }

/* Only the secret word error lands here now, and only on a submit that was
   refused, so it takes no height at all the rest of the time. */
.clue-note {
    padding: 4px 16px 0;
    font-size: 12px;
    line-height: 15px;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
  }

.clue-note:empty { display: none; }

.clue-note.is-error { color: var(--accent-red); }

/* The board and nothing else. One frame round the clues, so a clue
   arriving reads as a line added to a sheet the room is filling in
   together rather than as another card landing on a pile. */
.clue-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    /* Wears the shared .card class for its shape and depth, minus the
       padding: the chip strip and the clue rows set their own, and a third
       one round the outside would wrap a second margin over both (#256). */
    padding: 0;
    overflow: hidden;
  }

/* THE HEADER (#255)
   The play order sits on top of the board, inside the same panel, divided
   from it by a hairline. It scrolls sideways as it does everywhere else;
   the panel's own overflow clips it, so it never widens the card. */
.clue-panel > .turn-strip {
    padding: 9px 11px;
    border-bottom: 1.5px solid var(--line);
    align-items: center;
  }

/* The writer is pulled to the front so the live chip is always in the same
   place. Done with order rather than by moving the node, so the markup, and
   with it the reading order, stays in play order. */
.clue-panel .pchip.is-active { order: -1; }

/* THE META LINE (#259)
   A caption, not a control: how many are in the round on the left, how far
   through it the room is on the right. It sits under the strip's hairline
   and carries none of its own, because the head of the panel already has
   one line across it and a second one 30px below reads as a table. */
.board-meta {
    flex: none;
    display: flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--ink-soft);
    /* The head count barely moves and the round counter does, so both are
       set in tabular figures: without them the line twitches sideways every
       time a digit changes width. */
    font-variant-numeric: tabular-nums;
  }

/* The one number here that changes during a round, so it is the one that
   gets a ground. Soft rather than teal: teal is the live turn, and this is
   not a turn. */
.board-round {
    margin-left: auto;
    background: var(--bg-soft);
    color: var(--ink);
    border-radius: 999px;
    padding: 2px 9px;
  }

/* Teal is reserved for your own turn. Somebody else's gets the warm
   secondary surface, so a glance at the colour alone says which it is and
   the two are never mistaken for each other. */
.clue-panel .pchip.is-active.is-them {
    border-color: var(--ink-faint);
    background: var(--bg-soft);
  }

/* Three dots on the live chip. They do NOT mean a key was pressed: no
   keystroke goes on the wire, and putting one there would leak a half
   written clue to the room. They mean the turn is live, which is true from
   the moment it starts. */
.clue-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
  }

.clue-dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.28;
    animation: clueDot 1.25s infinite ease-in-out;
  }

.clue-dots i:nth-child(2) { animation-delay: 0.16s; }
.clue-dots i:nth-child(3) { animation-delay: 0.32s; }

@keyframes clueDot {
  0%, 62%, 100% { opacity: 0.28; transform: translateY(0); }
  31% { opacity: 1; transform: translateY(-3px); }
}

.clue-board {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

/* ROOM FOR THE PILL (#246)
   The chat pill floats in the bottom right corner rather than taking a line
   of layout, which is the trade that keeps the board its full height.

   The clue board needs nothing here, which was worth measuring rather than
   assuming: #app already holds 48px clear at the foot of every screen, and
   the pill is 45px of that, so it sits below the board rather than on it.
   The two screens that DO need room are the ones whose action bar cancels
   that 48px, which puts the pill back over the content. */

/* Outside the card, not inside it. The lobby's action bar is pushed down by
   an auto margin, so on a short lobby this is swallowed whole and nothing
   looks padded; on one long enough to scroll it is the clearance. */
body.chat-pill-on:not(.chat-side) #lobby-players-card { margin-bottom: 56px; }

/* Chat stays on every screen of a room round (#286), including the full-screen
   countdowns, which sit at 100 over the pill's 95. Lifted just above them and
   still under the chat sheet (110) and every popup. */
body.chat-pill-on .chat-pill { z-index: 101; }


.clue-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }

/* A clue landing while you read it is the main sign the game is moving,
   and the board is otherwise very still. The row eases its own height open
   in script, because no stylesheet can animate to a height it has not been
   told; this only fades the contents in behind that (#257). */
.clue-row.is-new > * { animation: clueIn 0.26s ease-out; }

/* Only while the height is running, so a chip is never left clipped. */
.clue-row.is-opening { overflow: hidden; }

/* A clue landing in a row that is ALREADY standing. The row moves to the
   top as it is, and the chip grows out of nothing rather than the row
   opening again underneath it (#258, #278). */
.clue-text.is-new { animation: chipIn 0.24s cubic-bezier(0.3, 0, 0.2, 1); }

@keyframes chipIn {
  from { opacity: 0; transform: scale(0.82); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes clueIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* The clue is written into its chip rather than dropped into it. The caret
   is the whole of the effect that lives in CSS: the letters are put in by
   script, one every 32ms. */
.clue-caret {
    display: inline-block;
    width: 2px;
    height: 16px;
    margin-left: 1px;
    vertical-align: -2px;
    background: var(--accent-teal);
    animation: clueCaret 0.6s steps(1, end) infinite;
  }

@keyframes clueCaret {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.clue-row .player-avatar { width: 36px; height: 36px; font-size: 13px; }

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

.clue-who {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 5px;
  }

.clue-who .you-pill { padding: 3px 7px; margin-left: 6px; }

/* Every clue this player has given, oldest first, left to right. They wrap
   onto a second line rather than scrolling sideways: a clue nobody can see
   is a clue nobody weighs, and weighing them is what the vote is (#258). */
.clue-words {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

/* The clue itself, in the same dark as the card above it, so the screen
   carries one dark rather than two. A long one wraps inside its own chip
   instead of stretching the row. */
.clue-text {
    max-width: 100%;
    background: var(--card-active);
    color: var(--ink-on-dark);
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: break-word;
  }

/* Said nothing before the clock ran out. The chip keeps its shape and
   loses its fill rather than disappearing: at vote time the room needs to
   see where somebody gave them nothing to go on, and with rounds that is a
   hole in the middle of a sequence rather than a whole empty row (#258). */
.clue-text.is-skipped {
    background: none;
    border: 1.5px solid var(--border);
    color: var(--ink-faint);
    font-size: 16px;
    font-weight: 500;
    font-style: italic;
    padding: 6px 11px;
  }

.clue-empty {
    flex: none;
    color: var(--ink-faint);
    padding: 22px 0;
  }

@media (prefers-reduced-motion: reduce) {
  .clue-row.is-new > * { animation: none; }
  .clue-text.is-new { animation: none; }
  .clue-caret { animation: none; }
  .clue-dots i { animation: none; opacity: 0.55; }
  .clue-dockwrap.is-arriving,
  .clue-dockwrap.is-arriving .clue-dock { animation: none; }
  .clue-ring-live { transition: none; }
}

/* ============================================================
   THE VOTE SCREEN  (#245)
   Names first, board second. Neither card scrolls inside itself: this is
   the one screen in the game that scrolls as a page, because a room of
   eight has eight names and eight clues and no amount of nesting makes
   that fit. The button rides the bottom on .sticky-actions instead.

   The rows themselves are shared/base.css, the drawing game's. What is
   here is what the card around them changes: inside a card a lifted row
   would be a card on a card, so the shadow gives way to an edge.
   ============================================================ */

.screen-vote .vote-head { margin-bottom: 24px; }

/* The card, the boxes, the picked state and the tick box are all in
   shared/base.css now: the drawing game's ballot wears them too (#261).
   What is left here is the space under the card, and the two things that
   only hold on a ballot with no ink dot in the row. */
.vote-list.is-boxed { margin-bottom: 28px; }

/* No ink dot on this ballot, so the name takes the slack the dot's auto
   margin takes in the drawing game, and a long one wraps inside its own row
   rather than ending in an ellipsis: on the one screen where a name is the
   whole of the decision, half a name is not enough to decide on. */
.vote-list.is-boxed .vote-name {
    flex: 1;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: break-word;
    line-height: 1.2;
  }

/* Beside the name rather than at the far end of the row. Quieter than the
   drawing game's version too: there it is the only thing in the right-hand
   column, here it sits next to a name and must not compete with it. */
.vote-list.is-boxed .vote-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--bg-soft);
    color: var(--ink-soft);
    font-size: 11px;
    letter-spacing: 0.4px;
    vertical-align: 1px;
  }

.vote-clues-label { margin-bottom: 12px; }

/* The board, as evidence. It stands at its full height: a scroller inside a
   scroller is two thumbs' worth of guessing about which one will move. */
.vote-evidence { flex: none; padding: 18px 20px; }

/* Last thing on the ballot before the button, so the pill sits on it once
   the screen is scrolled to the end. See the note by .clue-board. */
body.chat-pill-on:not(.chat-side) .vote-evidence { padding-bottom: 72px; }

/* The same rows, standing still: this board has no room left to make and
   nothing left to type. */
.vote-evidence .clue-board {
    flex: none;
    overflow: visible;
    padding: 0;
    gap: 12px;
  }
