/* Cards Against Humanity · Family Edition — mobile-first */

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

:root {
    --family-blue: #0B8FD9;
    --family-blue-deep: #0670ad;
    --family-blue-soft: #d9f0fc;
    --ink: #111111;
    --paper: #f7f7f5;
    --white: #ffffff;
    --black: #0a0a0a;
    --muted: #5c5c5c;
    --line: #e2e2de;
    --danger: #c62828;
    --win: #1b8a3e;
    --radius-card: 12px;
    --radius-ui: 14px;
    --shadow-card: 0 4px 0 rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lift: 0 8px 0 rgba(0, 0, 0, 0.14), 0 16px 32px rgba(0, 0, 0, 0.12);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --hand-height: 11.5rem;
    --font: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, sans-serif;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(120% 80% at 50% -10%, #7ec8f0 0%, transparent 55%),
        linear-gradient(180deg, #b8e3f8 0%, var(--family-blue) 42%, #0670ad 100%);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

#app {
    min-height: 100vh;
    min-height: 100dvh;
}

.hidden {
    display: none !important;
}

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

/* ---------- Screens (join / lobby) ---------- */

.screen {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(1rem + var(--safe-top)) calc(1rem + var(--safe-right)) calc(1.5rem + var(--safe-bottom)) calc(1rem + var(--safe-left));
}

.screen--game {
    padding: 0;
    align-items: stretch;
}

.panel {
    width: 100%;
    max-width: 420px;
    background: var(--paper);
    border-radius: 20px;
    padding: 1.5rem 1.25rem 1.35rem;
    box-shadow: var(--shadow-lift);
    border: 3px solid var(--ink);
}

/* Brand */

.brand {
    text-align: center;
    margin-bottom: 1.25rem;
}

.brand__eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.55rem;
    font-weight: 600;
}

.brand__title {
    font-size: clamp(1.75rem, 8vw, 2.15rem);
    line-height: 0.95;
    font-weight: 900;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: var(--ink);
}

.brand__line {
    display: block;
}

.brand__badge {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.35rem 0.85rem;
    background: var(--family-blue);
    color: var(--white);
    font-weight: 900;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 2px solid var(--ink);
    box-shadow: 2px 2px 0 var(--ink);
}

.brand__badge--sm {
    font-size: 0.68rem;
    padding: 0.25rem 0.65rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.brand__tagline {
    margin-top: 0.9rem;
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.4;
}

/* Forms */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.field-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-top: 0.35rem;
}

input[type="text"] {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2.5px solid var(--ink);
    border-radius: var(--radius-ui);
    font-size: 1.05rem;
    font-family: inherit;
    background: var(--white);
    color: var(--ink);
    appearance: none;
    min-height: 3rem;
}

input[type="text"]::placeholder {
    color: #9a9a9a;
}

input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--family-blue-soft);
    border-color: var(--family-blue);
}

#roomCodeInput {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
}

.error-message {
    color: var(--danger);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    min-height: 1.2em;
}

.error-message:empty {
    display: none;
}

.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0.35rem 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 2px;
    background: var(--line);
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.95rem 1.25rem;
    border: 2.5px solid var(--ink);
    border-radius: var(--radius-ui);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    user-select: none;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
    box-shadow: 3px 3px 0 var(--ink);
    min-height: 3.1rem;
}

.btn:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--ink);
}

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

.btn-block {
    width: 100%;
}

.btn-sm {
    min-height: 2.4rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
    box-shadow: 2px 2px 0 var(--ink);
    flex-shrink: 0;
}

.btn-primary {
    background: var(--family-blue);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--family-blue-deep);
}

.btn-dark {
    background: var(--black);
    color: var(--white);
}

.btn-dark:hover:not(:disabled) {
    background: #222;
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--family-blue-soft);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    border-style: dashed;
    min-height: 2.75rem;
    font-size: 0.9rem;
}

.btn-ghost:active:not(:disabled) {
    transform: none;
    box-shadow: none;
    background: var(--family-blue-soft);
}

.btn-share {
    gap: 0.5rem;
    font-size: 1.05rem;
    min-height: 3.35rem;
}

.btn-share__icon {
    font-size: 1.15rem;
    line-height: 1;
    font-weight: 900;
}

.btn-attention {
    animation: attention-pulse 1.1s ease-in-out 3;
}

@keyframes attention-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 3px 3px 0 var(--ink);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 5px 5px 0 var(--ink), 0 0 0 4px rgba(11, 143, 217, 0.35);
    }
}

.invite-banner {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background: var(--family-blue-soft);
    border: 2.5px solid var(--ink);
    border-radius: var(--radius-ui);
    box-shadow: 3px 3px 0 var(--ink);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.9rem;
    line-height: 1.35;
}

.invite-banner strong {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.invite-banner span {
    color: var(--muted);
    font-weight: 600;
}

.share-panel {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.share-actions .btn {
    min-height: 2.85rem;
    font-size: 0.9rem;
    padding: 0.65rem 0.5rem;
}

.share-hint {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
    text-align: center;
    line-height: 1.35;
}

body.join-from-invite .divider,
body.join-from-invite #createRoomBtn {
    opacity: 0.55;
}

.btn:focus-visible,
input:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--family-blue);
    outline-offset: 2px;
}

/* Rules accordion */

.rules {
    margin-top: 1.25rem;
    border-top: 2px solid var(--line);
    padding-top: 0.85rem;
}

.rules summary {
    cursor: pointer;
    font-weight: 800;
    font-size: 0.9rem;
    list-style: none;
    color: var(--ink);
}

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

.rules summary::after {
    content: " +";
    color: var(--family-blue);
    font-weight: 900;
}

.rules[open] summary::after {
    content: " −";
}

.rules__list {
    margin: 0.75rem 0 0.5rem 1.1rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #333;
}

.rules__list li + li {
    margin-top: 0.4rem;
}

.rules__footnote {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.35;
    margin-top: 0.5rem;
}

/* Lobby */

.lobby-header {
    text-align: center;
    margin-bottom: 1rem;
}

.lobby-header h2 {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.lobby-sub {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 0.25rem;
}

.room-code-btn {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
    background: var(--white);
    border: 2.5px solid var(--ink);
    border-radius: var(--radius-ui);
    box-shadow: 3px 3px 0 var(--ink);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    margin-bottom: 1rem;
}

.room-code-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 var(--ink);
}

.room-code-btn__label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.room-code-btn__value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 700;
    word-break: break-all;
    line-height: 1.35;
    color: var(--ink);
}

.room-code-btn__hint {
    align-self: flex-end;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--family-blue);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.room-code-btn.is-copied .room-code-btn__hint {
    color: var(--win);
}

.players-panel {
    border: 2.5px solid var(--ink);
    border-radius: var(--radius-ui);
    background: var(--white);
    overflow: hidden;
    margin-bottom: 1rem;
}

.players-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    background: var(--black);
    color: var(--white);
}

.players-panel__head h3 {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chip {
    background: var(--family-blue);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1.5px solid var(--white);
}

.players-list {
    list-style: none;
    max-height: 12rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.players-list li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    font-size: 0.95rem;
}

.players-list li:last-child {
    border-bottom: none;
}

.players-list li::before {
    content: "";
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--family-blue);
    border: 1.5px solid var(--ink);
    flex-shrink: 0;
}

.players-list li.is-host::before {
    background: var(--black);
}

.players-list li.is-bot::before {
    background: #f5c518;
}

.player-role {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.rando-option {
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 2.5px solid var(--ink);
    border-radius: var(--radius-ui);
    background: var(--family-blue-soft);
}

.toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle__ui {
    width: 2.75rem;
    height: 1.6rem;
    border-radius: 999px;
    background: #ccc;
    border: 2px solid var(--ink);
    position: relative;
    flex-shrink: 0;
    margin-top: 0.1rem;
    transition: background 0.15s ease;
}

.toggle__ui::after {
    content: "";
    position: absolute;
    top: 0.12rem;
    left: 0.12rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--ink);
    transition: transform 0.15s ease;
}

.toggle input:checked + .toggle__ui {
    background: var(--family-blue);
}

.toggle input:checked + .toggle__ui::after {
    transform: translateX(1.1rem);
}

.toggle__text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.92rem;
}

.helper-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    line-height: 1.3;
}

.lobby-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.waiting-message {
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
}

/* ---------- Game shell ---------- */

.game-shell {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: 560px;
    margin: 0 auto;
    background: var(--paper);
    overflow: hidden;
}

.game-top {
    background: var(--black);
    color: var(--white);
    padding:
        calc(0.55rem + var(--safe-top))
        calc(0.65rem + var(--safe-right))
        0.55rem
        calc(0.65rem + var(--safe-left));
    border-bottom: 3px solid var(--ink);
}

.phase-bar {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-bottom: 0.55rem;
}

.phase-bar__label {
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--family-blue);
}

.phase-bar__hint {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
}

.players-bar {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.players-bar::-webkit-scrollbar {
    display: none;
}

.player-score {
    flex: 0 0 auto;
    min-width: 4.5rem;
    padding: 0.4rem 0.55rem;
    border-radius: 10px;
    background: #222;
    border: 1.5px solid #444;
    font-size: 0.72rem;
    line-height: 1.2;
}

.player-score__name {
    font-weight: 800;
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-score__pts {
    color: #bbb;
    font-weight: 700;
    margin-top: 0.1rem;
}

.player-score.czar {
    background: var(--family-blue);
    border-color: var(--white);
}

.player-score.czar .player-score__pts {
    color: rgba(255, 255, 255, 0.9);
}

.player-score.you {
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35);
}

.player-score__czar-tag {
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 0.15rem;
    opacity: 0.95;
}

/* Prompt / black card */

.prompt-area {
    padding: 0.75rem 0.85rem 0.35rem;
    background: linear-gradient(180deg, #e8f5fc 0%, var(--paper) 100%);
}

.black-card {
    background: var(--black);
    color: var(--white);
    border-radius: var(--radius-card);
    padding: 1.1rem 1rem 1.25rem;
    min-height: 6.5rem;
    box-shadow: var(--shadow-card);
    border: 2.5px solid var(--ink);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.black-card::after {
    content: "CAH · FAMILY";
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    opacity: 0.45;
    margin-top: 0.85rem;
}

.black-card__text,
.black-card {
    font-size: clamp(1.05rem, 4.2vw, 1.25rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

#blackCard {
    white-space: pre-wrap;
    word-break: break-word;
}

#blackCard.game-over-card {
    background: var(--family-blue);
    min-height: 8rem;
}

.round-winner {
    margin-top: 0.55rem;
    padding: 0.7rem 0.85rem;
    background: var(--win);
    color: var(--white);
    font-weight: 900;
    text-align: center;
    border-radius: 10px;
    border: 2px solid var(--ink);
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 0.95rem;
    animation: pop-in 0.25s ease;
}

.play-progress {
    margin-top: 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
    min-height: 1.1em;
}

/* Table (played cards) */

.table-area {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0.65rem 0.5rem;
}

.section-label {
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.15rem 0.15rem 0.4rem;
}

.table-cards {
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    gap: 0.55rem;
    padding: 0.25rem 0.15rem 0.65rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.table-cards:empty::after {
    content: "Waiting for cards…";
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin: auto;
    padding: 1.5rem;
}

/* White cards (shared) */

.white-card {
    flex: 0 0 auto;
    width: 7.25rem;
    height: 10rem;
    background: var(--white);
    color: var(--ink);
    border: 2.5px solid var(--ink);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 0.7rem 0.6rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.25;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    cursor: default;
    scroll-snap-align: start;
    position: relative;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    user-select: none;
    -webkit-user-select: none;
}

.white-card__body {
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
}

.white-card__foot {
    font-size: 0.52rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    opacity: 0.35;
    margin-top: 0.4rem;
}

.white-card.clickable {
    cursor: pointer;
}

.white-card.clickable:active {
    transform: scale(0.97);
}

.white-card.selected {
    border-color: var(--family-blue);
    box-shadow: 0 0 0 3px var(--family-blue-soft), var(--shadow-lift);
    transform: translateY(-6px);
    z-index: 2;
}

.white-card.face-down {
    background: repeating-linear-gradient(
        -45deg,
        #f0f0ee,
        #f0f0ee 8px,
        #e4e4e0 8px,
        #e4e4e0 16px
    );
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    justify-content: center;
    align-items: center;
}

.white-card.face-down .white-card__body {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    -webkit-line-clamp: unset;
}

.white-card.winner {
    border-color: var(--win);
    box-shadow: 0 0 0 3px rgba(27, 138, 62, 0.35), var(--shadow-lift);
    transform: translateY(-4px) scale(1.03);
}

.white-card.dimmed {
    opacity: 0.45;
}

/* Hand dock */

.hand-dock {
    background: var(--white);
    border-top: 3px solid var(--ink);
    padding:
        0.45rem 0
        calc(0.45rem + var(--safe-bottom));
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
}

.hand-dock__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.75rem 0.35rem;
    min-height: 2.2rem;
}

.hand-strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.35rem 0.75rem 0.55rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    min-height: var(--hand-height);
    scrollbar-width: none;
}

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

.hand-strip .white-card {
    width: 6.6rem;
    height: 9.2rem;
    font-size: 0.78rem;
}

.hand-strip .white-card.clickable:not(.selected) {
    /* slightly tuck unselected hand cards */
}

.hand-message {
    margin: 0.75rem auto;
    padding: 1rem 1.1rem;
    max-width: 22rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--muted);
    background: var(--family-blue-soft);
    border: 2px dashed var(--family-blue);
    border-radius: var(--radius-ui);
}

.hand-message--czar {
    background: var(--black);
    color: var(--white);
    border-style: solid;
    border-color: var(--ink);
}

.game-over-panel {
    margin: 0.5rem auto;
    padding: 1.25rem 1rem;
    max-width: 22rem;
    text-align: center;
    background: var(--white);
    border: 3px solid var(--ink);
    border-radius: var(--radius-ui);
    box-shadow: var(--shadow-card);
}

.game-over-panel h2 {
    font-size: 1.35rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.game-over-panel p {
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Toast */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(1.25rem + var(--safe-bottom));
    transform: translateX(-50%);
    z-index: 1000;
    max-width: min(92vw, 360px);
    padding: 0.75rem 1.1rem;
    background: var(--black);
    color: var(--white);
    font-weight: 700;
    font-size: 0.88rem;
    border-radius: 999px;
    border: 2px solid var(--ink);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25);
    text-align: center;
    pointer-events: none;
}

.toast.is-error {
    background: var(--danger);
}

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

/* Larger phones / small tablets */
@media (min-width: 430px) {
    .white-card {
        width: 7.75rem;
        height: 10.75rem;
        font-size: 0.88rem;
    }

    .hand-strip .white-card {
        width: 7rem;
        height: 9.75rem;
        font-size: 0.82rem;
    }

    .black-card {
        min-height: 7.25rem;
    }
}

/* Desktop comfort */
@media (min-width: 720px) {
    .screen--join,
    .screen--lobby {
        align-items: center;
    }

    .game-shell {
        border-left: 3px solid var(--ink);
        border-right: 3px solid var(--ink);
        min-height: 100vh;
        min-height: 100dvh;
        height: 100dvh;
    }

    .table-cards {
        flex-wrap: wrap;
        overflow-y: auto;
        overflow-x: hidden;
        scroll-snap-type: none;
        justify-content: center;
        content-visibility: auto;
    }

    .hand-strip {
        justify-content: center;
        flex-wrap: wrap;
        min-height: auto;
        max-height: 14rem;
        overflow-y: auto;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
