:root {
    --bg: #07150f;
    --panel: rgba(11, 28, 20, 0.88);
    --panel-strong: rgba(8, 20, 15, 0.96);
    --line: rgba(255, 255, 255, 0.11);
    --line-bright: rgba(255, 255, 255, 0.2);
    --text: #f7fbf8;
    --muted: #a9bdb0;
    --gold: #f2c45f;
    --gold-2: #fff0ad;
    --green: #42d48d;
    --red: #ff6b70;
    --blue: #73a7ff;
    --felt: #0f5c3b;
    --felt-deep: #073c28;
    --shadow: 0 26px 70px rgba(0, 0, 0, 0.45);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #04100b;
    color: var(--text);
}

button,
a {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.game-shell {
    position: relative;
    display: grid;
    grid-template-rows: 74px minmax(0, 1fr) 38px 28px;
    width: 100vw;
    height: 100vh;
    min-width: 800px;
    min-height: 560px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 38%, rgba(66, 212, 141, 0.14), transparent 38%),
        linear-gradient(180deg, #0b2017 0%, #06130e 100%);
}

.topbar {
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 17, 12, 0.9);
    backdrop-filter: blur(14px);
}

.brand-block,
.you-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(242, 196, 95, 0.4);
    border-radius: 14px;
    color: #082017;
    background: linear-gradient(145deg, var(--gold-2), var(--gold));
    box-shadow: 0 9px 26px rgba(242, 196, 95, 0.18);
    font-family: Georgia, serif;
    font-size: 27px;
    font-weight: 800;
}

.brand-block strong {
    display: block;
    font-size: 18px;
    letter-spacing: 0.01em;
}

.brand-block small,
.game-footer,
.pile small,
.turn-orb small {
    color: var(--muted);
}

.game-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-pill {
    min-width: 92px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.045);
    text-align: center;
}

.stat-pill span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.stat-pill strong {
    font-size: 16px;
}

.icon-button {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid var(--line-bright);
    border-radius: 13px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.icon-button:hover {
    transform: translateY(-1px);
    border-color: rgba(242, 196, 95, 0.55);
    background: rgba(242, 196, 95, 0.09);
}

.sound-button.is-muted {
    color: #ffd0d2;
    border-color: rgba(255, 107, 112, 0.36);
    background: rgba(255, 107, 112, 0.09);
}

.table-area {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 238px;
    grid-template-rows: 112px minmax(190px, 1fr) 206px;
    grid-template-areas:
        "opponents opponents"
        "melds center"
        "player player";
    gap: 10px 14px;
    min-height: 0;
    padding: 12px 18px 10px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04), transparent 44%),
        linear-gradient(135deg, var(--felt), var(--felt-deep));
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.28);
}

.table-area::before {
    content: "";
    position: absolute;
    inset: 10px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 26px;
}

.table-glow {
    position: absolute;
    top: -130px;
    left: 50%;
    width: 540px;
    height: 280px;
    transform: translateX(-50%);
    pointer-events: none;
    border-radius: 50%;
    background: rgba(242, 196, 95, 0.08);
    filter: blur(50px);
}

.opponents {
    grid-area: opponents;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 990px;
    width: 100%;
    margin: 0 auto;
}

.opponent-card {
    position: relative;
    display: grid;
    grid-template-columns: 78px 1fr auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(6, 25, 17, 0.9), rgba(10, 34, 23, 0.72));
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.opponent-card.is-active {
    transform: translateY(3px);
    border-color: rgba(242, 196, 95, 0.7);
    box-shadow: 0 12px 34px rgba(242, 196, 95, 0.12);
}

.comic-avatar {
    --skin: #ffca94;
    --hair: #4d2d20;
    position: relative;
    width: 68px;
    height: 76px;
    flex: 0 0 auto;
}

.face-head {
    position: absolute;
    inset: 5px 4px 2px;
    overflow: hidden;
    border: 2px solid rgba(44, 21, 13, 0.72);
    border-radius: 48% 52% 46% 54% / 42% 44% 56% 58%;
    background: var(--skin);
    box-shadow: inset -7px -8px 0 rgba(120, 61, 35, 0.08);
    transition: transform 180ms ease;
}

.face-hair {
    position: absolute;
    z-index: 4;
    top: -5px;
    left: 6px;
    width: 55px;
    height: 26px;
    border-radius: 70% 42% 48% 30%;
    background: var(--hair);
    transform: rotate(-6deg);
}

.face-hair::after {
    content: "";
    position: absolute;
    right: -4px;
    top: 4px;
    width: 24px;
    height: 25px;
    border-radius: 50%;
    background: var(--hair);
}

.face-eye {
    position: absolute;
    z-index: 6;
    top: 29px;
    width: 13px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid rgba(44, 21, 13, 0.8);
    transition: all 170ms ease;
}

.face-eye::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 2px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #272019;
}

.face-eye.left { left: 14px; }
.face-eye.right { right: 14px; }

.face-brow {
    position: absolute;
    z-index: 7;
    top: 23px;
    width: 16px;
    height: 3px;
    border-radius: 3px;
    background: #4c2c1f;
    transition: transform 170ms ease;
}

.face-brow.left { left: 13px; transform: rotate(-6deg); }
.face-brow.right { right: 13px; transform: rotate(6deg); }

.face-nose {
    position: absolute;
    z-index: 6;
    top: 38px;
    left: 50%;
    width: 8px;
    height: 10px;
    transform: translateX(-50%) rotate(7deg);
    border-right: 2px solid rgba(116, 61, 40, 0.45);
    border-bottom: 2px solid rgba(116, 61, 40, 0.35);
    border-radius: 50%;
}

.face-mouth {
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: 11px;
    width: 25px;
    height: 9px;
    transform: translateX(-50%);
    border-bottom: 3px solid #6b2929;
    border-radius: 0 0 50% 50%;
    transition: all 170ms ease;
}

.face-cheek {
    position: absolute;
    z-index: 5;
    bottom: 18px;
    width: 10px;
    height: 6px;
    border-radius: 50%;
    background: rgba(244, 91, 94, 0.19);
}

.face-cheek.left { left: 8px; }
.face-cheek.right { right: 8px; }

.comic-avatar.expression-smug .face-mouth {
    width: 22px;
    height: 8px;
    transform: translateX(-43%) rotate(-9deg);
    border-bottom-width: 4px;
}

.comic-avatar.expression-smug .face-brow.left { transform: rotate(12deg) translateY(-2px); }
.comic-avatar.expression-smug .face-brow.right { transform: rotate(-14deg) translateY(-3px); }

.comic-avatar.expression-shocked .face-eye {
    width: 15px;
    height: 16px;
    top: 26px;
}

.comic-avatar.expression-shocked .face-mouth {
    width: 15px;
    height: 17px;
    bottom: 7px;
    border: 3px solid #6b2929;
    border-radius: 50%;
    background: rgba(91, 25, 29, 0.18);
}

.comic-avatar.expression-happy .face-eye {
    height: 7px;
    top: 31px;
    border-color: transparent transparent rgba(44, 21, 13, 0.8) transparent;
    background: transparent;
}

.comic-avatar.expression-happy .face-eye::after { display: none; }
.comic-avatar.expression-happy .face-mouth {
    width: 28px;
    height: 15px;
    bottom: 8px;
    border: 3px solid #6b2929;
    border-top: 0;
    background: rgba(255, 255, 255, 0.36);
}

.comic-avatar.expression-worried .face-brow.left { transform: rotate(18deg); }
.comic-avatar.expression-worried .face-brow.right { transform: rotate(-18deg); }
.comic-avatar.expression-worried .face-mouth {
    bottom: 7px;
    border-bottom: 0;
    border-top: 3px solid #6b2929;
    border-radius: 50% 50% 0 0;
}

.comic-avatar.expression-thinking .face-head { transform: rotate(5deg); }
.comic-avatar.expression-thinking .face-eye.left { transform: translate(2px, -2px); }
.comic-avatar.expression-thinking .face-eye.right { transform: translate(2px, -2px); }
.comic-avatar.expression-thinking .face-mouth { width: 15px; transform: translateX(-38%) rotate(8deg); }

.comic-avatar.expression-laugh .face-head { transform: rotate(-4deg) scale(1.02); }
.comic-avatar.expression-laugh .face-eye {
    height: 4px;
    top: 31px;
    border: 0;
    border-top: 3px solid #3f2a20;
    background: transparent;
}
.comic-avatar.expression-laugh .face-eye::after { display: none; }
.comic-avatar.expression-laugh .face-mouth {
    width: 30px;
    height: 20px;
    bottom: 5px;
    border: 3px solid #6b2929;
    border-radius: 10% 10% 50% 50%;
    background: #7f2e36;
}

.opponent-copy {
    min-width: 0;
}

.opponent-copy strong {
    display: block;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.opponent-copy small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.speech-bubble {
    position: absolute;
    z-index: 30;
    left: 72px;
    top: 72px;
    max-width: 185px;
    padding: 7px 10px;
    opacity: 0;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 11px 11px 11px 3px;
    color: #16241c;
    background: #f5f2e8;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.27);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    transform: translateY(-4px) scale(0.95);
    transition: opacity 160ms ease, transform 160ms ease;
}

.speech-bubble.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.card-fan {
    position: relative;
    width: 48px;
    height: 54px;
}

.fan-card {
    position: absolute;
    top: 4px;
    width: 34px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 3px, transparent 3px 6px),
        #173e2d;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.fan-card:nth-child(1) { left: 0; transform: rotate(-8deg); }
.fan-card:nth-child(2) { left: 7px; transform: rotate(0deg); }
.fan-card:nth-child(3) { left: 14px; transform: rotate(8deg); }

.card-count {
    position: absolute;
    right: -3px;
    bottom: -2px;
    z-index: 4;
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border: 2px solid #0e2f21;
    border-radius: 50px;
    color: #0d2218;
    background: var(--gold);
    font-size: 11px;
    font-weight: 900;
}

.meld-zone {
    grid-area: melds;
    z-index: 2;
    min-width: 0;
    min-height: 0;
    padding: 12px 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.12);
}

.zone-heading,
.player-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.zone-heading strong,
.player-head strong {
    font-size: 14px;
}

.eyebrow {
    display: block;
    margin-bottom: 2px;
    color: var(--gold-2);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.meld-count {
    padding: 5px 8px;
    border-radius: 99px;
    color: #d7ece0;
    background: rgba(255, 255, 255, 0.07);
    font-size: 10px;
    font-weight: 800;
}

.melds {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
    height: calc(100% - 38px);
    margin-top: 10px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.16) transparent;
}

.meld-group {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 70px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
}

.empty-melds {
    display: grid;
    place-items: center;
    height: calc(100% - 38px);
    color: rgba(229, 242, 234, 0.55);
    font-size: 12px;
    text-align: center;
}

.center-stack {
    grid-area: center;
    z-index: 4;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto 1fr;
    align-items: center;
    justify-items: center;
    gap: 8px;
    min-height: 0;
}

.pile {
    display: grid;
    grid-template-columns: 58px 1fr;
    grid-template-rows: 1fr 1fr;
    align-items: center;
    column-gap: 9px;
    width: 168px;
    min-height: 78px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 15px;
    color: var(--text);
    background: rgba(5, 24, 16, 0.72);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, opacity 150ms ease;
}

.pile:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: rgba(242, 196, 95, 0.55);
    background: rgba(10, 39, 27, 0.9);
}

.pile:disabled {
    opacity: 0.48;
    cursor: default;
}

.pile > :first-child {
    grid-row: 1 / 3;
}

.pile-label {
    align-self: end;
    font-size: 13px;
    font-weight: 900;
}

.pile small {
    align-self: start;
    font-size: 10px;
}

.card-back,
.discard-card-slot {
    display: grid;
    place-items: center;
    width: 50px;
    height: 66px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.82);
    border-radius: 8px;
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.28);
}

.card-back {
    position: relative;
    color: rgba(255,255,255,.88);
    background:
        radial-gradient(circle at 50% 50%, transparent 0 8px, rgba(255,255,255,.15) 8px 10px, transparent 10px 16px),
        repeating-linear-gradient(45deg, #174a35 0 4px, #0e3526 4px 8px);
}

.card-back i {
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 5px;
}

.card-back b {
    z-index: 1;
    font-family: Georgia, serif;
    font-size: 22px;
}

.discard-card-slot .playing-card {
    --card-w: 46px;
    --card-h: 62px;
    margin-left: 0;
    border-radius: 7px;
    box-shadow: none;
}

.discard-card-slot .playing-card:hover {
    transform: none;
}

.discard-card-slot .card-corner {
    left: 4px;
    top: 4px;
}

.discard-card-slot .card-corner.bottom {
    left: auto;
    top: auto;
    right: 4px;
    bottom: 4px;
}

.discard-card-slot .card-rank,
.discard-card-slot .card-suit {
    font-size: 9px;
}

.discard-card-slot .card-center {
    inset: 14px 5px 10px;
    font-size: 20px;
}

.turn-orb {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 7px;
    min-width: 168px;
    padding: 7px 10px;
    border: 1px solid rgba(242, 196, 95, 0.22);
    border-radius: 13px;
    background: rgba(242, 196, 95, 0.07);
}

.turn-dot {
    grid-row: 1 / 3;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 5px rgba(242, 196, 95, 0.1);
}

.turn-orb strong {
    font-size: 11px;
}

.turn-orb small {
    font-size: 9px;
}

.player-panel {
    grid-area: player;
    z-index: 5;
    display: grid;
    grid-template-rows: 38px minmax(98px, 1fr) 40px;
    gap: 8px;
    min-height: 0;
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(4, 20, 13, 0.78), rgba(3, 16, 11, 0.92));
    box-shadow: 0 -10px 38px rgba(0, 0, 0, 0.18);
}

.you-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(242, 196, 95, 0.25);
    border-radius: 11px;
    background: rgba(242, 196, 95, 0.08);
    font-size: 20px;
}

.status-copy {
    max-width: 60%;
    overflow: hidden;
    color: #d3e5da;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hand {
    display: flex;
    align-items: end;
    justify-content: center;
    min-width: 0;
    padding: 10px 8px 0;
    overflow: visible;
}

.playing-card {
    --card-w: 62px;
    --card-h: 88px;
    position: relative;
    flex: 0 0 var(--card-w);
    width: var(--card-w);
    height: var(--card-h);
    margin-left: -18px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(20, 27, 23, 0.22);
    border-radius: 9px;
    color: #151b17;
    background: linear-gradient(145deg, #fffefb, #ecebe6);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    user-select: none;
    transform-origin: 50% 100%;
    transition: transform 130ms ease, margin 130ms ease, box-shadow 130ms ease, border-color 130ms ease;
}

.hand .playing-card:first-child {
    margin-left: 0;
}

.playing-card:hover {
    z-index: 20;
    transform: translateY(-7px);
}

.playing-card.is-selected {
    z-index: 30;
    transform: translateY(-18px);
    border-color: var(--gold);
    box-shadow: 0 15px 26px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(242, 196, 95, 0.28);
}

.playing-card.is-red {
    color: #c43e4b;
}

.card-corner {
    position: absolute;
    left: 6px;
    top: 5px;
    display: grid;
    justify-items: center;
    line-height: 1;
}

.card-corner.bottom {
    left: auto;
    top: auto;
    right: 6px;
    bottom: 5px;
    transform: rotate(180deg);
}

.card-rank {
    font-size: 13px;
    font-weight: 900;
}

.card-suit {
    margin-top: 2px;
    font-size: 13px;
}

.card-center {
    position: absolute;
    inset: 19px 9px 14px;
    display: grid;
    place-items: center;
    font-family: Georgia, serif;
    font-size: 29px;
    font-weight: 800;
}

.playing-card.is-joker .card-center {
    font-size: 25px;
}

.joker-star {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 2px solid #6f5b1f;
    border-radius: 50% 38% 50% 40%;
    color: #6d5416;
    background: linear-gradient(145deg, #ffeb8a, #f3c94e);
    transform: rotate(-9deg);
}

.meld-group .playing-card,
.pending-meld .playing-card {
    --card-w: 43px;
    --card-h: 60px;
    margin-left: -10px;
    border-radius: 6px;
    cursor: default;
    box-shadow: 0 4px 9px rgba(0,0,0,.22);
}

.meld-group .playing-card:first-child,
.pending-meld .playing-card:first-child {
    margin-left: 0;
}

.meld-group .card-corner,
.pending-meld .card-corner {
    left: 4px;
    top: 4px;
}

.meld-group .card-corner.bottom,
.pending-meld .card-corner.bottom {
    right: 4px;
    bottom: 4px;
    left: auto;
    top: auto;
}

.meld-group .card-rank,
.meld-group .card-suit,
.pending-meld .card-rank,
.pending-meld .card-suit {
    font-size: 9px;
}

.meld-group .card-center,
.pending-meld .card-center {
    inset: 15px 5px 10px;
    font-size: 19px;
}

.meld-group .playing-card:hover,
.pending-meld .playing-card:hover {
    transform: none;
}

.action-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.action-button,
.primary-cta {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(242, 196, 95, 0.44);
    border-radius: 11px;
    color: #142219;
    background: linear-gradient(145deg, var(--gold-2), var(--gold));
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    transition: transform 140ms ease, opacity 140ms ease, filter 140ms ease;
}

.action-button:hover:not(:disabled),
.primary-cta:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.action-button:disabled {
    opacity: 0.35;
    cursor: default;
}

.action-button.secondary {
    color: #e9f5ee;
    border-color: var(--line-bright);
    background: rgba(255, 255, 255, 0.065);
}

.action-button.danger {
    color: #fff0f0;
    border-color: rgba(255, 107, 112, 0.42);
    background: rgba(255, 107, 112, 0.16);
}

.opening-tray {
    position: absolute;
    z-index: 40;
    left: 20px;
    bottom: 208px;
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 10px;
    width: calc(100% - 278px);
    min-height: 76px;
    padding: 8px 10px;
    border: 1px solid rgba(242, 196, 95, 0.34);
    border-radius: 15px;
    background: rgba(5, 23, 15, 0.97);
    box-shadow: var(--shadow);
}

.pending-melds {
    display: flex;
    gap: 7px;
    overflow-x: auto;
}

.pending-meld {
    display: flex;
    flex: 0 0 auto;
    padding: 4px;
    border-radius: 9px;
    background: rgba(255,255,255,.055);
}

.rules-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 0 14px;
    border-top: 1px solid rgba(255,255,255,.06);
    border-bottom: 1px solid rgba(255,255,255,.06);
    color: #bacfc1;
    background: #071912;
    font-size: 10px;
    white-space: nowrap;
}

.rules-strip b {
    color: var(--gold-2);
}

.game-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 18px;
    background: #040f0b;
    font-size: 9px;
}

.game-footer a {
    color: #c7d9ce;
    text-decoration: none;
}

.game-footer a:hover {
    color: var(--gold-2);
}

.toast {
    position: absolute;
    z-index: 120;
    left: 50%;
    top: 88px;
    max-width: 520px;
    padding: 9px 14px;
    opacity: 0;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px;
    color: #132219;
    background: #f8f5eb;
    box-shadow: 0 14px 34px rgba(0,0,0,.32);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    transform: translate(-50%, -8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

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

.toast.is-error {
    color: #5e1e22;
    background: #ffe8e8;
}

.screen-overlay {
    position: absolute;
    z-index: 200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 10, 7, 0.78);
    backdrop-filter: blur(10px);
}

.overlay-card {
    width: min(600px, 92vw);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 50% 0%, rgba(242, 196, 95, 0.14), transparent 38%),
        linear-gradient(145deg, rgba(11, 36, 24, 0.98), rgba(5, 19, 13, 0.98));
    box-shadow: var(--shadow);
    text-align: center;
}

.overlay-kicker {
    color: var(--gold-2);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.overlay-card h1,
.overlay-card h2 {
    margin: 10px 0 9px;
    letter-spacing: -0.03em;
}

.overlay-card h1 {
    font-family: Georgia, serif;
    font-size: clamp(34px, 5vw, 52px);
}

.overlay-card h2 {
    font-size: 31px;
}

.overlay-card p {
    max-width: 500px;
    margin: 0 auto;
    color: #c5d9cc;
    line-height: 1.55;
    font-size: 13px;
}

.intro-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 20px 0;
}

.intro-features span {
    padding: 9px 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    color: #e6f2ea;
    background: rgba(255,255,255,.045);
    font-size: 11px;
    font-weight: 700;
}

.waiting-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(242, 196, 95, 0.22);
    border-radius: 999px;
    color: #f5e4b0;
    background: rgba(242, 196, 95, 0.07);
    font-size: 11px;
    font-weight: 800;
}

.primary-cta {
    min-height: 44px;
    padding: 0 20px;
    font-size: 13px;
}

.result-emoji {
    font-size: 52px;
}

.result-score {
    display: inline-block;
    margin-top: 18px;
    padding: 9px 14px;
    border: 1px solid rgba(242, 196, 95, 0.3);
    border-radius: 12px;
    color: var(--gold-2);
    background: rgba(242, 196, 95, 0.08);
    font-size: 15px;
    font-weight: 900;
}

.game-over-card {
    border-color: rgba(255, 107, 112, 0.24);
}

.final-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 20px 0 14px;
}

.final-stats div {
    padding: 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 13px;
    background: rgba(255,255,255,.045);
}

.final-stats span,
.final-stats strong {
    display: block;
}

.final-stats span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.final-stats strong {
    font-size: 23px;
}

.overlay-card > small {
    color: #8fa89a;
    font-size: 10px;
}

.hidden {
    display: none !important;
}

@keyframes card-pop {
    0% { transform: translateY(-10px) scale(.92); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes face-bounce {
    0%, 100% { transform: translateY(0) rotate(0); }
    35% { transform: translateY(-5px) rotate(-3deg); }
    65% { transform: translateY(2px) rotate(3deg); }
}

.opponent-card.reacting .comic-avatar {
    animation: face-bounce 460ms ease;
}

.playing-card.card-enter {
    animation: card-pop 230ms ease both;
}

@media (max-height: 680px) {
    .game-shell {
        grid-template-rows: 62px minmax(0, 1fr) 32px 22px;
    }

    .topbar {
        padding: 8px 16px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
    }

    .table-area {
        grid-template-rows: 96px minmax(160px, 1fr) 176px;
        padding-top: 8px;
    }

    .comic-avatar {
        transform: scale(.86);
        transform-origin: left center;
        margin-right: -8px;
    }

    .opponent-card {
        grid-template-columns: 60px 1fr auto;
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .playing-card {
        --card-w: 56px;
        --card-h: 78px;
        margin-left: -16px;
    }

    .opening-tray {
        bottom: 178px;
    }

    .rules-strip {
        gap: 14px;
    }
}

/*
|--------------------------------------------------------------------------
| Acarde Basisauflösung 800 × 600
|--------------------------------------------------------------------------
| Die Spielfläche ist für 800 × 600 optimiert. Acarde kann diese Fläche
| auf kleineren Geräten proportional skalieren.
*/

.game-shell {
    min-width: 800px;
    min-height: 600px;
}

@media (max-width: 900px) and (max-height: 650px) {
    .game-shell {
        grid-template-rows: 56px minmax(0, 1fr) 28px 20px;
    }

    .topbar {
        gap: 10px;
        padding: 7px 12px;
    }

    .brand-block,
    .you-badge {
        gap: 8px;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 11px;
        font-size: 22px;
    }

    .brand-block strong {
        font-size: 15px;
    }

    .brand-block small {
        font-size: 9px;
    }

    .game-stats {
        gap: 5px;
    }

    .stat-pill {
        min-width: 72px;
        padding: 5px 8px;
        border-radius: 10px;
    }

    .stat-pill span {
        margin-bottom: 1px;
        font-size: 8px;
    }

    .stat-pill strong {
        font-size: 13px;
    }

    .icon-button {
        min-height: 34px;
        padding: 0 10px;
        border-radius: 10px;
    }

    .sound-text {
        display: none;
    }

    .table-area {
        grid-template-columns: minmax(0, 1fr) 192px;
        grid-template-rows: 88px minmax(150px, 1fr) 164px;
        gap: 8px 10px;
        padding: 8px 10px;
    }

    .table-area::before {
        inset: 6px;
        border-radius: 18px;
    }

    .opponents {
        gap: 7px;
        max-width: 760px;
    }

    .opponent-card {
        grid-template-columns: 52px minmax(0, 1fr) 40px;
        gap: 7px;
        padding: 5px 7px;
        border-radius: 13px;
    }

    .comic-avatar {
        width: 52px;
        height: 64px;
        margin-right: 0;
        transform: scale(.78);
        transform-origin: left center;
    }

    .opponent-copy strong {
        font-size: 12px;
    }

    .opponent-copy small {
        margin-top: 1px;
        font-size: 9px;
    }

    .card-fan {
        width: 39px;
        height: 46px;
        transform: scale(.82);
        transform-origin: right center;
    }

    .speech-bubble {
        left: 52px;
        top: 58px;
        max-width: 145px;
        padding: 5px 7px;
        font-size: 9px;
    }

    .meld-zone {
        padding: 8px 9px;
        border-radius: 14px;
    }

    .zone-heading strong,
    .player-head strong {
        font-size: 12px;
    }

    .eyebrow {
        font-size: 7px;
    }

    .meld-count {
        padding: 4px 6px;
        font-size: 8px;
    }

    .melds {
        gap: 5px;
        height: calc(100% - 30px);
        margin-top: 6px;
    }

    .meld-group {
        height: 57px;
        padding: 3px;
        border-radius: 9px;
    }

    .empty-melds {
        height: calc(100% - 30px);
        font-size: 10px;
    }

    .center-stack {
        gap: 5px;
    }

    .pile {
        grid-template-columns: 44px 1fr;
        column-gap: 7px;
        width: 138px;
        min-height: 60px;
        padding: 5px 7px;
        border-radius: 11px;
    }

    .pile-label {
        font-size: 11px;
    }

    .pile small {
        font-size: 8px;
    }

    .card-back,
    .discard-card-slot {
        width: 38px;
        height: 50px;
        border-radius: 6px;
    }

    .card-back b {
        font-size: 17px;
    }

    .discard-card-slot .playing-card {
        --card-w: 35px;
        --card-h: 47px;
        border-radius: 5px;
    }

    .discard-card-slot .card-corner {
        left: 3px;
        top: 3px;
    }

    .discard-card-slot .card-corner.bottom {
        right: 3px;
        bottom: 3px;
        left: auto;
        top: auto;
    }

    .discard-card-slot .card-rank,
    .discard-card-slot .card-suit {
        font-size: 7px;
    }

    .discard-card-slot .card-center {
        inset: 11px 4px 8px;
        font-size: 15px;
    }

    .turn-orb {
        min-width: 138px;
        padding: 5px 8px;
        border-radius: 10px;
    }

    .turn-orb strong {
        font-size: 10px;
    }

    .turn-orb small {
        font-size: 8px;
    }

    .player-panel {
        grid-template-rows: 28px minmax(76px, 1fr) 32px;
        gap: 4px;
        padding: 6px 8px;
        border-radius: 14px;
    }

    .you-avatar {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        font-size: 16px;
    }

    .status-copy {
        max-width: 58%;
        font-size: 9px;
    }

    .hand {
        padding: 3px 4px 0;
    }

    .playing-card {
        --card-w: 50px;
        --card-h: 72px;
        margin-left: -15px;
        border-radius: 7px;
    }

    .playing-card:hover {
        transform: translateY(-4px);
    }

    .playing-card.is-selected {
        transform: translateY(-12px);
    }

    .card-corner {
        left: 5px;
        top: 4px;
    }

    .card-corner.bottom {
        right: 5px;
        bottom: 4px;
        left: auto;
        top: auto;
    }

    .card-rank,
    .card-suit {
        font-size: 10px;
    }

    .card-center {
        inset: 16px 7px 12px;
        font-size: 23px;
    }

    .playing-card.is-joker .card-center {
        font-size: 20px;
    }

    .joker-star {
        width: 30px;
        height: 30px;
    }

    .meld-group .playing-card,
    .pending-meld .playing-card {
        --card-w: 37px;
        --card-h: 51px;
        margin-left: -9px;
    }

    .meld-group .card-rank,
    .meld-group .card-suit,
    .pending-meld .card-rank,
    .pending-meld .card-suit {
        font-size: 7px;
    }

    .meld-group .card-center,
    .pending-meld .card-center {
        inset: 12px 4px 8px;
        font-size: 15px;
    }

    .action-row {
        gap: 4px;
    }

    .action-button {
        min-height: 28px;
        padding: 0 8px;
        border-radius: 8px;
        font-size: 9px;
    }

    .opening-tray {
        left: 12px;
        bottom: 166px;
        grid-template-columns: 116px 1fr;
        gap: 7px;
        width: calc(100% - 220px);
        min-height: 60px;
        padding: 6px 8px;
        border-radius: 11px;
    }

    .pending-melds {
        gap: 5px;
    }

    .rules-strip {
        gap: 10px;
        padding: 0 9px;
        font-size: 8px;
    }

    .game-footer {
        gap: 10px;
        padding: 0 10px;
        font-size: 8px;
    }

    .toast {
        top: 64px;
        max-width: 480px;
        padding: 7px 10px;
        font-size: 10px;
    }

    .screen-overlay {
        padding: 16px;
    }

    .overlay-card {
        width: min(540px, 92vw);
        padding: 22px;
        border-radius: 20px;
    }

    .overlay-card h1 {
        font-size: 38px;
    }

    .overlay-card h2 {
        font-size: 26px;
    }

    .overlay-card p {
        font-size: 11px;
        line-height: 1.45;
    }

    .intro-features {
        gap: 6px;
        margin: 14px 0;
    }

    .intro-features span {
        padding: 7px 8px;
        border-radius: 9px;
        font-size: 9px;
    }

    .waiting-badge {
        min-height: 32px;
        padding: 0 11px;
        font-size: 9px;
    }

    .primary-cta {
        min-height: 36px;
        font-size: 11px;
    }

    .result-emoji {
        font-size: 42px;
    }

    .result-score {
        margin-top: 12px;
    }

    .final-stats {
        margin: 14px 0 10px;
    }
}
