:root {
    --background: #242424;
    --surface: #303030;
    --surface-soft: #2b2b2b;
    --text: #f3f3ef;
    --muted: #aaa9a3;
    --black-card: #000000;
    --black-card-text: #ffffff;
    --white-card: #ffffff;
    --white-card-text: #111111;
    --border: #454545;
    --control: #393939;
    --control-hover: #414141;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

html[data-theme="light"] {
    --background: #e9e7df;
    --surface: #f5f3eb;
    --surface-soft: #efede5;
    --text: #171717;
    --muted: #6d6b65;
    --border: #cfccc2;
    --control: #e4e1d8;
    --control-hover: #dad6cc;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.025), transparent 30%),
        var(--background);
    color: var(--text);
    transition:
        background 180ms ease,
        color 180ms ease;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

.landing-page {
    min-height: 100vh;
    padding: 96px 32px 44px;
    display: flex;
    align-items: center;
}

.landing-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 46px;
    align-items: stretch;
}

.black-card {
    min-height: 590px;
    padding: 30px;
    border-radius: 22px;
    background: var(--black-card);
    color: var(--black-card-text);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.black-card h1 {
    max-width: 280px;
    margin: 12px 0 22px;
    font-size: clamp(38px, 5vw, 58px);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero-copy {
    max-width: 230px;
    margin: 0;
    font-size: 24px;
    font-weight: 750;
    line-height: 1.2;
}



.white-card {
    background: var(--white-card);
    color: var(--white-card-text);
    border: 1px solid #d9d9d9;
}

.eyebrow {
    margin: 0;
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.eyebrow.dark {
    color: var(--muted);
}

.mode-panel {
    padding: 4px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-heading h2,
.join-section h3 {
    margin: 8px 0 10px;
    letter-spacing: -0.035em;
}

.section-heading h2 {
    font-size: clamp(32px, 4vw, 48px);
}

.section-heading > p:last-child {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 16px;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.mode-card {
    min-height: 300px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        border-color 160ms ease,
        background 160ms ease;
}

.mode-card:hover,
.mode-card:focus-visible {
    transform: translateY(-4px);
    border-color: var(--muted);
    background: var(--control-hover);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
    outline: none;
}

.mode-number {
    margin-bottom: auto;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    font-weight: 800;
}

.mode-title {
    margin-top: 38px;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.05;
}

.mode-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.mode-description {
    margin-top: 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.mode-action {
    margin-top: 22px;
    font-size: 13px;
    font-weight: 900;
}

.join-section {
    margin-top: 26px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-soft);
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.join-section h3 {
    font-size: 24px;
}

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

.field {
    display: grid;
    gap: 7px;
}

.field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.field input {
    width: 150px;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 17px;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    outline: none;
}

.field input:focus {
    border-color: var(--muted);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.join-button {
    height: 46px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--text);
    color: var(--background);
    font-weight: 900;
    cursor: pointer;
}

.update-pill {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 16px;
    border-radius: 999px;
    background: #000000;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    font-size: 14px;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.update-pill.visible {
    opacity: 1;
    transform: translateY(0);
}

.update-pill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    color: #000000;
    font-size: 12px;
    font-weight: 900;
}

.top-utility-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 950;

    display: flex;
    justify-content: flex-start;
    align-items: center;

    padding: 18px 20px;
    pointer-events: none;
}

.top-utility-bar > * {
    pointer-events: auto;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.theme-toggle-track {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: #111111;
    flex: 0 0 auto;
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 160ms ease;
}

.theme-toggle.is-light .theme-toggle-thumb {
    transform: translateX(14px);
}

.frontend-message {
    position: fixed;
    inset: 0;
    z-index: 900;
    padding: 24px;
    background: rgba(0, 0, 0, 0.56);
    display: none;
    place-items: center;
}

.frontend-message.visible {
    display: grid;
}

.frontend-message-card {
    position: relative;
    width: min(440px, 100%);
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.frontend-message-card h2 {
    margin: 9px 0 10px;
    font-size: 30px;
    letter-spacing: -0.03em;
}

.frontend-message-card p:last-child {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.message-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 28px;
    cursor: pointer;
}

@media (max-width: 960px) {
    .landing-shell {
        grid-template-columns: 1fr;
    }

    .black-card {
        min-height: 360px;
    }

    .black-card h1 {
        max-width: 520px;
    }

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

    .mode-card {
        min-height: 220px;
    }
}

@media (max-width: 640px) {
    .landing-page {
        padding: 88px 16px 20px;
        align-items: flex-start;
    }

    .black-card {
        min-height: 320px;
        padding: 24px;
    }

    .join-section,
    .join-form {
        align-items: stretch;
    }

    .join-section {
        flex-direction: column;
    }

    .join-form {
        width: 100%;
        flex-direction: column;
    }

    .field input,
    .join-button {
        width: 100%;
    }

    .update-pill {
        top: 70px;
        left: 16px;
        right: 16px;
        justify-content: center;
    }
}


/* ---------------------------------------------------------
   Pack selector
--------------------------------------------------------- */

.pack-selector {
    position: fixed;
    inset: 0;
    z-index: 910;
    padding: 24px;
    background: rgba(0, 0, 0, 0.62);
    display: none;
    place-items: center;
}

.pack-selector.visible {
    display: grid;
}

.pack-selector-card {
    position: relative;
    width: min(620px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: auto;
}

.pack-selector-card h2 {
    margin: 9px 0 8px;
    font-size: 32px;
    letter-spacing: -0.035em;
}

.pack-selector-copy {
    margin: 0 0 22px;
    color: var(--muted);
    line-height: 1.5;
}

.pack-list {
    display: grid;
    gap: 10px;
}

.pack-option {
    min-height: 78px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
    display: flex;
    align-items: center;
    gap: 18px;
    cursor: pointer;
}

.pack-option:hover {
    border-color: var(--muted);
}

.pack-option-copy {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 4px;
}

.pack-option-name {
    font-size: 15px;
    font-weight: 900;
}

.pack-option-description {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

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

.pack-switch {
    position: relative;
    width: 42px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #666666;
    transition: background 150ms ease;
}

.pack-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 150ms ease;
}

.pack-option-input:checked + .pack-switch {
    background: #111111;
}

.pack-option-input:checked + .pack-switch .pack-switch-thumb {
    transform: translateX(18px);
}

html[data-theme="dark"] .pack-option-input:checked + .pack-switch {
    background: #f3f3ef;
}

html[data-theme="dark"] .pack-option-input:checked + .pack-switch .pack-switch-thumb {
    background: #111111;
}

.pack-loading {
    padding: 24px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

.pack-selector-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.pack-secondary-button,
.pack-primary-button {
    min-height: 44px;
    padding: 0 17px;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
}

.pack-secondary-button {
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
}

.pack-primary-button {
    border: 1px solid transparent;
    background: var(--text);
    color: var(--background);
}

.pack-primary-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .pack-selector {
        padding: 14px;
    }

    .pack-selector-card {
        max-height: calc(100vh - 28px);
        padding: 24px 18px;
    }

    .pack-option {
        align-items: flex-start;
    }

    .pack-switch {
        margin-top: 4px;
    }
}


/* ---------------------------------------------------------
   Session setup / lobby
--------------------------------------------------------- */

.pack-host-name {
    margin: 0 0 16px;
}

.pack-host-name input {
    width: 100%;
    text-transform: none;
    letter-spacing: 0;
}

.lobby-page {
    min-height: 100vh;
    padding: 96px 32px 44px;
    display: flex;
    align-items: center;
}

.lobby-shell {
    width: min(1050px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(280px, 330px) 1fr;
    gap: 44px;
    align-items: stretch;
}

.lobby-code-card {
    min-height: 520px;
}

.lobby-code {
    margin: 14px 0 8px;
    font-size: clamp(62px, 9vw, 90px);
    font-weight: 950;
    line-height: 0.9;
    letter-spacing: 0.04em;
}

.lobby-mode {
    margin: 20px 0 0;
    color: #c6c6c6;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
}

.lobby-card-label {
    margin: 0 0 8px;
    color: #888888;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lobby-pack-summary {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.5;
}

.lobby-panel {
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lobby-panel .section-heading h1 {
    margin: 8px 0 10px;
    font-size: clamp(34px, 5vw, 50px);
    line-height: 1;
    letter-spacing: -0.04em;
}

.lobby-panel .section-heading > p:last-child {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.5;
}

.hotseat-add-player {
    margin-bottom: 18px;
}

.hotseat-add-player form {
    display: flex;
    align-items: end;
    gap: 10px;
}

.lobby-name-field {
    flex: 1;
}

.lobby-name-field input {
    width: 100%;
    text-transform: none;
    letter-spacing: 0;
}

.add-player-button {
    width: 48px;
    min-width: 48px;
    padding: 0;
    font-size: 25px;
}

.lobby-player-header {
    margin: 4px 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lobby-player-header h2 {
    margin: 0;
    font-size: 18px;
}

.lobby-player-header span {
    min-width: 28px;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    text-align: center;
    font-size: 12px;
    font-weight: 900;
}

.player-list {
    display: grid;
    gap: 8px;
}

.lobby-player {
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 10px;
}

.lobby-player-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lobby-player-name {
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 900;
    white-space: nowrap;
}

.you-pill {
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.lobby-player-score {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.player-remove-button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.player-remove-button:hover {
    color: var(--text);
}

.lobby-error {
    margin-top: 12px;
    padding: 11px 13px;
    border: 1px solid #8d3f3f;
    border-radius: 11px;
    background: rgba(140, 45, 45, 0.14);
    color: #eaa5a5;
    font-size: 13px;
    font-weight: 750;
}

html[data-theme="light"] .lobby-error {
    color: #7b2020;
}

.lobby-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.lobby-leave {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.waiting-message {
    margin-top: 20px;
    padding: 14px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
    font-weight: 750;
}

.hidden {
    display: none !important;
}

@media (max-width: 760px) {
    .lobby-page {
        padding: 88px 16px 24px;
        align-items: flex-start;
    }

    .lobby-shell {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .lobby-code-card {
        min-height: 330px;
    }

    .lobby-actions {
        flex-direction: column-reverse;
    }

    .lobby-actions > * {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}


.join-name-card {
    width: min(460px, 100%);
}


/* ---------------------------------------------------------
   Gameplay
--------------------------------------------------------- */

.game-body {
    padding-top: 0;
}

.czar-banner {
    position: sticky;
    top: 0;
    z-index: 1100;
    width: 100%;
    padding: 13px 20px;
    color: #ffffff;
    text-align: center;
    font-size: 14px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.czar-banner.is-czar {
    background: #267c45;
}

.czar-banner.not-czar {
    background: #a93030;
}

.game-utility-bar {
    top: 42px;
    justify-content: space-between;
}

.game-meta-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    font-size: 12px;
    font-weight: 900;
}

.game-meta-divider {
    color: var(--muted);
}

.game-update-pill {
    top: 104px;
}

.game-page {
    min-height: 100vh;
    padding: 118px 28px 42px;
}

.game-layout {
    width: min(1320px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 34px;
    align-items: start;
}

.scoreboard-panel {
    position: sticky;
    top: 118px;
    width: max-content;
    min-width: 240px;
    max-width: min(460px, 38vw);
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-soft);
}

.scoreboard-heading h2 {
    margin: 5px 0 16px;
    font-size: 24px;
}

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

.scoreboard-row {
    width: 100%;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 8px;
}

.scoreboard-row.current-czar {
    border-color: #6b946f;
}

.score-player-copy {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 7px;
}

.score-player-name {
    min-width: max-content;
    flex: 1 1 auto;
    overflow: visible;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.05;
    white-space: nowrap;
}

.czar-mini-pill {
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 999px;
    background: #267c45;
    color: #ffffff;
    font-size: 9px;
    font-weight: 950;
    text-transform: uppercase;
}

.score-value {
    flex: 0 0 auto;
    min-width: 28px;
    text-align: right;
    font-size: 20px;
    font-weight: 950;
}

.round-panel {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(260px, 350px) minmax(0, 1fr);
    gap: 34px;
    align-items: start;
}

.played-black-card {
    aspect-ratio: 0.7;
    min-height: 470px;
    padding: 26px;
    border-radius: 19px;
    background: #000000;
    color: #ffffff;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-type-label {
    margin: 0 0 22px;
    color: #898989;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.black-card-text {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 900;
    line-height: 1.12;
}

.black-card-bottom {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    font-weight: 950;
}

.round-action {
    min-width: 0;
    padding: 18px 0;
}

.round-action-heading {
    margin-bottom: 18px;
}

.round-action-heading h2,
.round-message h2 {
    margin: 6px 0 8px;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: -0.035em;
}

.round-action-heading > p:last-child,
.round-message > p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.winner-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.winner-button {
    min-height: 72px;
    padding: 15px 17px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

.winner-button:hover {
    transform: translateY(-2px);
    border-color: var(--muted);
}

.winner-score {
    color: var(--muted);
    font-size: 11px;
}

.white-hand {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    row-gap: 14px;
    column-gap: 14px;
}

.digital-white-card {
    aspect-ratio: 0.7;
    min-height: 220px;
    padding: 17px;
    border: 3px solid transparent;
    border-radius: 15px;
    background: #ffffff;
    color: #111111;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.17);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.23;
    cursor: pointer;
}

.digital-white-card.selected {
    border-color: #3c9d5f;
    transform: translateY(-5px);
}


.white-submit-bar {
    position: sticky;
    bottom: 14px;
    margin-top: 18px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.white-submit-bar span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.submission-grid {
    display: grid;
    gap: 10px;
}

.submission-button {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--text);
    display: grid;
    gap: 8px;
    text-align: left;
    cursor: pointer;
}

.submission-button:hover {
    border-color: var(--muted);
    transform: translateY(-2px);
}

.submission-card-text {
    padding: 14px;
    border-radius: 11px;
    background: #ffffff;
    color: #111111;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.25;
}

.round-message {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-soft);
}

.winner-message h2 {
    font-size: clamp(38px, 6vw, 64px);
}

.next-round-button {
    margin-top: 22px;
}

@media (max-width: 980px) {
    .game-layout {
        grid-template-columns: 1fr;
    }

    .scoreboard-panel {
        position: static;
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .score-player-name {
        min-width: 0;
        overflow: hidden;
    }

    .scoreboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .game-utility-bar {
        top: 44px;
    }

    .game-page {
        padding: 118px 16px 28px;
    }

    .round-panel {
        grid-template-columns: 1fr;
    }

    .played-black-card {
        width: min(100%, 340px);
        min-height: 450px;
        margin: 0 auto;
    }

    .white-hand {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .digital-white-card {
        min-height: 190px;
    }

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

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

    .white-hand {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .digital-white-card {
        min-height: 170px;
        padding: 14px;
        font-size: 14px;
    }

    .game-meta-pill {
        display: none;
    }
}


.game-utility-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    pointer-events: auto;
}

.leave-game-button {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #7f3434;
    border-radius: 999px;
    background: rgba(142, 45, 45, 0.14);
    color: #efb0b0;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.leave-game-button:hover {
    background: rgba(142, 45, 45, 0.24);
}

html[data-theme="light"] .leave-game-button {
    color: #7b2020;
}

.leave-game-button:disabled {
    opacity: 0.55;
    cursor: wait;
}

@media (max-width: 480px) {
    .leave-game-button {
        min-height: 36px;
        padding: 0 11px;
    }
}


.submission-button.read-only {
    cursor: default;
}

.submission-button.read-only:hover {
    border-color: var(--border);
    transform: none;
}


/* JS dynamically fits long black-card prompts to the card. */
.black-card-text {
    overflow-wrap: normal;
    word-break: normal;
}


.auto-next-round {
    margin-top: 22px;
}

.auto-next-round strong {
    color: var(--text);
    font-size: 1.15em;
}


.last-winner-pill {
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 999px;
    background: #5b8f63;
    color: #ffffff;
    font-size: 9px;
    font-weight: 950;
}

.last-round-summary {
    margin-top: 12px;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
}

.last-round-label {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.last-round-black,
.last-round-response {
    margin: 0;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.25;
}

.last-round-black {
    -webkit-line-clamp: 2;
    color: var(--text);
}

.last-round-response {
    margin-top: 4px;
    -webkit-line-clamp: 2;
    color: var(--muted);
}


.submitted-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #3c9d5f;
    color: #ffffff;
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
}
