:root {
    --bg-deep: #063630;
    --bg-mid: #0b5d54;
    --bg-bright: #22a76f;
    --ink: #f8f8f3;
    --muted: rgba(248, 248, 243, 0.72);
    --line: rgba(255, 255, 255, 0.16);
    --gold: #ffc44d;
    --felt-shadow: rgba(0, 0, 0, 0.28);
    --card-width: min(22vw, 290px);
    --card-height: calc(var(--card-width) * 1.45);
    --app-height: 100vh;
}

@supports (height: -webkit-fill-available) {
    :root {
        --app-height: -webkit-fill-available;
    }
}

@supports (height: 100dvh) {
    :root {
        --app-height: 100dvh;
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: var(--app-height);
    min-height: var(--app-height);
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(49, 194, 125, 0.25), transparent 26%),
        radial-gradient(circle at 18% 24%, rgba(255, 197, 77, 0.12), transparent 18%),
        radial-gradient(circle at 86% 82%, rgba(84, 184, 255, 0.16), transparent 24%),
        linear-gradient(160deg, #021f1c 0%, var(--bg-deep) 24%, #0e5148 58%, #0a3936 100%);
    color: var(--ink);
    font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
}

html {
    height: -webkit-fill-available;
}

body {
    position: relative;
}

.noise-layer {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(120deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.01) 20%, transparent 20%, transparent 40%, rgba(255, 255, 255, 0.02) 40%, rgba(255, 255, 255, 0.02) 60%, transparent 60%, transparent 80%, rgba(255, 255, 255, 0.02) 80%),
        radial-gradient(circle at center, rgba(255, 255, 255, 0.06) 0.08rem, transparent 0.09rem);
    background-size: 18rem 18rem, 1.1rem 1.1rem;
    opacity: 0.28;
    pointer-events: none;
}

.screen-shell {
    position: relative;
    z-index: 1;
    height: var(--app-height);
    max-height: var(--app-height);
    padding: 1.1rem 1.2rem;
    display: grid;
    grid-template-columns: minmax(19rem, 24rem) minmax(0, 1fr);
    gap: 1rem;
    overflow: hidden;
}

.info-sidebar {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 1rem;
}

.topbar {
    display: grid;
    gap: 1rem;
    min-width: 0;
    padding: 1rem 1.05rem;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    border-radius: 1.4rem;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(9, 29, 30, 0.82), rgba(6, 20, 22, 0.7));
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(14px);
}

.brand-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "eyebrow room"
        "title title"
        "status status";
    align-items: start;
    gap: 0.18rem 0.65rem;
    min-width: 0;
}

.brand-block .eyebrow {
    grid-area: eyebrow;
    min-width: 0;
}

.brand-block h1 {
    grid-area: title;
    margin: 0.15rem 0 0.3rem;
    font-size: clamp(2rem, 3vw, 3.3rem);
    line-height: 0.96;
    white-space: nowrap;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 0.2rem 1rem rgba(0, 0, 0, 0.26);
}

.brand-block .status-line {
    grid-area: status;
}

.eyebrow {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.82rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.status-line {
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-start;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: rgba(7, 24, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: var(--ink);
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

.room-pill {
    grid-area: room;
    position: static;
    justify-self: end;
    align-self: start;
    min-height: 1.45rem;
    max-width: 4.5rem;
    padding: 0.18rem 0.4rem;
    font-size: 0.62rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-stage {
    min-height: 0;
    display: block;
}

.join-panel,
.table-core,
.bottom-zone {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(9, 29, 30, 0.82), rgba(6, 20, 22, 0.7));
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(14px);
}

.join-panel {
    display: grid;
    align-content: start;
    gap: 0.7rem;
    padding: 0.95rem 1rem;
    border-radius: 1.4rem;
}

.join-copy {
    margin: -0.3rem 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.qr-link {
    display: inline-grid;
    place-items: center;
    justify-self: center;
    align-self: start;
    width: fit-content;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0.65rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1rem 2rem rgba(0, 0, 0, 0.16);
}

.qr-link:hover {
    transform: translateY(-0.08rem);
}

.qr-code {
    display: block;
    line-height: 0;
}

.qr-code canvas,
.qr-code img,
.qr-code svg,
.qr-link canvas,
.qr-link img,
.qr-link svg {
    display: block;
}

.table-core {
    position: relative;
    border-radius: 2.1rem;
    padding: 1rem;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: stretch;
    width: 100%;
    height: 100%;
}

.table-aura,
.felt-shadow {
    position: absolute;
    inset: 1rem;
    border-radius: 2rem;
    pointer-events: none;
}

.felt-shadow {
    background:
        radial-gradient(circle at center, rgba(58, 205, 133, 0.22), transparent 42%),
        radial-gradient(circle at 28% 62%, rgba(255, 196, 77, 0.16), transparent 24%),
        radial-gradient(circle at 72% 36%, rgba(84, 184, 255, 0.15), transparent 22%),
        linear-gradient(180deg, rgba(18, 96, 84, 0.9), rgba(7, 57, 51, 0.96));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.07),
        inset 0 -1rem 3rem rgba(0, 0, 0, 0.22),
        0 1.5rem 4rem rgba(0, 0, 0, 0.18);
}

.table-aura {
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.06), transparent 55%),
        radial-gradient(circle at center, rgba(255, 196, 77, 0.14), transparent 68%);
    filter: blur(10px);
    opacity: 0.85;
}

.table-aura.is-red {
    background: radial-gradient(circle at center, rgba(232, 74, 74, 0.36), transparent 58%);
}

.table-aura.is-yellow {
    background: radial-gradient(circle at center, rgba(255, 196, 77, 0.34), transparent 58%);
}

.table-aura.is-green {
    background: radial-gradient(circle at center, rgba(58, 205, 133, 0.34), transparent 58%);
}

.table-aura.is-blue {
    background: radial-gradient(circle at center, rgba(84, 184, 255, 0.32), transparent 58%);
}

.table-top {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.turn-panel {
    position: relative;
    width: min(42rem, 100%);
    padding: 0.78rem 1rem 0.9rem;
    margin-top: 8px;
    border-radius: 999px;
    background: rgba(8, 24, 25, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
    box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.16);
}

.turn-label {
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.turn-name {
    margin-top: 0.12rem;
    font-size: clamp(1.15rem, 1.8vw, 1.8rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.turn-hint {
    margin-top: 0.16rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.table-middle {
    position: relative;
    z-index: 1;
    min-height: 0;
    display: grid;
    place-items: center;
}

.table-core.is-celebrating .pile-lane {
    opacity: 0.16;
}

.table-core.is-celebrating .table-top,
.table-core.is-celebrating .table-bottom {
    opacity: 0.32;
}

.pile-lane {
    position: relative;
    width: 100%;
    max-width: 70rem;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    justify-items: center;
    column-gap: 1.2rem;
    row-gap: 0.8rem;
    padding: 0 0.5rem;
}

.pile-column {
    display: grid;
    grid-template-rows: auto auto auto;
    align-content: center;
    row-gap: 0.65rem;
    justify-items: center;
    min-width: 0;
    width: 100%;
}

.pile-caption {
    margin-bottom: 0.85rem;
}

.draw-column,
.discard-column {
    max-width: calc(var(--card-width) + 7rem);
}

.pile-caption,
.pile-meta {
    text-align: center;
    max-width: 100%;
}

.pile-caption {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.84rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.pile-meta {
    min-height: 1.2rem;
    position: relative;
    z-index: 2;
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.9rem;
    text-shadow: 0 0.08rem 0.45rem rgba(0, 0, 0, 0.45);
}

.pile-meta-spacer {
    visibility: hidden;
}

.card-pile {
    position: relative;
    width: calc(var(--card-width) + 1rem);
    height: calc(var(--card-height) + 1.85rem);
    display: grid;
    place-items: start center;
}

.celebration-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: min(34rem, calc(100% - 2rem));
    padding: 1.35rem 1.5rem 1.5rem;
    border-radius: 1.8rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background:
        radial-gradient(circle at top, rgba(255, 196, 77, 0.22), transparent 50%),
        linear-gradient(180deg, rgba(8, 24, 25, 0.92), rgba(8, 29, 27, 0.88));
    box-shadow:
        0 1.4rem 3rem rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    text-align: center;
    transform: translate(-50%, -50%);
    opacity: 1;
    backdrop-filter: blur(14px);
}

.celebration-panel.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.celebration-eyebrow {
    color: rgba(255, 241, 183, 0.9);
    font-size: 0.82rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.celebration-name {
    margin-top: 0.45rem;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 0.35rem 1.4rem rgba(255, 196, 77, 0.16);
}

.celebration-copy {
    margin-top: 0.6rem;
    color: rgba(248, 248, 243, 0.8);
    font-size: 1rem;
    line-height: 1.4;
}

.celebration-timer-wrap {
    margin-top: 1rem;
    display: inline-grid;
    gap: 0.35rem;
    justify-items: center;
    min-width: 9rem;
    padding: 0.75rem 1rem;
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.11);
}

.celebration-timer-label {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.celebration-timer {
    color: #ffe6aa;
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.table-bottom {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.center-effects {
    position: relative;
    width: auto;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.15rem;
}

.action-burst,
.color-choice-badge {
    min-width: 8.2rem;
    padding: 0.62rem 0.8rem;
    margin-bottom: 8px;
    border-radius: 1rem;
    text-align: center;
    background: rgba(8, 24, 25, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0.8rem 1.8rem rgba(0, 0, 0, 0.18);
}

.action-burst {
    color: rgba(255, 255, 255, 0.86);
}

.color-choice-badge {
    color: rgba(255, 255, 255, 0.86);
}

.action-burst.is-special {
    border-color: rgba(255, 196, 77, 0.42);
}

.motion-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 4;
}

.motion-card {
    position: absolute;
    width: min(14vw, 180px);
    aspect-ratio: 1 / 1.45;
    filter: drop-shadow(0 1.1rem 2rem rgba(0, 0, 0, 0.3));
    transform-origin: center center;
    will-change: transform, opacity;
    z-index: 4;
}

.stack-card {
    position: absolute;
    width: var(--card-width);
    height: var(--card-height);
    filter: drop-shadow(0 1rem 2rem rgba(0, 0, 0, 0.24));
}

.stack-card.is-ghost {
    opacity: 0.72;
}

.stack-card.is-concealed {
    opacity: 0;
}

.stack-card.top-card {
    filter: drop-shadow(0 1.4rem 2.8rem rgba(0, 0, 0, 0.3));
}

.stack-card svg,
.motion-card svg {
    width: 100%;
    height: 100%;
    display: block;
}

.bottom-zone {
    display: grid;
    gap: 0.4rem;
    min-height: 0;
    border-radius: 1.4rem;
    padding: 0.9rem 1rem;
    overflow: hidden;
    align-content: start;
}

.player-rail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    align-content: start;
    min-height: 0;
}

.player-chip {
    padding: 0.65rem 0.72rem;
    border-radius: 1rem;
    background: rgba(8, 24, 25, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.player-chip.is-current {
    border-color: rgba(255, 196, 77, 0.42);
    background: linear-gradient(180deg, rgba(255, 196, 77, 0.16), rgba(255, 196, 77, 0.05));
}

.player-chip.is-waiting {
    opacity: 0.72;
}

.player-chip.is-disconnected {
    opacity: 0.54;
}

.player-name-row,
.player-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    align-items: center;
}

.player-name-row strong {
    font-size: 0.92rem;
}

.player-seat {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.player-meta-row {
    margin-top: 0.36rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.player-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--ink);
}

@media (max-width: 1100px) {
    :root {
        --card-width: min(28vw, 240px);
    }

    .screen-shell {
        grid-template-columns: minmax(17rem, 20rem) minmax(0, 1fr);
    }

    .table-stage {
        min-width: 0;
    }
}

@media (max-height: 700px) {
    :root {
        --card-width: min(18vw, 24vh, 200px);
    }

    .screen-shell {
        padding: 0.7rem 0.8rem;
        gap: 0.75rem;
        grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
    }

    .info-sidebar {
        gap: 0.7rem;
    }

    .topbar,
    .join-panel,
    .bottom-zone {
        border-radius: 1.1rem;
    }

    .topbar {
        gap: 0.7rem;
        padding: 0.75rem 0.8rem;
    }

    .brand-block {
        gap: 0.12rem 0.5rem;
    }

    .brand-block h1 {
        margin: 0.1rem 0 0.2rem;
        font-size: clamp(1.55rem, 3.7vw, 2.35rem);
    }

    .eyebrow {
        font-size: 0.72rem;
        letter-spacing: 0.2em;
    }

    .status-line,
    .join-copy {
        font-size: 0.82rem;
    }

    .pill-row {
        gap: 0.45rem;
    }

    .pill {
        min-height: 2rem;
        padding: 0.4rem 0.7rem;
        font-size: 0.82rem;
    }

    .room-pill {
        min-height: 1.4rem;
        max-width: 4.2rem;
        padding: 0.18rem 0.38rem;
        font-size: 0.62rem;
    }

    .join-panel {
        gap: 0.55rem;
        padding: 0.75rem 0.8rem;
    }

    .qr-link {
        padding: 0.45rem;
        border-radius: 8px;
    }

    .table-core {
        border-radius: 1.4rem;
        padding: 0.7rem;
        gap: 0.7rem;
    }

    .table-aura,
    .felt-shadow {
        inset: 0.7rem;
        border-radius: 1.3rem;
    }

    .turn-panel {
        width: min(34rem, 100%);
        padding: 0.55rem 0.8rem 0.68rem;
    }

    .turn-label {
        font-size: 0.63rem;
    }

    .turn-name {
        font-size: clamp(1rem, 2vw, 1.45rem);
    }

    .turn-hint {
        font-size: 0.76rem;
    }

    .pile-lane {
        column-gap: 0.75rem;
        row-gap: 0.55rem;
        padding: 0 0.35rem;
    }

    .pile-column {
        row-gap: 0.35rem;
    }

    .pile-caption {
        margin-bottom: 0.5rem;
        font-size: 0.72rem;
    }

    .pile-meta {
        min-height: 1rem;
        margin-top: 0.3rem;
        font-size: 0.76rem;
    }

    .card-pile {
        width: calc(var(--card-width) + 0.55rem);
        height: calc(var(--card-height) + 1.2rem);
    }

    .celebration-panel {
        width: min(28rem, calc(100% - 1.2rem));
        padding: 1rem 1.1rem 1.15rem;
        border-radius: 1.35rem;
    }

    .celebration-eyebrow {
        font-size: 0.68rem;
    }

    .celebration-copy {
        font-size: 0.84rem;
    }

    .celebration-timer-wrap {
        margin-top: 0.8rem;
        padding: 0.55rem 0.8rem;
    }

    .center-effects {
        width: auto;
        max-width: 100%;
        gap: 0.45rem;
    }

    .action-burst,
    .color-choice-badge {
        min-width: 6.6rem;
        padding: 0.45rem 0.6rem;
        border-radius: 0.8rem;
        font-size: 0.76rem;
    }

    .bottom-zone {
        gap: 0.35rem;
        padding: 0.7rem 0.8rem;
    }

    .player-rail {
        gap: 0.4rem;
    }

    .player-chip {
        padding: 0.45rem 0.55rem;
        border-radius: 0.8rem;
    }

    .player-name-row strong {
        font-size: 0.82rem;
    }

    .player-seat {
        font-size: 0.6rem;
    }

    .player-meta-row {
        margin-top: 0.2rem;
        font-size: 0.72rem;
    }

    .player-badge {
        min-width: 2rem;
        padding: 0.15rem 0.38rem;
    }
}

@media (max-height: 620px) and (min-width: 761px) {
    :root {
        --card-width: min(16vw, 21vh, 168px);
    }

    .screen-shell {
        padding: 0.5rem 0.6rem;
        gap: 0.6rem;
        grid-template-columns: minmax(14rem, 16.5rem) minmax(0, 1fr);
    }

    .info-sidebar {
        gap: 0.55rem;
    }

    .topbar {
        gap: 0.55rem;
        padding: 0.62rem 0.7rem;
    }

    .brand-block {
        gap: 0.1rem 0.45rem;
    }

    .brand-block h1 {
        font-size: clamp(1.4rem, 3vw, 2rem);
    }

    .join-panel {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.35rem 0.55rem;
        align-items: center;
        padding: 0.62rem 0.7rem;
    }

    .join-panel .eyebrow,
    .join-panel .join-copy {
        grid-column: 1;
    }

    .qr-link {
        grid-column: 2;
        grid-row: 1 / span 2;
        justify-self: center;
        align-self: center;
        padding: 0.45rem;
    }

    .table-core {
        padding: 0.55rem;
        gap: 0.45rem;
    }

    .table-aura,
    .felt-shadow {
        inset: 0.55rem;
    }

    .turn-panel {
        width: min(26rem, 100%);
        padding: 0.45rem 0.65rem 0.58rem;
    }

    .turn-hint {
        font-size: 0.7rem;
    }

    .pile-lane {
        column-gap: 0.55rem;
        row-gap: 0.4rem;
    }

    .celebration-panel {
        width: min(23rem, calc(100% - 1rem));
        padding: 0.8rem 0.9rem 0.95rem;
    }

    .celebration-copy {
        font-size: 0.76rem;
    }

    .celebration-timer-label {
        font-size: 0.66rem;
    }

    .bottom-zone {
        padding: 0.55rem 0.65rem;
    }

    .player-chip {
        padding: 0.34rem 0.48rem;
    }

    .player-name-row strong {
        font-size: 0.76rem;
    }

    .player-meta-row {
        font-size: 0.68rem;
    }
}

@media (max-aspect-ratio: 5/4) and (min-width: 761px) {
    :root {
        --card-width: min(14vw, 17vh, 210px);
    }

    .screen-shell {
        padding: 0.85rem 0.9rem;
        gap: 0.8rem;
        grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
    }

    .topbar,
    .join-panel,
    .bottom-zone {
        border-radius: 1.25rem;
    }

    .topbar,
    .join-panel,
    .bottom-zone,
    .table-core {
        box-shadow: 0 0.8rem 2.2rem rgba(0, 0, 0, 0.2);
    }

    .topbar {
        gap: 0.8rem;
        padding: 0.85rem 0.9rem;
    }

    .brand-block h1 {
        font-size: clamp(1.75rem, 2.6vw, 2.7rem);
    }

    .status-line,
    .join-copy,
    .turn-hint,
    .pile-meta {
        font-size: 0.84rem;
    }

    .join-panel {
        gap: 0.6rem;
        padding: 0.8rem 0.9rem;
    }

    .qr-link {
        padding: 0.55rem;
    }

    .table-core {
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .table-aura,
    .felt-shadow {
        inset: 0.8rem;
    }

    .turn-panel {
        width: min(31rem, 100%);
        padding: 0.6rem 0.85rem;
    }

    .turn-name {
        font-size: clamp(1.1rem, 1.9vw, 1.6rem);
    }

    .pile-lane {
        column-gap: 0.7rem;
        row-gap: 0.4rem;
        padding: 0 0.3rem;
    }

    .pile-column {
        row-gap: 0.45rem;
        min-width: 0;
    }

    .pile-caption {
        margin-bottom: 0.55rem;
        font-size: 0.76rem;
    }

    .card-pile {
        width: calc(var(--card-width) + 0.5rem);
        height: calc(var(--card-height) + 1rem);
    }

    .center-effects {
        width: auto;
        max-width: 100%;
        gap: 0.45rem;
    }

    .celebration-panel {
        width: min(27rem, calc(100% - 1.4rem));
    }

    .action-burst,
    .color-choice-badge {
        min-width: 6.3rem;
        padding: 0.45rem 0.55rem;
        font-size: 0.76rem;
        line-height: 1.2;
    }

    .bottom-zone {
        gap: 0.35rem;
        padding: 0.75rem 0.85rem;
    }

    .player-chip {
        padding: 0.5rem 0.6rem;
    }
}

@media (max-width: 760px) {

    html,
    body {
        overflow: auto;
    }

    .screen-shell {
        height: auto;
        min-height: var(--app-height);
        max-height: none;
        grid-template-columns: 1fr;
    }

    .info-sidebar {
        grid-template-rows: auto auto auto;
    }

    .pill-row {
        justify-content: flex-start;
    }

    .table-stage {
        min-height: 46rem;
    }

    .pile-lane {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem 0.35rem;
        padding: 0;
    }

    .center-effects {
        width: auto;
        max-width: 100%;
    }

    .celebration-panel {
        width: min(24rem, calc(100% - 1rem));
    }

    .bottom-zone {
        margin-bottom: 1rem;
    }

    .player-rail {
        grid-template-columns: 1fr;
    }
}
