@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;650;700&family=Lora:wght@400;700&display=swap');
:root{color-scheme:dark;--table:#174d3c;--deep:#10382d;--cream:#fbf4e4;--gold:#ebcb78;--ink:#162b25;--clean:#dce9c9;--dirty:#f1d6c7;--focus:#91ddf8;--panel:#205846;--muted:#bad1c6;--border:#56806d;--nav-h:64px;--footer-h:48px;--space:16px;--inset:24px;--opp-h:210px;--hand-h:290px;--turn-h:72px}
html,body{height:100%;margin:0;background:var(--table);color:var(--cream);font-family:Inter,system-ui,sans-serif}body{overflow:hidden}button,select,input{font-family:inherit}button{touch-action:manipulation}button:disabled{cursor:default}button:focus-visible,[tabindex]:focus-visible,summary:focus-visible{outline:3px solid var(--focus)!important;outline-offset:2px!important}button[hidden],[hidden],#yourPhase[hidden],#yourBookStar{display:none!important}
.app{width:100%;height:100dvh;min-height:0;display:grid;grid-template-rows:var(--nav-h) minmax(0,1fr) var(--footer-h);background:var(--table);overflow:hidden}.app:before{display:none}.top{height:var(--nav-h);min-height:0;padding:0 var(--inset);gap:16px;background:var(--deep);border:0;box-shadow:none;backdrop-filter:none;flex-wrap:nowrap;z-index:2}.brand{gap:12px;white-space:nowrap}.brandmark{width:28px;height:32px;border:0;border-radius:0;color:var(--gold);font-size:30px;background:none;box-shadow:none}.brand h1{font:400 25px/32px Lora,Georgia,serif;letter-spacing:0}.brand p{font:400 11px Inter,system-ui;color:var(--cream);letter-spacing:0;text-transform:uppercase;margin:0}.brand>div:last-child{display:flex;align-items:center;gap:20px}.table-nav{margin-left:auto;display:flex;align-items:center;gap:24px;font-size:14px}.nav-link{color:var(--cream);background:transparent;border:0;border-radius:4px;padding:10px 0;font-size:14px;min-height:44px}.nav-round{font-size:14px}
.table{max-width:none;width:100%;min-height:0;height:100%;padding:var(--inset);margin:0;display:grid;grid-template-rows:var(--turn-h) minmax(0,1fr) var(--hand-h);gap:var(--space);position:relative;overflow:hidden}.turn-banner{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 20px;border-radius:12px;background:var(--cream);color:var(--ink);min-height:0}.turn-owner{font-size:12px;font-weight:700;color:#126043;margin-bottom:4px}.turn-banner h2{font:400 24px/29px Inter,system-ui;margin:0}.turn-steps{display:flex;list-style:none;padding:0;margin:0;gap:18px;font-size:14px}.turn-steps li{white-space:nowrap}.turn-steps li.active{font-weight:700}.turn-steps li.done{color:#126043}.turn-steps li.done:after{content:' ✓'}.selection-badge{font-size:12px;border-radius:6px;background:var(--gold);padding:5px 8px;white-space:nowrap;color:#624b1c}
.playing{display:grid;grid-template-columns:minmax(0,1fr) 274px;grid-template-rows:var(--opp-h) minmax(0,1fr);grid-template-areas:'opponents opponents' 'you piles';gap:var(--space);padding:0;min-height:0;align-items:stretch;overflow:visible}.playing>.other-players{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-area:opponents;gap:var(--space);min-height:0;order:initial}.playing>.player-panel[data-panel=you]{grid-area:you;width:100%;justify-self:stretch;background:var(--panel);border:2px solid var(--gold);border-radius:12px;box-shadow:none;padding:10px;min-height:0;height:100%;display:grid;grid-template-rows:38px minmax(0,1fr) auto;gap:8px;overflow:visible}.playing .other-panel[data-panel]{display:grid;grid-template-rows:38px minmax(0,1fr) auto;gap:10px;padding:12px;width:100%;height:100%;min-height:0;align-self:stretch;border:1px solid var(--border);border-radius:12px;background:var(--panel);box-shadow:none;justify-self:stretch;overflow:visible}.playing .opponent-header{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.playing .opponent-identity{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}.playing .opponent-name{font:400 14px/19px Inter,system-ui;color:var(--cream);letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.playing .player-stats{font:400 12px/16px Inter,system-ui;color:var(--muted);margin:0}.playing>.player-panel[data-panel=you] .sectiontitle{padding:0;gap:10px;display:flex;align-items:center;color:var(--cream);font:400 16px/20px Inter,system-ui;letter-spacing:0;text-transform:none;min-width:0}.your-identity{display:flex;flex-direction:column;gap:2px;margin-right:auto}.your-name{font-size:16px}#yourBoardDetail{font:400 12px/16px Inter,system-ui;color:var(--muted)}.sectiontitle:after{display:none!important}.playing .open-board{min-height:32px;padding:5px 8px;background:transparent;color:var(--muted);border:1px solid var(--border);border-radius:6px;font-size:12px}.book-summary{display:inline-flex;gap:6px;flex:none}.book-icon-pill{border-radius:6px;font:400 12px/16px Inter,system-ui;padding:4px 7px}.book-icon-pill.clean{background:var(--clean);color:var(--ink);border:0}.book-icon-pill.dirty{background:var(--dirty);color:#783e25;border:0}.book-icon-pill.no-books{color:#bad1c6;background:#ffffff0c;border:1px solid var(--border)}.book-badge-num{font:400 12px Inter,system-ui}
.playing .meld-grid,.playing>.player-panel[data-panel=you] .melds,.playing .other-panel[data-panel] .public-sets{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:8px;padding:0;margin:0;overflow:visible;min-height:0;align-items:stretch}.playing .other-panel[data-panel] .public-sets{gap:6px;align-items:start}.playing .meld-grid.multi-row{grid-template-rows:repeat(2,minmax(0,1fr));gap:6px}.meld-tile{min-width:0;width:100%;height:100%;max-height:204px;display:flex;flex-direction:column;gap:6px;align-items:stretch;padding:10px;background:var(--cream);color:var(--ink);border:1px solid #dfcc99;border-radius:8px;text-align:left;position:relative;box-shadow:none;overflow:visible;cursor:pointer}.meld-tile .meld-top{display:flex;align-items:center;justify-content:space-between;gap:4px;flex:none}.meld-rank{font:700 30px/34px Lora,Georgia,serif;white-space:nowrap}.meld-actual{font:700 15px Inter,system-ui}.meld-tile .tile-art{min-height:0;flex:1;display:flex;align-items:center;justify-content:center;overflow:hidden}.tile-art .card{width:72px!important;height:100px!important;min-width:0;background:var(--cream);box-shadow:none;outline:none;border:0;transform:none!important;flex:none}.tile-art .card:before{display:none}.tile-art .points-badge{display:none!important}.meld-tile .progress-pip-bar{display:flex;min-height:6px;height:6px;padding:0;margin:0;background:none;border:0;border-radius:0;box-shadow:none;flex:none;max-width:100%;width:100%;gap:4px}.meld-tile .pip-segments-row{display:flex;gap:2px;flex:1;min-width:0;height:6px}.meld-tile .pip-segment{flex:1;width:auto;height:6px;border:0;border-radius:0;background:#dce1d2;box-shadow:none;min-width:0}.meld-tile .pip-segment.clean-fill{background:#126043}.meld-tile .pip-segment.dirty-fill{background:#813f25}.meld-tile .pip-segment.wild-fill{background:#a57f2d;box-shadow:none}.meld-tile .overflow-chip{font-size:9px;padding:0;border:0;background:transparent;color:var(--ink);line-height:10px}.meld-caption{font:400 11px/14px Inter,system-ui;color:#126043;display:block;flex:none;white-space:nowrap;overflow:hidden}.meld-caption.dirty{color:#813f25}.meld-caption.book{background:var(--clean);padding:2px 4px;border-radius:12px;max-height:20px}.meld-caption.book.dirty{background:var(--dirty);border-radius:2px}.target-caption{font:700 11px/14px Inter,system-ui;display:none}.meld-tile.valid-target{border:3px solid var(--gold);padding:8px}.meld-tile.valid-target .target-caption{display:block}.meld-tile.chosen-target{box-shadow:inset 0 0 0 1px #d2a23d}.meld-tile.rejected-target{border:3px solid #a62f3a}.meld-tile.dense{height:112px;max-height:100%;padding:7px;gap:6px}.meld-tile.dense .meld-rank{font-size:22px;line-height:28px}.meld-tile.dense .meld-actual{font-size:11px}.meld-tile.dense .meld-caption{font-size:10px;line-height:12px;white-space:normal}.meld-tile.dense .target-caption{font-size:10px}.meld-tile.dense.valid-target{padding:5px}.meld-tile .seal-badge{width:20px;height:20px;right:5px;top:40px;opacity:.85;z-index:1}.meld-tile .seal-badge svg{width:14px;height:14px}.meld-tile.dense .seal-badge{display:none}.no-melds{font-size:12px;color:var(--muted);grid-column:1/-1}
.playing>.pilearea{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:16px minmax(0,1fr) auto auto;gap:8px;grid-area:piles;width:100%;max-width:none;height:100%;min-height:0;padding:14px 12px;align-self:stretch;justify-self:stretch;border:0;border-radius:12px;box-shadow:none;background:var(--deep);position:static;transform:none;order:initial;align-items:start}.piles-title{grid-column:1/-1;font:400 12px/16px Inter,system-ui;color:var(--muted);margin:0;text-transform:uppercase}.pilearea .pile{min-width:0;text-align:center;align-self:center}.pilearea .back,.pilearea #discard .card{width:70px!important;height:104px!important;max-width:100%;margin:0 auto;border-radius:6px;box-shadow:none;transform:none!important}.pilearea .back{background:var(--panel);border:1px solid var(--gold)}.pilearea .back:after{content:'♠';inset:0;border:0;color:var(--gold);font-size:40px}.pilearea .back:disabled{opacity:1;filter:none}.pilearea .pilelabel{font:400 11px/15px Inter,system-ui;color:var(--cream);letter-spacing:0;text-transform:none;margin:6px 0 0}.pilearea .draw-note{grid-column:1/-1;font:400 11px/15px Inter,system-ui;color:var(--muted);margin:0;flex-basis:auto;text-align:left}.pilearea .draw-action,.pilearea .pickup-action{grid-column:1/-1;background:var(--gold);color:var(--ink);border:0;border-radius:8px;min-height:44px;font-size:14px}.pilearea .draw-action:disabled{background:#46675a;color:var(--cream)}.pilearea .pickup-action{grid-row:auto}.pilearea .draw-note{order:5}
.handzone{margin:0;padding:16px;border:0;border-radius:12px;min-height:0;height:100%;background:var(--deep);box-shadow:none;display:grid;grid-template-rows:24px minmax(0,1fr) 64px;gap:8px;overflow:visible;position:relative}.handhead{display:flex;justify-content:space-between;align-items:center;margin:0;gap:12px}.hand-heading{display:flex;align-items:baseline;gap:16px}.handhead h2{margin:0;color:var(--cream);font:400 18px/24px Inter,system-ui}.handhead h2 small{font-size:12px;margin-left:14px}.hand-heading>span{font-size:12px;color:var(--muted)}.hand-tools{display:flex;align-items:center;gap:12px}.hand-tools button{font-size:12px;color:var(--muted);background:transparent;border:0;padding:6px 0;border-radius:3px;white-space:nowrap}.hand-tools button[aria-pressed=true]{color:var(--gold)}.handzone .hand{display:flex;align-items:center;justify-content:center;gap:10px;min-height:0;height:100%!important;width:100%;overflow:visible!important;position:relative;padding:14px 0 0;scrollbar-width:none}.handzone #hand .card{position:relative!important;top:auto!important;left:auto!important;width:88px!important;height:126px!important;margin:0!important;border-radius:8px;transform:none!important;flex:none;transition:transform .15s ease;box-shadow:none;touch-action:pan-y}.handzone #hand .card:hover{transform:translateY(-4px)!important;filter:none}.handzone #hand .card.selected{transform:translateY(-10px)!important;outline:3px solid var(--gold);outline-offset:0;filter:none}.handzone #hand .card.selected:after{content:'✓';position:absolute;z-index:30;right:2px;top:2px;width:20px;height:20px;border-radius:50%;background:var(--gold);color:var(--ink);display:grid;place-items:center;font:700 12px Inter,system-ui}.handzone #hand .card:focus-visible{outline:3px solid var(--focus)!important;outline-offset:3px!important}.handzone .points-badge{font-size:9px}.action-dock{display:flex;justify-content:space-between;align-items:end;gap:16px;min-width:0}.selection-copy{min-width:0}.selection-copy strong{font:400 16px/20px Inter,system-ui}.selection-copy p{font:400 12px/16px Inter,system-ui;margin:3px 0 0;color:var(--muted)}.dock-actions{display:flex;gap:8px;align-items:center;flex:none}.dock-actions button{height:44px;min-height:44px;padding:0 16px;border:1px solid var(--border);border-radius:8px;background:transparent;color:var(--cream);font:400 14px/19px Inter,system-ui;white-space:nowrap;min-width:0}.dock-actions #play{background:var(--gold);color:var(--ink);border-color:var(--gold);opacity:1}.dock-actions button:disabled,.dock-actions #play:disabled{background:#46675a;color:#d0d9d1;border-color:#46675a;opacity:1}.hand-pagination:empty{display:none}.hand-pagination{position:absolute;top:12px;left:35%;right:30%;height:28px;pointer-events:none}.hand-pagination .range-pager{pointer-events:auto}.range-pager{display:flex;align-items:center;justify-content:space-between;gap:8px;font:400 11px/16px Inter,system-ui;color:var(--muted);min-width:0}.range-pager button{background:none;border:0;color:var(--gold);font:400 12px/16px Inter,system-ui;padding:5px 2px;min-height:24px;white-space:nowrap}.range-pager button:disabled{opacity:.45}.page-range{white-space:nowrap}.own-board-pager:has(.range-pager[hidden]){display:none}.own-board-pager{min-height:0}.handzone .toast.show{position:absolute;top:-4px;left:50%;bottom:auto;transform:translateX(-50%);height:auto;max-width:50%;z-index:40;padding:6px 10px;font-size:12px;line-height:16px;background:var(--clean);color:var(--ink);border:1px solid #9cac8d;border-radius:6px;box-shadow:none;margin:0;white-space:normal}.handzone .toast.is-warning{background:#ffd9cf;color:#8a2c20;border-color:#b5654d}.handzone .toast:before{display:none}.table-footer{display:flex;align-items:center;justify-content:space-between;padding:0 var(--inset);font:400 12px/16px Inter,system-ui;color:var(--muted);background:var(--deep);gap:16px}.player-tabs{display:none}.mobile-info-bar{display:none!important}
.utility-dialog,.small-dialog{color-scheme:light;border:1px solid #768e77;background:var(--cream);color:var(--ink);border-radius:12px;padding:24px;max-width:min(900px,calc(100vw - 32px));width:800px;max-height:90dvh;overflow:auto}.utility-dialog::backdrop,.small-dialog::backdrop{background:#08261cd9}.utility-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.utility-dialog h2,.small-dialog h2{font:400 24px Lora,Georgia,serif;margin:0}.utility-dialog h3{font-size:16px;margin:18px 0 10px}.utility-dialog p{font-size:13px;line-height:1.5}.utility-dialog section{padding-bottom:14px;border-bottom:1px solid #c1c9b4}.utility-dialog details{padding:14px 0;border-bottom:1px solid #c1c9b4}.utility-dialog summary{cursor:pointer;min-height:32px}.utility-dialog button,.small-dialog button{min-height:44px;padding:9px 14px;border:1px solid #8a9d82;color:#254733;background:#fff9ed;border-radius:6px;font-size:13px}.utility-dialog .topright{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:10px}.utility-dialog .nav-link,.utility-dialog .prototype{display:none}.utility-dialog .dev-scenarios{display:block;margin:0;padding:0;border:0}.utility-dialog .scenario-controls{display:flex;flex-wrap:wrap}.utility-dialog .scenario-buttons button{color:#304c37}.utility-dialog .scenario-buttons button[aria-pressed=true]{color:var(--cream)}.utility-dialog .game-summary,.utility-dialog .tracker,.utility-dialog .gallery{margin:0;padding:12px 0;border:0}.utility-dialog .gallery-grid{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}.utility-dialog .gallery-tile .card{width:88px;height:126px}.utility-dialog .gallery-head{display:block}.utility-dialog .volume-control{display:flex;color:var(--ink)}.utility-dialog .size-picker span{display:inline}#demoUtilityActions{display:flex;gap:8px;margin-bottom:14px}.small-dialog{width:400px}.small-dialog>div{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}.utility-dialog .color-toggle{color:#34513a}.utility-dialog #fourColor[aria-pressed=true],.utility-dialog #showValues[aria-pressed=true]{color:var(--cream);background:#315e42}.info-sheet{display:none!important}.dialog{max-height:85dvh;overflow:auto}.board-overlay .board-dialog{background:var(--cream);color:var(--ink)}.board-dialog .board-cards{flex-wrap:wrap}.board-dialog .board-meld{margin-bottom:18px}.audio-diagnostic{position:fixed;z-index:1000;top:0;left:0;right:0;background:var(--cream);color:var(--ink)}
@media(min-width:1200px) and (max-width:1599px){:root{--nav-h:56px;--footer-h:32px;--space:12px;--inset:16px;--opp-h:178px;--hand-h:250px;--turn-h:64px}.playing{grid-template-columns:minmax(0,1fr) 274px}.meld-tile .tile-art{display:none}.meld-tile{height:112px;padding:7px;gap:6px}.meld-rank{font-size:24px;line-height:30px}.meld-caption{font-size:10px}.meld-tile .seal-badge{display:none}.handzone{padding:16px;grid-template-rows:24px minmax(0,1fr) 48px;gap:6px}.handzone #hand .card{width:76px!important;height:112px!important}.handzone .hand{gap:6px;padding-top:10px}.table-footer{font-size:10px}}
@media(min-width:768px) and (max-width:1199px){:root{--nav-h:56px;--footer-h:32px;--space:10px;--inset:12px;--opp-h:160px;--hand-h:230px;--turn-h:64px}.playing{grid-template-columns:minmax(0,1fr) 235px}.playing .other-panel[data-panel]{padding:8px;gap:6px}.meld-tile .tile-art{display:none}.meld-tile.dense,.meld-tile{height:90px;padding:4px;gap:4px}.meld-tile .meld-rank{font-size:19px;line-height:24px}.meld-caption{font-size:9px!important}.playing .opponent-name{font-size:12px}.playing .meld-grid{gap:4px}.meld-tile .seal-badge{display:none}.playing .other-panel[data-panel] .public-sets{gap:3px}.handzone{grid-template-rows:24px minmax(0,1fr) 48px;padding:12px}.handzone #hand .card{width:70px!important;height:100px!important}.handzone .hand{gap:6px}.hand-tools{gap:8px}.hand-tools #reorderUI{display:none}.table-nav{gap:16px}.brand p{display:none}.selection-copy strong{font-size:14px}.selection-copy p{font-size:11px}.dock-actions button{padding:0 10px;font-size:12px}.hand-pagination{left:25%;right:40%}}
@media(max-width:767px){:root{--nav-h:52px;--footer-h:0px;--inset:12px;--space:10px}.app{display:block;height:100dvh}.top{padding:0 12px;height:52px}.brandmark{width:22px;font-size:26px}.brand{gap:8px}.brand h1{font-size:21px;line-height:28px}.brand p,.nav-round{display:none}.table-nav{gap:16px}.nav-link{font-size:13px;min-height:44px}.table-nav #openUtilities{font-size:0;width:32px}.table-nav #openUtilities:before{content:'···';font-size:22px}.table-nav #help{font-size:0}.table-nav #help:before{content:'Rules';font-size:13px}.table{padding:0;gap:0;height:calc(100dvh - 132px);min-height:0;grid-template-rows:80px 76px minmax(0,1fr) 220px;overflow:hidden}.player-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:0;padding:8px 12px;height:80px;min-height:0;align-items:stretch}.player-tabs .player-tab{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:3px;min-width:0;min-height:64px;max-height:64px;margin:0;padding:6px;border:1px solid var(--border);border-radius:8px;background:var(--deep);color:var(--cream);font:400 12px/14px Inter,system-ui;letter-spacing:0;text-align:left}.player-tab>span{white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.player-tab small{font-size:10px;white-space:nowrap}.player-tab[aria-selected=true]{background:var(--cream);border:2px solid var(--gold);padding:5px;color:var(--ink)}.player-tab .book-summary{gap:3px;min-height:10px}.player-tab .book-icon-pill{font-size:9px;padding:0;background:none!important;border:0!important;color:inherit!important;gap:2px}.player-tab .book-icon-pill svg{width:10px;height:10px}.player-tab .book-badge-num{font-size:9px}.turn-banner{margin:12px 12px 0;padding:10px 12px;gap:8px;border-radius:12px;min-height:0}.turn-banner h2{font-size:20px;line-height:24px}.turn-owner{font-size:11px;line-height:13px;margin-bottom:3px}.turn-steps,.selection-badge{display:none}.playing{padding:10px 12px;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:108px minmax(0,1fr);grid-template-areas:'piles' 'board';gap:10px;overflow:hidden}.playing>.other-players{display:contents}.playing>.player-panel[data-panel=you],.playing .other-panel[data-panel]{display:none;grid-area:board;height:100%;padding:8px;border-radius:10px;grid-template-rows:34px minmax(0,1fr) auto;gap:5px;overflow:hidden}.playing>.player-panel[data-panel=you].mobile-current,.playing .other-panel.mobile-current{display:grid}.playing .opponent-header{align-items:center}.playing .opponent-name{font-size:13px}.playing .player-stats{font-size:11px}.playing .open-board{min-height:30px;padding:4px 6px;font-size:10px}.playing>.player-panel[data-panel=you] .sectiontitle{font-size:13px;gap:5px}.your-name{font-size:14px}#yourBoardDetail{font-size:10px;line-height:12px}.playing .book-summary{gap:3px}.playing .book-icon-pill{padding:2px 4px;font-size:10px}.playing .book-icon-pill svg{width:10px;height:10px}.playing .book-badge-num{font-size:10px}.playing .meld-grid,.playing>.player-panel[data-panel=you] .melds,.playing .other-panel[data-panel] .public-sets{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:5px;align-items:stretch}.meld-tile,.meld-tile.dense{height:100%;max-height:none;padding:4px 5px;gap:3px;border-radius:5px}.meld-tile .tile-art,.meld-tile .seal-badge{display:none}.meld-tile .meld-rank,.meld-tile.dense .meld-rank{font-size:18px;line-height:20px}.meld-tile .meld-actual{font-size:10px}.meld-tile .progress-pip-bar,.meld-tile .pip-segments-row,.meld-tile .pip-segment{height:5px;min-height:5px}.meld-tile .meld-caption,.meld-tile.dense .meld-caption{font-size:9px;line-height:11px;padding:0 2px;white-space:nowrap}.meld-tile .target-caption{display:none!important}.meld-tile.valid-target{padding:2px 3px}.playing>.pilearea{grid-area:piles;height:108px;padding:8px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:minmax(0,1fr);gap:8px;border-radius:12px}.piles-title,.playing .pilearea .draw-note,.playing .pilearea .draw-action,.playing .pilearea .pickup-action{display:none!important}.pilearea .pile{align-self:start}.pilearea .back,.pilearea #discard .card{width:64px!important;height:68px!important;max-width:100%;aspect-ratio:auto}.pilearea #discard .card{width:48px!important;height:68px!important}.pilearea .back:after{font-size:30px}.pilearea .pilelabel{font-size:10px;line-height:12px;margin-top:4px}.playing.inspecting{grid-template-rows:minmax(0,1fr);grid-template-areas:'board'}.playing.inspecting>.pilearea{display:none!important}.playing.inspecting .other-panel.mobile-current{grid-template-rows:38px minmax(0,1fr) 24px}.playing.inspecting .meld-tile.dense{height:100%;padding:8px;gap:6px}.playing.inspecting .meld-tile .meld-rank{font-size:24px;line-height:28px}.playing.inspecting .meld-caption{font-size:10px;white-space:normal}.handzone{margin:0;padding:8px 12px;min-height:0;height:220px;border-radius:0;display:grid;grid-template-rows:22px minmax(0,1fr) 44px;gap:4px;overflow:visible}.handhead{display:flex;align-items:center;gap:8px}.hand-heading{gap:4px}.handhead h2{font-size:14px;line-height:20px}.handhead h2 small{font-size:12px;margin-left:4px}.hand-heading>span{display:none}.hand-tools{gap:8px}.hand-tools button{font-size:11px;min-height:28px}.hand-tools #reorderUI{display:none}.handzone #hand.hand{display:grid;grid-template-columns:repeat(var(--hand-columns),minmax(0,88px));align-content:center;justify-content:center;gap:4px;padding:0;height:100%!important}.handzone #hand .card{width:100%!important;height:124px!important;max-width:88px;max-height:124px;transform:none!important;aspect-ratio:88/124}.handzone #hand .card.selected{transform:none!important;outline:3px solid var(--gold)}.handzone #hand .card:hover{transform:none!important}.hand-pagination{position:static;left:auto;right:auto;top:auto;pointer-events:auto;height:44px;min-width:0}.hand-pagination .range-pager{height:44px}.range-pager{font-size:11px}.range-pager button{min-height:44px;min-width:44px}.own-board-pager .range-pager{height:20px;font-size:9px}.own-board-pager .range-pager button{min-height:20px;padding:0;font-size:10px}.action-dock{position:fixed;z-index:20;bottom:0;left:0;right:0;min-height:80px;height:80px;padding:7px 12px 8px;background:var(--cream);color:var(--ink);display:grid;grid-template-rows:14px 44px;gap:5px;border-top:1px solid #d4d8c9}.selection-copy{display:flex;align-items:center;justify-content:space-between;gap:8px}.selection-copy strong{font-size:11px;line-height:14px;white-space:nowrap}.selection-copy p{font-size:10px;line-height:12px;color:#42634c;text-align:right;margin:0;max-width:65%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dock-actions{display:grid;grid-template-columns:1fr 1.2fr;gap:8px;height:44px}.dock-actions #newMeldAction,.dock-actions #discardAction{display:none}.dock-actions button{width:100%;min-height:44px;height:44px;padding:0 10px;font-size:14px;background:var(--deep);color:var(--cream)}.dock-actions button:disabled{color:#c0d0c5;background:#46675a}.dock-actions #play{background:var(--gold);color:var(--ink)}.dock-actions #play:disabled{background:#ded9c8;color:#5f655c;border-color:#b8bba9}.handzone .toast.show{position:fixed;left:12px;right:12px;top:auto;bottom:84px;transform:none;max-width:none;z-index:40;margin:0;padding:9px 12px;font-size:12px}.table-footer{display:none}.utility-dialog{padding:18px;width:calc(100% - 24px);max-width:none;max-height:90dvh}.utility-dialog .topright{gap:10px;justify-content:flex-start}.utility-dialog .volume-control span{display:inline}.utility-dialog .deck-picker select{font-size:13px}.utility-dialog .tracker-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.board-dialog{max-height:90dvh}.board-dialog .board-cards .card{width:76px;height:106px}.dialog{padding:20px}.dialog p{font-size:13px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
/* Neutralize legacy positional board rules inside the new opponent grid. */
.playing .other-players>.other-panel[data-panel]{grid-area:auto!important;grid-column:auto!important;grid-row:auto!important}
.brand h1{color:var(--cream)}
.meld-tile,.meld-caption{text-transform:none;letter-spacing:0}.meld-tile.dirty{display:flex;background:var(--cream);font-size:inherit;font-weight:inherit}.meld-caption.dirty{background:transparent;padding:0;border:0;text-transform:none;letter-spacing:0;font-weight:400}.meld-caption.book.dirty{background:var(--dirty);padding:2px 4px}
.pilearea .back{background:var(--panel)!important}.pilearea .back:before{display:none!important}.pilearea .back:after{display:grid!important}
.brandmark{font-size:0;background:transparent url('ui-assets/table-spade.svg') center/28px 28px no-repeat}
.pilearea .back:after{content:'';background:url('ui-assets/table-spade.svg') center/32px 32px no-repeat}
.meld-caption.book{max-height:none}.top{align-items:center}
@media(max-width:767px){.dock-actions.single-discard-choice{grid-template-columns:1fr 1.2fr 1fr}.dock-actions.single-discard-choice #discardAction{display:block;font-size:12px;padding:0 6px}.meld-caption.book.dirty{padding:0 2px}.meld-caption.book{white-space:nowrap}}
.mobile-hand-meta{display:none}
@media(max-width:767px){.hand-tools{display:none}.hand-heading{width:100%;justify-content:space-between}.hand-heading .mobile-hand-meta{display:inline;font:400 10px/14px Inter,system-ui;color:var(--muted)}.own-board-pager .range-pager{height:44px}.own-board-pager .range-pager button{min-height:44px;min-width:44px;padding:0 2px}#yourPanel:has(.range-pager:not([hidden])){grid-template-rows:30px minmax(0,1fr) 44px;gap:4px}#yourPanel:has(.range-pager:not([hidden])) .meld-tile{padding:3px 5px;gap:2px}#yourPanel:has(.range-pager:not([hidden])) .meld-rank{font-size:17px;line-height:18px}#yourPanel:has(.range-pager:not([hidden])) .meld-caption{font-size:8px;line-height:10px}}
@media(max-width:767px){.playing .open-board{display:none}.board-dialog button,.values-dialog input,.values-dialog button,.confirm-dialog button,.dialog button{min-height:44px}}
.utility-dialog :focus-visible,.small-dialog :focus-visible,.values-dialog :focus-visible{outline-color:#126043!important}

/* Original sage tabletop and illustrated cards; compact layout stays intact. */
:root{color-scheme:light;--table:#c6d3bf;--deep:#91ae96;--panel:#f2f0e2;--ink:#304c37;--muted:#506a55;--border:#8ca187;--clean:#e5ebd9;--dirty:#f0ddd0;--gold:#c87357;--focus:#315e42}
html,body{color:var(--ink);font-family:'DM Sans',system-ui,sans-serif;background:var(--table)}
.app{background:#c6d3bf}.top{background:#e5e7d8;border-bottom:1px solid #9bad92}.brand h1{font-family:'Playfair Display',Georgia,serif;font-weight:700;color:#344b3b}.brand p{color:#506a55;letter-spacing:.12em}.brandmark{width:38px;height:38px;border:2px solid #63806a;border-radius:50%;background:#faf3df;color:#344b3b;font-size:22px;box-shadow:1px 2px 0 #8ba28b}.brand>div:last-child{gap:14px}.nav-link,.nav-round{color:#344b3b}
.turn-banner{background:#f8f3e5;border:1px solid #a8b49c;border-radius:8px}.turn-banner h2{font-family:'DM Sans',system-ui,sans-serif;font-weight:600}.turn-owner{color:#315e42}.selection-badge{background:#e8dbc0;color:#4e553c}
.playing>.player-panel[data-panel=you],.playing .other-panel[data-panel]{background:#f0f0e2;border:1px solid #b4bea5;border-radius:10px}.playing>.player-panel[data-panel=you]{border-color:#6d8c6e;box-shadow:inset 0 2px 0 #315e42}.playing .opponent-name,.playing>.player-panel[data-panel=you] .sectiontitle{color:#304c37;font-family:'DM Sans',system-ui,sans-serif;font-weight:700}.playing .open-board{color:#34513a;background:#faf6e9}.your-name{font-weight:700}.book-icon-pill.no-books{color:#65715a;background:#f3eddf}.book-icon-pill.clean{color:#315e42;border:1px solid #92a086}.book-icon-pill.dirty{border:1px solid #b58d75}
.playing>.pilearea{background:#83a38a;border:1px solid #6c8c70;border-radius:10px}.pilearea .pilelabel,.piles-title,.pilearea .draw-note{color:#294a34}.pilearea .back{background:repeating-linear-gradient(45deg,#83a991 0 5px,#9dc0a5 5px 10px)!important;border:4px solid #f8f0db;box-shadow:2px 3px 0 #c8c7af,4px 5px 0 #718b7488}.pilearea .back:after{background:none;content:'♠';color:#f8e7bb;border:1px solid #53765b;inset:4px;font-size:30px}.pilearea .draw-action,.pilearea .pickup-action{background:#faf1db;color:#304c37;border:1px solid #758c71;box-shadow:2px 3px 0 #6d886d}.pilearea .draw-action:disabled{color:#47634b;background:#cad7c5;box-shadow:none}
.handzone{background:#91ae96;border:1px solid #6f9075;border-radius:10px}.handhead h2,.hand-heading>span,.hand-tools button,.selection-copy,.table-footer{color:#304c37}.handhead h2{font-family:'DM Sans',system-ui,sans-serif;font-weight:700}.hand-tools button[aria-pressed=true]{color:#82462f}.table-footer{background:#e5e7d8;border-top:1px solid #9bad92}.dock-actions button{color:#304c37;background:#faf3e1;border-color:#82977b;box-shadow:2px 3px 0 #6d886d}.dock-actions #play{background:#c87357;color:#fff9ed;border-color:#a65e48}.dock-actions button:disabled,.dock-actions #play:disabled{background:#d5d8c8;color:#586550;border-color:#a5b19a;box-shadow:none}.range-pager button{color:#385c3e;font-weight:700}.handzone #hand .card{box-shadow:2px 3px 0 #d4cbb5,4px 5px 0 #637b6559}.handzone #hand .card.selected{outline-color:#b6674f}.handzone #hand .card.selected:after{background:#b6674f;color:#fff9ed}
/* A meld is one original playing card, never a card inside a second tile. */
.playing .meld-grid{justify-items:center;align-items:start}
.meld-tile.face-meld{width:144px;max-width:100%;height:204px;max-height:100%;padding:0;gap:0;background:transparent;border:0;border-radius:7px;display:block;position:relative;text-align:left}
.face-meld .tile-art{position:absolute;inset:0;display:block!important;overflow:visible;pointer-events:none}
.face-meld .tile-art .card{width:100%!important;height:100%!important;border:1px solid #e0d1ae;border-radius:7px;box-shadow:none;overflow:hidden}
.face-meld .meld-top{position:absolute;inset:0;z-index:20;pointer-events:none}.face-meld .meld-rank{display:none}.face-meld .meld-actual{position:absolute;top:7px;right:7px;min-width:22px;height:22px;padding:0 4px;display:grid;place-items:center;border:1px solid #9ba98d;border-radius:4px;background:#faf5e8;color:#304c37;font:700 12px 'DM Sans',system-ui,sans-serif}
.meld-tile.face-meld .progress-pip-bar{position:absolute;z-index:22;left:5px;right:5px;bottom:18px;width:auto;height:17px;padding:4px;gap:3px;border:1px solid #a5b193;border-radius:3px;background:#fbf5e8f2}.face-meld .pip-segments-row{align-self:center}.meld-tile .pip-segment.clean-fill{background:#315e42}.meld-tile .pip-segment.dirty-fill{background:#9a543e}.meld-tile .pip-segment.wild-fill{background:#b9944f}.face-meld .meld-caption{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.meld-tile.face-meld .seal-badge{display:flex;top:34px;right:-5px;width:26px;height:26px;opacity:1;z-index:25}.meld-tile.face-meld .seal-badge svg{width:18px;height:18px}.face-meld .target-caption{position:absolute;z-index:24;bottom:39px;left:5px;right:5px;font-size:10px;background:#f5e8c6;color:#304c37;border-radius:3px;text-align:center}.face-meld .target-caption:empty{display:none}.meld-tile.face-meld.valid-target{padding:0;outline:2px solid #b9944f;outline-offset:3px}.meld-tile.face-meld.chosen-target{outline:3px solid #b6674f}.meld-tile.rejected-target{outline:2px solid #a64e38!important}
.playing .other-panel .meld-tile.face-meld{width:80px;height:112px}.other-panel .face-meld .meld-actual{top:4px;right:4px;min-width:17px;height:17px;font-size:10px;padding:0 2px}.other-panel .meld-tile.face-meld .seal-badge{width:20px;height:20px;top:24px;right:-3px}.other-panel .meld-tile.face-meld .seal-badge svg{width:14px;height:14px}.other-panel .meld-tile.face-meld .progress-pip-bar{left:3px;right:3px;bottom:14px;padding:3px;height:14px}.other-panel .face-meld .pip-segment,.other-panel .face-meld .pip-segments-row{height:5px}.meld-tile.summary-meld{background:#fbf5e8;border-color:#c6bda4}.meld-tile.summary-meld .meld-rank{font-family:'Playfair Display',Georgia,serif}.meld-caption{color:#315e42}.meld-caption.dirty{color:#82462f}.meld-caption.book{background:#e5ebd9}.meld-caption.book.dirty{background:#f0ddd0}
@media(min-width:768px) and (max-width:1199px){.playing .other-panel .meld-tile.face-meld{height:88px}.other-panel .face-meld .meld-actual{font-size:9px}.other-panel .meld-tile.face-meld .seal-badge{top:23px}.meld-tile.face-meld{height:164px;width:116px}}
@media(max-width:767px){.brandmark{width:30px;height:30px;font-size:18px}.player-tabs .player-tab{background:#e1e6d6;color:#304c37}.player-tab[aria-selected=true]{background:#faf3e1;border-color:#b6674f}.handzone{border-radius:0;border-left:0;border-right:0}.action-dock{background:#f8f3e5}.dock-actions button{color:#304c37;background:#e6ebdb;box-shadow:none}.dock-actions #play{background:#c87357;color:#fff9ed}.playing .meld-grid{justify-items:stretch;align-items:stretch}.hand-heading .mobile-hand-meta{color:#3e5d44}}

.meld-tile.face-meld{box-shadow:calc(var(--stack-depth)*.45px) calc(var(--stack-depth)*.55px) 0 #e7ddc8,calc(var(--stack-depth)*.8px) calc(var(--stack-depth)*.95px) 0 #c9bfa8,0 3px 7px #304d3826}.face-meld .tile-art .points-badge{display:block!important}.face-meld .tile-art .points-badge[hidden]{display:none!important}
.player-tabs .player-tab[aria-selected=true]{background:#faf3e1;color:#304c37;border-color:#b6674f}
html[data-show-values=false] .face-meld .tile-art .points-badge{display:none!important}
/* Wide stock targets frame the discard in the desktop side column. */
@media(min-width:768px){
 .playing>.pilearea{grid-template-columns:minmax(0,1fr);grid-template-rows:44px minmax(76px,1fr) 44px;gap:8px;padding:12px;align-items:stretch}
 .pilearea .piles-title{display:none}
 .playing .pilearea>.pile{width:100%;height:100%;min-height:0;align-self:stretch;position:relative}
 .pilearea>.pile:has(#draw){grid-row:1}.pilearea>.pile.discard{grid-row:2}.pilearea>.pile:has(#draw2){grid-row:3}
 .playing .pilearea .back{width:100%!important;max-width:none;height:44px!important;border-width:3px;border-radius:5px;box-shadow:2px 2px 0 #c8c7af}
 .playing .pilearea .back:after{background:none;content:'';border:1px solid #53765b;inset:3px}
 .pilearea>.pile:not(.discard) .pilelabel{position:absolute;inset:0;margin:0;display:flex;align-items:center;justify-content:center;gap:3px;pointer-events:none;font-size:12px;font-weight:700;color:#304c37;background:#f8f0dbe8;border:1px solid #8ba187;border-radius:5px}
 .pilearea>.pile.discard{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px}
 .pilearea #discard{height:calc(100% - 20px);max-height:148px;min-height:56px;aspect-ratio:5/7;width:auto;flex:none}
 .playing .pilearea #discard .card{height:100%!important;width:100%!important;max-width:none}
 .pilearea>.pile.discard .pilelabel{margin:0;line-height:15px;font-size:12px}
 .playing .pilearea .draw-action,.playing .pilearea .pickup-action,.playing .pilearea .draw-note{display:none!important}
}

/* Let boards hug their contents; reserve the remaining useful space for the hand. */
@media(min-width:768px){
 :root{--opp-h:184px;--own-h:296px;--board-face-h:204px}
 .table{grid-template-rows:var(--turn-h) max-content minmax(210px,1fr);align-content:start}
 .playing{grid-template-columns:minmax(0,1fr);grid-template-rows:var(--opp-h) var(--own-h);grid-template-areas:'opponents' 'you';height:auto}
 .playing>.player-panel[data-panel=you]{grid-template-rows:64px minmax(0,1fr) auto;align-self:start;height:var(--own-h)}
 .playing .meld-tile.face-meld{height:var(--board-face-h)}
 .playing .other-panel .meld-tile.face-meld{height:112px}
 .playing>.player-panel[data-panel=you] .sectiontitle{flex-wrap:nowrap;min-width:0;gap:12px}
 .your-identity{flex:none;margin-right:0;min-width:140px}
 .playing .sectiontitle>.pilearea{display:grid;grid-template-columns:100px 104px 100px;grid-template-rows:64px;align-items:center;gap:8px;width:320px;max-width:100%;height:64px;min-height:0;margin:0 auto;padding:0;border:0;background:transparent;box-shadow:none;border-radius:0;flex:none}
 .sectiontitle>.pilearea>.pile:has(#draw),.sectiontitle>.pilearea>.pile.discard,.sectiontitle>.pilearea>.pile:has(#draw2){grid-row:1;height:64px;align-self:center}
 .sectiontitle>.pilearea>.pile:has(#draw){grid-column:1}.sectiontitle>.pilearea>.pile.discard{grid-column:2}.sectiontitle>.pilearea>.pile:has(#draw2){grid-column:3}
 .playing .sectiontitle>.pilearea .back{height:44px!important;margin-top:10px}
 .sectiontitle>.pilearea>.pile:not(.discard) .pilelabel{top:10px;bottom:10px;font-size:11px}
 .sectiontitle>.pilearea>.pile.discard{flex-direction:row;gap:5px;justify-content:center}
 .sectiontitle>.pilearea #discard{height:60px;min-height:60px;max-height:60px;width:43px;aspect-ratio:5/7}
 .sectiontitle>.pilearea>.pile.discard .pilelabel{width:54px;white-space:normal;font-size:10px;line-height:14px;text-align:left;letter-spacing:0;text-transform:none;font-weight:500}
 .handzone{height:100%;max-height:420px;align-self:start;padding:12px;grid-template-rows:24px minmax(0,1fr) 48px;gap:6px}
 .handzone #hand{container-type:size;gap:8px;padding:12px 0 0}
 .handzone #hand .card{--hand-card-w:min(168px,calc((100cqh - 14px)*.6984),calc((100cqw - (var(--hand-columns) - 1)*8px)/var(--hand-columns)));width:var(--hand-card-w)!important;height:calc(var(--hand-card-w)/.6984)!important;max-width:none;max-height:none;aspect-ratio:88/126}
 .hand-pagination{top:10px}
}
@media(min-width:1200px) and (max-width:1599px){:root{--opp-h:178px;--own-h:256px;--board-face-h:164px}.meld-tile.face-meld{width:116px}}
@media(min-width:768px) and (max-width:1199px){:root{--opp-h:160px;--own-h:236px;--board-face-h:144px}.meld-tile.face-meld{width:102px}.playing .other-panel .meld-tile.face-meld{height:88px}.your-identity{min-width:100px}.playing .sectiontitle>.pilearea{grid-template-columns:76px 90px 76px;width:258px}.playing>.player-panel[data-panel=you] .sectiontitle{gap:6px}}
@media(min-width:768px) and (max-height:850px){:root{--opp-h:150px;--own-h:224px;--board-face-h:132px}.playing .other-panel .meld-tile.face-meld{height:88px}.meld-tile.face-meld{width:94px}.handzone{grid-template-rows:20px minmax(0,1fr) 44px;padding:8px;gap:4px}}
@media(min-width:768px){.playing #melds.multi-row .summary-meld{height:100%;max-height:112px;min-height:0}}
@media(min-width:1200px) and (max-width:1599px){:root{--opp-h:160px;--own-h:236px;--board-face-h:144px}.meld-tile.face-meld{width:102px}.playing .other-panel .meld-tile.face-meld{height:88px}}
@media(min-width:768px) and (max-height:850px){:root{--opp-h:132px;--own-h:204px;--board-face-h:112px}.table{grid-template-rows:var(--turn-h) max-content minmax(160px,1fr)}.playing .other-panel[data-panel]{grid-template-rows:30px minmax(0,1fr) auto;padding:8px;gap:6px}.playing .other-panel .meld-tile.face-meld{height:72px}.meld-tile.face-meld{width:80px}}
/* Seven printed edge marks replace the progress strip across the artwork. */
.playing .meld-tile.face-meld .progress-pip-bar{left:5px;right:auto;top:34px;bottom:32px;width:5px;height:auto;min-height:0;padding:0;margin:0;gap:0;display:flex;flex-direction:column;background:transparent;border:0;border-radius:0;box-shadow:none}
.playing .face-meld .progress-pip-bar .pip-segments-row{display:flex;flex-direction:column;align-items:stretch;align-self:stretch;gap:3px;flex:1;width:5px;height:100%;min-height:0}
.playing .face-meld .progress-pip-bar .pip-segment{width:5px;height:auto;min-height:0;min-width:0;flex:1;border-radius:1px;border:1px solid #b2b8a0;background:#e8e4d6}
.playing .face-meld .progress-pip-bar .pip-segment.clean-fill{background:#315e42;border-color:#315e42}
.playing .face-meld .progress-pip-bar .pip-segment.dirty-fill{background:#9a543e;border-color:#9a543e}
.playing .face-meld .progress-pip-bar .pip-segment.wild-fill{width:7px;align-self:center;background:#b9944f;border:0;transform:none}
.playing .face-meld .progress-pip-bar .overflow-chip{position:absolute;left:8px;bottom:-2px;padding:0;margin:0;background:transparent;border:0;color:#315e42;font:700 9px/12px 'DM Sans',system-ui,sans-serif;white-space:nowrap}
.playing .other-panel .meld-tile.face-meld .progress-pip-bar{left:4px;top:25px;bottom:23px;width:4px}
.playing .other-panel .face-meld .progress-pip-bar .pip-segments-row{width:4px;gap:2px}
.playing .other-panel .face-meld .progress-pip-bar .pip-segment{width:4px}
.playing .other-panel .face-meld .progress-pip-bar .pip-segment.wild-fill{width:5px}
.playing .other-panel .face-meld .progress-pip-bar .overflow-chip{left:6px;font-size:7px;line-height:9px}
@media(min-width:768px) and (max-width:1599px){.playing .other-panel .meld-tile.face-meld .progress-pip-bar{top:20px;bottom:18px}.playing .other-panel .face-meld .progress-pip-bar .pip-segments-row{gap:1px}}
@media(min-width:768px) and (max-height:850px){.playing .meld-tile.face-meld .progress-pip-bar{top:25px;bottom:23px}.playing .face-meld .progress-pip-bar .pip-segments-row{gap:2px}.playing .other-panel .meld-tile.face-meld .progress-pip-bar{top:18px;bottom:16px}.playing .other-panel .face-meld .progress-pip-bar .pip-segments-row{gap:1px}}

/* Book seals occupy the corner; edge marks communicate meld progress. */
.playing .meld-tile.face-meld .seal-badge{top:7px;right:7px}
.playing .other-panel .meld-tile.face-meld .seal-badge{top:4px;right:4px}

/* The discard is a named table region; stocks stay behind the Draw action. */
.playing>.pilearea .piles-title{display:block;text-transform:none;color:#304c37;font:700 15px/20px 'DM Sans',system-ui,sans-serif;margin:0}
.playing>.pilearea .draw-action,.playing>.pilearea .pickup-action,.playing>.pilearea .draw-note{display:none!important}
.playing>.pilearea .pilelabel{font:600 13px/18px 'DM Sans',system-ui,sans-serif;color:#405c44;letter-spacing:0;text-transform:none}
@media(min-width:768px){
 :root{--own-h:270px}
 .playing{grid-template-columns:minmax(0,1fr) 210px;grid-template-areas:'opponents opponents' 'you piles'}
 .playing>.player-panel[data-panel=you]{grid-template-rows:38px minmax(0,1fr) auto}
 .your-identity{margin-right:4px}
 .playing>.pilearea{grid-area:piles;width:100%;height:var(--own-h);display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:20px minmax(0,1fr);gap:10px;padding:12px;background:#f0f0e2;border:1px solid #8ca187;border-radius:10px;align-self:start}
 .playing>.pilearea .piles-title{grid-column:1;grid-row:1;text-align:center}
 .playing>.pilearea>.pile.discard{grid-column:1;grid-row:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;height:100%;width:100%;min-height:0}
 .playing>.pilearea #discard{height:calc(100% - 28px);max-height:176px;min-height:48px;aspect-ratio:5/7;width:auto;flex:none}
 .playing>.pilearea #discard .card{height:100%!important;width:100%!important;max-width:none}
 .playing>.pilearea .pile.discard .pilelabel{margin:0}
 .playing>.pilearea #discard.empty-discard{display:grid;place-items:center;border-radius:6px}
 .playing>.pilearea #discard.empty-discard:after{content:'Empty';font:500 13px 'DM Sans',system-ui,sans-serif;color:#506a55}
}
@media(min-width:1200px) and (max-width:1599px){:root{--own-h:210px}.playing{grid-template-columns:minmax(0,1fr) 180px}}
@media(min-width:768px) and (max-width:1199px){:root{--own-h:210px}.playing{grid-template-columns:minmax(0,1fr) 150px}}
@media(min-width:768px) and (max-height:850px){:root{--own-h:178px}.playing>.pilearea{gap:6px;padding:8px}.playing>.pilearea #discard{max-height:112px}}
@media(max-width:767px){
 .playing>.pilearea{display:grid;grid-template-columns:64px minmax(0,1fr);grid-template-rows:24px minmax(0,1fr);gap:4px 12px;padding:12px;background:#e5e8d7;border:1px solid #8ca187}
 .playing>.pilearea .piles-title{grid-column:2;grid-row:1;align-self:end}
 .playing>.pilearea>.pile.discard{display:contents}
 .playing>.pilearea #discard{grid-column:1;grid-row:1 / span 2;justify-self:center;align-self:center;width:48px;height:68px}
 .playing>.pilearea #discard .card{width:48px!important;height:68px!important}
 .playing>.pilearea .pile.discard .pilelabel{grid-column:2;grid-row:2;align-self:start;text-align:left;margin:0;font-size:14px}
}
.playing>.pilearea .piles-title{display:block!important}

/* Keep hand faces readable; use real card overlap when the row fills. */
@media(min-width:768px){
 .handzone #hand.hand{gap:0}
 .handzone #hand .card{width:var(--dealt-card-width,126px)!important;height:calc(var(--dealt-card-width,126px)/.6984)!important;flex:0 0 auto;z-index:var(--hand-order,1)}
 .handzone #hand .card+.card{margin-left:var(--dealt-card-margin,8px)!important}
 .handzone #hand.overlapping .card{box-shadow:-1px 2px 4px #304d3838,inset 0 0 0 1px #e6d8bd}
 .handzone #hand .card.selected{transform:translateY(-18px)!important}
 .handzone #hand .card:hover{transform:translateY(-24px)!important;z-index:var(--hand-order,1)}
 .handzone #hand .card:focus-visible{transform:translateY(-24px)!important;z-index:var(--hand-order,1)}
}
/* Indicators follow the playing card's border and corner geometry. */
.playing .meld-tile.face-meld .progress-pip-bar{left:0;right:auto;top:5px;bottom:5px;width:12px;height:auto;padding:0;border:0;background:transparent}
.playing .face-meld .progress-pip-bar .pip-segments-row{width:12px;gap:2px;align-items:center}
.playing .face-meld .progress-pip-bar .pip-segment{width:4px;align-self:center;border-radius:1px}
.playing .face-meld .progress-pip-bar .pip-segment:first-child{border-radius:3px 3px 1px 1px}
.playing .face-meld .progress-pip-bar .pip-segment:last-child{border-radius:1px 1px 3px 3px}
.pip-segment.wild-fill{clip-path:none!important;transform:none!important;background:transparent!important;border:0!important;display:grid;place-items:center;color:#987236;overflow:visible}
.pip-segment.wild-fill .jester-icon{display:block;width:10px;height:10px;max-height:100%;flex:none;fill:currentColor;stroke:none}
.playing .face-meld .progress-pip-bar .pip-segment.wild-fill{width:12px;background:transparent;border:0;align-self:center}
.playing .face-meld .progress-pip-bar .pip-segment.wild-fill .jester-icon{width:12px;height:12px;max-height:100%}
.playing .face-meld .progress-pip-bar .overflow-chip{left:34px;bottom:-2px;color:#765c2f;font-size:9px;line-height:11px}
.face-meld .tile-art .points-badge{left:12px;bottom:3px;background:transparent;color:#304c37;border:0;border-radius:0;box-shadow:none;padding:0;font:700 9px/11px 'DM Sans',system-ui,sans-serif}
.playing .meld-tile.face-meld .seal-badge{top:0;right:0;width:30px;height:30px;border-radius:0 7px 0 10px;border:0;border-left:1px solid #c9b787;border-bottom:1px solid #c9b787;background:#f0e4c6;box-shadow:none;opacity:1}
.playing .meld-tile.face-meld .seal-badge.dirty{background:#eedccc;border-color:#c59d82;color:#82462f}
.playing .meld-tile.face-meld .seal-badge.clean{color:#315e42}
.playing .meld-tile.face-meld .seal-badge>svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.5}
.seal-badge .jester-icon{stroke:none}
.playing .other-panel .meld-tile.face-meld .progress-pip-bar{top:4px;bottom:4px;left:0;width:9px}
.playing .other-panel .face-meld .progress-pip-bar .pip-segments-row{width:9px;gap:1px}
.playing .other-panel .face-meld .progress-pip-bar .pip-segment{width:3px}
.playing .other-panel .face-meld .progress-pip-bar .pip-segment.wild-fill{width:9px}
.playing .other-panel .face-meld .progress-pip-bar .pip-segment.wild-fill .jester-icon{width:9px;height:9px;max-height:100%}
.playing .other-panel .face-meld .progress-pip-bar .overflow-chip{left:25px;font-size:7px;line-height:9px}
.other-panel .face-meld .tile-art .points-badge{left:10px;bottom:3px;font-size:7px;line-height:9px}
.playing .other-panel .meld-tile.face-meld .seal-badge{top:0;right:0;width:22px;height:22px;border-radius:0 7px 0 8px}
.playing .other-panel .meld-tile.face-meld .seal-badge>svg{width:16px;height:16px}
.meld-caption>.jester-icon,.wild-legend-icon>.jester-icon{display:inline-block;width:12px;height:12px;vertical-align:-2px;color:#82462f;fill:currentColor;stroke:none}
.summary-meld .pip-segment.wild-fill .jester-icon{width:8px;height:8px}
@media(min-width:768px) and (max-height:850px){.playing .face-meld .progress-pip-bar .pip-segments-row{gap:1px}}

.book-icon-pill .jester-icon{stroke:none}
/* Clean/dirty is a readable card state, never a tiny wild-card decoration. */
.status-corner{position:absolute;z-index:26;top:0;right:0;display:flex;align-items:center;justify-content:center;gap:3px;padding:4px 5px;border-radius:0 7px 0 8px;border-left:1px solid #a3b299;border-bottom:1px solid #a3b299;background:#e6eddc;color:#315e42;font:800 8px/12px 'DM Sans',system-ui,sans-serif;pointer-events:none}
.status-corner.dirty{background:#f2ddcd;color:#82462f;border-color:#bd9279}
.status-corner svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.completed .status-corner{display:none}
.playing .meld-tile.face-meld .seal-badge{width:26px;height:26px}
.playing .meld-tile.face-meld .seal-badge>svg{width:18px;height:18px}
.book-ink-stamp{position:absolute;z-index:26;left:50%;top:52%;transform:translate(-50%,-50%) rotate(-12deg);border:2px double currentColor;padding:4px 7px;color:#315e42;background:#fbf5e8ec;font:800 15px/18px 'DM Sans',system-ui,sans-serif;letter-spacing:.08em;box-shadow:0 0 0 2px #fbf5e8a8;pointer-events:none}
.book-ink-stamp.dirty{color:#9a543e}
.playing .meld-tile.face-meld.completed{transform:rotate(-1.3deg)}
.playing .meld-tile.face-meld.completed:nth-child(even){transform:rotate(1.3deg)}
.playing .other-panel .book-ink-stamp{padding:2px 3px;font-size:8px;line-height:11px;letter-spacing:.03em;border-width:1px}
.other-panel .status-corner{padding:2px 3px;font-size:6px;gap:1px;line-height:9px}
.other-panel .status-corner svg{width:8px;height:8px}
.summary-meld .status-corner{display:none}
.summary-meld .book-ink-stamp{left:auto;right:5px;top:8px;transform:rotate(-7deg);font-size:9px;line-height:12px;padding:2px 4px;border-width:1px}
.meld-caption>svg,.wild-legend-icon>svg{display:inline-block;width:12px;height:12px;vertical-align:-2px;fill:none;stroke:currentColor;stroke-width:2}
/* Player phases remain icon-only, with the active phase visibly filled. */
.player-phase,#yourPhase{display:inline-flex!important;vertical-align:middle;margin-left:7px;padding:1px;gap:0;border-radius:5px;min-height:24px!important}
.player-phase .phase-step,#yourPhase .phase-step{display:flex;align-items:center;min-height:22px;padding:1px 3px;border-radius:3px;gap:1px;opacity:.45}
.player-phase .phase-step.active,#yourPhase .phase-step.active{background:#315e42;opacity:1;color:#fff9e9}
.player-phase .phase-step.complete,#yourPhase .phase-step.complete{opacity:1}
.player-phase .phase-step>span,#yourPhase .phase-step>span{font-size:16px}
.player-phase .phase-arrow,#yourPhase .phase-arrow{font-size:10px}
.playing .opponent-name{display:flex;align-items:center;overflow:visible}
.playing>.player-panel,.playing .other-panel{position:relative}
.playing .book-summary{position:absolute;top:0;right:0;gap:0;margin:0;min-height:25px;border-radius:0 9px 0 8px;overflow:hidden;border-left:1px solid #a6b498;border-bottom:1px solid #a6b498}
.playing .book-icon-pill{border:0!important;border-radius:0!important;padding:5px 7px;font-size:10px;gap:3px;min-height:25px}
.playing .book-icon-pill+.book-icon-pill{border-left:1px solid #c1bca3!important}
.playing .book-kind{font-size:9px;font-weight:700}
.playing .opponent-identity{padding-right:115px}

/* Newly drawn cards remain marked until the next turn, including across hand pages. */
.handzone #hand .card.newly-drawn{outline:3px solid #b38a30;outline-offset:1px;animation:none!important;filter:none;box-shadow:0 0 0 5px #f4df91a8,2px 3px 4px #304d3833}
.handzone #hand .card.newly-drawn.selected{outline-color:#b6674f}
.drawn-label{position:absolute;z-index:31;top:-17px;left:0;height:17px;min-width:33px;padding:2px 5px;border-radius:4px 4px 0 0;background:#ead181;color:#304327;font:800 9px/13px 'DM Sans',system-ui,sans-serif;letter-spacing:.06em;pointer-events:none}
/* A darker felt well distinguishes the communal discard from cream meld boards. */
.playing>.pilearea{background:#456a56;border:1px solid #31513e;box-shadow:inset 0 2px 6px #203d3029}
.playing>.pilearea .piles-title,.playing>.pilearea .pilelabel{color:#fff5de}
.playing>.pilearea #discard{outline:1px dashed #e0d3a8;outline-offset:6px;border-radius:6px}
.playing>.pilearea #discard .card{box-shadow:2px 3px 0 #dbd0b5,4px 5px 0 #213e3266}
@media(max-width:767px){.playing .opponent-identity{padding-right:100px}.playing .book-icon-pill{font-size:9px;padding:4px}.playing .book-kind{font-size:8px}.playing .book-icon-pill svg{width:10px;height:10px}.playing .book-summary{min-height:22px}.player-tabs .book-kind{display:none}.player-tabs .player-phase{margin-left:4px;min-height:16px!important;padding:0;border:0}.player-tabs .phase-step{min-height:16px;padding:0 1px}.player-tabs .phase-step>span{font-size:12px}.player-tabs .phase-arrow,.player-tabs .phase-step b{display:none}.player-tab>span{display:flex;align-items:center;overflow:visible}.summary-meld .book-ink-stamp{font-size:7px;line-height:9px;top:4px;padding:1px 3px;right:3px}.player-phase,#yourPhase{margin-left:4px}.playing .opponent-name{font-size:12px}.playing .player-stats{font-size:10px}.drawn-label{height:15px;top:-15px;font-size:8px;line-height:11px;min-width:28px}}

@media(max-width:767px){#yourPanel{grid-template-rows:38px minmax(0,1fr) auto}.summary-meld.completed{transform:rotate(-.5deg)}}
@media(max-width:767px){.player-tabs .phase-step:not(.active){display:none}.player-tabs .player-phase{margin-left:3px}.player-tabs .phase-step>span{font-size:14px}}
.round-score-dialog{color-scheme:light;width:min(1160px,calc(100vw - 32px));max-height:90dvh;padding:24px;background:#fbf5e8;color:#304c37;border:1px solid #789278;border-radius:10px;overflow:auto}
.round-score-dialog::backdrop{background:#213d32d9}.round-score-heading{display:flex;align-items:start;justify-content:space-between;gap:16px}.round-score-heading h2{font:700 25px/32px 'Playfair Display',Georgia,serif;margin:4px 0 12px}.round-score-kicker{font-size:11px;font-weight:700;letter-spacing:.08em;margin:0;color:#315e42}.round-score-dialog button{min-height:44px;padding:8px 14px;background:#eee7d4;border:1px solid #82977b;border-radius:5px;color:#304c37}.score-rule,.score-note{font-size:13px;line-height:1.6}.score-note{margin-bottom:0}.round-score-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:20px}.score-player{border:1px solid #bac3ac;border-radius:6px;padding:14px;background:#f3f0e4;min-width:0}.score-player h3{font-size:15px;display:flex;justify-content:space-between;gap:10px;align-items:center;margin:0 0 14px;flex-wrap:wrap}.score-total{font-size:28px;line-height:32px}.score-player dl{margin:0}.score-player dl>div{display:flex;align-items:start;justify-content:space-between;gap:8px;border-top:1px solid #d0d4c4;padding:8px 0;font-size:12px}.score-player dd{margin:0;font-weight:700;font-variant-numeric:tabular-nums}.score-player details{font-size:12px;margin-top:10px}.score-player summary{min-height:32px;cursor:pointer}.score-player details p{line-height:1.7;overflow-wrap:anywhere}.broken-books{font-size:11px;padding:8px;background:#efdece;color:#82462f;border-radius:4px;margin:8px 0}.broken-books p{margin:6px 0 0;line-height:1.5}
@media(max-width:1000px){.round-score-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.round-score-dialog{padding:16px}.round-score-grid{grid-template-columns:minmax(0,1fr)}.round-score-heading h2{font-size:21px;line-height:28px}.score-player summary{min-height:44px}}
.board-dialog .inspection-meld-heading{display:flex;align-items:center;justify-content:flex-start;gap:10px;margin:0 0 8px;text-align:left;flex-wrap:wrap}
.board-dialog .inspection-meld-heading>b{font:700 20px/26px 'Playfair Display',Georgia,serif;color:#304c37}
.inspection-status{padding:4px 8px;border-radius:4px;border:1px solid #92a086;background:#e5ebd9;color:#315e42;font:700 12px/17px 'DM Sans',system-ui,sans-serif}
.inspection-status.dirty{border-color:#b58d75;background:#f0ddd0;color:#82462f}
.inspection-count{font:500 12px/17px 'DM Sans',system-ui,sans-serif;color:#506a55}
.board-dialog .board-meld{padding-bottom:18px;border-bottom:1px solid #c5cdb9}
.board-dialog .board-meld:last-child{border-bottom:0;margin-bottom:0;padding-bottom:0}
.board-dialog .progress-pip-bar{margin:0 0 12px}
.seal-badge>svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.inspection-status.dirty{text-transform:none;letter-spacing:0}
/* Book totals are color fields of the player panel, without badge outlines. */
.playing>.player-panel[data-panel=you],.playing .other-panel[data-panel]{border:0;box-shadow:none}
.playing .book-summary{top:0;right:0;border:0;border-radius:0 10px 0 8px;box-shadow:none;outline:0;gap:0}
.playing .book-summary .book-icon-pill{border:0!important;box-shadow:none;outline:0}
.playing .book-summary .book-icon-pill.clean{background:#d7e2ca;color:#304e36}
.playing .book-summary .book-icon-pill.dirty{background:#e9cdbb;color:#763d29}
.playing .book-summary .book-icon-pill.no-books{background:#dfe4d4;color:#50634c}
.playing .book-summary .book-icon-pill{margin:0!important;text-transform:none;letter-spacing:0}
/* Give the discard heading and count clear space outside the card's dashed frame. */
@media(min-width:768px){
 .playing>.pilearea{grid-template-rows:20px minmax(0,1fr) 18px;padding:16px;gap:18px}
 .playing>.pilearea>.pile.discard{display:contents}
 .playing>.pilearea #discard{grid-column:1;grid-row:2;justify-self:center;align-self:center;height:100%;max-height:176px;min-height:0}
 .playing>.pilearea .pile.discard .pilelabel{grid-column:1;grid-row:3;margin:0;align-self:center;justify-self:center;line-height:18px}
}
@media(min-width:768px) and (max-height:850px){.playing>.pilearea{padding:12px;gap:12px}}
@media(max-width:767px){.playing>.pilearea{gap:8px 18px}}

/* Narrow tables use bounded board rows; viewport height must not stretch melds. */
@media(max-width:767px){
 .table{display:flex;flex-direction:column;height:calc(100dvh - 52px);overflow:hidden}
 .player-tabs{flex:0 0 72px;height:72px}
 .player-tabs .player-tab{min-height:56px;max-height:56px}
 .turn-banner{flex:0 0 56px;margin:8px 12px 0;padding:8px 12px}
 .playing{flex:0 1 300px;width:100%;min-height:0;padding:8px 12px;gap:8px;grid-template-rows:92px minmax(0,1fr)}
 .playing:has(.own-board-pager .range-pager:not([hidden])){flex-basis:342px}
 #yourPanel:has(.range-pager:not([hidden])){grid-template-rows:38px minmax(0,1fr) 44px}
 .playing>.pilearea{height:92px}
 .playing.inspecting{grid-template-rows:minmax(0,1fr)}
 .playing .meld-grid,.playing>.player-panel[data-panel=you] .melds,.playing .other-panel[data-panel] .public-sets{grid-template-rows:repeat(2,minmax(56px,1fr));grid-auto-rows:56px;overflow-y:auto;overflow-x:hidden;align-content:start}
 .handzone{flex:0 0 300px;width:100%;height:300px;grid-template-rows:22px minmax(0,1fr) 44px 80px;gap:4px}
 .hand-pagination{grid-row:3}
 .handzone:has(.hand-pagination>.range-pager[hidden]){flex-basis:256px;height:256px;grid-template-rows:22px minmax(0,1fr) 0 80px}
 .action-dock{position:static;grid-row:4;grid-template-columns:minmax(0,1fr);min-height:80px;height:80px;margin:0 -12px -8px;padding:7px 12px 8px;border-radius:0}
 .action-dock .dock-actions{width:100%}
}

/* Inspection belongs to the player identity, with secondary header styling. */
@media(min-width:768px){
 .playing>.player-panel[data-panel=you] .sectiontitle{justify-content:flex-start}
 .playing>.player-panel[data-panel=you] .open-board{margin:0;padding:5px 6px;min-height:32px;border:0;border-radius:4px;background:transparent;box-shadow:none;color:#506a55;font-weight:500;text-decoration:underline;text-underline-offset:3px}
 .playing>.player-panel[data-panel=you] .open-board:hover{background:#e3e7d8;color:#304c37}
}

/* One clear turn step and one action/selection area. */
.turn-steps{gap:8px;align-items:center}
.turn-steps li{display:flex;align-items:center;gap:6px;padding:5px 9px;border:1px solid transparent;border-radius:6px;color:#65715d;font-weight:500}
.turn-steps .step-marker{display:grid;place-items:center;width:20px;height:20px;flex:none;border:1px solid #9da98f;border-radius:50%;font-size:11px;font-weight:700}
.turn-steps li.active{background:#315e42;border-color:#315e42;color:#fff8e8;font-weight:700}
.turn-steps li.active .step-marker{background:#fff8e8;color:#315e42;border-color:#fff8e8}
.turn-steps li.done{color:#315e42}
.turn-steps li.done .step-marker{background:#e1e8d5;border-color:#91a184}
.turn-steps li.done:after{content:none}
.turn-banner>div{min-width:0}
.dock-actions button:disabled,.dock-actions #play:disabled{background:#e2e5da;color:#5c6757;border:1px dashed #9ba68f;box-shadow:none;opacity:1;transform:none}
.playing>.pilearea .pilelabel{display:flex;align-items:center;justify-content:center;gap:6px}
.discard-state{display:inline-flex;align-items:center;white-space:nowrap;padding:1px 5px;border-radius:3px;background:#f3df9f;color:#304c37;font:700 10px/16px 'DM Sans',system-ui,sans-serif}
.playing>.pilearea.pickup-ready{background:#355d47}
.playing>.pilearea #discard.pickup-eligible{outline:2px solid #e4c674;outline-offset:6px;box-shadow:none}
@media(max-width:1199px) and (min-width:768px){.playing>.pilearea.pickup-ready .pilelabel{font-size:11px;gap:4px}.discard-state{padding-inline:3px;font-size:9px}}
@media(max-width:767px){
 .turn-banner{flex-basis:64px;min-height:64px;flex-wrap:nowrap;gap:8px}
 .turn-banner h2{font-size:18px;line-height:22px}
 .turn-banner>div{flex:1}
 .turn-steps{display:flex;gap:3px;flex:none}
 .turn-steps li{padding:3px;gap:4px}
 .turn-steps .step-marker{width:18px;height:18px;font-size:10px}
 .turn-steps .step-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .turn-steps li.active .step-label{position:static;width:auto;height:auto;margin:0;clip-path:none;font-size:10px}
 .playing>.pilearea .pilelabel{justify-content:flex-start}
 .discard-state{font-size:11px}
}

/* Public book progress belongs to the panel, with an explicit label. */
.books-label{display:inline-flex;align-items:center;padding:4px 6px;background:#dce3cf;color:#304c37;font:700 10px/17px 'DM Sans',system-ui,sans-serif}
.playing .book-kind,.playing .book-badge-num{font-size:11px}
.playing .book-icon-pill{padding:4px 6px}
.player-tabs .books-label{display:none}
.readiness-tag{display:inline-flex;align-items:center;margin-left:8px;white-space:nowrap;color:#315e42;font:700 11px/15px 'DM Sans',system-ui,sans-serif}
.readiness-tag[data-readiness=books-and-foot]{text-decoration:underline;text-decoration-style:dotted;text-underline-offset:3px}
.playing .opponent-identity{padding-right:0}
.playing .other-panel .player-stats{display:flex;align-items:center;flex-wrap:wrap;row-gap:0;font-size:12px;line-height:16px}
/* More readable opponent faces; bounded rows keep the hand in view. */
@media(min-width:768px){
 :root{--opp-h:204px;--own-card-width:144px}
 .playing .other-panel[data-panel]{padding:10px;gap:6px;grid-template-rows:40px minmax(0,1fr) auto}
 .playing .other-panel[data-panel] .public-sets{gap:4px;justify-items:center;align-items:start}
 .playing .other-panel .meld-tile.face-meld{width:100%;max-width:88px;height:auto;aspect-ratio:5/7;max-height:100%}
 .other-panel .status-corner{font-size:8px;line-height:11px;padding:2px 3px}
 .playing .other-panel .book-ink-stamp{font-size:10px;line-height:12px;padding:2px 4px}
 .playing .other-panel .face-meld .progress-pip-bar .pip-segment{width:4px}
 .playing>.player-panel[data-panel=you] .melds{grid-template-columns:repeat(6,minmax(0,var(--own-card-width)));justify-content:center;column-gap:18px}
 .handzone{max-height:340px}
 .handzone #hand.overlapping .card{transform:translateY(var(--fan-drop,0px)) rotate(var(--fan-angle,0deg))!important;transform-origin:50% 100%}
 .handzone #hand .card.selected{transform:translateY(-18px)!important;z-index:var(--hand-order,1)}
 .handzone #hand .card:hover,.handzone #hand .card:focus-visible{transform:translateY(-24px)!important;z-index:var(--hand-order,1)}
}
@media(min-width:1200px) and (max-width:1599px){:root{--opp-h:176px;--own-card-width:102px}}
@media(min-width:768px) and (max-height:850px){:root{--opp-h:148px;--own-card-width:80px}}
@media(min-width:768px) and (max-width:1199px){
 :root{--opp-h:200px;--own-card-width:102px}
 .playing .other-panel[data-panel]{padding:8px;grid-template-rows:70px minmax(0,1fr) auto;gap:4px}
 .playing .other-panel .opponent-header{flex-direction:column;align-items:flex-start;gap:2px}
 .playing .other-panel .book-summary{position:static;flex:none}
 .playing .other-panel[data-panel] .public-sets{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:4px}
 .other-panel .summary-meld.dense{height:100%;max-height:54px;padding:3px 5px;gap:2px}
 .other-panel .summary-meld .meld-rank{font-size:18px;line-height:20px}
 .other-panel .summary-meld .meld-caption{font-size:10px!important;line-height:12px;white-space:nowrap}
 .other-panel .summary-meld .book-ink-stamp{font-size:8px;line-height:10px;padding:1px 3px;top:4px;right:3px}
}
@media(min-width:768px) and (max-width:1199px) and (max-height:850px){:root{--opp-h:196px;--own-card-width:80px}}
/* Selection, new cards, legal targets and rejection each have their own grammar. */
.handzone #hand .card.selected{outline:3px solid #304c37;outline-offset:1px}
.handzone #hand .card.selected:after{background:#304c37;color:#fff8e8}
.handzone #hand .card.newly-drawn{outline:2px solid #ad832c;outline-offset:1px;box-shadow:2px 3px 0 #d4cbb5,4px 5px 0 #637b6559}
.handzone #hand .card.newly-drawn.selected{outline:3px solid #304c37}
.handzone #hand .card:focus-visible{outline:3px solid #236b85!important;outline-offset:5px!important}
.playing .meld-tile.valid-target{outline:2px dashed #315e42;outline-offset:3px}
.playing .meld-tile.chosen-target{outline:3px solid #315e42;outline-offset:3px}
.playing .meld-tile.rejected-target{outline:2px solid #a64e38!important;outline-offset:3px}
.playing .face-meld .target-caption{bottom:0;left:0;right:0;border-radius:0 0 6px 6px;border-top:1px solid #a9b79d;padding:2px 0;background:#e4ebd8;color:#304c37;font-size:10px;line-height:13px}
.playing .rejected-target .target-caption{display:block!important;background:#f2ddd0;color:#82462f;border-color:#c49c86}
.playing .summary-meld.valid-target{border-width:1px;padding:7px}
.playing .summary-meld .target-caption{position:absolute;bottom:2px;left:3px;right:3px;font-size:10px;line-height:12px;background:#e4ebd8;text-align:center;border-radius:2px}
.playing .summary-meld.valid-target .meld-caption,.playing .summary-meld.rejected-target .meld-caption{visibility:hidden}
@media(max-width:767px){
 .playing .books-label{font-size:9px;padding:3px 4px}
 .playing .book-kind,.playing .book-badge-num{font-size:9px}
 .playing .book-icon-pill{padding:3px 4px}
 .playing .other-panel .player-stats{font-size:11px}
 .readiness-tag{font-size:10px;margin-left:5px}
 .playing .summary-meld.valid-target{padding:4px 5px}
 .playing .summary-meld.valid-target .target-caption,.playing .summary-meld.rejected-target .target-caption{display:block!important;font-size:9px;line-height:11px}
}
@media(min-width:768px){
 .playing>.player-panel[data-panel=you] .summary-meld.dense{height:100%;max-height:100%;padding:3px 5px;gap:2px}
 .playing>.player-panel[data-panel=you] .summary-meld .meld-caption{white-space:nowrap;font-size:10px;line-height:12px}
 .playing>.player-panel[data-panel=you] .summary-meld .meld-rank{font-size:20px;line-height:22px}
 .playing .summary-meld.valid-target{border-color:#c6bda4}
}
@media(min-width:768px) and (max-height:850px){
 .playing>.player-panel[data-panel=you] .summary-meld .meld-rank{font-size:16px;line-height:18px}
 .playing>.player-panel[data-panel=you] .summary-meld .meld-caption{font-size:9px;line-height:11px}
 .playing>.player-panel[data-panel=you] .summary-meld .book-ink-stamp{font-size:7px;line-height:9px;top:3px;right:3px;padding:1px 2px}
}
@media(min-width:768px) and (max-height:850px){.playing>.player-panel[data-panel=you] .summary-meld .target-caption{font-size:8px;line-height:10px}}

/* Context explanations stay off the table until hover, focus, or Rules. */
.symbol-tip{position:fixed;z-index:150;width:max-content;max-width:min(280px,calc(100vw - 16px));padding:10px 12px;border:1px solid #7c9173;border-radius:6px;background:#fff9e9;color:#304c37;box-shadow:0 3px 8px #203b2b30;font:500 13px/19px 'DM Sans',system-ui,sans-serif;overflow-wrap:anywhere}
.rules-dialog{color-scheme:light;width:min(720px,calc(100vw - 24px));max-height:90dvh;margin:auto;padding:0;border:1px solid #789278;border-radius:10px;background:#fbf5e8;color:#304c37;overflow:auto}
.rules-dialog::backdrop{background:#213d32d9}
.rules-body{padding:24px}
.rules-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.rules-heading h2{margin:0;font:700 26px/32px 'Playfair Display',Georgia,serif}
.rules-dialog button{min-height:44px;padding:8px 12px;border:1px solid #82977b;border-radius:5px;background:#f8f0df;color:#304c37;font:600 13px/18px 'DM Sans',system-ui,sans-serif}
.rules-dialog h3{font-size:16px;margin:0 0 12px}
.symbol-guide{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 24px;margin:0}
.symbol-guide>div{min-width:0}.symbol-guide dt{font-weight:700;font-size:14px;line-height:20px;margin-bottom:4px}.symbol-guide dd{font-size:13px;line-height:20px;margin:0;color:#405c44}
.rules-dialog p{font-size:13px;line-height:1.65}.rules-dialog .guide-tip{margin:16px 0;color:#506a55;font-size:12px}
.rules-section{border-top:1px solid #c7cfb9}.rules-section summary{min-height:44px;padding:12px 0;cursor:pointer;font-size:14px;font-weight:700}.rules-section p{margin:0 0 14px}.rules-section button{margin:0 0 14px}
.rules-actions{display:flex;justify-content:flex-end;margin-top:16px}
.table-footer .symbols-link{padding:4px 0;min-height:28px;background:transparent;border:0;color:#304c37;font:600 12px 'DM Sans',system-ui,sans-serif;text-decoration:underline;text-underline-offset:3px}
/* Native modality provides focus containment and makes the background inert. */
dialog.board-overlay{width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:20px;border:0;color:#304c37}
dialog.board-overlay:not([hidden]){display:grid;place-items:center}
dialog.board-overlay::backdrop{background:transparent}
.playing .pip-segment:not(.clean-fill):not(.dirty-fill):not(.wild-fill){background:#f6f3e9;border:1px solid #75856b}
@media(max-width:767px){
 .rules-body{padding:16px}.rules-heading{gap:8px}.rules-heading h2{font-size:22px;line-height:28px}.symbol-guide{grid-template-columns:minmax(0,1fr);gap:14px}
 .table-nav .nav-link{min-width:44px}.table-nav #openUtilities{width:44px}
 .utility-dialog button,.utility-dialog select,.utility-dialog summary,.utility-dialog input[type=number]{min-height:44px}
 dialog.board-overlay{padding:12px}.board-dialog{max-height:90dvh}
}
/* Text on green felt needs a darker ink than text on cream. */
.handzone .handhead h2,.handzone .hand-heading>span,.handzone .hand-tools button,.handzone .mobile-hand-meta,.handzone .selection-copy,.handzone .selection-copy p,.handzone .range-pager{color:#263f2c}
.handzone .hand-tools button[aria-pressed=true]{color:#5b3022;text-decoration:underline;text-underline-offset:3px}
.handzone #hand .card:focus-visible{outline-color:#19566d!important}
@media(pointer:coarse){.playing .open-board,.utility-dialog button,.utility-dialog select,.utility-dialog summary{min-height:44px}}
@media(pointer:coarse) and (min-width:768px){:root{--footer-h:48px}.table-footer .symbols-link{min-height:44px}}
.rules-dialog .meld-symbol-legend{border:0;margin:0;padding:0}
@media(max-width:767px){.rules-heading{position:sticky;top:0;z-index:1;padding-bottom:12px;background:#fbf5e8}}

/* Table menu: aligned settings, everyday actions first, development tools folded away. */
.utility-dialog{width:min(620px,calc(100vw - 24px));max-width:none;max-height:90dvh;padding:0;border-radius:10px;background:#fbf5e8;color:#304c37}
.utility-dialog .utility-heading{position:sticky;top:0;z-index:2;padding:18px 24px;background:#fbf5e8;border-bottom:1px solid #c7cfb9}
.utility-dialog h2{font:700 24px/30px 'Playfair Display',Georgia,serif}
.utility-dialog .utility-body{padding:0 24px 12px}
.utility-dialog .menu-section{padding:14px 0;border-bottom:1px solid #c7cfb9}
.utility-dialog h3{margin:0 0 10px;font:700 14px/20px 'DM Sans',system-ui,sans-serif}
.utility-dialog button,.utility-dialog .btn{min-height:44px;padding:8px 12px;border-radius:5px;border:1px solid #8a9d82;background:#fff9ed;color:#304c37;box-shadow:none;font:600 13px/18px 'DM Sans',system-ui,sans-serif;letter-spacing:0;text-transform:none}
.utility-dialog button:hover{background:#e8eddc}
.utility-dialog .settings-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:8px}
.utility-dialog .settings-field{display:flex;flex-direction:column;gap:4px;min-width:0}
.utility-dialog .settings-field>span{font:600 12px/18px 'DM Sans',system-ui,sans-serif;letter-spacing:0;text-transform:none;color:#506a55}
.utility-dialog .settings-field select{width:100%;min-width:0;min-height:44px;padding:8px 10px;border:1px solid #8a9d82;border-radius:5px;background:#fff9ed;color:#304c37;font:500 13px 'DM Sans',system-ui,sans-serif}
.utility-dialog .setting-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0;min-height:52px}
.utility-dialog .setting-copy{min-width:0}
.utility-dialog .setting-copy h4{font:600 13px/18px 'DM Sans',system-ui,sans-serif;margin:0}
.utility-dialog .setting-copy p{font:400 12px/18px 'DM Sans',system-ui,sans-serif;margin:2px 0 0;color:#506a55}
.utility-dialog .setting-actions{display:flex;align-items:center;gap:8px;flex:none}
.utility-dialog .setting-toggle{min-width:52px;width:52px;margin:0;border-radius:5px}
.utility-dialog .setting-toggle[aria-pressed=true],.utility-dialog #fourColor[aria-pressed=true],.utility-dialog #showValues[aria-pressed=true]{background:#315e42;color:#fff9e9;border-color:#315e42}
.utility-dialog .setting-toggle[aria-pressed=false]{background:#e9eddf;color:#50634c}
.utility-dialog #openValues{border-color:transparent;background:transparent;text-decoration:underline;text-underline-offset:3px;padding-inline:4px}
.utility-dialog .volume-setting{display:grid;grid-template-columns:60px minmax(0,1fr) 42px;gap:10px;align-items:center;width:100%;font-size:12px;color:#506a55}
.utility-dialog .volume-setting input{width:100%;min-width:0;min-height:44px;margin:0;accent-color:#315e42}
.utility-dialog .volume-amount{font-variant-numeric:tabular-nums;text-align:right}
.utility-dialog .menu-section:nth-child(3){display:flex;align-items:center;justify-content:space-between;gap:12px}
.utility-dialog .menu-section:nth-child(3) h3{margin:0}
.utility-dialog .game-menu-actions{display:flex;gap:8px;flex-wrap:wrap}
.utility-dialog #deal{border-color:#b99078;color:#82462f;background:transparent}
.utility-dialog .menu-disclosure{padding:0;border-bottom:1px solid #c7cfb9}
.utility-dialog .menu-disclosure:last-child{border-bottom:0}
.utility-dialog .menu-disclosure>summary{min-height:48px;padding:14px 0;font:500 13px/20px 'DM Sans',system-ui,sans-serif}
.utility-dialog .disclosure-body{padding:0 0 12px}
.utility-dialog .scenario-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.utility-dialog .scenario-label{display:none}
.utility-dialog .scenario-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0}
.utility-dialog .scenario-buttons button{width:100%;padding-inline:8px;border-radius:0;min-width:0}
.utility-dialog .scenario-buttons button:first-child{border-radius:5px 0 0 5px}
.utility-dialog .scenario-buttons button:last-child{border-radius:0 5px 5px 0}
.utility-dialog .scenario-buttons button[aria-pressed=true]{background:#315e42;color:#fff9e9;border-color:#315e42}
.utility-dialog #resetScenario{font-weight:500;padding-inline:8px}
.utility-dialog #scenarioDescription{font-size:12px;line-height:18px;margin:10px 0 4px}
.utility-dialog .scenario-note{font-size:11px;line-height:16px;color:#506a55}
.utility-dialog #demoUtilityActions{margin:12px 0 0;gap:8px;flex-wrap:wrap}
@media(max-width:767px){.utility-dialog .utility-heading{padding:16px}.utility-dialog .utility-body{padding:0 16px 8px}.utility-dialog .scenario-controls{grid-template-columns:minmax(0,1fr)}.utility-dialog #resetScenario{justify-self:start}.utility-dialog .setting-actions{gap:4px}}
@media(max-width:359px){.utility-dialog .settings-fields{grid-template-columns:minmax(0,1fr)}}
