/* Rooms use the available landscape rectangle, including browsers without orientation lock. */
#meme-community-ui .ec-stage { position: relative; width: 100%; }
#meme-community-ui .ec-phone.is-game-room {
    --room-rotated: 0;
    --room-height: min(100vw, var(--app-height, 100dvh));
    --room-block-insets: calc(max(4px,env(safe-area-inset-top)) + max(4px,env(safe-area-inset-bottom)));
    --card-height: clamp(46px, calc(var(--room-height) * .285 - 45px), 94px);
    --card-width: calc(var(--card-height) * .75 + 4px);
    width: min(100%, 1200px); height: 100%; max-width: none; min-height: 0;
    container-type: size;
}
@media (orientation: portrait) {
    #meme-community-ui .ec-phone.is-game-room {
        --room-rotated: 1;
        --room-block-insets: calc(max(4px,env(safe-area-inset-left)) + max(4px,env(safe-area-inset-right)));
        position: absolute; left: 50%; top: 50%;
        width: var(--app-height, 100dvh); height: 100vw;
        transform: translate(-50%, -50%) rotate(90deg);
        border: 0;
    }
}
#meme-community-ui .is-game-room > :is(.ec-header, .ec-bottom-nav, .ec-preview-note, .ec-home-indicator) { display: none; }
#meme-community-ui .ec-phone.is-game-room > .ec-main { padding: max(4px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); overflow: hidden; }
@media (orientation: portrait) {
    #meme-community-ui .ec-phone.is-game-room > .ec-main { padding: max(4px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-top)); }
}
#meme-community-ui .is-game-room .ec-toast { bottom: 54px; left: 25%; right: 25%; font-size: 12px; }
#meme-community-ui .is-live-game.is-table .ec-toast { top: 84px; bottom: auto; padding: 7px 10px; pointer-events: none; }

/* A compact room makes teammates, seating and the ready action visible together. */
#meme-community-ui .gd-lobby { height: 100%; display: flex; flex-direction: column; }
#meme-community-ui .gd-lobby-head { display: flex; align-items: center; gap: 14px; min-height: 40px; font-size: 12px; border-bottom: 1px solid var(--ec-line); }
#meme-community-ui .gd-lobby-head button { min-height: 40px; }
#meme-community-ui .gd-lobby-head > span { margin-left: auto; color: var(--ec-muted); font-size: 11px; }
#meme-community-ui .gd-lobby-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; flex: 1; min-height: 0; }
#meme-community-ui .gd-seating { position: relative; min-height: 0; }
#meme-community-ui .gd-lobby-felt { position: absolute; inset: 40px 35px; border: 5px solid light-dark(#d1dfce,#496a51); border-radius: 45%; background: light-dark(#e6eee1,#2f4938); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; }
#meme-community-ui .gd-lobby-felt img { width: 43px; height: 43px; border-radius: 10px; }
#meme-community-ui .gd-lobby-felt b { font-size: 12px; color: light-dark(#54785c,#c6dfc5); }
#meme-community-ui .gd-lobby-felt > span { font-size: 10px; color: light-dark(#718e74,#b2ceb8); }
#meme-community-ui .gd-seat { position: absolute; display: flex; align-items: center; flex-direction: column; gap: 3px; font-size: 12px; }
#meme-community-ui .gd-seat small { font-size: 9px; color: var(--ec-link); }
#meme-community-ui .gd-seat > span:last-child { font-size: 10px; color: var(--ec-link); }
#meme-community-ui .gd-seat-top { top: 5px; left: 50%; transform: translateX(-50%); }
#meme-community-ui .gd-seat-bottom { bottom: 5px; left: 50%; transform: translateX(-50%); }
#meme-community-ui .gd-seat-left { top: 50%; left: 0; transform: translateY(-50%); }
#meme-community-ui .gd-seat-right { top: 50%; right: 0; transform: translateY(-50%); }
#meme-community-ui .gd-room-info { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 0; padding: 10px 8px; }
#meme-community-ui .gd-room-info .ec-eyebrow { margin: 0; }
#meme-community-ui .gd-room-info h1 { font-size: 23px; }
#meme-community-ui .gd-room-info > p { font-size: 11px; color: var(--ec-muted); line-height: 1.7; }
#meme-community-ui .gd-room-info > small { font-size: 10px; color: var(--ec-muted); text-align: center; }
#meme-community-ui .gd-room-info .ec-button { min-height: 44px; width: 100%; font-size: 13px; }
#meme-community-ui .gd-room-spec { display: grid; gap: 8px; background: var(--ec-surface); border: 1px solid var(--ec-line); border-radius: 12px; padding: 12px; }
#meme-community-ui .gd-room-spec > span { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--ec-muted); }
#meme-community-ui .gd-room-spec b { color: var(--ec-ink); }

/* The game surface owns its palette; community sheets keep their existing theme. */
#meme-community-ui .ec-phone.is-game-room {
    --card-height: clamp(64px, calc(var(--room-height) * .21), 110px);
    --card-width: clamp(58px, calc(var(--room-height) * .22), 100px);
    --card-lift: 12px;
    --stack-step: clamp(18px, calc(var(--room-height) * .051), 27px);
    --hand-height: calc(var(--card-height) + 3 * var(--stack-step) + var(--card-lift));
    background: #143e3b;
}
#meme-community-ui .ec-phone.is-game-room > .ec-main {
    background: radial-gradient(ellipse at 50% 10%, #72a99655, transparent 55%), linear-gradient(135deg, #345e53, #153f3e 65%, #123735);
}
#meme-community-ui .is-game-room .ag-table-page {
    position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0,1fr);
    grid-template-rows: 40px minmax(64px,1fr) 44px auto; gap: 4px;
    height: 100%; min-height: 0; color: #f4f5df;
}
#meme-community-ui .is-game-room .ag-table-page::before {
    content: ''; position: absolute; z-index: -1; pointer-events: none;
    inset: 46px 4% 32px; border-radius: 42% 42% 14% 14% / 32% 32% 18% 18%;
    border: 5px solid #9fba9277; outline: 2px solid #172e2d88;
    background: radial-gradient(ellipse at 50% 15%, #449c83, #267565 60%, #1b6058);
    box-shadow: inset 0 0 0 2px #a1d2ad66, inset 0 10px 35px #083e3b55, 0 8px 0 #0e302e88, 0 15px 40px #092d2d66;
}
#meme-community-ui .is-game-room .ag-table-page::after {
    content: ''; position: absolute; z-index: -1; pointer-events: none; inset: 0;
    background: repeating-linear-gradient(120deg, #ffffff02 0 1px, transparent 1px 4px);
}
#meme-community-ui .is-game-room .ag-table-page > :is(.ag-table-top,.ag-table-scene,.ag-play-actions,.ag-hand-zone) { grid-column: 1; }
#meme-community-ui .is-game-room .ag-table-top { grid-row: 1; padding: 0; gap: 8px; border: 0; min-height: 0; }
#meme-community-ui .is-game-room .ag-table-back { min-width: 34px; min-height: 34px; border-radius: 50%; background: #092f3666; color: #e9f6e6; font-size: 26px; }
#meme-community-ui .is-game-room .ag-table-brand { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 2px 8px #052e3944; }
#meme-community-ui .is-game-room .ag-table-top > div { min-width: 0; }
#meme-community-ui .is-game-room .ag-table-top b { color: #f4f2d9; font-size: 13px; }
#meme-community-ui .is-game-room .ag-table-top > div > span { color: #b9d4c6; font-size: 9px; }
#meme-community-ui .is-game-room .ag-table-top :is(.ag-emote-button,.ec-text-button) { background: #0a343b66; color: #d6e9d9; border: 1px solid #94b8a333; border-radius: 9px; min-height: 32px; padding: 5px 10px; font-size: 11px; margin-left: 0; }
#meme-community-ui .is-game-room .ag-table-top [data-auto-button][aria-pressed=true] { background: #e9c86a; color: #59441a; }
#meme-community-ui .gd-grade { margin-left: auto; color: #d6e7c8; font-size: 11px; white-space: nowrap; }
#meme-community-ui .gd-grade b { display: inline-grid; place-items: center; width: 22px; height: 27px; margin-left: 4px; background: #fff9de; border-radius: 4px; color: #b2473f !important; box-shadow: 0 2px 0 #0b2d32; font: bold 20px Georgia,serif !important; }
#meme-community-ui .gd-demo-label { color: #b8d3c6; font-size: 9px; padding: 3px 7px; border: 1px solid #a4cbb044; border-radius: 20px; }
#meme-community-ui .is-game-room .ag-table-scene { grid-row: 2; height: auto; min-height: 0; margin: 0 12px; }
#meme-community-ui .is-game-room .ag-table-felt { inset: 0; border: 0; outline: 0; border-radius: 0; box-shadow: none; background: none; overflow: visible; }
#meme-community-ui .gd-felt-motto { position: absolute; top: 55%; left: 50%; transform: translate(-50%,-50%); color: #d7eccc35; font: 700 26px/1.2 Arial,sans-serif; letter-spacing: 5px; white-space: nowrap; text-align: center; }
#meme-community-ui .gd-felt-motto small { display: block; font: 8px/2 Arial,sans-serif; letter-spacing: 3px; }
#meme-community-ui .is-game-room .ag-player { color: #f3f4df; gap: 6px; }
#meme-community-ui .is-game-room .ag-player .ec-face { width: 46px; height: 46px; border-radius: 16px; border: 2px solid #ffe9bd; outline: 3px solid #123e3855; box-shadow: inset 0 3px 10px #ffffff88, 0 5px 10px #092f3255; }
#meme-community-ui .is-game-room .ag-player .ec-face::before { top: 16px; left: 12px; }
#meme-community-ui .is-game-room .ag-player .ec-face::after { top: 16px; right: 12px; }
#meme-community-ui .is-game-room .ag-player .ec-face i { top: 23px; left: 16px; }
#meme-community-ui .is-game-room .ag-player-top { top: 2px; padding: 4px 12px 4px 5px; border-radius: 30px; background: #103f4177; border: 1px solid #d7f1c833; gap: 7px; }
#meme-community-ui .is-game-room .ag-player-top .ec-face { width: 32px; height: 32px; border-radius: 50%; border-color: #b7f0d8; outline: 0; }
#meme-community-ui .is-game-room .ag-player-top .ec-face::before { top: 9px; left: 8px; }
#meme-community-ui .is-game-room .ag-player-top .ec-face::after { top: 9px; right: 8px; }
#meme-community-ui .is-game-room .ag-player-top .ec-face i { top: 15px; left: 9px; }
#meme-community-ui .is-game-room .ag-player-top > div { flex-direction: row; align-items: center; gap: 12px; }
#meme-community-ui .is-game-room .ag-player-top small { color: #b6e9c3; background: #52776b88; padding: 2px 5px; border-radius: 4px; }
#meme-community-ui .is-game-room .ag-player-top > div > span { color: #d6dfbd; font-size: 10px; }
#meme-community-ui .is-game-room :is(.ag-player-left,.ag-player-right) { top: 50%; transform: translateY(-42%); flex-direction: column; text-align: center; max-width: none; min-width: 64px; }
#meme-community-ui .is-game-room :is(.ag-player-left,.ag-player-right) > div { display: flex; flex-direction: column; align-items: center; gap: 3px; }
#meme-community-ui .is-game-room :is(.ag-player-left,.ag-player-right) b { font-size: 12px; }
#meme-community-ui .is-game-room :is(.ag-player-left,.ag-player-right) > div > span { padding: 3px 8px; border-radius: 10px; background: #0a363d88; color: #ffeab4; font-size: 10px; }
#meme-community-ui .is-game-room :is(.ag-player-left,.ag-player-right) small { position: absolute; top: 16px; color: #dbe9cc; font-size: 11px; white-space: nowrap; }
#meme-community-ui .is-game-room .ag-player-left small { left: 76px; }
#meme-community-ui .is-game-room .ag-player-right small { right: 76px; }
#meme-community-ui .is-game-room .ag-center-play { top: 60%; transform: translate(-50%,-30%); gap: 3px; }
#meme-community-ui .is-game-room .ag-center-play > span { color: #c4dec9; font-size: 9px; }
#meme-community-ui .is-game-room .ag-trick-cards { align-items: center; gap: 0; }
#meme-community-ui .gd-played-card { position: relative; width: 35px; height: 45px; background: linear-gradient(#fffef8,#ececdb); border: 1px solid #b9b8a2; border-radius: 4px; box-shadow: 1px 3px 4px #123b3b55; color: #202f3a; padding: 2px 5px; font: 700 21px/1 Georgia,serif; margin-left: -4px; }
#meme-community-ui .gd-played-card span { display: block; font-size: 18px; }
#meme-community-ui .gd-played-card.is-red { color: #bf3038 !important; }
#meme-community-ui .is-game-room .ag-trick-cards > small { font-size: 10px; color: #d6e6ce; margin-left: 4px; white-space: nowrap; }
#meme-community-ui .is-game-room .ag-turn-label { bottom: -3px; color: #ffe2a3; font-size: 11px; line-height: 16px; text-shadow: 0 1px 2px #183c2c; }
#meme-community-ui .is-game-room .ag-turn-label::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #ffdd88; box-shadow: 0 0 8px #ffdc8899; }
#meme-community-ui .is-game-room:not(.is-live-game) .ag-table-scene:has(.gd-played-card) .ag-turn-label { opacity: 0; }
#meme-community-ui .is-game-room .ag-table-message { position: absolute; width: 1px; height: 1px; min-height: 0; overflow: hidden; clip-path: inset(50%); padding: 0; border: 0; }

/* Actions stay above the hand, within the same visual field as the trick. */
#meme-community-ui .is-game-room .ag-play-actions { grid-row: 3; display: flex; justify-content: center; align-items: center; gap: 12px; padding: 0; position: relative; }
#meme-community-ui .is-game-room .ag-play-actions > button { flex: 0 0 92px; min-height: 38px; padding: 4px 10px; color: #fffbe4; background: linear-gradient(#75b7a3,#408c80); border: 1px solid #b4d9b077; border-radius: 20px; font-size: 16px; font-weight: 700; text-shadow: 0 1px 2px #23574f; box-shadow: inset 0 2px 0 #e0f7ca33, 0 3px 0 #113f39, 0 5px 7px #123d3e55; }
#meme-community-ui .is-game-room .ag-play-actions > .ag-play-primary { background: linear-gradient(#ffe7a0,#edbc58); border-color: #fff0b2; color: #71451b; text-shadow: 0 1px #fff2b9; flex-basis: 116px; }
#meme-community-ui .is-game-room .ag-play-actions > button:disabled { opacity: .48; box-shadow: none; }
#meme-community-ui .is-game-room .ag-play-actions > button:not(:disabled):active { transform: translateY(2px); box-shadow: none; }
#meme-community-ui .gd-selection { position: absolute; left: 3px; max-width: calc((100% - 348px)/2); display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
#meme-community-ui [data-selection-title] { color: #cde5d4; font-size: 10px; white-space: nowrap; }
#meme-community-ui [data-selection-cards] { display: none; }
#meme-community-ui [data-action=table-clear] { border: 0; padding: 2px 0; min-height: 28px; background: none; color: #ffe5a3; font-size: 10px; }
#meme-community-ui [data-action=table-clear]:disabled { visibility: hidden; }
#meme-community-ui .live-advice { position: absolute; right: 0; width: max(72px,calc((100% - 348px)/2)); max-width: calc((100% - 348px)/2); color: #d9edce; font-size: 10px; line-height: 1.3; text-align: right; pointer-events: none; }
#meme-community-ui .live-advice[hidden] { display: none; }
#meme-community-ui .live-advice b { display: block; margin-top: 2px; font-weight: 500; color: #ffe6a5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#meme-community-ui .is-game-room .ag-play-actions > .is-suggested { border-color: #ffe6a5; box-shadow: inset 0 0 0 1px #ffe6a5; }

/* Grouped stacks and a continuous overlapping fan share the same hand stage. */
#meme-community-ui .is-game-room .ag-hand-zone { grid-row: 4; margin: 0; min-width: 0; display: flex; flex-direction: column; }
#meme-community-ui .is-game-room .ag-hand { order: 0; display: flex; align-items: flex-end; justify-content: center; min-height: 0; height: var(--hand-height); gap: 0; padding: 0 2px; touch-action: none; user-select: none; -webkit-user-select: none; }
#meme-community-ui .gd-hand-stacks { height: 100%; display: flex; justify-content: center; align-items: flex-end; gap: 4px; width: min(100%,calc(var(--columns) * 68px)); }
#meme-community-ui .gd-card-stack {
    --stack-trim: clamp(0px, calc((var(--depth) - 5) * 3px), 9px);
    --stack-face-height: calc(var(--card-height) - var(--stack-trim));
    --stack-strip: min(var(--stack-step), calc((3 * var(--stack-step) + var(--stack-trim)) / max(1,var(--depth) - 1)));
    position: relative; flex: 1; min-width: 0; max-width: 64px;
    height: calc(var(--stack-face-height) + (var(--depth) - 1) * var(--stack-strip));
}
#meme-community-ui .gd-hand-row { position: relative; flex-shrink: 0; height: calc(var(--card-height) + var(--card-lift)); width: min(100%,calc(var(--cols) * 35px + var(--card-width) - 35px)); }
#meme-community-ui [data-hand][data-layout=fan] { --card-height: clamp(92px, calc(var(--room-height) * .32), 150px); --card-width: clamp(76px, calc(var(--room-height) * .29), 124px); }
#meme-community-ui .gd-card { position: absolute; top: var(--card-lift); left: calc((100% - var(--card-width)) * var(--i) / var(--gaps)); width: var(--card-width); height: var(--card-height); padding: 0; color: #202b35; background: linear-gradient(125deg,#fffefb 25%,#f1eee1); border: 1px solid #adb5a6; border-radius: 6px; box-shadow: -2px 0 3px #153b3544, 0 3px 0 #d5d3bb, 0 5px 7px #0b353744; text-align: left; touch-action: none; transition: transform .12s ease,background .12s; }
#meme-community-ui .gd-card-stack .gd-card { top: calc(var(--i) * var(--stack-strip)); left: 0; width: 100%; height: var(--stack-face-height); }
#meme-community-ui .gd-card.is-red { color: #c62f37 !important; }
#meme-community-ui .gd-corner { position: absolute; top: 4px; left: 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; line-height: 1; }
#meme-community-ui .gd-corner b { font: 700 clamp(17px,3.1cqw,28px)/.95 Arial,sans-serif; letter-spacing: -1px; }
#meme-community-ui .gd-corner > span { font: clamp(17px,2.8cqw,24px)/.9 Georgia,serif; }
#meme-community-ui .gd-card-stack .gd-corner { top: 2px; left: 4px; flex-direction: row; gap: 2px; }
#meme-community-ui .gd-card-stack .gd-corner b { font-size: clamp(16px,2.7cqw,23px); }
#meme-community-ui .gd-card-stack .gd-corner > span { font-size: clamp(13px,2.4cqw,21px); }
#meme-community-ui .gd-hand-row .gd-corner { left: 2px; }
#meme-community-ui .gd-hand-row .gd-corner b { font-size: clamp(15px,2.65cqw,25px); letter-spacing: -1.5px; }
#meme-community-ui .gd-card.is-joker .gd-corner b { font-size: clamp(15px,2.4cqw,20px); }
#meme-community-ui .gd-card.is-joker .gd-corner > span { font-size: clamp(14px,2.2cqw,18px); }
#meme-community-ui .gd-pip { position: absolute; bottom: 10px; right: 8px; font: clamp(28px,6cqh,45px)/1 Georgia,serif; opacity: .9; }
#meme-community-ui .gd-card-stack .gd-pip { bottom: 12px; right: 50%; transform: translateX(50%); }
#meme-community-ui .gd-level { position: absolute; bottom: 3px; left: 4px; padding: 1px 3px; background: #276f58; color: #fff8c8; font-size: 9px; border-radius: 3px; line-height: 11px; }
#meme-community-ui .gd-card.is-wild { background: linear-gradient(120deg,#fff8d7,#ffedb5); border-color: #b79c60; }
#meme-community-ui .gd-selected-mark { display: none; }
#meme-community-ui .gd-card.is-selected { transform: translateY(calc(-1 * var(--card-lift))); background: linear-gradient(#d8f4e5,#b9dec7); border-color: #41b897; box-shadow: inset 0 0 0 1px #6fc4a8,-2px 0 3px #153b3544,0 3px 0 #398b70; }
#meme-community-ui .gd-card:focus-visible { outline: 2px solid #ffe29a; outline-offset: 2px; }
#meme-community-ui .gd-hand-toolbar { order: 1; display: flex; justify-content: space-between; align-items: center; min-height: 28px; gap: 6px; padding: 2px 3px 0; }
#meme-community-ui .gd-hand-toolbar > div { display: flex; align-items: center; gap: 10px; }
#meme-community-ui .gd-hand-toolbar b { color: #e2e9d7; font-size: 10px; white-space: nowrap; }
#meme-community-ui .gd-hand-toolbar b > span { color: #ffe09b; margin-left: 6px; }
#meme-community-ui .gd-hand-guide { color: #afcbbd; font-size: 9px; }
#meme-community-ui .gd-hand-toolbar button { border: 0; background: none; color: #d2e1c9; padding: 4px 6px; min-height: 26px; font-size: 10px; border-radius: 6px; }
#meme-community-ui .gd-hand-toolbar button:first-child { background: #082f363d; border: 1px solid #b7d8b333; }

/* Optional large-print selection keeps the default table flow intact. */
#meme-community-ui .ec-sheet:has(.gd-expanded) { display: flex; flex-direction: column; gap: 8px; max-height: calc(100% - 8px); padding: 10px 14px; }
#meme-community-ui .ec-sheet:has(.gd-expanded) .ec-sheet-handle { display: none; }
#meme-community-ui .ec-sheet:has(.gd-expanded) .ec-sheet-heading { position: static; flex-shrink: 0; min-height: 40px; margin: 0; padding: 0; }
#meme-community-ui .gd-expanded { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
#meme-community-ui .gd-expanded > p { font-size: 11px; color: var(--ec-muted); margin: 0; }
#meme-community-ui .gd-expanded-grid { min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill,minmax(62px,1fr)); gap: 10px; padding: 14px 4px 4px; }
#meme-community-ui .gd-expanded-grid .gd-card { position: relative; left: auto; top: auto; width: 100%; height: 82px; --card-height: 82px; touch-action: pan-y; }
#meme-community-ui .gd-expanded-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-shrink: 0; }
#meme-community-ui .gd-expanded-footer > span { font-size: 12px; color: var(--ec-link); white-space: nowrap; }
#meme-community-ui .gd-expanded-footer .ec-button { min-height: 44px; min-width: 160px; width: auto; flex-shrink: 0; margin: 0; }

/* The ready room shares the club table, without changing its community controls. */
#meme-community-ui .gd-lobby { color: #e9edd9; }
#meme-community-ui .gd-lobby-head { border-color: #bfd5b433; }
#meme-community-ui .gd-lobby-head :is(button,span) { color: #ccdecb; }
#meme-community-ui .gd-lobby-felt { background: radial-gradient(ellipse at 50% 15%,#459782,#1f6659); border-color: #9bb495; box-shadow: inset 0 0 0 2px #b3d8af55,0 8px 0 #0a302d77,0 15px 25px #0f383b55; }
#meme-community-ui .gd-lobby-felt b { color: #e0ecd1; }
#meme-community-ui .gd-lobby-felt > span { color: #b8d6c2; }
#meme-community-ui .gd-seat :is(small,span:last-child), #meme-community-ui .gd-room-info > :is(p,small), #meme-community-ui .gd-room-info .ec-eyebrow { color: #c4d9c9; }
#meme-community-ui .gd-room-spec { background: #173e3d88; border-color: #b4d8b133; }
#meme-community-ui .gd-room-spec > span { color: #b8d3c5; }
#meme-community-ui .gd-room-spec b { color: #f1efda; }
#meme-community-ui .gd-room-info .ec-button { background: linear-gradient(#ffe7a0,#edbc58); color: #71451b; border-color: #fce9ad; border-radius: 22px; box-shadow: 0 3px 0 #123936; }
@container (max-width: 650px) {
    #meme-community-ui .gd-hand-guide, #meme-community-ui .gd-demo-label { display: none; }
    #meme-community-ui .is-game-room .ag-table-top { gap: 5px; }
    #meme-community-ui .is-game-room .ag-table-top :is(.ag-emote-button,.ec-text-button) { padding: 4px 7px; }
    #meme-community-ui .gd-lobby-body { gap: 12px; }
    #meme-community-ui .gd-room-info { gap: 6px; padding: 5px 0; }
    #meme-community-ui .gd-room-info h1 { font-size: 18px; }
    #meme-community-ui .gd-room-info .ec-eyebrow { display: none; }
    #meme-community-ui .gd-room-spec { gap: 5px; padding: 8px; }
    #meme-community-ui .gd-room-tip { font-size: 10px; }
    #meme-community-ui .gd-room-info > small { font-size: 9px; }
    #meme-community-ui .gd-hand-stacks { gap: 3px; }
    #meme-community-ui .gd-card-stack .gd-corner { left: 2px; gap: 1px; }
    #meme-community-ui .gd-card-stack .gd-pip { font-size: 27px; }
    #meme-community-ui .gd-selection { left: 0; }
    #meme-community-ui [data-selection-title] { font-size: 8px; }
}
@container (max-height: 350px) {
    #meme-community-ui .is-game-room .ag-table-page { grid-template-rows: 36px minmax(54px,1fr) 40px auto; gap: 3px; }
    #meme-community-ui .is-game-room .ag-table-page::before { inset: 40px 6% 30px; }
    #meme-community-ui .is-game-room :is(.ag-player-left,.ag-player-right) { flex-direction: row; top: 30%; transform: none; gap: 5px; }
    #meme-community-ui .is-game-room .ag-player .ec-face { width: 36px; height: 36px; border-radius: 12px; }
    #meme-community-ui .is-game-room .ag-player .ec-face::before { left: 9px; top: 11px; }
    #meme-community-ui .is-game-room .ag-player .ec-face::after { right: 9px; top: 11px; }
    #meme-community-ui .is-game-room .ag-player .ec-face i { left: 11px; top: 18px; }
    #meme-community-ui .is-game-room .ag-player-top .ec-face { display: none; }
    #meme-community-ui .is-game-room .ag-player-top { top: -4px; padding: 2px 10px; }
    #meme-community-ui .is-game-room :is(.ag-player-left,.ag-player-right) small { display: none; }
    #meme-community-ui .is-game-room .ag-center-play { top: 45%; }
    #meme-community-ui .is-game-room .ag-center-play:not(.is-exchange) { top: auto; bottom: 0; transform: translateX(-50%); gap: 2px; }
    #meme-community-ui .is-game-room .ag-center-play:not(.is-exchange) > [data-last-player] { line-height: 1.2; }
    #meme-community-ui .is-game-room .ag-turn-label { bottom: -4px; font-size: 10px; }
    #meme-community-ui .is-game-room .gd-played-card { height: 32px; width: 27px; font-size: 16px; padding: 1px 4px; }
    #meme-community-ui .is-game-room .gd-played-card span { font-size: 13px; }
    #meme-community-ui .gd-felt-motto { font-size: 20px; }
    #meme-community-ui .gd-felt-motto small, #meme-community-ui .gd-lobby-felt > span { display: none; }
    #meme-community-ui .gd-lobby-felt { gap: 4px; }
    #meme-community-ui .gd-lobby-felt img { width: 32px; height: 32px; }
    #meme-community-ui .gd-room-info { gap: 5px; }
    #meme-community-ui .gd-room-info h1 { font-size: 18px; }
    #meme-community-ui .gd-room-info .ec-eyebrow { display: none; }
    #meme-community-ui .gd-room-spec { padding: 7px 9px; gap: 5px; }
    #meme-community-ui .gd-room-tip { font-size: 10px; line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) {
    #meme-community-ui .gd-card { transition: none; }
}

#meme-community-ui .gd-card:disabled { opacity: 1; cursor: default; }
#meme-community-ui .gd-card.is-unavailable { filter: saturate(.35) brightness(.72); }
#meme-community-ui .gd-card.is-exchange-option { border-color: #ffdc7c; box-shadow: inset 0 0 0 2px #f1c65b,0 3px 0 #a47e2d; }
#meme-community-ui .gd-card.is-exchange-option.is-selected { border-color: #45b98d; box-shadow: inset 0 0 0 2px #51bd93,0 3px 0 #2e8067; }
#meme-community-ui .is-live-game .ag-center-play.is-exchange {
    width: min(60%,440px); top: auto; bottom: 24px; transform: translateX(-50%); gap: 4px;
}
#meme-community-ui .is-live-game .is-exchange [data-last-player] {
    display: flex; align-items: center; justify-content: center; gap: 7px; text-align: center;
}
#meme-community-ui .is-live-game .is-exchange [data-last-player] b {
    color: #ffe5ac; font-size: 12px; white-space: nowrap;
}
#meme-community-ui .is-live-game .is-exchange .ag-trick-cards {
    display: flex; align-items: stretch; justify-content: center; width: 100%; gap: 5px;
}
#meme-community-ui .live-exchange-pair {
    flex: 1; min-width: 0; max-width: 100%; display: flex; align-items: center; gap: 4px;
    padding: 3px 5px; border: 1px solid #b6ceb34a; border-radius: 7px;
    background: #163c34; color: #e6eee1; font-size: 10px; white-space: nowrap;
}
#meme-community-ui .live-exchange-pair:only-child { flex: 0 1 auto; }
#meme-community-ui .live-exchange-names { display: flex; min-width: 0; align-items: center; gap: 3px; }
#meme-community-ui .live-exchange-names > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#meme-community-ui .live-exchange-names > b, #meme-community-ui .live-exchange-pending { color: #abc7ad; }
#meme-community-ui .live-exchange-relative { display: none; }
#meme-community-ui .live-exchange-card { display: inline-flex; flex: none; align-items: center; gap: 2px; }
#meme-community-ui .live-exchange-card > span:first-child { color: #e3cd96; }
#meme-community-ui .live-mini-card {
    display: inline-flex; flex: none; align-items: center; justify-content: center;
    min-width: 22px; min-height: 20px; padding: 2px 3px;
    color: #273e36; background: #fffaf0; border: 1px solid #c7c9b9; border-radius: 4px;
    font: 700 11px/1 system-ui,sans-serif; white-space: nowrap;
}
#meme-community-ui .live-mini-card.is-red { color: #a62843; }
@container (max-width: 640px) {
    #meme-community-ui .is-live-game .ag-center-play.is-exchange { width: 46%; }
    #meme-community-ui .live-exchange-full { display: none; }
    #meme-community-ui .live-exchange-relative { display: inline; }
}
#meme-community-ui .is-live-game [data-selection-title] { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
#meme-community-ui [data-live-pattern] { min-height: 44px; width: 100%; font-size: 16px; padding: 8px; }
#meme-community-ui .is-live-game .ag-player.is-current-turn .ec-face { outline: 2px solid #d2b66d; box-shadow: none; }
#meme-community-ui .is-live-game [data-action=table-emote]:disabled { opacity: 1; color: #ffe1a0; }
#meme-community-ui .gd-card-stack { container-type: inline-size; }
#meme-community-ui .gd-card-stack .gd-corner b { font-size: clamp(12px,42cqw,23px); }
#meme-community-ui .gd-card-stack .gd-corner > span { font-size: clamp(11px,36cqw,21px); }
#meme-community-ui .gd-card-stack .gd-card.is-joker .gd-corner b { font-size: clamp(11px,36cqw,18px); }
#meme-community-ui .gd-card-stack .gd-card.is-joker .gd-corner > span { font-size: clamp(11px,34cqw,17px); }
#meme-community-ui .is-live-game .ag-table-top > div { flex: 1; max-width: 240px; }
#meme-community-ui .is-live-game .ag-table-top > div b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#meme-community-ui .is-live-game .ag-player b { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#meme-community-ui .is-live-game [data-last-player] { display: flex; align-items: center; justify-content: center; }
#meme-community-ui .is-live-game .live-play-owner { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#meme-community-ui .is-live-game .live-play-pattern { flex: none; white-space: pre; }
#meme-community-ui .is-live-game .gd-lobby-head > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Each player's public cards sit just inside their seat. */
#meme-community-ui .ec-phone.is-game-room.is-live-game {
    --deck-paper: linear-gradient(160deg,#fff 32%,#f1faf7);
    --deck-ink: #141d2f;
    --deck-red: #b91d36;
    --deck-edge: #b8cfc6;
}
#meme-community-ui .ec-phone.is-game-room.is-live-game > .ec-main {
    background: #173631;
}
#meme-community-ui .is-live-game .ag-table-page {
    --live-stack-height: clamp(59px, calc(var(--room-height) * .185), 104px);
    --live-stack-step: clamp(19px, calc(var(--room-height) * .055), 28px);
    --live-hand-height: calc(var(--live-stack-height) + 3 * var(--live-stack-step) + var(--card-lift));
    --live-header-height: 38px;
    --live-actions-height: 45px;
    --live-scene-base: 84px;
    --live-scene-min: var(--live-scene-base);
    --live-grid-gap: 4px;
    --live-toolbar-height: 30px;
    --live-played-height: clamp(34px, calc(var(--room-height) * .15 - 8px), 70px);
    --live-away-height: calc(var(--live-played-height) * .76);
    --live-played-bottom: clamp(3px, calc((var(--room-height) - 425px) * .22), 100px);
    --live-partner-inset: 36px;
    --live-partner-min: 20px;
    --live-seat-rail: clamp(57px, 10.5%, 112px);
    grid-template-rows: var(--live-header-height) minmax(var(--live-scene-min),1fr) var(--live-actions-height) auto;
    gap: var(--live-grid-gap);
}
#meme-community-ui .is-live-game .ag-table-page:has(.gd-card-stack > :nth-child(6)) {
    --live-scene-min: max(var(--live-scene-base),calc(var(--live-partner-inset) + var(--live-partner-min)
        + var(--live-played-height) + var(--live-played-bottom) + 4px));
}
#meme-community-ui .is-live-game .ag-table-page::before {
    inset: 40px 3% 30px;
    border: 2px solid #739783;
    outline: 1px solid #132d28;
    border-radius: 42% 42% 14% 14% / 29% 29% 18% 18%;
    background: #24594c;
    box-shadow: inset 0 0 0 4px #152f2b66, 0 5px 0 #102823, 0 9px 18px #091c1a65;
}
#meme-community-ui .is-live-game .ag-table-page::after { background: none; }
#meme-community-ui .is-live-game .gd-felt-motto { display: none; }
#meme-community-ui .is-live-game .ag-player .ec-face { box-shadow: 0 3px 7px #102d2b70; }
#meme-community-ui .is-live-game .ag-player.is-current-turn .ec-face { outline-color: #e7c67d; }
#meme-community-ui .is-live-game .gd-lobby-felt { background: #28594b; box-shadow: none; }
#meme-community-ui .is-live-game .gd-room-info .ec-button { background: #e8c683; color: #3d2c16; border-color: #e8c683; }
#meme-community-ui .gd-room-share { display: flex; flex-wrap: wrap; gap: 4px 12px; }
#meme-community-ui .gd-room-share button { min-height: 36px; }
#meme-community-ui .is-live-game .ag-table-top > div > span {
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: #c5d8cd; font-size: 10px;
}
#meme-community-ui .is-live-game [data-action=table-emote] {
    min-width: 55px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
#meme-community-ui .is-live-game [data-action=table-emote].is-urgent {
    background: #563527; color: #ffe1a0; border-color: #dfad6577;
}
#meme-community-ui .is-live-game .room-toggle {
    flex: 0 0 64px; min-height: 36px; padding: 3px 4px; border: 1px solid #8dad9870;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    position: relative; -webkit-tap-highlight-color: transparent;
    border-radius: 8px; background: #173f36; color: #e5efe3; font-size: 11px;
    font-weight: 650; white-space: nowrap;
}
#meme-community-ui .is-live-game .room-toggle::after { content: ''; position: absolute; inset: -4px 0; }
#meme-community-ui .is-live-game .room-toggle.room-settings {
    flex: 0 0 34px; font-size: 16px; font-weight: 500;
}
#meme-community-ui .room-toggle i { width: 16px; height: 16px; position: relative; flex: none; }
#meme-community-ui .room-lock-icon::before {
    content: ''; position: absolute; width: 8px; height: 8px; border: 1.5px solid currentColor;
    border-bottom: 0; border-radius: 6px 6px 0 0; top: 0; left: 6px; transform: rotate(17deg);
    transform-origin: left bottom;
}
#meme-community-ui [data-action=table-lock][aria-pressed=true] .room-lock-icon::before { left: 4px; transform: none; }
#meme-community-ui .room-lock-icon::after {
    content: ''; position: absolute; inset: 7px 2px 0; border: 1.5px solid currentColor; border-radius: 2px;
    background: radial-gradient(circle at center, currentColor 1px, transparent 1.5px);
}
#meme-community-ui .room-sound-icon::before {
    content: ''; position: absolute; inset: 2px 6px 2px 0; background: currentColor;
    clip-path: polygon(0 30%,35% 30%,100% 0,100% 100%,35% 70%,0 70%);
}
#meme-community-ui .room-sound-icon::after {
    content: ''; position: absolute; width: 10px; height: 1.5px; top: 7px; right: -2px;
    background: currentColor; transform: rotate(-55deg);
}
#meme-community-ui [data-action=table-sound][aria-pressed=true] .room-sound-icon::after {
    width: 9px; height: 14px; top: 1px; right: -1px; border-right: 1.5px solid currentColor;
    border-radius: 50%; background: none; transform: none;
}
#meme-community-ui [data-action=table-sound][aria-pressed=true] .room-sound-icon b {
    position: absolute; width: 7px; height: 8px; top: 4px; right: 2px; border-right: 1.5px solid currentColor; border-radius: 50%;
}
#meme-community-ui .is-live-game [data-action=table-lock][aria-pressed=true] {
    background: #e9cc8c; border-color: #f2dba7; color: #392c19;
}
#meme-community-ui .is-live-game [data-action=table-sound][aria-pressed=true] {
    background: #2c6955; border-color: #9bc4a5; color: #f1f7eb;
}
#meme-community-ui .is-live-game [data-action=table-sound]:is([data-audio-state=waiting],[data-audio-state=blocked]) {
    background: #51432e; border-color: #ddbc7c; color: #ffebba;
}
#meme-community-ui .is-live-game .room-toggle:focus-visible { outline-color: #ffe19b; outline-offset: 2px; }
#meme-community-ui .is-live-game .gd-lobby-head .room-toggle[aria-pressed=false] { background: #2d5b4f; }
#meme-community-ui .is-live-game .gd-lobby-head [data-room-id] { white-space: nowrap; }
#meme-community-ui .is-live-game .gd-lobby-head [data-room-title] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#meme-community-ui .live-result-actions [data-result-unlock] { color: var(--ec-link); }
#meme-community-ui .is-live-game .ag-player-top { border-radius: 12px; padding: 3px 8px 3px 4px; background: #103a32; }
#meme-community-ui .is-live-game .ag-player-top > div { gap: 8px; }
#meme-community-ui .is-live-game .ag-player-top .ec-face { width: 26px; height: 26px; }
#meme-community-ui .is-live-game .ag-player-top .ec-face::before,
#meme-community-ui .is-live-game .ag-player-top .ec-face::after { top: 7px; }
#meme-community-ui .is-live-game .ag-player-top .ec-face i { top: 12px; left: 6px; }
#meme-community-ui .is-live-game .ag-table-scene {
    --live-side-center: calc(50% + var(--live-actions-height) * .75);
}
#meme-community-ui .is-live-game :is(.ag-player-left,.ag-player-right) {
    top: var(--live-side-center); transform: translateY(-50%);
}
#meme-community-ui .is-live-game .ag-table-scene:not(:has(.is-exchange)) :is(.ag-player-left,.ag-player-right) {
    width: var(--live-seat-rail); min-width: 0;
    flex-direction: column; gap: 2px;
}
#meme-community-ui .is-live-game .ag-table-scene:not(:has(.is-exchange)) :is(.ag-player-left,.ag-player-right) b {
    max-width: clamp(48px,8cqw,90px);
}
#meme-community-ui .is-live-game :is(.ag-player-left,.ag-player-right) > div > span {
    background: #112e29; color: #eaf2df; border: 1px solid #bfd9aa35; font-size: 11px;
}
#meme-community-ui .is-live-game .ag-player.is-low-hand > div > span { background: #5b432d; color: #ffe1a0; border-color: #dfad6577; }
#meme-community-ui .is-live-game .ag-player.is-offline .ec-face { opacity: .65; }
#meme-community-ui .is-live-game .ag-player-top.is-current-turn { border-color: #e5c779; }
#meme-community-ui .is-live-game .ag-player :is([data-ally-count],[data-neko-count],[data-luna-count]):empty { display: none; }
#meme-community-ui .is-game-room .ag-player [data-seat-status]:empty { display: none; }
#meme-community-ui .is-live-game .ag-player [data-seat-status]:not(:empty) {
    display: inline-flex; position: static; padding: 2px 6px; border-radius: 5px;
    color: #deeee0; background: #164a40; font-size: 10px; line-height: 13px; white-space: nowrap;
}
#meme-community-ui .is-live-game .ag-player.has-passed [data-seat-status] { color: #f6deb1; background: #584834; }
#meme-community-ui [data-prior-plays] { display: none; }
#meme-community-ui .is-live-game [data-prior-plays]:not([hidden]),
#meme-community-ui .is-live-game .ag-center-play:not(.is-exchange) { display: contents; }
#meme-community-ui .is-live-game .ag-center-play:not(.is-exchange) > [data-last-player] {
    position: absolute; top: 1px; left: 0; max-width: 30%; min-height: 18px;
    justify-content: flex-start; white-space: nowrap; overflow: hidden;
}
#meme-community-ui .is-live-game .ag-center-play:not(.is-exchange) > [data-last-player]:empty { display: none; }
#meme-community-ui .is-live-game .ag-trick-cards[data-play-position] {
    --trick-height: var(--live-away-height);
    --trick-width: calc(var(--trick-height) * .75);
    --trick-gap: min(4px, calc((100cqw - var(--trick-width) * var(--trick-count,1)) / max(1, var(--trick-count,1) - 1)));
    position: absolute; display: flex; justify-content: center; width: 32%;
    container-type: inline-size; pointer-events: none;
}
#meme-community-ui .is-live-game .ag-trick-cards[data-play-position]:empty { display: none; }
#meme-community-ui .is-live-game .ag-trick-cards:is([data-play-position=self],[data-play-position=partner]) {
    left: 50%; transform: translateX(-50%);
}
#meme-community-ui .is-live-game .ag-trick-cards[data-play-position=self] {
    --trick-height: var(--live-played-height); bottom: var(--live-played-bottom);
}
#meme-community-ui .is-live-game .ag-trick-cards[data-play-position=partner] {
    --trick-height: max(var(--live-partner-min),min(var(--live-away-height),100cqh));
    top: max(var(--live-partner-inset),15%);
    bottom: calc(var(--live-played-height) + var(--live-played-bottom) + 4px);
    align-items: flex-start; container-type: size;
}
#meme-community-ui .is-live-game .ag-trick-cards:is([data-play-position=left],[data-play-position=right]) {
    --side-play-half: calc(var(--trick-height) / 2);
    top: min(var(--live-side-center),calc(100% - var(--side-play-half) - 2px)); transform: translateY(-50%);
    width: calc(34% - var(--live-seat-rail) - 8px);
}
#meme-community-ui .is-live-game .ag-trick-cards[data-play-position=left] {
    left: calc(var(--live-seat-rail) + 4px); justify-content: flex-start;
}
#meme-community-ui .is-live-game .ag-trick-cards[data-play-position=right] {
    right: calc(var(--live-seat-rail) + 4px); justify-content: flex-end;
}
#meme-community-ui .is-live-game .ag-trick-cards:is([data-play-position=left],[data-play-position=right]):has(> :nth-child(6)) {
    display: grid; --side-cell: min(100% / 5, var(--trick-width) + 4px);
    --side-play-half: calc(var(--trick-height) + 1.5px);
    grid-template-columns: repeat(5,var(--side-cell)); row-gap: 3px;
}
#meme-community-ui .is-live-game .ag-trick-cards:is([data-play-position=left],[data-play-position=right]):has(> :nth-child(6)) > .gd-played-card {
    margin: 0; width: min(100%,var(--trick-width));
    font-size: min(16px, calc(var(--trick-height) * .46)); justify-items: center;
}
#meme-community-ui .is-live-game .live-prior-play { opacity: .74; }
#meme-community-ui .is-live-game .live-prior-play .gd-played-card { animation: none; }
#meme-community-ui .is-live-game [data-trick][data-play-position] .gd-played-card {
    border-color: #b5ead9; box-shadow: inset 0 1px 0 #fff,0 2px 0 #78aa9b,0 4px 7px #0b392e66;
}
#meme-community-ui .is-live-game [data-last-player] { font-size: 13px; line-height: 16px; color: #e5f3e2; }
#meme-community-ui .is-live-game .live-play-role {
    background: #323757; color: #ffdf91; padding: 1px 5px; margin-right: 4px;
    border-radius: 5px; font-weight: 700; white-space: nowrap;
}
#meme-community-ui .is-live-game .is-last-move {
    animation: gd-seat-flash .9s ease-out both;
}
@keyframes gd-seat-flash {
    from { box-shadow: 0 0 0 2px #ffdd87, 0 0 12px #ffdd8766; }
    to { box-shadow: 0 0 0 1px #ffdd8744; }
}
@media (prefers-reduced-motion: reduce) {
    #meme-community-ui .is-live-game .is-last-move { animation: none; outline: 1px solid #ffdd87; }
}
#meme-community-ui .is-live-game .live-play-pattern { color: #f4d693; }
#meme-community-ui .is-live-game .gd-played-card {
    background: var(--deck-paper); color: var(--deck-ink); border-color: var(--deck-edge); border-radius: 4px;
    box-shadow: inset 0 1px 0 #fff,0 2px 0 #88a99c,0 4px 7px #0b392e66;
    display: grid; align-content: center; justify-items: center; flex: none;
    width: var(--trick-width); height: var(--trick-height); padding: 1px 3px; margin: 0;
    font: 700 clamp(13px, calc(var(--trick-height) * .48), 32px)/.94 Georgia,"Times New Roman",serif;
    font-variant-numeric: lining-nums;
    letter-spacing: -.025em;
    animation: gd-trick-entry .14s ease-out both;
}
#meme-community-ui .is-live-game .gd-played-card + .gd-played-card { margin-inline-start: var(--trick-gap); }
#meme-community-ui .is-live-game .ag-trick-cards:is([data-play-position=self],[data-play-position=partner]):has(> .gd-played-card:nth-child(6)) .gd-played-card:not(:last-child) {
    justify-items: start;
    font-size: min(calc(var(--trick-height) * .45), clamp(9px, calc((var(--trick-width) + min(0px,var(--trick-gap)) - 4px) * .9), 27px));
}
#meme-community-ui .is-live-game .ag-hand { height: var(--live-hand-height); }
#meme-community-ui .is-live-game [data-hand][data-layout=stack] {
    --card-height: var(--live-stack-height);
    --stack-step: var(--live-stack-step);
    /* Let a tall stack grow into spare table space while keeping the play area reachable. */
    --hand-limit: calc(100cqh - var(--room-block-insets) - var(--live-header-height)
        - var(--live-actions-height) - var(--live-scene-min) - 3 * var(--live-grid-gap) - var(--live-toolbar-height));
    --deep-face: clamp(var(--stack-face-min,36px), calc(var(--hand-limit) - var(--stack-layers) * var(--stack-strip-min,13px)), var(--card-height));
    --stack-stage: max(var(--live-hand-height),min(var(--hand-limit),calc(var(--deep-face) + var(--stack-layers) * var(--stack-step))));
    height: var(--stack-stage);
}
#meme-community-ui .is-live-game .gd-card-stack {
    --stack-face-height: clamp(var(--deep-face),calc(var(--stack-stage) - (var(--depth) - 1) * var(--stack-strip-min,13px)),var(--card-height));
    --stack-strip: min(var(--stack-step),calc((var(--stack-stage) - var(--stack-face-height)) / max(1,var(--depth) - 1)));
    --stack-corner-top: clamp(2.5px,calc(var(--stack-strip) * .18),5px);
    --stack-corner-band: calc(var(--stack-strip) - var(--stack-corner-top) - 2.5px);
}
#meme-community-ui .is-live-game .gd-card-stack > .gd-card:not(:only-child).is-selected { transform: none; }
#meme-community-ui .is-live-game .gd-played-card span { font-size: clamp(11px, calc(var(--trick-height) * .38), 26px); }
#meme-community-ui .is-live-game .ag-turn-label {
    left: 50%; right: auto; bottom: 1px; transform: translateX(-50%);
    width: max-content; max-width: calc(100% - 176px); min-height: 18px; padding: 0 8px; border-radius: 10px;
    background: #102e29; border: 1px solid #abc8a730; color: #e1ece1; font-size: 11px; font-weight: 600;
    line-height: 16px; overflow-wrap: anywhere; text-shadow: none;
}
#meme-community-ui .is-live-game .ag-turn-label::before { flex: 0 0 5px; background: #96bab1; box-shadow: none; }
#meme-community-ui .is-live-game .ag-turn-label.is-mine { background: #f3d78d; color: #392b16; border-color: #fff0b8; }
#meme-community-ui .is-live-game .ag-turn-label.is-mine::before { background: #795825; }
#meme-community-ui .is-live-game .ag-table-scene:not(:has(.is-exchange)) .ag-turn-label {
    top: 1px; bottom: auto; left: auto; right: 0; transform: none;
    display: block; max-width: 26%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#meme-community-ui .is-live-game .ag-table-scene:not(:has(.is-exchange)) .ag-turn-label::before {
    display: inline-block; margin-right: 5px; vertical-align: 2px;
}
#meme-community-ui .is-live-game .ag-play-actions {
    --selection-slot: clamp(96px,19cqw,172px);
    gap: clamp(7px,1.4cqw,14px);
}
#meme-community-ui .is-live-game .ag-play-actions:has(> button:not([hidden]))::before {
    content: ""; flex: 0 1 var(--selection-slot);
}
#meme-community-ui .is-live-game .ag-play-actions > button {
    flex-basis: clamp(68px,14cqw,104px); min-height: 42px;
    position: relative; border-radius: 999px; font-weight: 800; text-shadow: none; white-space: nowrap;
    padding-inline: 8px;
    -webkit-tap-highlight-color: transparent;
    transition: transform .12s ease,box-shadow .12s ease;
}
#meme-community-ui .is-live-game .ag-play-actions > button:enabled {
    background: linear-gradient(168deg,#317a6b,#1d574b 72%); color: #f0fff9; border-color: #a1ddc8;
    box-shadow: inset 0 1px 0 #d0f7e68c,inset 0 -1px 0 #144b40,0 3px 0 #153e36,0 5px 9px #082d2699;
}
#meme-community-ui .is-live-game .ag-play-actions > [data-action=table-hint]:enabled {
    background: linear-gradient(157deg,#e7f9ff 4%,#b4dbff 47%,#76b3f8);
    color: #103264; border-color: #ccecff;
    box-shadow: inset 0 1px 0 #fff,inset 0 -1px 0 #72a7eb,0 3px 0 #2860aa,0 5px 9px #082d2699;
}
#meme-community-ui .is-live-game .ag-play-actions > .ag-play-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    flex-basis: clamp(110px,19cqw,148px); font-size: 16px; white-space: nowrap;
}
#meme-community-ui .is-live-game .ag-play-actions > .ag-play-primary:enabled {
    background: linear-gradient(156deg,#d1fbe0 4%,#8eeabd 48%,#4bd59a);
    color: #103d2d; border-color: #b5f0cd;
    box-shadow: inset 0 1px 0 #effff5,inset 0 -1px 0 #4bba8d,0 3px 0 #237455,0 5px 10px #082d268c;
}
#meme-community-ui .is-live-game .ag-play-actions > .is-suggested:enabled { outline: 1px solid #ffe4a3; outline-offset: 2px; }
#meme-community-ui .is-live-game .ag-play-actions > button:enabled:active {
    transform: translateY(2px); box-shadow: inset 0 1px 0 #ffffff60,0 1px 2px #0b392e90;
}
#meme-community-ui .is-live-game .ag-play-actions > button:enabled:focus-visible {
    outline: 2px solid #ffdd92; outline-offset: 2px;
}
#meme-community-ui .is-live-game .ag-play-actions > button:disabled {
    background: #285c50; color: #c9e8de; border-color: #79aa996f; opacity: 1; box-shadow: none;
}
#meme-community-ui .is-live-game [data-selected-count] {
    padding: 2px 4px; background: #422f1621; border-radius: 5px;
    font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums;
}
#meme-community-ui .is-live-game [data-selected-count]:empty { display: none; }
#meme-community-ui .is-live-game .gd-selection {
    position: static; flex: 0 1 var(--selection-slot); width: auto; min-width: 0; max-width: none;
    min-height: 32px; margin: 0; box-sizing: border-box; padding: 3px 4px 3px 6px;
    border: 1px solid transparent;
    flex-direction: row; align-items: center; justify-content: space-between; gap: 4px;
}
#meme-community-ui .is-live-game .gd-selection:not(.has-selection) { visibility: hidden; }
#meme-community-ui .is-live-game .gd-selection.has-selection {
    padding: 3px 4px 3px 6px; background: #173d34; border: 1px solid #aec5a640; border-radius: 8px;
}
#meme-community-ui .is-live-game .gd-selection-summary { min-width: 0; flex: 1; }
#meme-community-ui .is-live-game [data-selection-title] {
    display: block; overflow: hidden; text-overflow: ellipsis; color: #e2ebdd;
    font-size: 10px; line-height: 1.25;
}
#meme-community-ui .is-live-game [data-selection-feedback] {
    display: block; color: #ffdfa4; font-size: 10px; font-weight: 650; line-height: 1.35;
}
#meme-community-ui .is-live-game [data-selection-cards] { display: flex; gap: 2px; margin-top: 3px; overflow: hidden; }
#meme-community-ui .is-live-game [data-selection-cards] > span {
    flex: none; padding: 1px 3px; border-radius: 3px;
    background: #f5f2e4; color: #243c35; font: 700 9px/1.15 system-ui,sans-serif;
}
#meme-community-ui .is-live-game [data-selection-cards] > .is-red { color: #9e2740; }
#meme-community-ui .is-live-game [data-action=table-clear] {
    flex: none; min-height: 29px; padding: 2px 4px; border-left: 1px solid #b6c6a640;
}
#meme-community-ui .is-live-game [data-action=table-clear]:disabled { display: none; }
#meme-community-ui .is-live-game .live-advice {
    width: min(176px,calc((100% - 318px)/2)); max-width: none;
    padding: 4px 6px; border-radius: 7px; background: #173d34; border: 1px solid #aec5a640;
}
#meme-community-ui .live-pattern-cards { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 7px; }
#meme-community-ui .live-pattern-choices { display: grid; margin: 0 0 8px; padding: 0; gap: 4px; border: 0; }
#meme-community-ui .live-pattern-choices legend {
    margin: 0 0 5px; padding: 0; color: var(--ec-muted); font-size: 12px;
}
#meme-community-ui .live-pattern-choices label {
    display: flex; min-height: 40px; align-items: center; gap: 8px; padding: 4px 10px;
    border: 1px solid var(--ec-line); border-radius: 8px; color: var(--ec-ink); font-size: 13px;
}
#meme-community-ui .live-pattern-choices label:has(:checked) {
    background: var(--ec-soft); border-color: var(--ec-data);
}
#meme-community-ui .live-pattern-choices input[type=radio] {
    flex: 0 0 18px; width: 18px; min-width: 18px; height: 18px; min-height: 18px;
    margin: 0; padding: 0; accent-color: var(--ec-data);
}
#meme-community-ui .ec-sheet:has(.live-pattern-choices) {
    width: min(100%,460px); margin-inline: auto; padding: 10px 16px 14px;
}
#meme-community-ui .ec-sheet:has(.live-pattern-choices) .ec-sheet-handle { display: none; }
#meme-community-ui .ec-sheet:has(.live-pattern-choices) .ec-sheet-heading { min-height: 40px; margin-bottom: 7px; padding: 0; }
#meme-community-ui .ec-sheet:has(.live-pattern-choices) [data-action=live-play-pattern] { margin-top: 3px; min-height: 42px; }
#meme-community-ui .is-live-game .gd-card {
    background: var(--deck-paper); color: var(--deck-ink); border-color: var(--deck-edge); border-radius: 5px;
    box-shadow: inset 0 1px 0 #fff,0 1px 0 #84a79a,0 3px 6px #0a382d55;
    transition: transform .12s ease-out;
    -webkit-tap-highlight-color: transparent;
}
#meme-community-ui .is-live-game .gd-card > * { pointer-events: none; }
#meme-community-ui .is-live-game .gd-corner { top: 5px; }
#meme-community-ui .is-live-game .gd-corner b {
    font-family: Georgia,"Times New Roman",serif; font-weight: 700;
    font-variant-numeric: lining-nums; letter-spacing: -.03em;
}
#meme-community-ui .is-live-game .gd-card-stack .gd-corner {
    top: var(--stack-corner-top); left: clamp(3px,8cqw,5px); gap: clamp(1px,4cqw,3px);
    height: var(--stack-corner-band);
}
#meme-community-ui .is-live-game .gd-card-stack > .gd-card:not(:last-child) .gd-corner b {
    font-family: Arial,sans-serif; font-weight: 800; letter-spacing: -.04em;
    font-size: min(40cqw,23px,calc(var(--stack-corner-band) / .8)); line-height: .8;
}
#meme-community-ui .is-live-game .gd-card-stack .gd-corner > span {
    font-family: "Segoe UI Symbol",Georgia,serif;
    font-size: min(32cqw,19px,calc(var(--stack-corner-band) / .84)); line-height: .84;
}
#meme-community-ui .is-live-game .gd-card-stack > .gd-card:last-child .gd-corner {
    top: clamp(5px,calc(var(--stack-face-height) * .1),8px); height: auto;
}
#meme-community-ui .is-live-game .gd-card-stack > .gd-card:last-child .gd-corner b {
    font-size: min(clamp(13px,42cqw,27px), calc(var(--stack-face-height) * .34));
}
#meme-community-ui .is-live-game .gd-card-stack > .gd-card:last-child .gd-corner > span {
    font-size: min(clamp(10px,29cqw,19px), calc(var(--stack-face-height) * .27));
}
#meme-community-ui .is-live-game .gd-card.is-joker .gd-corner b,
#meme-community-ui .is-live-game .gd-card.is-joker .gd-corner > span {
    font-family: system-ui,sans-serif; letter-spacing: 0;
}
#meme-community-ui .is-live-game .gd-card-stack > .gd-card.is-joker:not(:last-child) .gd-corner :is(b,span) {
    font-size: min(35cqw,17px,calc(var(--stack-corner-band) / .84));
}
#meme-community-ui .is-live-game .gd-card-stack .gd-pip:not(:has(.gd-court,.gd-joker-art)) {
    bottom: 3px; font-size: min(clamp(16px,58cqw,41px), calc(var(--stack-face-height) * .54));
}
#meme-community-ui .is-live-game .gd-card-stack > .gd-card:not(:last-child) .gd-pip { visibility: hidden; }
#meme-community-ui .is-live-game :is(.gd-card,.gd-played-card).is-red { color: var(--deck-red) !important; }
#meme-community-ui .is-live-game .gd-card.is-wild {
    background: linear-gradient(150deg,#fff9fc,#fae9f4); border-color: #cd9cbd;
}
#meme-community-ui .is-live-game .gd-level {
    bottom: auto; left: auto; top: 2px; right: 2px;
    padding: 0 2px; background: #255da5; color: #fff; border: 1px solid #255da5;
    font-size: 8px; line-height: 10px;
}
#meme-community-ui .is-live-game .gd-card.is-wild .gd-level { background: #852b70; border-color: #852b70; }
#meme-community-ui .is-live-game .gd-card-stack .gd-level { top: var(--stack-corner-top); }
@container (max-width: 51px) {
    #meme-community-ui .is-live-game .gd-card-stack .gd-level { top: auto; right: auto; bottom: 3px; left: 2px; }
}
#meme-community-ui .is-live-game .gd-card.is-exchange-option {
    border-color: #54a989; box-shadow: inset 0 0 0 1px #a9eaca,0 2px 0 #307e64;
}
#meme-community-ui .is-live-game .gd-card.is-selected {
    background: linear-gradient(145deg,#f1fdf5,#afeccc); border-color: #51a784;
    box-shadow: inset 0 1px 0 #f3fff7,inset 0 -1px 0 #80d0a9,0 2px 0 #438b6c,0 4px 6px #103c2f77;
}
#meme-community-ui .is-live-game .gd-card.is-selected .gd-selected-mark {
    display: grid; place-items: center; position: absolute; bottom: 3px; right: 3px;
    width: 12px; height: 12px; border-radius: 50%; background: #10694c; color: #fff;
    font: 800 9px/1 system-ui,sans-serif; pointer-events: none;
}
#meme-community-ui .is-live-game .gd-card-stack > .gd-card:not(:last-child).is-selected .gd-selected-mark {
    bottom: auto; top: 1px; right: 2px; height: min(12px,calc(var(--stack-strip) - 2px));
}
@container (max-width: 45px) {
    #meme-community-ui .is-live-game .gd-card-stack > .gd-card:not(:last-child).is-selected .gd-selected-mark {
        width: 7px; right: 1px; font-size: 6px;
    }
}
#meme-community-ui .gd-pip:has(.gd-court,.gd-joker-art) {
    display: grid; place-items: center; height: clamp(22px,8cqh,44px); width: min(58px,86%);
    bottom: 5px; left: 50%; right: auto; transform: translateX(-50%); opacity: 1;
}
#meme-community-ui .is-live-game .gd-card-stack .gd-pip:has(.gd-court,.gd-joker-art) {
    height: min(44px,calc(var(--stack-face-height) * .52));
}
#meme-community-ui .is-live-game .gd-expanded-grid .gd-pip:has(.gd-court,.gd-joker-art) { height: 43px; }
#meme-community-ui :is(.gd-court,.gd-joker-art) {
    display: block; height: 100%; max-width: 100%; aspect-ratio: 1;
    background: url("club-deck-art.webp?v=20261127-04") var(--deck-art-position,0%) 50% / 500% 100% no-repeat;
}
#meme-community-ui .gd-court-Q { --deck-art-position: 25%; }
#meme-community-ui .gd-court-K { --deck-art-position: 50%; }
#meme-community-ui .gd-joker-art.is-big-joker { --deck-art-position: 75%; }
#meme-community-ui .gd-joker-art.is-small-joker { --deck-art-position: 100%; }
#meme-community-ui :is(.live-mini-card,[data-selection-cards] > span) > b { font-weight: 800; }
#meme-community-ui .live-table-effects {
    position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
#meme-community-ui .live-table-effect {
    position: absolute; left: 50%; bottom: 14%; width: min(52%,320px); height: min(66px,80%);
    transform: translateX(-50%);
}
#meme-community-ui .is-live-game .ag-table-scene:not(:has(.is-exchange)) .live-table-effect:is(.is-bomb,.is-kings,.is-flush) {
    bottom: var(--live-played-bottom);
}
#meme-community-ui .live-table-effect::before, #meme-community-ui .live-table-effect::after {
    content: ''; position: absolute; inset: 4px 9%;
}
#meme-community-ui .live-table-effect > i { position: absolute; top: 50%; left: 50%; }
#meme-community-ui .live-table-effect.is-bomb::before {
    border: 3px solid #ffce6f; border-radius: 50%;
    box-shadow: inset 0 0 14px #ff995855,0 0 11px #ff995857;
    animation: gd-impact var(--effect-duration) both;
}
#meme-community-ui .live-table-effect.is-bomb::after {
    inset: 9px 22%; border: 1px solid #fff3b8; border-radius: 50%;
    animation: gd-impact var(--effect-duration) ease-out 35ms both;
}
#meme-community-ui .live-table-effect.is-bomb > i {
    transform-origin: 0 50%; width: 19px; height: 3px; border-radius: 5px;
    background: linear-gradient(90deg,#f77b41, #ffe58a 57%, transparent);
    --ray: calc(var(--piece) * 45deg);
    animation: gd-impact-rays var(--effect-duration) ease-out both;
}
#meme-community-ui .live-table-effect.is-flush::before {
    inset: 17px 4% 11px; border-radius: 50%;
    border-bottom: 4px solid #74e9d7; border-top: 1px solid #b8fbff;
    box-shadow: inset 0 -8px 13px #54e1ed48;
    animation: gd-ribbon var(--effect-duration) ease-out both;
}
#meme-community-ui .live-table-effect.is-flush > i {
    left: calc(14% + var(--piece) * 17%);
    top: calc(38% + var(--piece) * 5%);
    width: 9px; height: 9px; border-radius: 2px;
    background: #d2fff4; box-shadow: 0 0 9px #71f8e5;
    animation: gd-flush-sparks 410ms ease-out calc(105ms + var(--piece) * 45ms) both;
}
#meme-community-ui .live-table-effect.is-kings::before {
    border: 4px double #ffdd7d; border-radius: 48%;
    box-shadow: inset 0 0 17px #ffcc635d,0 0 14px #ffb94359;
    animation: gd-crown-ring var(--effect-duration) ease-out both;
}
#meme-community-ui .live-table-effect.is-kings::after {
    inset: 18% 18%; border: 1px solid #fff2b3; border-radius: 50%;
    animation: gd-crown-ring var(--effect-duration) 65ms both;
}
#meme-community-ui .live-table-effect.is-kings > i {
    left: calc(9% + var(--piece) * 26%);
    top: 15%; width: 15px; height: 20px;
    background: #ffdc70;
    clip-path: polygon(50% 0,61% 34%,100% 50%,61% 64%,50% 100%,38% 64%,0 50%,38% 34%);
    animation: gd-crown-sparks 490ms ease-out calc(90ms + var(--piece) * 78ms) both;
}
#meme-community-ui .live-table-effect.is-exchange::before {
    inset: 18px 20% 12px; border: 2px dashed #9ef0ff; border-radius: 50%;
    animation: gd-ribbon var(--effect-duration) ease-out both;
}
#meme-community-ui .live-table-effect.is-exchange > i {
    top: 29%; width: 17px; height: 13px; color: #a9edff;
    clip-path: polygon(0 32%,60% 32%,60% 0,100% 50%,60% 100%,60% 68%,0 68%);
    background: currentColor; --side: 1;
    animation: gd-exchange-flight var(--effect-duration) both;
}
#meme-community-ui .live-table-effect.is-exchange > i + i { --side: -1; top: 65%; color: #ffdd8d; }
#meme-community-ui .live-table-effect.is-deal > i {
    top: 18%; width: 19px; height: 26px;
    margin-left: -10px; border: 1px solid #ffd888; border-radius: 5px;
    background: repeating-linear-gradient(40deg,#193b73 0 4px,#2c67aa 4px 6px);
    box-shadow: 0 2px 4px #10223b95;
    --target: calc((var(--piece) - 1.5) * 46px);
    --tilt: calc((var(--piece) - 1.5) * 13deg);
    animation: gd-deal-flight 320ms ease-out calc(var(--piece) * 60ms) both;
}
#meme-community-ui .live-table-effect.is-deal > i::after {
    content: ''; position: absolute; inset: 6px 4px; background: #f3cd81;
    clip-path: polygon(50% 0,100% 100%,77% 100%,50% 45%,22% 100%,0 100%);
}
#meme-community-ui .ag-table-scene:has(.live-table-effect:is(.is-bomb,.is-kings)) [data-last-player] { color: #ffedbd; }
#meme-community-ui .ag-table-scene:has(.live-table-effect.is-flush) [data-last-player] { color: #b9fff0; }
@keyframes gd-impact {
    0%,13% { transform: scale(.32); opacity: 0; }
    27% { opacity: .92; }
    100% { transform: scale(1.18); opacity: 0; }
}
@keyframes gd-impact-rays {
    0%,12% { transform: rotate(var(--ray)) translateX(16px) scaleX(.5); opacity: 0; }
    27% { opacity: .86; }
    100% { transform: rotate(var(--ray)) translateX(clamp(42px,15cqw,108px)) scaleX(.23); opacity: 0; }
}
@keyframes gd-ribbon {
    0% { transform: translateX(-23px) rotate(-8deg) scaleX(.58); opacity: 0; }
    44% { opacity: .88; }
    100% { transform: translateX(23px) rotate(3deg) scaleX(1.08); opacity: 0; }
}
@keyframes gd-flush-sparks {
    0% { opacity: 0; transform: translate(-10px,7px) rotate(30deg) scale(.4); }
    36% { opacity: .95; }
    100% { opacity: 0; transform: translate(17px,-13px) rotate(80deg) scale(.48); }
}
@keyframes gd-crown-ring {
    0%,29% { transform: scale(.48); opacity: 0; }
    44%,56% { opacity: .95; }
    100% { transform: scale(1.13) rotate(-6deg); opacity: 0; }
}
@keyframes gd-crown-sparks {
    0% { transform: translateY(8px) scale(.55) rotate(-12deg); opacity: 0; }
    36%,55% { opacity: 1; }
    100% { transform: translateY(-14px) scale(.50) rotate(18deg); opacity: 0; }
}
@keyframes gd-exchange-flight {
    0% { transform: translateX(calc(var(--side) * -56px)) scaleX(var(--side)); opacity: 0; }
    38%,58% { opacity: .9; }
    100% { transform: translateX(calc(var(--side) * 61px)) scaleX(var(--side)); opacity: 0; }
}
@keyframes gd-deal-flight {
    0% { transform: translate(0,7px); opacity: 0; }
    18%,55% { opacity: 1; }
    100% { transform: translate(var(--target),-9px) rotate(var(--tilt)); opacity: 0; }
}
#meme-community-ui .live-result-lead.is-new-result { animation: gd-result-appear .38s ease-out both; }
@keyframes gd-result-appear {
    from { opacity: .55; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
}
#meme-community-ui .is-live-game .ag-turn-label.is-mine { animation: gd-own-turn .28s ease-out both; }
@keyframes gd-own-turn {
    from { border-color: #b49351; }
    to { border-color: #fff0b8; }
}
#meme-community-ui .live-audio-settings { display: grid; gap: 8px; }
#meme-community-ui .live-audio-settings > button {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px;
    border: 1px solid var(--ec-line); padding: 7px 12px; border-radius: 10px;
    background: var(--ec-soft); color: var(--ec-ink); text-align: left;
    -webkit-tap-highlight-color: transparent;
}
#meme-community-ui .live-audio-settings button > span { display: grid; gap: 2px; }
#meme-community-ui .live-audio-settings small,#meme-community-ui .live-audio-settings p { color: var(--ec-muted); font-size: 11px; }
#meme-community-ui .live-audio-settings em {
    padding: 4px 8px; border: 1px solid var(--ec-line); border-radius: 6px;
    font-size: 11px; font-style: normal;
}
#meme-community-ui .live-audio-settings button[aria-pressed=true] em { background: #24614f; color: #f3f9ed; }
#meme-community-ui .live-audio-settings p:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
    #meme-community-ui .live-table-effects { display: none; }
    #meme-community-ui .live-result-lead.is-new-result,
    #meme-community-ui .is-live-game .ag-turn-label.is-mine { animation: none; }
}
#meme-community-ui .is-live-game .ag-hand.is-sliding .gd-card { transition: none; }
#meme-community-ui .is-live-game .gd-hand-toolbar { padding: 3px 3px 0; }
#meme-community-ui .is-live-game .gd-hand-toolbar > div:first-child { min-width: 0; gap: 6px; }
#meme-community-ui .is-live-game .gd-hand-toolbar > div:last-child { flex: none; gap: 5px; }
#meme-community-ui .is-live-game .gd-hand-toolbar b { display: flex; align-items: center; min-width: 0; gap: 5px; }
#meme-community-ui .is-live-game [data-self-name] {
    min-width: 0; max-width: 25ch; overflow: hidden; text-overflow: ellipsis; color: #e4eee1;
}
#meme-community-ui .is-live-game [data-hand-count] {
    flex: none; padding: 2px 4px; background: #102f27; border-radius: 4px; margin: 0;
}
#meme-community-ui .is-live-game .gd-hand-guide { flex: none; white-space: nowrap; }
#meme-community-ui .is-live-game .gd-hand-toolbar b,
#meme-community-ui .is-live-game .gd-hand-toolbar button { font-size: 11px; }
#meme-community-ui .is-live-game .gd-hand-toolbar button:hover { background: #b8d9bf24; }
#meme-community-ui .is-live-game .gd-hand-toolbar button:disabled { opacity: .65; }
#meme-community-ui .is-live-game [data-action=table-smart-sort] {
    background: #27674f; color: #f1f9ec; border: 1px solid #79b697; white-space: nowrap;
}
#meme-community-ui .is-live-game [data-action=table-smart-sort][aria-pressed=true] {
    background: #d0edbb; color: #163d2e; border-color: #d0edbb;
}
#meme-community-ui .is-live-game .gd-card[data-hand-group]::after {
    content: ""; position: absolute; inset: auto 3px 2px; height: 3px; border-radius: 2px;
    background: #529c77; pointer-events: none;
}
#meme-community-ui .is-live-game .gd-card[data-hand-group="1"]::after { background: #528ea1; }
#meme-community-ui .is-live-game .gd-card-stack > .gd-card:not(:last-child)::after { display: none; }
#meme-community-ui .live-arrange-options {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px;
}
#meme-community-ui .live-arrange-options > button { min-height: 40px; }
#meme-community-ui .live-arrange-options > [aria-pressed=true] {
    background: var(--ec-soft); color: var(--ec-data); border-color: var(--ec-data);
}
#meme-community-ui [data-live-groups] > p {
    margin: 10px 0 8px; color: var(--ec-muted); font-size: 12px; line-height: 1.45;
}
#meme-community-ui .live-arrange-group {
    width: 100%; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 6px; margin: 5px 0; padding: 6px 9px;
    text-align: left; background: var(--ec-soft); color: var(--ec-ink);
    border: 1px solid var(--ec-line); border-radius: 9px;
}
#meme-community-ui .live-arrange-group > strong { font-size: 12px; }
#meme-community-ui .live-arrange-group > span { display: flex; flex-wrap: wrap; gap: 3px; }
@container (min-height: 381px) and (max-height: 425px) {
    #meme-community-ui .is-live-game .ag-table-page { --live-stack-step: 21px; --card-lift: 9px; }
}
@container (max-height: 380px) {
    #meme-community-ui .is-live-game .ag-table-page {
        --live-stack-height: 55px; --live-stack-step: 17px; --card-lift: 10px;
        --live-header-height: 34px; --live-actions-height: 38px; --live-scene-base: 82px;
        --live-grid-gap: 3px; --live-toolbar-height: 27px;
        --live-partner-inset: 23px; --live-played-bottom: 3px;
    }
    #meme-community-ui .is-live-game .ag-table-page:has(.gd-card-stack > :nth-child(6)) {
        --live-partner-min: 18px; --live-played-height: 36px;
    }
    #meme-community-ui .is-live-game .ag-table-page::before { inset: 37px 4% 29px; }
    #meme-community-ui .is-live-game .gd-hand-toolbar { min-height: 25px; padding-top: 0; }
    #meme-community-ui .is-live-game .ag-player-top { top: 0; padding: 1px 8px; }
    #meme-community-ui .is-live-game .ag-player-top .ec-face { display: none; }
    #meme-community-ui .is-live-game .ag-center-play:not(.is-exchange) > [data-last-player] { line-height: 13px; }
    #meme-community-ui .is-live-game .live-play-role { padding-block: 0; }
    #meme-community-ui .is-live-game [data-last-player] { font-size: 12px; line-height: 15px; }
    #meme-community-ui .is-live-game .ag-turn-label { bottom: -4px; min-height: 16px; line-height: 14px; }
    #meme-community-ui .is-live-game .ag-play-actions > button { min-height: 36px; font-size: 14px; }
    #meme-community-ui .is-live-game .ag-play-actions { --selection-slot: 88px; }
    #meme-community-ui .is-live-game .ag-play-actions:has(> button:not([hidden]))::before { flex-basis: 12px; }
    #meme-community-ui .is-live-game .gd-selection { gap: 2px; padding-inline: 4px 2px; }
    #meme-community-ui .is-live-game .gd-selection [data-action=table-clear] { padding-inline: 2px; }
    #meme-community-ui .is-live-game .gd-selection :is([data-selection-title],[data-selection-feedback]) { white-space: nowrap; }
}
@container (max-width: 520px) {
    #meme-community-ui .is-live-game :is(.ag-player-left,.ag-player-right) b { max-width: 64px; }
}
@container (max-height: 316px) {
    #meme-community-ui .is-live-game .ag-table-page {
        --live-header-height: 32px; --live-actions-height: 34px;
        --live-played-height: clamp(32px, calc(var(--room-height) * .135 - 7px), 39px);
        --live-stack-height: clamp(42px, calc(var(--room-height) * .16), 49px);
        --live-stack-step: 15px; --card-lift: 8px;
    }
    #meme-community-ui .is-live-game .ag-table-page:has(.gd-card-stack > :nth-child(6)) { --live-played-height: 34px; }
    #meme-community-ui .is-live-game .ag-play-actions > button { min-height: 34px; }
}
@container (max-height: 380px) {
    #meme-community-ui .is-live-game .ag-table-page:has(.gd-card-stack > :nth-child(7)) {
        --stack-face-min: 32px; --stack-strip-min: 14px;
        --live-grid-gap: 2px; --live-toolbar-height: 25px;
        --live-scene-base: 69px; --live-partner-inset: 19px; --live-partner-min: 15px;
        --live-played-height: 32px; --live-played-bottom: 2px;
    }
}
@keyframes gd-trick-entry {
    from { opacity: .45; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    #meme-community-ui .is-live-game :is(.gd-card,.ag-play-actions > button) { transition: none; }
    #meme-community-ui .is-live-game .gd-played-card { animation: none; }
}

/* Friend-room continuity stays visible from the community hall. */
#meme-community-ui .live-match-options { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
#meme-community-ui .live-match-options .ec-dialog-label { margin:4px 0; }
#meme-community-ui .live-match-recovery { display: flex; flex-wrap: wrap; gap: 8px; }
#meme-community-ui .live-match-recovery button { flex: 1 0 120px; }
#meme-community-ui [data-match-shortfall] { color: var(--ec-ink); font-weight: 700; }
#meme-community-ui .point-round-delta {
    display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
    margin: 6px 0; padding: 8px 10px; border: 1px solid var(--ec-line);
    border-radius: 8px; background: var(--ec-surface); color: var(--ec-ink); font-weight: 700;
}
#meme-community-ui .point-round-delta > b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#meme-community-ui .live-match-options select { min-height:44px;max-width:100%; }
#meme-community-ui .live-match-form p,#meme-community-ui .live-match-progress p { font-size:13px;color:var(--ec-muted);line-height:1.6;margin:10px 0; }
#meme-community-ui .live-match-form [type=submit] { width:100%; }
#meme-community-ui .live-match-form [data-match-refresh] { min-height:44px;color:var(--ec-link); }
#meme-community-ui .live-match-progress { padding:14px;border:1px solid var(--ec-line);border-radius:12px;background:var(--ec-soft); }
#meme-community-ui .live-match-progress b { display:block;font-size:18px;color:var(--ec-data);font-variant-numeric:tabular-nums; }
#meme-community-ui .live-match-progress progress { width:100%;height:8px;accent-color:var(--ec-data);margin:9px 0 0; }
#meme-community-ui .live-match-progress p { margin:6px 0 0; }
#meme-community-ui .live-cross-offer { margin-top:12px; }
#meme-community-ui .live-match-actions { display:grid;gap:7px;margin-top:12px; }
#meme-community-ui .live-match-actions .ec-text-button { min-height:44px;justify-content:center; }
#meme-community-ui .live-current-card { margin:0 0 16px;padding:14px;background:var(--ec-surface);border:1px solid var(--ec-line);border-radius:14px;color:var(--ec-ink); }
#meme-community-ui .live-current-card h2 { font-size: 19px; margin: 10px 0; overflow-wrap: anywhere; }
#meme-community-ui .live-current-card p { font-size: 12px; line-height: 1.8; margin: 8px 0; }
#meme-community-ui .live-current-card .ec-button { width: 100%; margin-top: 10px; }
#meme-community-ui .live-form-message { min-height: 20px; color: #8e603b; font-size: 12px; line-height: 1.7; }
#meme-community-ui [data-live-form] .ec-button { width: 100%; margin: 4px 0 14px; }
#meme-community-ui :is(.gd-lobby-head,.ag-table-top) { position: relative; }
#meme-community-ui .live-connection { position: absolute; top: 0; bottom: 0; left: 44px; right: 0; z-index: 7; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 8px; border: 1px solid #f0d5a0; border-radius: 8px; background: #fff3d9; color: #644d30; font-size: 11px; box-shadow: 0 4px 16px #18382d26; }
#meme-community-ui .gd-lobby-head > .live-connection { left: 82px; }
#meme-community-ui .is-live-game .ag-table-top > .live-connection { max-width: none; flex-direction: row; }
#meme-community-ui .is-live-game :is(.gd-lobby-head,.ag-table-top) > .live-connection { right: 185px; }
#meme-community-ui .is-game-room :is(.gd-lobby-head,.ag-table-top):has(.live-connection:not([hidden])) > :not(:first-child):not(.live-connection):not(.room-toggle) { visibility: hidden; }
#meme-community-ui .is-game-room :is(.gd-lobby-head,.ag-table-top) .live-connection > span { color: #644d30; font-size: 11px; }
#meme-community-ui .live-connection button { flex-shrink: 0; min-height: 36px; padding: 5px 10px; color: #235b4f; border-radius: 8px; background: #e1ebd8; }
#meme-community-ui .live-result-lead {
    text-align: left; padding: 9px 12px; margin-bottom: 8px; border-radius: 12px;
    color: light-dark(#294840,#deeee3); background: light-dark(#edf2e9,#28413a);
    border: 1px solid light-dark(#d7e2d2,#476255);
}
#meme-community-ui .live-result-lead.is-win {
    color: light-dark(#544527,#ffebbd); background: light-dark(#fff2cd,#523f2a);
    border-color: light-dark(#ead8a8,#796040);
}
#meme-community-ui .live-result-lead h3 { font-size: 20px; margin: 0; }
#meme-community-ui .live-result-lead p { margin: 4px 0 0; }
#meme-community-ui .live-result-places {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 6px 0; padding: 0; gap: 4px;
    list-style: none;
}
#meme-community-ui .live-result-places > li {
    min-width: 0; min-height: 31px; display: flex; align-items: center; gap: 4px;
    padding: 3px 5px; border: 1px solid var(--ec-line); border-radius: 6px;
    color: var(--ec-ink); font-size: 11px; white-space: nowrap;
}
#meme-community-ui .live-result-places > .is-own-team { background: var(--ec-soft); }
#meme-community-ui .live-result-places li > span { color: var(--ec-muted); }
#meme-community-ui .live-result-places li > strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#meme-community-ui .live-result-places li > small { color: var(--ec-data); font-size: 9px; }
#meme-community-ui .live-result-levels { display: flex; gap: 6px; color: var(--ec-muted); font-size: 11px; }
#meme-community-ui .live-result-levels > span {
    display: flex; flex: 1; justify-content: space-between; gap: 5px; padding: 4px 6px;
    border-top: 1px solid var(--ec-line); white-space: nowrap;
}
#meme-community-ui .live-result-levels b { color: var(--ec-data); font-size: 13px; }
#meme-community-ui .live-score-detail { background: #eef4e7; color: #365e4f; border-radius: 12px; padding: 9px 12px; margin-bottom: 8px; font-size: 10px; line-height: 1.4; }
#meme-community-ui .live-score-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 10px; }
#meme-community-ui .live-score-numbers b { display: block; font-size: 21px; margin-top: 3px; }
#meme-community-ui .live-score-detail p, #meme-community-ui .live-score-detail small { font-size: 10px; line-height: 1.5; margin: 3px 0 0; overflow-wrap: anywhere; }
#meme-community-ui .live-score-detail .ec-text-button { min-height: 28px; font-size: 11px; }
#meme-community-ui .ec-sheet:has([data-live-result]) { padding: 8px 18px 12px; }
#meme-community-ui .ec-sheet:has([data-live-result]) .ec-sheet-handle { display: none; }
#meme-community-ui .ec-sheet:has([data-live-result]) .ec-sheet-heading { min-height: 40px; padding: 4px 0; margin-bottom: 8px; top: -8px; }
#meme-community-ui .ec-sheet:has([data-live-result]) .ec-sheet-heading h2 { font-size: 20px; }
#meme-community-ui .live-result-actions > .ec-button { width: 100%; margin: 7px 0; }
#meme-community-ui .live-result-actions > p { font-size: 11px; line-height: 1.8; }
#meme-community-ui [data-live-ready-count] { background: #eaf0e2; padding: 10px 14px; border-radius: 12px; color: #326451; }
#meme-community-ui .gd-room-info { overflow-y: auto; overscroll-behavior: contain; }
#meme-community-ui .gd-room-info > * { flex-shrink: 0; }
#meme-community-ui .gd-room-info [data-action=live-copy] { min-height: 36px; color: #e7ecd9; }
@container (min-width: 500px) {
    #meme-community-ui [data-live-result] { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
    #meme-community-ui .live-result-lead h3 { font-size: 18px; }
    #meme-community-ui .live-result-lead p { font-size: 11px; line-height: 1.4; }
    #meme-community-ui .live-result-actions .ec-button { min-height: 40px; margin: 4px 0; }
    #meme-community-ui .live-result-actions > p { margin: 4px 0; font-size: 10px; }
    #meme-community-ui .live-result-actions > .ec-text-button { min-height: 32px; margin-right: 8px; }
    #meme-community-ui .live-score-numbers > span { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
    #meme-community-ui .live-score-numbers b { margin: 0; font-size: 20px; line-height: 1.2; }
}
@container (max-height: 350px) {
    #meme-community-ui .live-result-lead { padding: 6px 10px; }
    #meme-community-ui .live-result-places > li { min-height: 28px; }
    #meme-community-ui .live-score-detail { padding: 6px 10px; margin-bottom: 5px; }
    #meme-community-ui .live-score-detail p, #meme-community-ui .live-score-detail small { font-size: 9px; }
}
