/* ============================================================
   Medieval Solutions — the table (every phone in a game: host and guests)
   Layout: top row (room · round · leave) → sticky head (banner + score
   bar) → the stage (changes per phase) → the dock pinned to the bottom
   (hand · action · sound). Components come from components.css.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-ui); }
body.at-table { padding-bottom: 104px; overflow-x: hidden; }

/* ── Top row ── */
.tbl-top {
    position: sticky; top: 0; z-index: 120;
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; background: var(--paper); border-bottom: 2px solid var(--tan);
}
.tbl-top .room {
    font-weight: bold; letter-spacing: 3px; font-size: .95rem; color: var(--red);
    background: #fff; border: 2px solid var(--tan); border-radius: 8px; padding: 2px 8px;
}
.tbl-top .room[role=button] { cursor: pointer; }
.tbl-top .room-pin { letter-spacing: 1px; color: var(--ink2); }
.tbl-top .round { flex: 1; text-align: center; font-family: var(--font-pixel); color: var(--red); font-size: 1.15rem; }
.tbl-top .round small { display: block; font-family: var(--font-ui); color: var(--ink3); font-size: .72rem; }
.tbl-top .leave {
    width: 32px; height: 32px; margin: 0; padding: 0; border-radius: 50%;
    background: #fff; color: var(--ink2); border: 2px solid var(--tan); font: 1rem var(--font-ui); cursor: pointer;
}
/* The language menu: a small seal with this phone's card language, beside × */
.tbl-top .lang-btn {
    min-width: 32px; height: 32px; margin: 0; padding: 0 6px; border-radius: 16px;
    background: #fff; color: var(--red); border: 2px solid var(--tan); font: bold .72rem var(--font-ui); letter-spacing: 1px; cursor: pointer;
}
.tbl-top .lang-btn.on { border-color: var(--red); }
.lang-sheet {
    position: fixed; top: 54px; right: 12px; z-index: 130; width: min(320px, calc(100vw - 24px));
    padding: 12px 14px 14px; background: var(--parch); border: 2px solid var(--red); border-radius: 12px;
    box-shadow: 0 6px 18px rgba(30, 14, 6, .25); text-align: left; animation: rise .2s ease both;
}
.lang-sheet[hidden] { display: none; }
.lang-sheet h3 { margin: 0 0 4px; font-family: var(--font-pixel); font-weight: normal; color: var(--red); font-size: 1.1rem; }
.lang-sheet label { display: block; margin: 10px 0 0; font-size: .85rem; color: var(--ink2); }
.lang-sheet select { display: block; width: 100%; margin-top: 3px; padding: 8px 10px; font: 1rem var(--font-ui); color: var(--ink); background: #fff; border: 2px solid var(--tan); border-radius: 8px; }
.lang-sheet .dim { margin: 3px 0 0; font-size: .78rem; }
.lang-sheet .ls-done { width: 100%; margin-top: 12px; }

/* "Spoken as": the names the Troubler or a presenter says, when this phone shows others */
.spoken-as { margin: 2px auto 8px; max-width: 300px; font-size: .88rem; color: var(--ink2); text-align: center; line-height: 1.3; }
.spoken-as b { color: var(--red); font-family: var(--font-pixel); font-weight: normal; font-size: 1rem; }
.judge-trouble + .spoken-as { margin: 0 0 6px; text-align: left; }

/* A card with no name in this language yet shows English, marked (card-render.js renderCardEl) */
.card-name[data-fallback]::after {
    content: attr(data-fallback); display: inline-block; margin-left: .3em; padding: 0 .25em; vertical-align: super;
    font: bold 7cqw/1.2 var(--font-ui); letter-spacing: .05em; border: 1px solid currentColor; border-radius: 3px; opacity: .6;
}

/* ── Sticky head: banner + score bar ── */
.tbl-head {
    position: sticky; top: 50px; z-index: 110;
    max-width: 520px; margin: 0 auto; padding: 8px 16px 6px; background: var(--paper);
}
.tbl-head::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -14px; height: 14px;
    background: linear-gradient(var(--paper), rgba(243, 239, 237, 0)); pointer-events: none;
}
.ms-seat .nudge {
    position: absolute; top: -10px; left: -12px; width: 22px; height: 22px; padding: 2px; margin: 0;
    border-radius: 50%; background: #fff; border: 2px solid var(--red); cursor: pointer;
    animation: beckon 1.4s ease-in-out infinite;
}
.ms-seat .nudge img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }

/* ── Stage ── */
.tbl-stage { max-width: 520px; margin: 0 auto; padding: 14px 16px 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.tbl-stage.enter > * { animation: rise .45s ease both; }
.tbl-stage h2 { font-family: var(--font-pixel); font-weight: normal; color: var(--red); font-size: 1.6rem; margin: 6px 0 4px; }
.tbl-stage .lead { font-size: 1.02rem; line-height: 1.45; margin: 4px 0 10px; max-width: 420px; }
.tbl-stage .dim { color: var(--ink3); font-size: .9rem; margin: 6px 0; }

/* Someone else is doing something: their avatar and a line in the game's voice. */
.waiting-on { display: flex; align-items: center; gap: 12px; margin: 14px 0; text-align: left; }
.waiting-on .av { --av: 52px; }
.waiting-on p { margin: 0; font-size: 1rem; line-height: 1.35; }
.waiting-on b { color: var(--acc); }
.waiting-on .typing { display: inline-block; margin-left: 4px; }

.big-card { width: min(200px, 50vw); margin: 6px auto 10px; }
.mid-card { width: min(140px, 36vw); margin: 4px auto 8px; }
.judge-trouble { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; }
.judge-trouble span { font-family: var(--font-pixel); color: var(--red); font-size: 1rem; }
.judge-trouble .mini-card { width: 64px; rotate: -3deg; }
.card-row { display: flex; gap: 12px; justify-content: center; margin: 8px 0; }
.card-row .card { width: min(120px, 32vw); }
.card-row.sealed .card { position: relative; }
.seal-badge { width: 40px; image-rendering: pixelated; margin-top: -26px; position: relative; z-index: 2; animation: stamp .45s cubic-bezier(.3, 1.6, .5, 1) both; }

/* Town setup */
.town-form { width: 100%; max-width: 380px; text-align: left; }
.town-form label { display: block; font-size: .85rem; color: var(--ink2); margin: 8px 0 3px; }
.town-form input {
    width: 100%; padding: 10px 12px; font: 1rem var(--font-ui); color: var(--ink);
    background: #fff; border: 2px solid var(--tan); border-radius: 8px; outline: none;
}
.town-form input:focus { border-color: var(--red); }
.inspire {
    margin: 10px 0 0; padding: 6px 14px; width: auto;
    font: .95rem var(--font-ui); color: #412d0a; background: var(--btn-tan);
    border: 2px solid #000; border-radius: 10px; cursor: pointer;
}
.town-unrolled { margin: 10px 0; width: 100%; max-width: 380px; }

/* Reveal queue */
.presenter { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0 8px; }
.presenter .who { display: flex; align-items: center; gap: 8px; font-family: var(--font-pixel); color: var(--acc); font-size: 1.15rem; }
.presenter .who .av { --av: 40px; }
.flip-pair { display: flex; gap: 14px; justify-content: center; }
.flip-pair .flip-card { width: min(130px, 36vw); cursor: default; }
.flip-pair .flip-card.mine { cursor: pointer; }
.flip-pair .flip-card.mine:not(.flipped) .flip-inner { animation: beckon 1.6s ease-in-out infinite; }
.flip-pair .tap-hint { font-size: .8rem; color: var(--ink2); margin-top: 4px; }
/* My own cards while presenting: face up for me, with a "tap to reveal" ribbon (its words in data-hint, from table.js). */
.flip-card.mine .peek { position: absolute; inset: 0; border-radius: var(--card-radius); }
.flip-card.mine .peek .card { height: 100%; opacity: .92; }
.flip-card.mine .peek::after {
    content: attr(data-hint); position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
    background: var(--red); color: #fff; font-size: .7rem; padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.queue { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 14px 0 4px; }
.queue .q { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .75rem; color: var(--ink2); min-width: 60px; }
.queue .q .av { --av: 38px; }
.queue .q.done .av { opacity: .55; }
.queue .q.presenting .av { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--red); }
.queue .q .mini { display: flex; gap: 2px; }
.queue .q .mini .card { width: 30px; }

/* Judge */
.judge-list { display: grid; gap: 10px; width: 100%; margin: 8px 0; }
/* Judging is done from the cards themselves, so each pair is dealt large under its councillor. */
.judge-list .option { flex-wrap: wrap; padding: 10px; }
.judge-list .option .thumbs { width: 100%; margin: 2px 0 0; gap: 8px; justify-content: center; }
.judge-list .option .thumbs .card { width: calc(50% - 4px); max-width: 200px; }

/* Result */
.result { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.result .crowned { display: flex; align-items: center; gap: 12px; }
.result .crowned .av { --av: 64px; animation: pop .7s .7s ease both; }
.result .crowned .award-card { width: 70px; }
.result h2 .who { font-family: var(--font-pixel); color: var(--acc); text-shadow: none; }

/* End: the champion's scroll */
.champion {
    width: 100%; max-width: 420px; padding: 18px 16px; margin: 6px 0 10px;
    background: var(--parch); border: 3px double var(--parch-brd); border-radius: 12px; box-shadow: 0 4px 0 var(--tan);
}
.champion .throne { position: relative; margin: 46px auto 10px; }
.champion .av { --av: 84px; }
/* The crown lands on the champion's head, as on the TV. */
.champion .crown { position: absolute; left: 50%; top: -44px; translate: -50% 0; width: 72px; height: auto; z-index: 2;
    image-rendering: pixelated; animation: crown-land .9s .5s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes crown-land { from { opacity: 0; transform: translateY(-80px) rotate(-25deg); } }
.champion h2 { margin: 4px 0; }
.champion h2 .who, .tbl-stage h2 .who { font-family: var(--font-pixel); color: var(--acc); text-shadow: none; }
.champion .trophies { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.champion .trophies .card { width: 58px; }
.standings { width: 100%; max-width: 420px; margin: 8px 0; }
.standings .row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px dotted var(--tan); }
.standings .row .av { --av: 30px; }
.standings .row .name { flex: 1; text-align: left; }
.standings .row .pts { font-family: var(--font-pixel); color: var(--red); font-size: 1.2rem; }
.keep-town { width: 100%; max-width: 380px; padding: 12px; margin-top: 8px; background: #fff; border: 2px solid var(--tan); border-radius: 10px; }
.keep-town p { margin: 0 0 8px; }
.keep-town .row2 { display: flex; gap: 8px; }
.keep-town .row2 button { flex: 1; }

/* ── Lobby: the council assembles ── */
.lobby-code { font-weight: bold; letter-spacing: 10px; font-size: clamp(38px, 12vw, 54px); color: var(--red); margin: 0; }
.lobby-qr img { width: 180px; height: 180px; border: 2px solid var(--tan); border-radius: 10px; background: #fff; padding: 6px; }
.lobby-link { font-size: .8rem; color: var(--ink3); word-break: break-all; margin: 4px 0 8px; }
.keep-open {
    width: 100%; max-width: 420px; margin: 10px 0; padding: 8px 12px;
    background: var(--parch); border: 2px solid var(--red); border-radius: 10px; font-size: .9rem;
}
.offers { display: flex; justify-content: center; gap: 4px; margin: 6px 0; }
.offer {
    width: auto; margin: 0; padding: 12px 8px 8px; background: transparent; border: 2px solid transparent;
    border-radius: 14px; cursor: pointer; transition: transform .15s;
}
.offer .av { --av: min(48px, 11vw); }
.offer:hover { transform: translateY(-2px); filter: none; }
.offer.on { border-color: var(--red); background: #fff; }
.reroll { width: auto; margin: 4px 0 0; padding: 4px 12px; font: .85rem var(--font-ui); color: var(--ink2); background: #fff; border: 2px solid var(--tan); border-radius: 10px; cursor: pointer; }
/* The lobby: councillors take seats around the table as they join
   (positions from table.js seatAround). Seats behind the table wear their
   name above; seats in front, below. */
.lobby-table { position: relative; width: 340px; max-width: 100%; height: 290px; margin: 4px auto 6px; }
.lobby-table .council-table { position: absolute; left: 50%; top: 68px; translate: -50% 0; z-index: 2; }
.seated { position: absolute; inset: 0; }
.seated .s { position: absolute; translate: -50% -24px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .85rem; max-width: 84px; white-space: nowrap; z-index: 3; }
.seated .s.back { flex-direction: column-reverse; translate: -50% calc(24px - 100%); z-index: 1; }
.seated .s span { overflow: hidden; text-overflow: ellipsis; max-width: 84px; }
.seated .s .av { --av: 48px; }
.seated .s.arrive { animation: slam .5s cubic-bezier(.5, 0, .75, 0) both; }
.seated .s .you { color: var(--ink3); font-size: .72rem; }

/* ── Dock: hand · action · (sound sits at the right edge) ── */
.tbl-dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 130;
    padding: 10px 16px max(12px, env(safe-area-inset-bottom));
    background: linear-gradient(rgba(243, 239, 237, 0), var(--paper) 30%);
}
.tbl-dock .inner { max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 50px 0 0; }
.tbl-dock .acts { flex: 1; display: flex; gap: 8px; }
.tbl-dock .acts button, .tbl-dock .acts a { flex: 1; margin: 0; }
/* Secondary actions (Change, Leave) stay compact beside the main one. */
.tbl-dock .acts .ms-btn-2 { flex: 0 0 auto; padding-left: 14px; padding-right: 14px; }
.tbl-dock .acts:empty { display: none; }
/* Throw tray: artwork to throw at the table (polish.js REACTIONS). */
.throw-btn {
    flex-shrink: 0; width: 46px; height: 46px; margin: 0; padding: 0; border-radius: 50%;
    background: #fff; border: 2px solid var(--tan); cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform .15s, border-color .15s;
}
.throw-btn img { width: 30px; image-rendering: pixelated; }
.throw-btn.on { border-color: var(--red); transform: rotate(-12deg); }
.throw-btn:active { transform: scale(.9); }
.throw-tray {
    position: fixed; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 140;
    display: grid; grid-template-columns: repeat(4, 48px); gap: 6px; padding: 8px;
    background: var(--parch); border: 2px solid var(--parch-brd); border-radius: 14px; box-shadow: 0 4px 0 var(--tan);
    animation: rise .2s ease both;
}
.throw-tray button { width: 48px; height: 48px; margin: 0; padding: 4px; border: 0; border-radius: 10px; background: #fff; cursor: pointer; transition: transform .12s; }
.throw-tray button:active { transform: scale(.85) rotate(-8deg); }
.throw-tray button:disabled { opacity: .5; cursor: default; }
.throw-tray img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }

.card.selected { border-color: var(--gold); box-shadow: 0 0 12px var(--gold-gl); transform: translateY(-4px); }

/* Toast (nudges, notices) */
.tbl-toast {
    position: fixed; top: 60px; left: 50%; translate: -50% 0; z-index: 200; width: max-content; max-width: calc(100vw - 32px);
    display: flex; align-items: center; gap: 8px; padding: 8px 14px;
    background: var(--parch); border: 2px solid var(--red); border-radius: 12px; box-shadow: 0 4px 12px rgba(30, 14, 6, .2);
    animation: rise .3s ease both;
}
.tbl-toast img { width: 22px; image-rendering: pixelated; }

/* Join / host setup forms (before the table) */
.setup { max-width: 420px; margin: 0 auto; padding: 22px 20px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.setup h1 { font-family: var(--font-pixel); font-weight: normal; color: var(--red); font-size: 2rem; margin: 6px 0; }
.setup form, .setup .fields { width: 100%; text-align: left; }
.setup label { display: block; font-size: .85rem; color: var(--ink2); margin: 10px 0 3px; }
.setup input[type=text], .setup input[type=number], .setup select {
    width: 100%; padding: 10px 12px; font: 1rem var(--font-ui); color: var(--ink);
    background: #fff; border: 2px solid var(--tan); border-radius: 8px; outline: none;
}
.setup input:focus, .setup select:focus { border-color: var(--red); }
.setup .check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .9rem; color: var(--ink2); }
.setup .check input { width: auto; margin: 0; }
.setup .opt { font-weight: normal; color: var(--ink3); }
.setup .deck-note { margin: 4px 0 0; font-size: .82rem; color: var(--ink3); }
.setup .go { width: 100%; margin-top: 18px; }
.setup .err { color: var(--red); min-height: 1.2em; margin: 8px 0 0; }
.setup .err:not(:empty) { padding: 8px 12px; background: #f6d6d3; border-radius: 10px; color: #6b1515; }
/* Joining (play.html): a code from a link shows as a chip; the TV option sits quietly below. */
.setup .help { margin: 4px 0 0; font-size: .8rem; color: var(--ink3); }
.setup .code-input::placeholder { color: var(--tan); letter-spacing: 12px; }
.setup .room-chip { margin: 6px 0 0; padding: 10px 14px; background: var(--parch); border: 2px solid var(--parch-brd); border-radius: 12px; font-size: .95rem; color: var(--ink2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.setup .room-chip b { font-size: 1.3rem; letter-spacing: 4px; color: var(--red); }
.setup .room-chip[hidden], .setup #code-field[hidden] { display: none; }
.setup .linkish { margin-left: auto; padding: 8px 4px; border: 0; background: none; color: var(--red); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.setup .tv-switch { margin-top: 22px; padding-top: 12px; border-top: 1px dashed var(--tan); font-size: .82rem; color: var(--ink3); }
.setup .go:disabled { opacity: .8; cursor: progress; }
.setup .code-input { text-transform: uppercase; letter-spacing: 8px; font-size: 1.6rem !important; text-align: center; }
/* Hosting (host.html): a game saved on this device, offered above the form. */
.setup .resume { width: 100%; margin: 14px 0 4px; padding: 12px 14px; background: var(--parch); border: 2px solid var(--red); border-radius: 12px; }
.setup .resume p { margin: 0; color: var(--ink2); }
.setup .resume b { color: var(--red); letter-spacing: 2px; }
.setup .resume .go { margin-top: 12px; }
.setup .resume .linkish { margin: 4px auto 0; display: block; }
.setup .resume[hidden] { display: none; }
/* Hosting: the form in groups (a parchment panel each, named on its border), and the rarer
   settings folded away under a dashed edge (host.js openFoldIfSet). */
.setup .group { min-width: 0; margin: 16px 0 0; padding: 2px 14px 14px; background: var(--parch); border: 2px solid var(--parch-brd); border-radius: 12px; }
.setup .group legend { padding: 0 8px; margin-left: -4px; font-family: var(--font-pixel); color: var(--red); font-size: 1.1rem; }
.setup .group legend + div > label:first-child, .setup .group legend + label { margin-top: 4px; }
.setup .fold { margin: 16px 0 0; padding: 0 14px; border: 2px dashed var(--tan); border-radius: 12px; }
.setup .fold[open] { padding-bottom: 14px; background: var(--parch); border-color: var(--parch-brd); }
.setup .fold summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; font-family: var(--font-pixel); color: var(--red); font-size: 1rem; line-height: 1.2; }
.setup .fold summary::-webkit-details-marker { display: none; }
.setup .fold summary::after { content: "+"; margin-left: auto; font-size: 1.5rem; line-height: 1; }
.setup .fold[open] summary::after { content: "\2212"; }
.setup .fold summary:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 4px; }
.setup .fold summary + label { margin-top: 0; }
/* Carrying on a room from another device (host.html), with the teacher PIN. */
.setup #btn-takeover { margin: 18px auto 0; display: block; }
.setup .takeover[hidden] { display: none; }
.setup .takeover input { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-size: 1.3rem; }
.setup .back { align-self: flex-start; color: var(--ink2); text-decoration: none; font-size: .9rem; padding: 10px 10px 10px 0; }
/* The council table, carried over from the title screen (title.css .chamber .table). */
.council-table { width: 225px; height: 144px; image-rendering: pixelated; view-transition-name: council-table; }
.setup .council-table { width: 150px; height: 96px; margin: 4px 0 0; }

.reconnect-banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 300; display: none;
    padding: 8px 16px; text-align: center; background: var(--red); color: #fff;
}
.reconnect-banner a { color: #fff; }

@media (max-width: 360px) {
    .tbl-stage h2 { font-size: 1.35rem; }
    .offer .av { --av: 42px; }
    /* Five goblins on offer fit a 320 px phone without pushing the page sideways. */
    .offers { gap: 2px; }
    .offer { padding-left: 4px; padding-right: 4px; }
}

/* ── Moments ── */
/* The trouble lands: the stage jolts and a red pulse washes out from the middle. */
body.trouble-pulse .tbl-stage { animation: trouble-jolt .45s cubic-bezier(.3, 1.6, .5, 1); }
body.trouble-pulse::after {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 150;
    background: radial-gradient(circle at 50% 42%, rgba(139, 0, 0, 0) 20%, rgba(139, 0, 0, .35) 70%);
    animation: trouble-wash .9s ease-out forwards;
}
@keyframes trouble-jolt { 0% { translate: 0 0; } 20% { translate: -7px 3px; } 40% { translate: 6px -2px; } 60% { translate: -4px 1px; } 80% { translate: 2px 0; } 100% { translate: 0 0; } }
@keyframes trouble-wash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

.ph-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 160; }
.ph-confetti i { position: absolute; top: -4%; width: 8px; height: 12px; animation: ph-fall linear forwards; }
@keyframes ph-fall { to { transform: translateY(110vh) rotate(720deg); } }
.seat-fly { position: fixed; z-index: 170; pointer-events: none; transform-origin: center; }
.seat-fly .card { width: 100%; }

.my-shelf { width: 100%; max-width: 380px; margin-top: 14px; padding: 10px 12px; border: 2px dashed var(--tan); border-radius: 12px; }
.my-shelf h3 { margin: 0 0 6px; font-family: var(--font-pixel); font-weight: normal; color: var(--red); font-size: 1.15rem; }
.my-shelf .trophies { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.my-shelf .trophies .card { width: 58px; }
.my-shelf .dim { margin: 0; }

/* Away: this councillor's phone has dropped out. The host gets a remove chip. */
/* Joining next round: arrived mid-game, faded at the end of the score bar. */
.ms-seat.joining .av { opacity: .5; }
.ms-seat.joining .next { display: block; font-size: .58rem; line-height: 1.1; color: var(--ink3); white-space: nowrap; text-align: center; }
.ms-seat.away .av { opacity: .35; filter: grayscale(1); }
.ms-seat.away::before {
    content: 'away'; position: absolute; top: 16px; left: 50%; translate: -50% 0; z-index: 2;
    font-size: .62rem; font-weight: bold; letter-spacing: .04em; color: #fff; background: var(--ink2);
    border-radius: 999px; padding: 0 5px; line-height: 1.4;
}
.ms-seat .kick {
    position: absolute; top: -10px; right: -12px; width: 22px; height: 22px; padding: 0; margin: 0;
    border-radius: 50%; background: var(--red); color: #fff; border: 2px solid #fff; font: bold 14px/1 var(--font-ui); cursor: pointer;
}

/* End of a game: a quiet door to the physical deck. */
.real-deck { margin: 18px auto 4px; max-width: 320px; text-align: center; font-size: .88rem; color: var(--ink3); line-height: 1.45; }
.real-deck a { color: var(--red); font-weight: bold; }

/* Reduced motion. components.css already stops every animation and transition; here the
   moments that carry news fade in quickly instead, cards turn over by cross-fading rather
   than spinning, and the confetti and the red wash stay home. */
@media (prefers-reduced-motion: reduce) {
    .ph-confetti, body.trouble-pulse::after { display: none; }
    .big-card.slam, .seated .s.arrive, .tbl-stage.enter > *, .seal-badge,
    .result .crowned .award-card, .champion .crown { animation: fade-in .25s ease both !important; }
    .flip-card .flip-inner, .flip-card.flipped .flip-inner, .flip-front { transform: none; }
    .flip-face { transition: opacity .2s ease !important; }
    .flip-front, .flip-card.flipped .flip-face:not(.flip-front) { opacity: 0; }
    .flip-card.flipped .flip-front { opacity: 1; }
}

/* The pitch timer on the presenter's phone */
.pitch-timer { font-family: var(--font-pixel); font-size: 1.6rem; color: var(--ink); text-align: center; }
.pitch-timer.low, .pitch-timer.up { color: var(--red); }
.pitch-timer.up { font-size: 1rem; animation: timerNudge 1s ease-in-out infinite; }
@keyframes timerNudge { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .pitch-timer.up { animation: none; } }
