/**
 * One Night: Starship Red Alert - the page.
 *
 * LCARS: black space, a coloured rail of elbows, and type that is read from
 * across the bridge. The board is two columns on a laptop - your card, notes and
 * the table's moves on the left, the table and whatever you may press on the
 * right. On a phone the hand stacks above the table so the card you were dealt is
 * never below the fold during the night.
 */

/*
 * The display face, served from this game's own folder: a condensed, uppercase-
 * friendly sans is the whole LCARS sign-painter look, and a stack that leaned on
 * a font the visitor may not have ("Oswald", Impact) set half the page in
 * whatever the machine owned. One variable file covers every weight, so a bold
 * heading costs nothing extra. SIL OFL 1.1 - see `assets/fonts/OFL.txt`.
 */
@font-face {
    font-family: "Antonio";
    font-style: normal;
    font-weight: 100 700;
    font-display: swap;
    src: url("../fonts/antonio-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --night: #000005;
    --night-2: #07070f;
    --panel: #0c0c18;
    --panel-2: #151732;
    --line: #2f3358;
    --ink: #f5f1e6;
    --muted: #9aa3c9;
    --moon: #ff9c00;
    --wolf: #cc6666;
    --village: #9999cc;
    --tanner: #ffcc99;
    --ok: #99cc99;

    /* The LCARS rail: every bar, cap and highlight is one of these five. */
    --lcars-orange: #ff9c00;
    --lcars-peach: #ffcc99;
    --lcars-tan: #ffcc66;
    --lcars-lilac: #cc99cc;
    --lcars-blue: #9999cc;
    --lcars-teal: #99ccff;
    --lcars-red: #cc6666;

    --shadow: 0 18px 40px rgba(0, 0, 0, 0.62);
    --radius: 6px;
    /* Antonio is the file in this game's `assets/fonts`; the rest of the stack is
     * what a machine without it would still make look like a sign. */
    --display: "Antonio", "Oswald", "Roboto Condensed", "Liberation Sans Narrow",
        "Arial Narrow", "Helvetica Neue", Impact, sans-serif;
    --serif: var(--display);
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background:
        radial-gradient(1.4px 1.4px at 18% 24%, rgba(255, 255, 255, 0.5), transparent 60%),
        radial-gradient(1.2px 1.2px at 74% 12%, rgba(255, 255, 255, 0.34), transparent 60%),
        radial-gradient(1.3px 1.3px at 62% 68%, rgba(255, 255, 255, 0.28), transparent 60%),
        radial-gradient(1px 1px at 33% 82%, rgba(255, 255, 255, 0.32), transparent 60%),
        radial-gradient(1200px 620px at 82% -14%, rgba(255, 156, 0, 0.13), transparent 62%),
        radial-gradient(900px 620px at 4% 108%, rgba(153, 153, 204, 0.1), transparent 60%),
        var(--night);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--moon);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

[hidden] {
    display: none !important;
}

.app {
    display: flex;
    flex-direction: column;
    /* The bar sits above this in the flow, so the game fills what is left of
       the window rather than a full viewport plus the bar. */
    min-height: calc(100vh - var(--jn-nav-height, 44px));
}

/* ------------------------------------------------------------------- chips */

/* The room chip: the code, on the table screen, where a player still needs it
   to hand to somebody. The bar above the page is the way home. */
.roomchip {
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
}

.roomchip b {
    color: var(--moon);
    font-family: var(--mono);
    letter-spacing: 0.18em;
}

.iconbtn {
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.iconbtn:hover {
    border-color: var(--moon);
}

/* ------------------------------------------------------------------- stage */

.stage {
    flex: 1;
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: clamp(18px, 4vw, 40px) clamp(14px, 4vw, 34px) 60px;
}

.screen {
    animation: rise 260ms ease-out;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* -------------------------------------------------------------------- menu */

.menu {
    display: grid;
    gap: 26px;
    max-width: 760px;
}

.menu__kicker,
.lobby__kicker {
    margin: 0;
    color: var(--moon);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.menu__title {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(38px, 8vw, 68px);
    font-weight: 700;
    line-height: 0.94;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

/* The line under the name, in LCARS orange: one bar, two words. */
.menu__title::after {
    content: "";
    display: block;
    width: min(240px, 42vw);
    height: 10px;
    margin-top: 14px;
    border-radius: 0 10px 10px 0;
    background: linear-gradient(90deg, var(--lcars-orange) 0 62%, var(--lcars-peach) 62%);
}

.menu__lede {
    margin: 0;
    max-width: 54ch;
    color: var(--muted);
    font-size: 17px;
}

/*
 * Two ways to begin, in one panel: start a table, or join one with a code. Each
 * has its own heading, so the code field reads as part of "join" and never as a
 * third button in the row above it.
 */
.paths {
    display: grid;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(16, 20, 48, 0.45);
}

.path {
    display: grid;
    gap: 10px;
    align-content: start;
}

.path__title {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.path__buttons {
    display: grid;
    gap: 10px;
}

.path--join {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

@media (min-width: 760px) {
    .paths {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
        column-gap: 26px;
    }

    .path--join {
        padding-top: 0;
        padding-left: 26px;
        border-top: 0;
        border-left: 1px solid var(--line);
    }
}

.menu__error {
    margin: 0;
    padding: 10px 14px;
    border: 1px solid rgba(192, 57, 43, 0.55);
    border-radius: 10px;
    background: rgba(192, 57, 43, 0.12);
    color: #ffb7ad;
    font-size: 14px;
}

.field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.field__label {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.field__input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--night-2);
    color: var(--ink);
    font: inherit;
}

.field__input:focus {
    outline: 2px solid rgba(240, 192, 90, 0.55);
    outline-offset: 1px;
}

.field__input--code {
    width: 8ch;
    font-family: var(--mono);
    font-size: 22px;
    letter-spacing: 0.28em;
    text-align: center;
    text-transform: uppercase;
}

.join {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.btn {
    display: inline-grid;
    gap: 2px;
    padding: 11px 18px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 140ms, transform 140ms, background 140ms;
}

.btn:hover:not(:disabled) {
    border-color: var(--moon);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn--primary {
    border-color: rgba(240, 192, 90, 0.55);
    background: linear-gradient(180deg, rgba(240, 192, 90, 0.22), rgba(240, 192, 90, 0.08));
}

.btn__label {
    font-size: 16px;
    font-weight: 600;
}

.btn__meta {
    color: var(--muted);
    font-size: 12px;
}

.btn--ghost {
    background: transparent;
    color: var(--muted);
}

.btn--slim {
    padding: 9px 14px;
}

.btn--danger {
    border-color: rgba(192, 57, 43, 0.5);
    color: #ffb7ad;
    background: rgba(192, 57, 43, 0.1);
}

/* ------------------------------------------------------------------ rules */

.rules {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(21, 26, 56, 0.55);
    padding: 14px 18px;
}

.rules summary {
    cursor: pointer;
    color: var(--moon);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.rules__list {
    margin: 12px 0 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 14px;
}

.rules__list li + li {
    margin-top: 8px;
}

.rules__list b {
    color: var(--ink);
}

/* The three sides, on their own: a round is decided by this block, not by the
 * fifth line of the clock. */
.rules__heading {
    margin: 14px 0 6px;
    color: var(--moon);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.rules__wins {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 14px;
}

.rules__wins li {
    padding-left: 14px;
    border-left: 3px solid color-mix(in srgb, var(--moon) 45%, transparent);
}

.rules__wins b {
    color: var(--ink);
}

.glossary {
    display: grid;
    gap: 10px;
}

.glossary__title {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/*
 * The roster is the deck, not a list of rules: every row is the same card face
 * the hand, a seat and a picker tile show, so a card reads the same everywhere
 * it is named. The one row that is not a card is a pack heading, and it carries
 * the pack's name alone - how many cards a pack holds is a number the picker
 * counts, not something a title has to say.
 */
.roles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ------------------------------------------------------------------- lobby */

.lobby {
    display: grid;
    gap: 18px;
    /* Wide enough for the deck picker's card grid: the seats stay a list, so the
     * width is spent on the one control that needs more than one column. */
    max-width: min(100%, 960px);
}

.lobby__code {
    margin: 0;
    color: var(--moon);
    font-family: var(--mono);
    font-size: clamp(40px, 10vw, 62px);
    letter-spacing: 0.28em;
    line-height: 1;
}

.lobby__lede {
    margin: 0;
    color: var(--muted);
}

.seats {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.seats li {
    display: grid;
    grid-template-columns: 30px 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(21, 26, 56, 0.6);
}

/*
 * The lobby roster is a list of names, not a column of rows: twelve seats as
 * twelve full-width rows pushed the clock and the deal off the screen. The
 * seats flow in columns instead - four to a row at the lobby's width - so the
 * roster is three lines at the biggest table and one on a phone. The badges
 * shrink with it: a chip says who is here, the board says what they are.
 */
.seats--lobby {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.seats--lobby li {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 9px;
}

.seats--lobby .seat__index {
    font-size: 11px;
}

.seats--lobby .seat__name {
    font-size: 14px;
}

.seats--lobby .seat__badges {
    gap: 4px;
}

.seats--lobby .badge {
    padding: 1px 5px;
    font-size: 9px;
}

.seats--lobby .seat__state {
    width: 7px;
    height: 7px;
}

.seats--lobby .seat__remove {
    padding: 1px 6px;
    font-size: 10px;
}

.seat--mine {
    border-color: rgba(89, 192, 138, 0.4);
}

.seat__index {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 13px;
}

.seat__name {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seat__badges {
    display: flex;
    gap: 6px;
}

.badge {
    padding: 2px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.badge--host {
    border-color: rgba(240, 192, 90, 0.5);
    color: var(--moon);
}

.badge--you {
    border-color: rgba(89, 192, 138, 0.5);
    color: var(--ok);
}

.seat__state {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--line);
}

.seat--ready .seat__state,
.seat--voted .seat__state {
    background: var(--ok);
    box-shadow: 0 0 10px rgba(89, 192, 138, 0.6);
}

.seat--away {
    opacity: 0.5;
}

.seat--dead .seat__name {
    text-decoration: line-through;
    text-decoration-color: var(--wolf);
}

.seat__role {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}

/*
 * The lobby's one decision: how long the table talks. It sits with the deal
 * rather than in a settings panel of its own, because it is the last thing a
 * host chooses before the cards move.
 */
.lobby__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.lobby__clock {
    width: 10rem;
}

.lobby__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hint {
    min-height: 1.4em;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

/* ------------------------------------------------------------------- table */

.tablebar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.phase__name {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.phase__sub {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.tablebar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.clock {
    min-width: 74px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--night-2);
    color: var(--moon);
    font-family: var(--mono);
    font-size: 24px;
    text-align: center;
}

.clock__unit {
    margin-left: 2px;
    color: var(--muted);
    font-size: 12px;
}

.clock--low {
    border-color: rgba(192, 57, 43, 0.6);
    color: #ff9d90;
}

.table {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    margin-top: 18px;
}

.hand {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 14px;
    padding: 14px 14px 14px 22px;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    background:
        linear-gradient(90deg, var(--lcars-peach) 0 8px, transparent 8px),
        rgba(10, 10, 20, 0.84);
    box-shadow: var(--shadow);
}

.hand__block {
    display: grid;
    gap: 8px;
}

.hand__label {
    margin: 0;
    color: var(--lcars-peach);
    font-family: var(--display);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.board {
    display: grid;
    gap: 16px;
    min-width: 0;
}

/* ------------------------------------------------------------------- cards */

/*
 * A card is a card: an art window, then the role's name, its side and what the
 * card does, centred under the emblem like a face rather than a datasheet. The
 * set a card came from is a fact about the lobby, not about the card, so it is
 * only ever shown while choosing cards. The same markup is the card in your hand,
 * a card in the round's row and a card on a seat - `.card--small` keeps the face
 * and drops the words, which is what a narrow screen shows everywhere.
 */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    aspect-ratio: 5 / 7;
    padding: 8px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--tone, var(--line)) 42%, var(--line));
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 34%),
        linear-gradient(165deg, color-mix(in srgb, var(--tone, #232a58) 18%, #1b2148), #0d1130 76%);
    box-shadow: var(--shadow);
    text-align: left;
}

.card__art {
    position: relative;
    display: grid;
    flex: 1 1 auto;
    place-items: center;
    min-height: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--tone, var(--line)) 32%, transparent);
    border-radius: 9px;
    background:
        radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--tone, var(--moon)) 28%, transparent), transparent 70%),
        rgba(7, 10, 28, 0.74);
    color: #eef2ff;
}

.card__art .art {
    width: 76%;
    height: 76%;
}

.card__art .art__tone {
    stroke: var(--tone, var(--moon));
}

.card__art .art__fill {
    fill: var(--tone, var(--moon));
    stroke: none;
}

/* The painting on the face. The artwork is wide and the frame is tall, so it
   covers rather than stretches - a portrait keeps its proportions and the crop
   lands on the middle of the picture. It sits over the emblem, which stays
   underneath as the fallback a card shows before its image arrives. */
.card__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 34%;
}

/* A wash in the card's own colour, and a fade into the words: the picture
   belongs to the card instead of sitting on top of it. */
.card__art::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
        radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--tone, var(--moon)) 14%, transparent), transparent 72%),
        linear-gradient(180deg, transparent 58%, rgba(8, 11, 30, 0.66));
}

.card__body {
    display: grid;
    flex: 0 0 auto;
    gap: 3px;
    text-align: center;
}

.card__name {
    margin: 0;
    font-family: var(--display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.015em;
    line-height: 1.02;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.card__team {
    margin: 0;
    color: color-mix(in srgb, var(--tone, var(--moon)) 62%, var(--muted));
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.card__rules {
    display: -webkit-box;
    margin: 3px 0 0;
    overflow: hidden;
    color: #d9dff5;
    font-size: 11.5px;
    line-height: 1.36;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.card--small {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    aspect-ratio: auto;
    padding: 6px 8px;
    border-radius: 10px;
}

.card--small .card__art {
    width: 100%;
    height: 34px;
    border-radius: 6px;
}

.card--small .card__art .art {
    width: 78%;
    height: 78%;
}

.card--small .card__body {
    gap: 1px;
    text-align: left;
}

.card--small .card__name {
    font-size: 13.5px;
    line-height: 1.15;
}

.card--small .card__team,
.card--small .card__rules {
    display: none;
}

.card--dead {
    border-color: rgba(192, 57, 43, 0.55);
    opacity: 0.74;
}

.card--dead .card__name {
    color: #ffb7ad;
}

/* ------------------------------------------------------------ notes & chips */

.notes {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.notes li {
    padding: 8px 10px;
    border-left: 2px solid var(--moon);
    border-radius: 0 8px 8px 0;
    background: rgba(240, 192, 90, 0.07);
    color: #d8ddf5;
    font-size: 13px;
}

.notes li:first-child {
    border-left-color: var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
}

.deck {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
}

/* ------------------------------------------------------------------ action */

.action {
    display: grid;
    gap: 14px;
    padding: clamp(14px, 3vw, 20px) clamp(14px, 3vw, 20px) clamp(14px, 3vw, 20px) 26px;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    background:
        linear-gradient(90deg, var(--lcars-orange) 0 10px, transparent 10px),
        linear-gradient(180deg, rgba(22, 22, 44, 0.95), rgba(8, 8, 16, 0.95));
    box-shadow: var(--shadow);
}

.action__title {
    margin: 0;
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* The step counter is a readout, so it reads like one: a bar and a number. */
.action__step {
    margin: 0;
    color: var(--lcars-peach);
    font-family: var(--display);
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.action__step::before {
    content: "";
    display: inline-block;
    width: 26px;
    height: 8px;
    margin-right: 10px;
    border-radius: 0 8px 8px 0;
    background: var(--lcars-orange);
    vertical-align: middle;
}

.action__text {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.action__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.choice {
    padding: 9px 15px 9px 18px;
    border: 1px solid var(--line);
    border-radius: 999px 8px 8px 999px;
    background: var(--panel-2);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 120ms, background 120ms, color 120ms;
}

.choice:hover:not(:disabled) {
    border-color: var(--moon);
}

.choice:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.choice--selected {
    border-color: var(--moon);
    background: var(--lcars-orange);
    color: #120c00;
    font-weight: 600;
}

.choice--ghost {
    background: transparent;
    color: var(--muted);
}

.verdict {
    margin: 0;
    color: var(--moon);
    font-family: var(--display);
    font-size: clamp(22px, 4vw, 30px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
}

.result-seat {
    display: grid;
    gap: 6px;
}

.result-seat__name {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-seat__moved {
    color: var(--moon);
    font-size: 11px;
}

.votes-list,
.recap {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13px;
}

.votes-list li + li,
.recap li + li {
    margin-top: 4px;
}

/* The socket's state, in the table bar - live, reconnecting, or not at a table. */

.tablebar__conn {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
}

.toast {
    position: fixed;
    bottom: 22px;
    left: 50%;
    z-index: 20;
    max-width: min(92vw, 460px);
    margin: 0;
    padding: 10px 16px;
    transform: translateX(-50%);
    border: 1px solid rgba(240, 192, 90, 0.55);
    border-radius: 10px;
    background: var(--panel-2);
    box-shadow: var(--shadow);
    color: var(--ink);
    font-size: 13px;
    text-align: center;
}

/* ---------------------------------------------------------------------- AI */

/*
 * The step between "New solo" / "New online" and the lobby: one question, the
 * size the table deals with. It replaces the three ways in rather than sitting
 * under them, so the menu asks one thing at a time.
 */
.size {
    display: grid;
    gap: 12px;
    max-width: 34rem;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(16, 20, 48, 0.55);
}

.size__title {
    margin: 0;
    font-family: var(--display);
    font-size: 20px;
    letter-spacing: 0.02em;
}

.size__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.badge--bot {
    border-color: rgba(127, 140, 172, 0.55);
    color: #aab6d6;
}

.seat__remove {
    padding: 2px 7px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.seat__remove:hover:not(:disabled) {
    border-color: rgba(192, 57, 43, 0.55);
    color: #ffb7ad;
}

/* -------------------------------------------------------------- the board */

.panel {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 14px 16px 16px 22px;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: rgba(10, 10, 20, 0.7);
}

/* The elbow: the panel's own colour runs down its left edge. */
.panel::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 8px;
    border-radius: 10px 0 0 10px;
    background: var(--cap, var(--lcars-blue));
}

.panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 14px;
}

.panel__title {
    margin: 0;
    color: var(--moon);
    font-family: var(--display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.panel__hint {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.seatcell {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(21, 26, 56, 0.66);
}

.seatcell--mine {
    border-color: rgba(89, 192, 138, 0.45);
    box-shadow: inset 0 0 0 1px rgba(89, 192, 138, 0.12);
}

.seatcell__head {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
}

.seatcell__name {
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: stretch;
    min-height: 54px;
    border-radius: 10px;
}

.slot--board {
    border: 1px dashed rgba(127, 140, 172, 0.45);
    background: rgba(13, 17, 48, 0.55);
    transition: border-color 120ms ease, background 120ms ease;
}

.slot--board.slot--filled {
    border-style: solid;
    border-color: rgba(240, 192, 90, 0.35);
    background: transparent;
}

.slot--over {
    border-color: var(--moon);
    background: rgba(240, 192, 90, 0.1);
}

.board-grid--open .slot--board {
    cursor: pointer;
}

/* Your own seat holds the one card you were dealt, so it takes no drop. */
.board-grid--open .slot--board.slot--known {
    cursor: default;
}

.slot__empty {
    margin: 0;
    padding: 12px 8px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-align: center;
}

/* A seat nobody has a card for: the slot stays empty, not a card back. */
.slot__empty--down {
    color: color-mix(in srgb, var(--muted) 62%, transparent);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.slot__clear {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--bg, #0b0f2b);
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.slot__clear:hover:not(:disabled) {
    border-color: var(--wolf);
    color: #ffb7ad;
}

.seatcell__conf {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
}

.seatcell__conf-label {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.seatcell__range {
    width: 100%;
    accent-color: var(--moon);
    cursor: pointer;
}

.seatcell__out {
    color: var(--moon);
    font-family: var(--mono);
    font-size: 12px;
}

.readchips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.readchips__label {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    align-self: center;
}

.readchip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border: 1px solid color-mix(in srgb, var(--tone, var(--line)) 45%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--tone, transparent) 10%, transparent);
    font-size: 11px;
}

.readchip__who {
    color: var(--muted);
}

.readchip__role {
    color: var(--ink);
    font-weight: 600;
}

.readchip__conf {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
}

/* An emblem at the size of a word: chips and read chips carry their card art. */
.chip__art,
.readchip__art {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    color: #eef2ff;
}

.chip__art {
    width: 15px;
    height: 15px;
}

.readchip__art {
    width: 13px;
    height: 13px;
}

.chip__art .art,
.readchip__art .art {
    width: 100%;
    height: 100%;
}

.chip__art .art__tone,
.readchip__art .art__tone {
    stroke: var(--tone, var(--moon));
}

.chip__art .art__fill,
.readchip__art .art__fill {
    fill: var(--tone, var(--moon));
    stroke: none;
}

/* ------------------------------------------------------------ the palette */

/*
 * The round's cards, drawn as the cards themselves: the same face as the card in
 * your hand, at the size of a hand of cards you scroll across. A card leaves the
 * row when it is moved onto a seat.
 */

.palette {
    display: flex;
    gap: 10px;
    align-items: stretch;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scrollbar-width: thin;
}

/* The night shows the round's cards (the deck is public), but a guess made
 * before anyone has spoken is not a read: the row is dimmed until the talk
 * opens, and the hint beside it says which card of the deal it is waiting for. */
.palette--locked .palette__card {
    opacity: 0.55;
}

.palette__card {
    flex: 0 0 auto;
    width: clamp(104px, 22vw, 132px);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: grab;
    user-select: none;
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.palette__card .card__name {
    font-size: 14px;
}

.palette__card .card__rules {
    font-size: 9px;
    line-height: 1.3;
    -webkit-line-clamp: 4;
}

.palette__card:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--tone, var(--moon));
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
}

/* Shown but not playable: the deck is public, the board is not open yet. */
.palette__card:disabled {
    opacity: 0.8;
    cursor: default;
}

.palette__card:focus-visible {
    outline: 2px solid var(--moon);
    outline-offset: 2px;
}

.palette__card--picked {
    border-color: var(--moon);
    box-shadow: 0 0 0 1px var(--moon) inset, 0 8px 20px rgba(240, 192, 90, 0.2);
}

.palette__card--dragging {
    opacity: 0.45;
    cursor: grabbing;
}

/* ------------------------------------------------------------ table talk */

.talk__list {
    display: grid;
    align-content: start;
    gap: 2px;
    max-height: 260px;
    margin: 0;
    padding: 4px;
    overflow-y: auto;
    border-radius: 10px;
    background: rgba(13, 17, 48, 0.5);
    list-style: none;
}

.talk__line {
    display: grid;
    grid-template-columns: minmax(56px, max-content) minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 14px;
}

.talk__line + .talk__line {
    border-top: 1px solid rgba(127, 140, 172, 0.12);
}

.talk__line--claim {
    background: rgba(240, 192, 90, 0.05);
}

.talk__name {
    color: var(--moon);
    font-weight: 600;
    white-space: nowrap;
}

.talk__tag {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    padding: 0 6px;
    border: 1px solid rgba(127, 140, 172, 0.4);
    border-radius: 999px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 0.12em;
    line-height: 15px;
    text-transform: uppercase;
}

.talk__line--claim .talk__text {
    grid-column: 2;
}

.talk__text {
    color: var(--ink);
    overflow-wrap: anywhere;
}

.talk__time {
    justify-self: end;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
}

.talk__empty {
    padding: 10px 8px;
    color: var(--muted);
    font-size: 13px;
}

.composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.composer__input {
    min-width: 0;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(13, 17, 48, 0.7);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
}

.composer__input:focus {
    border-color: var(--moon);
    outline: none;
}

.composer__input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ------------------------------------------------------------ pick a deck */

/*
 * The lobby picker: the deck as tiles above, then every card in the game as the
 * card itself, grouped by the set it came from. The set is named here and
 * nowhere else - once a card is dealt it is just a card, and the board has no
 * room for a publisher's label.
 *
 * A group's "All n" button is the select-all the batch was asked for, and it
 * reads "None" once every card in the group is in, so one button is both.
 */
.picker {
    padding: 12px 16px 14px 22px;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    background:
        linear-gradient(90deg, var(--lcars-lilac) 0 8px, transparent 8px),
        rgba(12, 12, 24, 0.72);
}

.picker__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    list-style: none;
}

.picker__summary::-webkit-details-marker {
    display: none;
}

/* The deck's name and its count on one line: the count is how much of the deck
 * the table still needs, so it belongs beside the heading rather than at the far
 * end of the header. */
.picker__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}

.picker__summary::after {
    content: "\25be";
    color: var(--muted);
    font-size: 12px;
}

.picker[open] .picker__summary::after {
    content: "\25b4";
}

.picker__title {
    color: var(--lcars-lilac);
    font-family: var(--display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.picker__count {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
}

.picker__count--short {
    color: #ff9d90;
}

/*
 * The saved decks: one line above the deck itself, because a deck is chosen
 * before a card is swapped in. It stays outside the scrolling packs, and a table
 * with nothing saved never shows it - the lobby is already a long page.
 */
.picker__sets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.picker__sets-label {
    color: var(--lcars-tan);
    font-family: var(--display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.picker__sets-select,
.picker__sets-name {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--night-2);
    color: var(--ink);
    font: inherit;
    font-size: 12px;
}

.picker__sets-select {
    max-width: 240px;
}

.picker__sets-name {
    width: 160px;
}

.picker__sets-name::placeholder {
    color: var(--muted);
}

.picker__sets-select:focus,
.picker__sets-name:focus {
    outline: 2px solid rgba(240, 192, 90, 0.55);
    outline-offset: 1px;
}

.picker__sets-btn {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.picker__sets-btn:hover:not(:disabled) {
    border-color: var(--lcars-lilac);
    color: var(--lcars-lilac);
}

.picker__sets-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.picker__sets-hint {
    margin-top: 4px;
    font-size: 12px;
}

/*
 * The deck itself, above the packs: one tile per card in the order the room
 * deals them, so a host sees what the table will deal rather than a list of
 * names, and two copies are two tiles. It wraps rather than scrolls - a
 * twelve-seat deck and its empty slots is eighteen tiles, and one row of those
 * runs off the side of the screen - and it sits outside the scrolling packs so
 * it stays put while a host browses the cards below.
 */
.picker__chosen {
    margin-top: 12px;
}

.chosen {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    gap: 10px;
    margin: 0;
    /* The x sits half outside a card's corner: this padding is what keeps the
       first and last one inside the box. */
    padding: 8px;
    list-style: none;
}

.chosen__item {
    position: relative;
    display: grid;
}

/* The whole face is the button: one click takes that card out. It fills its
 * column, so a tile and the outlines beside it are the same size. */
.chosen__card {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.chosen__card:disabled {
    cursor: default;
}

.chosen__card .card {
    width: 100%;
}

.chosen__card:not(:disabled):hover .card {
    border-color: color-mix(in srgb, var(--tone, var(--line)) 70%, #ffffff);
}

/* A card is over this tile and letting go will swap it in. */
.chosen__card--over .card {
    border-color: var(--lcars-orange);
    box-shadow:
        0 0 0 2px rgba(240, 146, 90, 0.45),
        var(--shadow);
}

.chosen__card:focus-visible .card {
    outline: 2px solid var(--moon);
    outline-offset: 2px;
}

.chosen__x {
    position: absolute;
    top: -6px;
    right: -6px;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #12162e;
    color: var(--muted);
    font-size: 12px;
    line-height: 1;
}

.chosen__card:not(:disabled):hover .chosen__x {
    border-color: rgba(255, 157, 144, 0.6);
    color: #ff9d90;
}

/*
 * An empty slot is a card the table still needs: the outline is where a card
 * dropped from a pack lands, and the plus in it says so on a device that has no
 * drag. It is the size and the corner radius of a face, so a full deck reads as
 * a row of cards and a short one reads as a row of cards and gaps.
 */
.chosen__slot {
    display: grid;
    place-items: center;
    aspect-ratio: 5 / 7;
    border: 1px dashed rgba(127, 140, 172, 0.42);
    border-radius: 14px;
    color: rgba(127, 140, 172, 0.75);
    font-family: var(--mono);
    font-size: 20px;
}

.chosen__slot::before {
    content: "+";
}

.chosen__slot--over {
    border-color: var(--lcars-orange);
    background: rgba(240, 146, 90, 0.08);
    color: var(--lcars-orange);
}

.picker__packs {
    display: grid;
    gap: 16px;
    margin-top: 12px;
    /* The deck is sixty-one faces: without a cap the picker is tall enough to
     * push the clock and the deal out of reach. It scrolls inside instead, so
     * the lobby stays one screen and the cards stay browsable. */
    max-height: min(52vh, 520px);
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-color: rgba(127, 140, 172, 0.45) transparent;
    scrollbar-width: thin;
    /* A drop never rebuilds the list, and this makes sure the browser cannot
     * slide the page to "keep" an anchor that did not move anyway. */
    overflow-anchor: none;
}

/* The page is dark; the browser's pale scrollbar would be the brightest thing
 * in the lobby. */
.picker__packs::-webkit-scrollbar {
    width: 10px;
}

.picker__packs::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(127, 140, 172, 0.45);
}

.picker__packs::-webkit-scrollbar-track {
    background: transparent;
}

.picker__group {
    display: grid;
    gap: 8px;
}

.picker__pack {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(127, 140, 172, 0.14);
}

.picker__packname {
    color: var(--lcars-tan);
    font-family: var(--display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.picker__inside {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.picker__all {
    margin-left: auto;
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: 999px 6px 6px 999px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.picker__all:hover:not(:disabled) {
    border-color: var(--lcars-lilac);
    color: var(--lcars-lilac);
}

.picker__all:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/*
 * The picker lists the cards themselves - the same face a seat shows - so a host
 * is choosing a card rather than a row of text. The face is dragged onto the
 * deck, and the plus on its top-right corner is the same edit for a device whose
 * browser will not carry a drag: it sits exactly where the x sits on a card in
 * the deck.
 */
.picker__cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    gap: 8px;
}

.picker__card {
    position: relative;
    display: grid;
}

.picker__face {
    display: grid;
    cursor: grab;
}

.picker__face:active {
    cursor: grabbing;
}

.picker__face .card {
    height: 100%;
}

.picker__card--on .card {
    border-color: color-mix(in srgb, var(--tone, var(--moon)) 62%, var(--line));
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--tone, var(--moon)) 26%, transparent),
        var(--shadow);
}

.picker__card--on .card__name {
    color: var(--moon);
}

/* The card under the pointer is the one travelling: it fades where it sits so
 * the deck it is dragged onto is the thing in focus. */
.picker__card--dragging {
    opacity: 0.45;
}

.picker__more {
    position: absolute;
    top: -5px;
    right: -5px;
    z-index: 2;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #12162e;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.picker__more:hover:not(:disabled) {
    border-color: var(--lcars-orange);
    color: var(--lcars-orange);
}

.picker__more:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* The plus arrives with the host and is painted on every render, so `hidden` is
 * what takes it off a seat's screen again. */
.picker__more[hidden] {
    display: none;
}

/* --------------------------------------------------------- the table's moves */

/*
 * The public record of the night, under the notes: what each seat did, in that
 * seat's colour. A line saying what a card *is* never appears here - that half of
 * the night stays in the notes above it.
 */
.history {
    display: grid;
    gap: 3px;
    max-height: 210px;
    margin: 0;
    padding: 2px;
    overflow-y: auto;
    list-style: none;
}

.history__line {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 6px;
    padding: 5px 8px 5px 9px;
    border-left: 3px solid var(--seat, var(--line));
    border-radius: 0 6px 6px 0;
    background: rgba(255, 255, 255, 0.025);
    font-size: 12px;
    line-height: 1.35;
}

.history__line--table {
    border-left-color: var(--lcars-blue);
    background: rgba(153, 153, 204, 0.07);
}

.history__name {
    color: var(--seat, var(--moon));
    font-weight: 700;
    white-space: nowrap;
}

.history__text {
    color: var(--ink);
    overflow-wrap: anywhere;
}

.history__time {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
}

/* ------------------------------------------------------- one night, n picks */

/*
 * A night step that wants picks groups them: seats, center cards, marks. Each
 * group is a labelled row of the same pill the rest of the app presses, and a
 * picked pill is filled rather than outlined, so "these two, then confirm" is
 * readable at a glance.
 */
.pickgrid {
    display: grid;
    gap: 12px;
}

.pickrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pickrow__label {
    width: 100%;
    margin: 0;
    color: var(--lcars-peach);
    font-family: var(--display);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* A seat waiting for a card: the whole cell is the target, so it says so. */
.seatcell--drop {
    border-color: rgba(255, 156, 0, 0.32);
}

.seatcell--over {
    border-color: var(--moon);
    background: rgba(255, 156, 0, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 156, 0, 0.22);
}

/* The glossary's own headings: a pack name over the cards it owns. */
.roles__pack {
    display: block;
    grid-column: 1 / -1;
    padding: 8px 2px 2px;
    border: 0;
    background: none;
    color: var(--lcars-tan);
    font-family: var(--display);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* A talk line wears its speaker's colour too. */
.talk__line {
    border-left: 3px solid var(--seat, transparent);
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 840px) {
    .table {
        grid-template-columns: 1fr;
    }

    .hand {
        position: static;
        gap: 12px;
    }

    /* A slim card is a row, so it takes the rail's width instead of a face's. */
    .hand #you-card {
        max-width: none;
    }

    /*
     * One card size per view: narrow screens get the slim row everywhere a card
     * is one of a list - the board, the round's row, the dawn reveal - and wide
     * screens get full faces. The card in your hand is the exception on purpose:
     * it is the one card whose words you have to read mid-night.
     */
    .board-grid .card,
    .palette .card,
    .result-grid .card {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        aspect-ratio: auto;
        padding: 8px 10px;
        border-radius: 10px;
    }

    .board-grid .card .card__art,
    .palette .card .card__art,
    .result-grid .card .card__art {
        width: 44px;
        height: 44px;
        border-radius: 7px;
    }

    .board-grid .card .card__team,
    .board-grid .card .card__rules,
    .palette .card .card__team,
    .palette .card .card__rules,
    .result-grid .card .card__team,
    .result-grid .card .card__rules {
        display: none;
    }

    .board-grid .card .card__name,
    .palette .card .card__name,
    .result-grid .card .card__name {
        font-size: 14px;
    }

    .board-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .palette {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
        overflow-x: visible;
    }

    .palette__card {
        width: auto;
    }

    /*
     * The roster and the picker follow the board's rule: slim cards on a narrow
     * screen. A slim card in the picker keeps room at its right end for the plus,
     * which sits on the corner and would otherwise sit on the card's name.
     */
    .roles,
    .picker__cards {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .picker__face .card--small {
        padding-right: 28px;
    }
}

@media (max-width: 520px) {
    .roles,
    .picker__cards {
        grid-template-columns: 1fr;
    }
    /*
     * A seat is a slim card on a phone: two to a row leaves ~120px inside the
     * cell, which is where "Shapeshifter" starts breaking mid-word.
     */
    .board-grid,
    .palette {
        grid-template-columns: 1fr;
    }

    /*
     * The lobby roster stays one line per chip: the badges are small enough to
     * sit beside the name, and a chip that wrapped to two lines would be the
     * full-width row the chips replaced.
     */
    .seats li,
    .seats--lobby li {
        grid-template-columns: 24px minmax(0, 1fr) auto;
    }

    .seats--lobby .seat__badges {
        grid-column: auto;
    }

    .hand {
        grid-template-columns: 1fr;
    }

    .hand #you-card {
        max-width: none;
    }

    .join {
        align-items: stretch;
        flex-direction: column;
    }

    .field__input--code {
        width: 100%;
    }

    .solo {
        align-items: stretch;
        flex-direction: column;
    }

    .ai {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------ polish */

:focus-visible {
    outline: 2px solid var(--moon);
    outline-offset: 2px;
}

::selection {
    background: rgba(240, 192, 90, 0.3);
}

/* A phone has no drag, so the tiles are taps - say so with the cursor. */
@media (hover: none) {
    .palette__card {
        cursor: pointer;
    }
}
