
/* Bushido edition: washi, vermilion seals and lacquered ink. Core layout stays in style.css. */
:root {
  color-scheme: light;
  --bg:#e9dbc0; --panel:#f2e4c9; --line:#b4a184; --white:#2b2922;
  --light:#514837; --muted:#625643; --pink:#923629; --mint:#33564f;
  --lime:#e1e9ad; --gold:#8d3728; --ink:#252d29;
  --serif: "Iowan Old Style", Palatino, "Book Antiqua", Georgia, serif;
}
body {
  background: url("/paper.svg"), radial-gradient(ellipse at 43% -5%,#f8edd7 4%,#e9dbc0 65%,#dfcaaa);
}
:where(h1,h2,h3){font-family:var(--serif)}
button:focus-visible, summary:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline-color:#9c3827;
}
.top { background:linear-gradient(105deg,#242c29,#303932); border-color:#725b43; box-shadow:0 2px 6px #372b1f28; }
.brand { color:#fff0cf; letter-spacing:.095em; }
.brand b { color:#fff0cf;font-family:var(--serif);font-weight:850;letter-spacing:.16em; }
.brand span { width:39px; height:39px; background:url("/crest.svg") center / 100% no-repeat; box-shadow:none; color:transparent; }
.head-mark, .counter .label { color:#dbc49b; }
.counter b { color:#fdf0d0; }
.sound { background:#303b34;color:#f4e8c8;border-color:#88806c; }
.hero {
  background:url("/paper.svg"), radial-gradient(ellipse at 14% 30%,#fbf0d8 15%,#e3ceb0 81%);
  border:1px solid #a98f6b;
  border-inline:9px solid #574b38;
  border-radius:7px;
  box-shadow: 0 3px 8px #40331f32,inset 0 0 0 3px #a68c6931;
  min-height:232px;
}
.hero.compact { min-height:155px; }
.hero::before {
  content:""; position:absolute; inset:0; z-index:1; pointer-events:none;
  background:linear-gradient(90deg,#f9edd3ac 0%,#f9edd39e 25%,#f9edd300 66%);
}
.hero .sun,.hero .grid { display:none; }
.hero .skyline { background-image:url("/ink-ridge.svg"); background-size:auto 108%; background-position:right bottom; z-index:0; }
.hero .label { color:#763226; text-shadow:none; letter-spacing:.165em; }
.hero .label i { background:#a43d2e; border-radius:1px; transform:rotate(10deg); width:7px; height:7px; }
.hero h1 {
  font-family:var(--serif); text-transform:none; font-size:clamp(3.25rem,7vw,6rem); font-weight:800;
  letter-spacing:-.065em; word-spacing:.02em; text-shadow:1px 1px #f6e7c9;
  color:#272c26;
}
.hero h1 em { color:#8f3226; }
.hero.compact h1 { font-size:clamp(2.75rem,5.9vw,4.45rem); }
.hero-text>p:last-child { color:#4a412f;text-shadow:none;font-weight:550; }
.hero-code {
  color:#ffedc9; font-size:.59rem; line-height:1.25; text-align:left;
  padding:.45rem .52rem; border:1px solid #f0d3a4; outline:1px solid #963526; outline-offset:2px;
  background:#8d3024; transform:rotate(-5deg); right:22px; bottom:22px;
 }
.table-wrap,.rail-card { background:url("/paper.svg"),#f3e6cc; border-color:#ad9878; box-shadow:0 2px 5px #40331f1c; border-radius:8px; }
.table-head { border-top:3px solid #923a2c; }
.table-head h2,.rail-card h2 { color:#262e27;font-family:var(--serif);font-size:1.55rem;letter-spacing:-.025em; }
.table-head .label,.rail-card>.label,.deck-head .label { color:#78382a; }
.table-head .shoe,.deck-head .badge {
  background:#eaddc0; border-color:#99815f; color:#383d32; border-radius:5px;
}
.shoe small { color:#594a37; }
.deck-trigger:hover { border-color:#9d3c2b; box-shadow:0 0 0 2px #9d3c2b38; }
.felt {
  --mint:#c7d8bb; --light:#d8d8ba; --white:#f8edce;
  background:url("/paper.svg"),radial-gradient(ellipse at 50% 47%,#354b3d 3%,#263a32 55%,#1a2c27 100%);
  border-color:#745f47;
}
.felt-lines { border-color:#d0bf8970; box-shadow:0 0 0 4px #dec99912,inset 0 0 0 4px #dec9990c; }
.felt .badge { color:#f0deab;background:#273930;border-color:#8a8a62; }
.signal { color:#fff2cf; }
.signal span { color:#d6ddc3; }
.empty-player { background:#1f3029a3;border-color:#c7b58496;color:#eee4c0; }
.empty-player div { color:#e1d4ae; }
.empty-player span { color:#e79d7d; }
.playing {
  color:#262922; background:linear-gradient(150deg,#fff5d8,#e7d7ae); border-color:#fff4d6;
  box-shadow:0 3px 6px #14191471,inset 0 0 0 2px #b59b641b; border-radius:5px;
}
.playing.red { color:#902e22; }
.playing.back {
  color:#f4d7a5; border-color:#ab875b;
  background:
    url("/crest.svg") center/66% no-repeat,
    repeating-linear-gradient(45deg,#d4a96e21 0 1px,transparent 1px 6px),
    linear-gradient(155deg,#544538,#302b24);
  box-shadow:inset 0 0 0 3px #322b245f,0 3px 6px #14191471;
}
.playing.back span { visibility:hidden; }
.hand { background:#222f27;border-color:#8b8766; }
.hand.active { border-color:#dfcb91;background:#304537;box-shadow:inset 0 0 0 1px #dfcb91,0 0 11px #dbcb9a2c; }
.hand-head b { color:#f3e4b2; }
.hand-head span,.hand-foot { color:#e0d9bd; }
.hand-foot b { color:#eac68e; }
.positive { color:#e3eaa9!important; }
.negative { color:#ffc4ab!important; }
.key { border-color:#8f8065;background:linear-gradient(#f7e8ca,#e7d7b7);color:#312e25;border-radius:6px; }
.key.primary { color:#fff0d1;background:linear-gradient(155deg,#a84a34,#863023);border-color:#733326;box-shadow:0 2px 5px #7b361f39; }
.key.tertiary { color:#273d33;border-color:#72836e;background:linear-gradient(#ecedcf,#d6dbbb); }
.chip { background:#eddfc4;color:#493e2e;border-color:#a08864; }
.chip[aria-pressed=true] { background:#364b3d;color:#fff0c8;border-color:#364b3d; }
.ladder li.current { background:#e6d6b6;border-color:#b59f79; }
.ladder li.current .node { background:#8f3326;color:#fff0cc; }
.node { color:#3a4334;background:#ddd2b4;border:1px solid #aa9a76; }
.progress-row b { color:#3c5549; }
progress,progress::-webkit-progress-bar { background:#d8c8a7; }
progress::-webkit-progress-value { background:#81513b; }
progress::-moz-progress-bar { background:#81513b; }
.counts span { background:#e9dbbd;border-color:#b39b77; }
.counts b { color:#823628; }
.swaps select { color:#2a3127;background:#f7ebd0;border-color:#a08864; }
.announce:not(:empty),.confirmation,.lobby-tools { background:#eddfc1;color:#383024;border-color:#b39a73; }
.text-button { color:#823628;background:#f6e9cb;border-color:#a88e6a; }
footer { color:#594a37; }
#deck-view {
  background:url("/paper.svg"),#f4e8cf;color:#2c2b21;border-color:#986a49;
  border-inline:6px solid #755c44;box-shadow:0 16px 60px #211713a6,0 0 4px #fff2ca50;
}
#deck-view::backdrop { background:#1b241fbd; }
.deck-dialog-head { background:url("/paper.svg"),linear-gradient(105deg,#eee0c2,#e4cfad); border-color:#a88e6c; }
.deck-dialog-head .label { color:#78382a; }
.deck-tile>span,.deck-tile.seen>span { color:#584c3a; }
.deck-tile.next-card { background:#dce0be;border-color:#526c51; }
.deck-tile.next-card>span { color:#324c3d; }
.deck-tile.seen .playing { opacity:.68; }
@media(max-width:820px) {
 .hero { min-height:171px;border-inline-width:6px; }
 .hero.compact { min-height:114px; }
 .hero .skyline { background-size:auto 112%; background-position:right -30px bottom; }
 .hero-code { right:18px;bottom:14px; }
}
@media(max-width:520px) {
 .brand span { width:29px;height:32px; }
 .hero .skyline { opacity:.77;background-position:right -119px bottom; }
 .hero h1 { font-size:clamp(2.8rem,11vw,3.75rem); }
 .hero.compact h1 { font-size:clamp(2.35rem,9vw,3rem); }
 .hero .label { font-size:.57rem; }
 .hero::before { background:linear-gradient(90deg,#f9edd3be 0%,#f9edd365 47%,#f9edd31a 100%); }
 .hero-text>p:last-child { color:#3a3024; }
 .table-head h2 { font-size:1.31rem; }
}


.playtest-panel .hint{font-size:.8rem;color:var(--light);margin:.4rem 0;line-height:1.5}.log-buttons{display:flex;gap:.4rem;flex-wrap:wrap}.log-buttons .key{flex:1;min-width:max-content;font-size:.79rem}.playtest-panel #log-event-count{color:#794232;font-weight:750;white-space:nowrap}


/* Let the table, rather than the lobby artwork, fill the viewport during play. */
#root:has(.hero.compact) {
  --table-header-height: 65px;
  --table-gap: 10px;
}
.hero.compact { display: none; }
main:has(> .hero.compact) { padding-block-start: var(--table-gap); }
main:has(> .hero.compact) .table-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(min-content, 1fr) auto;
  min-block-size: calc(100vh - var(--table-header-height) - 1px - var(--table-gap) - var(--table-gap));
  min-block-size: calc(100dvh - var(--table-header-height) - 1px - var(--table-gap) - var(--table-gap));
}
main:has(> .hero.compact) .felt {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(min-content, 1fr) auto;
}
@media (max-width: 520px) {
  #root:has(.hero.compact) {
    --table-header-height: 56px;
    --table-gap: 7px;
  }
}

.log-auto {display:flex;align-items:center;gap:.55rem;margin:.65rem 0 0;min-height:44px;padding:.25rem .34rem;background:#eddfc4;border:1px solid #b4a184;border-radius:6px;font-size:.81rem;font-weight:700;cursor:pointer}.log-auto input{width:1.08rem;height:1.08rem;min-width:1.08rem;margin:0;accent-color:#8d3024}.log-auto:focus-within{outline:2px solid #9c3827;outline-offset:2px}.playtest-panel #auto-log-notice{color:#794232;font-weight:700}


/* Fixed desktop workspace; touch layouts retain normal document scrolling. */
@media (hover:hover) and (pointer:fine) {
 html,body{height:100%;overflow:hidden;overscroll-behavior:none}
 #root{height:100vh;height:100dvh;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden}
 #root>.top .wrap,#root>main.wrap{width:min(1536px,calc(100% - 36px))}
 #root>main.wrap{min-height:0;padding:10px 0 12px;display:flex;flex-direction:column;gap:8px}
 #root>footer{display:none}
 main>.hero:not(.compact){flex:none;min-height:clamp(95px,21dvh,216px);margin:0}
 main>.hero:not(.compact) h1{font-size:clamp(2.35rem,7.3dvh,5.1rem)}
 main>.hero:not(.compact) .hero-text{padding:clamp(.5rem,2.1dvh,1.55rem) clamp(.75rem,3vw,2.1rem)}
 main>.confirmation,main>.lobby-tools,main>.announce:not(:empty){flex:none;margin:0}
 main>.layout{
  flex:1;min-height:0;grid-template-columns:minmax(166px,1fr) minmax(0,3fr) minmax(184px,1.1fr);
  grid-template-areas:"left table right";gap:clamp(.45rem,1.05vw,1rem);align-items:stretch;
 }
 .layout>.table-wrap{grid-area:table;min-height:0;min-block-size:0!important;display:grid;grid-template-rows:auto minmax(0,1fr) auto}
 .layout>.rail-left{grid-area:left}.layout>.rail-right{grid-area:right}
 .layout>.rail{
  grid-template-columns:minmax(0,1fr);min-height:0;align-content:start;
  overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;
 }
 .layout .felt{
  min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;
  padding:clamp(.4rem,1.25dvh,1rem);gap:clamp(.2rem,.75dvh,.65rem);
 }
 .layout .signal{min-height:0}
 .layout .dealer-cards{max-width:100%;justify-content:safe center;flex-wrap:nowrap;overflow:auto;scrollbar-width:thin}
 .layout .hand .cards{flex-wrap:nowrap;overflow:auto;scrollbar-width:thin}
 .layout .playing{width:clamp(34px,5.7dvh,51px);height:clamp(46px,8.25dvh,71px)}
}
@media (hover:hover) and (pointer:fine) and (max-height:700px){
 #root>main.wrap{padding-block:7px;gap:5px}
 .top-inner{min-height:52px}
 .table-head,.action-panel,.rail-card{padding:.52rem .65rem}
 .layout .rail{gap:.45rem}
 .ladder{margin:.35rem 0;gap:.22rem}.ladder li{padding:.28rem}
 .layout .felt .row-label{min-height:20px;margin-bottom:.22rem}
 .layout .key{min-height:42px}
 .layout .hand{padding:.3rem}
 .layout .hand-track{padding-block:2px 5px}
 .layout .playing strong{font-size:1.45rem}
 .layout .playing b{font-size:.64rem}
}
@media (hover:hover) and (pointer:fine) and (max-height:540px){
 main>.hero:not(.compact){display:none}
 .table-head .label{display:none}
 .layout .action-panel .aside-note{display:none}
 .layout .table-head,.layout .action-panel{padding:.37rem .5rem}
 .layout .playing{width:32px;height:43px}
 .layout .hand{min-width:91px}
}
@media (hover:hover) and (pointer:fine) and (max-width:760px){
 #root>.top .wrap,#root>main.wrap{width:calc(100% - 16px)}
 main>.layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) clamp(84px,24dvh,190px);grid-template-areas:"table table" "left right"}
 main>.hero:not(.compact){display:none}
 .layout>.rail .rail-card{padding:.48rem}
}

@media (hover:hover) and (pointer:fine) {
 .layout .rules{line-height:1.32}
 .layout .rules li{margin:.24rem 0}
}
@media (hover:hover) and (pointer:fine) and (max-height:700px){
 main>.hero:not(.compact){display:none}
 .layout .rail-card h2{font-size:1.31rem}
}

/* Mobile is a fixed tabbed workspace. Use buttons, not scrolling, to page long lists. */
.mobile-tabs,.mobile-subnav,#hands-pager,#rules-pager,.deck-mobile{display:none}
@media (hover:none) and (pointer:coarse){
 html,body{height:100%;overflow:hidden;overscroll-behavior:none}
 #root{height:100vh;height:100dvh;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden}
 #root>footer,#root .hero{display:none}
 #root>.top .wrap,#root>main.wrap{width:calc(100% - 18px);max-width:780px}
 #root>main.wrap{min-height:0;padding:6px 0 max(6px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:6px;overflow:hidden}
 #root .top-inner{min-height:50px}
 .top .head-mark{display:none}
 main>.confirmation,main>.lobby-tools,main>.announce:not(:empty){flex:none;margin:0;font-size:.77rem;padding:.35rem .52rem}
 main>.lobby-tools .text-button,.confirmation .key{min-height:38px}
 .mobile-tabs,.mobile-subnav{display:grid;gap:3px;grid-template-columns:repeat(3,minmax(0,1fr));flex:none;border-radius:8px;padding:3px;border:1px solid #a68e69;background:#dfcfad}
 .mobile-subnav{grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:2px}
 .mobile-tabs button,.mobile-subnav button,.mobile-pager button{font-weight:750;border:1px solid transparent;background:#efe2c7;color:#43392a;border-radius:5px;min-height:44px;padding:.25rem .18rem;font-size:clamp(.69rem,3.3vw,.9rem);line-height:1.15}
 .mobile-subnav [aria-pressed=true]{color:#fff2d3;background:#3f4b3c;border-color:#354135}
 main>.layout{flex:1;min-height:0;display:block;overflow:hidden}
 main>.layout>.table-wrap,main>.layout>.rail{height:100%;min-height:0;min-block-size:0!important;display:none}
 main>.layout[data-mobile-tab=table]>.table-wrap{display:grid}
 main>.layout[data-mobile-tab=circuit]>.rail-left,main>.layout[data-mobile-tab=tools]>.rail-right{display:flex;flex-direction:column;align-items:stretch;gap:6px;overflow:hidden}
 .layout[data-left-view=ladder] .rules,.layout[data-left-view=rules] .dealer-ladder,
 .layout[data-right-view=deck-shop] .playtest-panel,.layout[data-right-view=logs] .deck{display:none}
 .layout .rules li:not([data-on-page]){display:none}
 .layout .rail-card{padding:.65rem;overflow:visible}
 .layout .rules summary{min-height:24px}
 .layout .rules li{margin:.55rem 0}
 .layout .felt{min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;padding:.48rem .66rem;gap:4px;overflow:hidden}
 .layout .signal{min-height:0;padding:.15rem .2rem;line-height:1.25}
 .layout .table-head,.layout .action-panel{padding:.45rem .65rem}
 .layout .hand-track,.layout .hand .cards,.layout .dealer-cards{overflow:visible;flex-wrap:nowrap}
 .layout .hand-track{padding:1px 2px 4px}
 .layout .hand{max-width:100%}
 .layout .hand .cards .playing:not(:first-child){margin-left:0}
 .layout .cards:has(>.playing:nth-child(6)) .playing+.playing{margin-left:-23px}
 .layout .cards:has(>.playing:nth-child(9)) .playing+.playing{margin-left:-28px}
 #hands-pager,#rules-pager,.deck-mobile{display:block}
 .mobile-pager{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:.3rem;text-align:center;font-size:.75rem;font-weight:750}
 .mobile-pager button{font-size:1.23rem;border-color:#a58a62}
 #hands-pager .mobile-pager button{min-height:36px;color:#fff2c6;background:#374e40;border-color:#8e8764}
 #hands-pager .mobile-pager{color:#f6e5bc}
 #deck-view .deck-dialog-scroll{display:none}
 #deck-view .deck-mobile{padding:.45rem .65rem .55rem;overflow:hidden}
 #deck-view .deck-mobile-tally{font-size:.76rem;margin-bottom:.32rem}
 #deck-view .deck-mobile .deck-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:.2rem}
 #deck-view .deck-mobile .mobile-pager{margin-top:.42rem}
 #deck-view .deck-mobile .deck-tile{padding:.16rem .08rem}
 #deck-view .deck-mobile .deck-tile>span{font-size:.53rem}
}
@media (hover:none) and (pointer:coarse) and (max-height:650px){
 .layout .felt .row-label{min-height:18px;margin-bottom:3px}
 .layout .playing{width:38px;height:51px}
 .layout .playing strong{font-size:1.3rem}
 .layout .hand-head,.layout .hand-foot{margin-block:2px}
 .layout .action-panel .aside-note{font-size:.67rem;margin-top:.3rem}
 .layout .hero-code{display:none}
}
@media (hover:none) and (pointer:coarse) and (max-height:440px) and (orientation:landscape){
 #root .top-inner{min-height:43px}
 #root .top button{min-height:40px}
 #root>main.wrap{padding-block:3px;gap:3px}
 .mobile-tabs button,.mobile-subnav button{min-height:35px}
 .layout .table-head{padding:.27rem .55rem}
 .layout .table-head .label,.layout .action-panel .aside-note{display:none}
 .layout .shoe{min-height:35px}
 .layout .felt{grid-template-columns:minmax(0,1fr) minmax(0,1.55fr);grid-template-rows:minmax(0,1fr) auto;gap:2px 7px;padding:.22rem .52rem}
 .layout .dealer{grid-area:1/1/2/2}.layout .player{grid-area:1/2/2/3}
 .layout .signal{grid-area:2/1/3/3;font-size:.72rem}
 .layout .hand{min-width:90px;padding:.24rem}
 .layout .playing{width:34px;height:44px}
 .layout #hands-pager .mobile-pager button{min-height:30px}
 .layout .action-panel{padding:.25rem .55rem}
 .layout .action-panel .key{min-height:38px}
 .layout .action-panel .key small{margin-top:.1rem}
 .layout .rail-card{padding:.37rem .6rem}
 .layout .rail-card h2{font-size:1.15rem}
 .layout .ladder{grid-template-columns:repeat(3,minmax(0,1fr));margin:.31rem 0}
 .layout .ladder li{padding:.22rem}
 .layout .ladder strong{font-size:.76rem}
 .layout .ladder small{font-size:.66rem;line-height:1.25}
 .layout .counts{margin:.24rem 0}
 .layout .swaps{margin:.22rem 0}
 .layout .swaps select,.layout .deck form .key{min-height:32px}
 .layout .playtest-panel .hint{font-size:.68rem;margin:.16rem 0}
 .layout .log-auto{margin-top:.22rem;min-height:34px}
 .layout .log-buttons .key{min-height:35px}
 #deck-view .deck-mobile .deck-grid{grid-template-columns:repeat(10,minmax(0,1fr))}
 #deck-view .deck-mobile .deck-tile .playing{width:min(100%,37px)}
 #deck-view .deck-mobile .deck-mobile-tally{font-size:.68rem;margin-bottom:.2rem}
}


@media (hover:none) and (pointer:coarse){
 #root .layout:not([data-mobile-tab=table])>.table-wrap{display:none}
 #root main>.layout[data-mobile-tab=table]>.table-wrap{display:grid}
}

/* A seat has the same dimensions in every phase. Content never changes its grid tracks. */
.visually-hidden{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden;white-space:nowrap}
#root .layout{min-height:0}
#root .layout>.table-wrap{
 --table-header:clamp(63px,9.2dvh,80px);
 --table-actions:clamp(124px,17dvh,150px);
 grid-template-rows:var(--table-header) minmax(0,1fr) var(--table-actions);
 min-block-size:0!important;
}
#root .layout>.table-wrap .table-head{min-height:0}
#root .layout>.table-wrap .table-head h2{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#root .layout>.table-wrap .table-head>div{min-width:0}
#root .layout>.table-wrap .action-panel{min-height:0;align-content:start}
.saved-seat{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:.35rem;font-size:.77rem;color:var(--light)}
.saved-seat .text-button{min-height:33px;padding:.25rem .6rem}
.lobby-ink{
 display:none;position:absolute;inset:0;z-index:-1;pointer-events:none;
 background:linear-gradient(90deg,#1d332bbf 0%,#1d332b24 100%),url("/ink-ridge.svg") right bottom/auto 100% no-repeat;
 opacity:.45;
}
.lobby-ink span{position:absolute;left:5%;top:40%;font:700 .65rem ui-monospace,monospace;letter-spacing:.09em;color:#e4d0a6}
.storage-notice{position:fixed;right:12px;bottom:12px;z-index:3;max-width:min(24rem,calc(100% - 24px));padding:.55rem .7rem;background:#f5dfb6;border:1px solid #9c6e4c;border-radius:7px;font-size:.82rem;pointer-events:none}
@media (hover:hover) and (pointer:fine){
 .lobby-ink{display:block}
}
@media (hover:none) and (pointer:coarse){
 #root .layout>.table-wrap{--table-header:62px;--table-actions:126px}
 #root .layout>.table-wrap .bet-bar{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"stake deal" "chips chips";gap:4px}
 #root .layout>.table-wrap .bet-bar>div:first-child{grid-area:stake}
 #root .layout>.table-wrap .bet-bar .chips{grid-area:chips;justify-content:center}
 #root .layout>.table-wrap .bet-bar .key{grid-area:deal;justify-self:stretch;min-height:40px}
}
@media (hover:hover) and (pointer:fine) and (max-height:540px){
 #root .layout>.table-wrap{--table-header:54px;--table-actions:100px}
}
@media (hover:none) and (pointer:coarse) and (max-height:440px) and (orientation:landscape){
 #root .layout>.table-wrap{--table-header:48px;--table-actions:94px}
 #root .layout>.table-wrap .bet-bar{display:flex;flex-wrap:nowrap}
 #root .layout>.table-wrap .saved-seat{position:absolute;right:16px;top:4px;z-index:1}
 #root .layout>.table-wrap .saved-seat span{display:none}
 #root .layout>.table-wrap .action-panel:has(.saved-seat){padding-right:118px}
 #root .layout>.table-wrap .action-panel .key{
  padding-block:.24rem;font-size:.77rem;-webkit-text-size-adjust:100%;text-size-adjust:100%;
 }
 #root .layout>.table-wrap .action-panel .key small{font-size:.59rem}
}

#root .layout .felt{overflow:hidden}
@media (hover:hover) and (pointer:fine) and (max-height:570px){
 #root .layout>.table-wrap .felt{grid-template-columns:minmax(0,1fr) minmax(0,2fr);grid-template-rows:minmax(0,1fr) auto;gap:3px 8px}
 #root .layout .dealer{grid-area:1/1/2/2;min-width:0;align-self:start}
 #root .layout .player{grid-area:1/2/2/3;min-width:0;align-self:start}
 #root .layout .signal{grid-area:2/1/3/3;font-size:.77rem}
 #root .layout .signal .net{font-size:.72rem}
 #root .layout .felt .row-label .label{font-size:.57rem}
}

.brand{text-transform:uppercase}

:is(#reward-view,#deck-picker){width:min(530px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:0;border:1px solid #986a49;border-inline:6px solid #755c44;border-radius:11px;color:#2c2b21;background:url("/paper.svg"),#f4e8cf;box-shadow:0 16px 60px #211713a6;overflow:hidden}
:is(#reward-view,#deck-picker)::backdrop{background:#1b241fbd}
.reward-body{padding:.8rem .9rem .95rem;display:grid;align-items:center;gap:.65rem}
.reward-body p{font-size:.85rem;color:#594a37}
.reward-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.45rem}
.reward-option{display:grid;justify-items:center;align-items:center;padding:.55rem .16rem;gap:.36rem;min-width:0;background:#ede0c1;color:#382f22;border:1px solid #a58d65;border-radius:8px;font-size:.72rem;font-weight:750}
.reward-option:hover,.reward-option:focus-visible{background:#e1d1ab;border-color:#8d3024}
.reward-option .playing{width:49px;height:67px}
.reward-skip{justify-self:end;min-height:38px}
@media(max-height:420px){.reward-body{gap:.35rem;padding:.4rem .65rem .55rem}.reward-option{padding:.3rem .16rem}.reward-option .playing{width:38px;height:49px}}

/* Draws happen over the viewport, not inside the fixed table tracks. */
[data-in-flight],.draw-stat{visibility:hidden}
.draw-flight{
 position:fixed;inset:0 auto auto 0;z-index:10;pointer-events:none;
 width:clamp(75px,14vmin,112px);aspect-ratio:5/7;perspective:820px;
}
.draw-turn{position:absolute;inset:0;transform-style:preserve-3d}
.draw-flight .playing{
 position:absolute;inset:0;width:100%;height:100%;border-radius:9px;
 backface-visibility:hidden;-webkit-backface-visibility:hidden;
 box-shadow:0 9px 25px #10150eb0,inset 0 0 0 3px #b59b6430;
}
.draw-flight .playing:not(.back){transform:rotateY(180deg)}
.draw-flight .playing b{font-size:clamp(1.05rem,2.6vmin,1.54rem);top:8px;left:8px}
.draw-flight .playing b.corner{top:auto;left:auto;bottom:8px;right:8px}
.draw-flight .playing strong{font-size:clamp(2.2rem,6vmin,3.7rem)}
.draw-note{padding:.32rem 0;text-align:center;color:#655341;font-size:.86rem}

/* Casino spread: the felt is the hand surface, not a set of playing-card boxes. */
#root .layout .player{min-width:0}
#root .layout .player>.row-label{justify-content:center}
.felt .hand-power{
 font:inherit;font-size:.72rem;font-weight:750;font-variant-numeric:tabular-nums;
 min-block-size:22px;padding:.12rem .4rem;cursor:pointer;
}
.felt .hand-power:enabled:hover,.felt .hand-power[aria-expanded=true]{border-color:#f1dca2}
.hand-power-detail{
 position:absolute;z-index:4;inset-inline-start:50%;inset-block-end:calc(100% + 4px);
 transform:translateX(-50%);box-sizing:border-box;width:max-content;max-width:100%;
 padding:.24rem .48rem;border:1px solid #d5b36c;border-radius:6px;background:#221811;color:#fff0c4;
 font:750 clamp(.64rem,2.4vmin,.82rem)/1.18 ui-monospace,monospace;
 text-align:center;box-shadow:0 3px 10px #15110ab0;pointer-events:none;
}
.hand-power-detail[hidden]{display:none}
.felt{--power-card-gap:10px}
.dealer-power{display:grid;justify-items:center;margin-block-start:var(--power-card-gap)}
#root .layout .player>.row-label:has(>.hand-power){align-items:end;margin-block-end:0}
#root .layout .player>.hand-track{padding-block-start:calc(var(--power-card-gap) - 1px)}
#root .layout .player>.hand-track>.hand[data-position=center]{padding-block-start:0;align-self:start}
@media (hover:none) and (pointer:coarse){
 .felt{--power-card-gap:8.5px}
}
.dealer-power .hand-power-detail{inset-block-start:calc(100% + 4px);inset-block-end:auto}
@media (max-height:440px) and (orientation:landscape),
       (max-height:570px) and (hover:hover) and (pointer:fine){
 #root .layout .player:has(.hand-power-detail:not([hidden])){padding-block-start:23px}
 .hand-power-detail{inset-block-start:0;inset-block-end:auto}
}
#root .layout .hand-track{
 justify-content:safe center;align-items:stretch;
 gap:clamp(5px,1.35vw,18px);padding-inline:3px;
}
#root .layout .hand{
 --spread-gap:var(--main-hand-gap);
 container-type:inline-size;
 flex:1 0 100%;min-width:0;max-width:none;
 padding:.22rem 3px .27rem;border-color:transparent;border-radius:0;
 background:none;box-shadow:none;
}
#root .layout .hand-track:has(>.hand:nth-child(2))>.hand{
 --spread-gap:clamp(5px,1.55vw,13px);
 flex:1 0 max(20%,88px);
}
#root .layout .hand .cards{
 --step:min(calc(var(--table-card-width) + var(--spread-gap)),calc((100cqi - var(--table-card-width)) / var(--fan-steps, 1)));
 width:100%;min-height:var(--table-card-height);
 justify-content:center;gap:0;flex-wrap:nowrap;overflow:visible;
}
#root .layout .hand .cards>.playing{
 width:var(--table-card-width);height:var(--table-card-height);
}
#root .layout .hand .cards>.playing+.playing{
 margin-inline-start:calc(var(--step) - var(--table-card-width));
}
#root .layout .hand-head,#root .layout .hand-foot{
 justify-content:center;gap:.45rem;text-align:center;
}
#root .layout .hand-head span{
 letter-spacing:.09em;color:#e4dbbc;
}
#root .layout .hand-head b{
 min-width:1.65em;padding:.1em .29em;border:1px solid #c9b67c5e;border-radius:999px;
 background:#15251cd9;color:#f7e8bb;text-align:center;
}
#root .layout .hand.active .hand-head b{
 background:#ead396;color:#2c3629;border-color:#ffe9ad;
}
#root .layout .hand-foot{margin-top:.32rem}
#root .layout .hand-foot b{overflow:hidden;text-overflow:ellipsis}
@media (hover:none) and (pointer:coarse){
 #root .layout .hand-track:has(>.hand:nth-child(2))>.hand{
  --spread-gap:clamp(16px,5vw,30px);flex-basis:100%;
 }
}
@media (max-height:570px) and (hover:hover) and (pointer:fine),
       (max-height:440px) and (orientation:landscape) and (hover:none) and (pointer:coarse){
 #root .layout .hand-head{margin-bottom:.21rem}
 #root .layout .hand-foot{margin-top:.2rem}
}

/* Keep the felt clear above the cards; put the score at the seat's lower right. */
#root .layout .hand-foot{
 justify-content:space-between;align-items:center;
 gap:.22rem .6rem;flex-wrap:wrap;text-align:left;
}
#root .layout .hand-outcome{
 display:flex;align-items:center;gap:.35rem;min-width:0;
}
#root .layout .hand-foot .hand-head{
 margin:0 0 0 auto;gap:.3rem;white-space:nowrap;
}
@media (max-height:570px) and (hover:hover) and (pointer:fine),
       (max-height:440px) and (orientation:landscape) and (hover:none) and (pointer:coarse){
 #root .layout .hand-foot .hand-head b{font-size:.72rem}
}

.reward-body .reward-skip{grid-column:1;grid-row:3}
#score-view{
 width:min(460px,calc(100% - 24px));max-height:calc(100dvh - 16px);
 padding:0;border:1px solid #986a49;border-radius:11px;
 color:#2c2b21;background:url("/paper.svg"),#f4e8cf;
 box-shadow:0 16px 60px #211713a6;
}
#score-view[open]{display:flex;flex-direction:column}
#score-view::backdrop{background:#1b241fbd}
.score-body{padding:.62rem .95rem;overflow:auto;min-height:0}
.score-body h3{font-family:var(--serif);font-size:1.3rem;margin:.12rem 0;display:flex;justify-content:space-between;gap:.35rem}
.score-body h3 span{color:#843c29;font:800 .9rem ui-monospace,monospace;align-self:center}
.score-note{color:#66533c;font-size:.78rem;line-height:1.28;margin:.25rem 0}
.score-list{padding:0;margin:.3rem 0;list-style:none}
.score-list li{
 display:flex;align-items:center;justify-content:space-between;gap:.5rem;
 padding:.3rem 0;border-bottom:1px solid #99795c4a;font-size:.83rem;
}
.score-list small{display:block;color:#6b563d;font-size:.71rem;line-height:1.18}
.score-list li>b{color:#843c29;white-space:nowrap}
.score-totals{display:grid;grid-template-columns:1fr 1fr;gap:.38rem;margin:.36rem 0}
.score-totals>div{padding:.35rem .55rem;border:1px solid #b39e7f;border-radius:6px;background:#e9dbba}
.score-totals small{font-size:.6rem}
.score-totals strong{display:block;font:800 1.3rem ui-monospace,monospace}
.score-nav{display:grid;grid-template-columns:38px auto 38px 1fr;gap:.38rem;align-items:center;padding:.46rem .72rem;border-top:1px solid #b39e7f;font-size:.8rem}
.score-nav .key,.score-close{min-height:35px;padding:.23rem .5rem}
.score-nav .key:last-child[data-score=toggle]{justify-self:end}
@media(max-height:440px){
 #score-view .deck-dialog-head{padding:.35rem .65rem}
 .score-body{padding:.35rem .66rem}
 .score-list li{padding:.18rem 0}
}

/* Face-down decks sit on the felt, at the origin of their draw animations. */
#root .layout .felt{
 --main-hand-gap:clamp(18px,6vw,34px);
 --pile-w:clamp(36px,6.7dvh,48px);
 --pile-h:clamp(47px,8.9dvh,64px);
 --pile-gutter:calc(var(--pile-w) + clamp(10px,1.6vw,25px));
 --table-card-width:clamp(36px,6.45dvh,57px);
 --table-card-height:clamp(47px,8.9dvh,79px);
}
#root .layout .dealer,#root .layout .player{position:relative;min-width:0}
#root .layout .dealer{padding-inline:var(--pile-gutter)}
#root .layout .dealer-cards{
 --dealer-step:min(calc(var(--table-card-width) + var(--main-hand-gap)),calc((100% - var(--table-card-width)) / var(--dealer-fan-steps,1)));
 width:100%;justify-content:center;gap:0;overflow:visible;
}
#root .layout .dealer-cards>.playing{width:var(--table-card-width);height:var(--table-card-height)}
#root .layout .dealer-cards>.playing+.playing{margin-inline-start:calc(var(--dealer-step) - var(--table-card-width))}
#root .layout .player>.hand-track,#root .layout .player>.empty-player{margin-inline:var(--pile-gutter)}
.shoe-pile{
 --pile-tint:#342b23;
 position:absolute;inset-block-start:6px;z-index:1;width:var(--pile-w);height:var(--pile-h);
 isolation:isolate;display:grid;place-items:center;padding:0;border-radius:5px;
 border:1px solid #bd9d67;background:repeating-linear-gradient(135deg,#d9aa7326 0 1px,transparent 1px 6px),var(--pile-tint);
 color:#fff0c4;box-shadow:1px 2px #a08660,2px 3px #3c3027,3px 5px #92764d,5px 7px 8px #101910af;
}
.shoe-pile::before{
 content:"";position:absolute;inset:2px;z-index:-1;border:1px solid #e2bb794f;border-radius:3px;
 background:url("/crest.svg") center / 90% auto no-repeat;opacity:.79;
}
.shoe-pile b{
 font:850 clamp(.8rem,2.8vmin,1.05rem)/1 ui-monospace,monospace;
 padding:.12rem .18rem;background:#231d18de;border:1px solid #cb9e5f94;border-radius:4px;
 text-shadow:0 1px 1px #000;pointer-events:none;
}
.player-shoe{left:clamp(3px,1.4vw,18px);--pile-tint:#52402e}
.dealer-shoe,.shared-shoe{right:clamp(3px,1.4vw,18px);--pile-tint:#4a251e}
.player-shoe:hover:not(:disabled),.player-shoe:focus-visible,.shared-shoe:hover:not(:disabled),.shared-shoe:focus-visible{outline:2px solid #f2d29b;outline-offset:3px}
.shoe-pile:disabled{opacity:1;cursor:wait}
.shoe-pile[data-empty]{box-shadow:none;border-style:dashed}
.shoe-pile[data-empty]::before{opacity:.24}
@media(max-width:520px){
 #root .layout .felt{--pile-w:36px;--pile-h:48px}
}
@media(max-height:570px) and (hover:hover) and (pointer:fine),
      (max-height:440px) and (orientation:landscape) and (hover:none) and (pointer:coarse){
 #root .layout .felt{--pile-w:34px;--pile-h:44px;--pile-gutter:42px;--table-card-width:34px;--table-card-height:44px}
 .shoe-pile{inset-block-start:4px}
 .player-shoe{left:1px}.dealer-shoe,.shared-shoe{right:3px}
}

/* Keep the lower-right score and wager outside the card-only side margins. */
#root .layout .player>.hand-track:has(>.hand:only-child){margin-inline:0}
#root .layout .hand-track>.hand:only-child .cards{
 width:calc(100% - 2 * var(--pile-gutter));margin-inline:var(--pile-gutter);
 --step:min(calc(var(--table-card-width) + var(--spread-gap)),calc((100% - var(--table-card-width)) / var(--fan-steps,1)));
}
@media(hover:none) and (pointer:coarse){
 #root .layout .player>.hand-track{margin-inline:0}
 #root .layout .hand-track .hand .cards{
  width:calc(100% - 2 * var(--pile-gutter));margin-inline:var(--pile-gutter);
  --step:min(calc(var(--table-card-width) + var(--spread-gap)),calc((100% - var(--table-card-width)) / var(--fan-steps,1)));
 }
}

/* Health duel and between-round shop. */
/* Matching full-width stacks in the trays above and below the felt. */
#root .layout>.table-wrap :is(.table-head,.action-panel){padding-inline:clamp(.55rem,1.5vw,1.2rem)}
.health-side{width:100%;min-width:0;color:#393326}
.health-side>span{display:flex;align-items:center;justify-content:space-between;gap:4px;font:750 var(--health-font)/1.16 ui-monospace,monospace}
.health-track{height:var(--health-height);border:1px solid #805d46;border-radius:4px;background:#ded1b7;overflow:hidden;margin-top:var(--health-gap)}
.health-track i{height:100%;display:block;background:#307055}
[data-health=dealer] .health-track i{background:#9e3829}
.shop-actions{display:flex;justify-content:space-between;align-items:center;gap:.5rem}
.shop-actions .key{flex:none;min-height:40px}
.reward-option:disabled{opacity:.58}
#reward-view{overflow-y:auto}

/* Price and status copy must not set the table's intrinsic track width. */
#root .layout > .table-wrap{grid-template-columns:minmax(0,1fr)}
.shared-shoe small{position:absolute;top:calc(100% + 7px);left:50%;transform:translateX(-50%);font:800 .55rem/1 ui-monospace,monospace;color:#f6e6ad;text-shadow:0 1px 2px #141a13;letter-spacing:.06em;pointer-events:none}
.shared-shoe:disabled{cursor:default}
#combo-stage{
 position:absolute;inset-inline:0;
 inset-block:var(--dealer-tray-depth) var(--table-actions);
 z-index:5;display:grid;place-items:center;pointer-events:none;
}
.combo-popup{
 --combo-edge:#efc469;
 display:grid;justify-items:center;gap:.28rem;min-width:min(10rem,90%);max-width:calc(100% - 24px);
 padding:.56rem .95rem;border:2px solid var(--combo-edge);border-radius:7px;background:#221811;
 color:#fff4d6;box-shadow:0 6px 22px #100b08b0,0 0 12px color-mix(in srgb,var(--combo-edge),transparent 55%);
 text-align:center;opacity:1;transition:opacity 180ms ease;
 animation:combo-pop 160ms ease-out;transform-origin:center;
}
.combo-popup[data-combo-side=dealer]{--combo-edge:#ef624f}
.combo-popup[data-combo-side=neutral]{--combo-edge:#e1d6b5}
.outcome-popup .health-impact{display:grid;gap:.25rem}
.outcome-popup>span{font-size:.78rem}

.combo-popup small{font:800 .63rem/1 ui-monospace,monospace;letter-spacing:.115em;color:var(--combo-edge)}
.combo-popup strong{font:850 clamp(.88rem,3.5vmin,1.19rem)/1.1 var(--serif)}
.combo-popup b{color:var(--combo-edge);font:950 clamp(.94rem,3.8vmin,1.36rem)/1 ui-monospace,monospace}
.combo-popup b span{font-size:.62em}
@keyframes combo-pop{
 0%{transform:scale(.72)}
 66%{transform:scale(1.09)}
 100%{transform:scale(1)}
}
.combo-popup.is-fading{opacity:0}
@media(prefers-reduced-motion:reduce){.combo-popup{animation:none;transition:none}}
/* Readouts must not widen a split seat's card track. */
#root .layout .hand{grid-template-columns:minmax(0,1fr)}
#root .layout .hand-foot .hand-head{max-width:100%;flex-wrap:wrap;justify-content:flex-end;row-gap:.1rem}

/* Power remains immediately below its matching health bar. */
.power-meter{
 --power-fill:#be8033;min-inline-size:0;margin-top:var(--power-gap);
}
.health-side[data-health=dealer] .power-meter{--power-fill:#a7533b}
.power-caption{
 display:flex;justify-content:space-between;gap:.22rem;align-items:baseline;
 font:750 var(--power-font)/1.15 ui-monospace,monospace;
 color:#514333;margin-block-end:var(--power-caption-gap);
}
.power-caption span{white-space:nowrap}
.power-caption .power-bonus{color:#914323;font-weight:900}
.power-caption span:last-child{color:#625039;margin-left:auto}
.power-track{
 block-size:var(--power-height);border:1px solid #876b49;border-radius:3px;background:#13231d;
 box-shadow:inset 0 1px 2px #050d0a90;
}
.power-track i{height:100%;display:block;border-radius:2px;background:var(--power-fill)}
.power-track[data-overcharge]{border-color:#ffe8a7;box-shadow:0 0 0 1px #ffe8a7,0 0 9px 2px #ffbc5bae}
.power-meter:has([data-overcharge]) .power-caption span:first-child{color:#75401d}
.power-track[data-bust]{border-color:#d48c78}
.power-meter:has([data-bust]) .power-caption span:first-child{color:#8e3021}
/* The selected split hand stays centered. Neighboring seats are compact previews. */
#root .layout .player>.hand-carousel{
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr)) minmax(0,3.8fr) repeat(2,minmax(0,1fr));
 grid-template-rows:auto;align-items:center;gap:2px;
 margin-inline:0;overflow:visible;
}
#root .layout .hand-carousel>.hand{display:grid;position:relative;padding-inline:1px;grid-row:1}
#root .layout .felt:has(.hand-carousel){--main-hand-gap:clamp(10px,3vw,29px)}
#root .layout .hand-track.hand-carousel:has(>.hand:nth-child(2))>.hand[data-position=center]{grid-column:3;--spread-gap:var(--main-hand-gap)}
#root .layout .hand-carousel>.hand[data-position=left]{grid-column:1/3}
#root .layout .hand-carousel:has([data-position=left-edge])>.hand[data-position=left]{grid-column:2}
#root .layout .hand-carousel>.hand[data-position=right]{grid-column:4/6}
#root .layout .hand-carousel:has([data-position=right-edge])>.hand[data-position=right]{grid-column:4}
#root .layout .hand-carousel>.hand[data-position=left-edge]{grid-column:1}
#root .layout .hand-carousel>.hand[data-position=right-edge]{grid-column:5}
#root .layout .hand-carousel>.hand[data-position=off]{display:none}
#root .layout .hand-carousel>.hand:not([data-position=center]) .cards{
 --peek-width:min(calc(var(--table-card-width) * .58),88cqi);
 --peek-height:calc(var(--peek-width) * 1.36);
 --step:min(calc(var(--peek-width) * .67),calc((100cqi - var(--peek-width)) / var(--fan-steps,1)));
 min-height:var(--peek-height);
}
#root .layout .hand-carousel>.hand:not([data-position=center]) .playing{width:var(--peek-width);height:var(--peek-height)}
#root .layout .hand-carousel>.hand:not([data-position=center]) .playing+.playing{margin-inline-start:calc(var(--step) - var(--peek-width))}
#root .layout .hand-carousel>.hand:not([data-position=center]) .playing b{top:2px;left:2px;font-size:clamp(.46rem,8cqi,.62rem)}
#root .layout .hand-carousel>.hand:not([data-position=center]) .playing small{font-size:.95em;margin-top:1px}
#root .layout .hand-carousel>.hand:not([data-position=center]) .playing .corner{inset:auto 2px 2px auto}
#root .layout .hand-carousel>.hand:not([data-position=center]) .playing strong{font-size:clamp(.63rem,22cqi,1.05rem)}
#root .layout .hand-carousel>.hand:not([data-position=center]) .hand-outcome{display:none}
#root .layout .hand-carousel>.hand:not([data-position=center]) .hand-head{margin-inline:auto;justify-content:center}
.hand-preview-select{position:absolute;inset:0;min-width:0;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer}
.hand-preview-select:hover,.hand-preview-select:focus-visible{border-color:#f1dca2;outline-offset:0;background:#ead39619}
#root #hands-pager{display:block}
#root #hands-pager .mobile-pager{
 display:grid;grid-template-columns:44px auto 44px;align-items:center;justify-content:center;gap:8px;
 color:#f6e5bc;font:750 .67rem ui-monospace,monospace;text-align:center;
}
#root #hands-pager .mobile-pager button{min-height:28px;line-height:1;padding:1px;border:1px solid #9a8764;border-radius:5px;font-size:1rem}
#root #hands-pager button:disabled{opacity:.36}
#root .layout .hand-carousel>.hand:not([data-position=center]){overflow:clip}
#root .layout .hand-carousel .hand-preview-select{z-index:1}
#root .layout .hand-carousel>.hand .cards{width:100%;margin-inline:0}

/* WAAPI transforms the card art only. Layout and the preview hit targets stay put. */
#root .layout .hand-carousel[data-carousel-motion]>.hand:not([data-position=center]){overflow:visible}
#root .layout .hand-carousel[data-carousel-motion] .playing{pointer-events:none}
#root .layout .hand-carousel[data-carousel-motion]>.hand[data-position=center]{z-index:2}

/* Keep the split controls reachable without making the short landscape felt scroll. */
@media (hover:none) and (pointer:coarse) and (max-height:440px) and (orientation:landscape){
 #root .layout .player:has(#hands-pager)>.row-label{justify-content:flex-start;min-height:28px}
 #root #hands-pager{position:absolute;top:0;right:0}
 #root #hands-pager .mobile-pager{grid-template-columns:32px auto 32px;gap:4px}
}

/* The header disclosure overlays the table without consuming another row. */
#root>.top{position:relative;z-index:12}
.header-menu{position:relative}
.header-trigger{display:inline-flex;align-items:center;gap:.35rem;min-height:44px;padding-inline:.65rem;font-size:.82rem}
.header-trigger[aria-expanded=true] span{transform:rotate(180deg)}
.header-menu-panel{
 position:absolute;inset-block-start:calc(100% + 4px);inset-inline-end:0;
 display:grid;gap:4px;width:min(210px,calc(100vw - 24px));padding:5px;
 background:#dfcfad;border:1px solid #a68e69;border-radius:8px;box-shadow:0 7px 24px #151e19a0;
}
.header-trigger[aria-expanded=false]+.header-menu-panel{display:none}
.header-menu-panel .mobile-tabs{grid-template-columns:1fr;padding:0;border:0}
#header-menu-panel button{
 min-height:44px;text-align:start;padding-inline:.65rem;
 font-family:inherit;font-size:.84rem;font-weight:750;line-height:1.15;
 color:#43392a;background:#efe2c7;border:1px solid #c5b18c;border-radius:5px;
}
.header-menu-panel .mobile-tabs button{display:flex;justify-content:space-between;align-items:center}
.menu-current-mark{visibility:hidden}
.header-menu-panel [aria-current=true] .menu-current-mark{visibility:visible}
@media(hover:hover) and (pointer:fine){
 .header-menu-panel button:hover:not(:disabled){background:#e4d2ae}
}
@media (hover:none) and (pointer:coarse){
 /* A small exterior gutter separates the table frame from the header. */
 #root>main.wrap:has(>.layout[data-mobile-tab=table]){padding-block-start:6px}
}

/* Mount the trays above the fixed felt. The painted board never enters their layout. */
#root .layout>.table-wrap{
 --tray-top-pad:clamp(4px,1.25dvh,12px);
 --tray-rule:1px;
 --meter-gap:7px;
 --health-font:clamp(.67rem,1.5vw,.78rem);
 --health-height:9px;
 --health-gap:4px;
 --power-font:clamp(.53rem,1.35vmin,.66rem);
 --power-height:7px;
 --power-gap:4px;
 --power-caption-gap:2px;
 --dealer-tray-depth:calc(2 * var(--tray-rule) + var(--tray-top-pad) + var(--meter-gap) +
  var(--health-font) * 1.16 + var(--health-gap) + var(--health-height) + var(--power-gap) +
  var(--power-font) * 1.15 + var(--power-caption-gap) + var(--power-height));
 position:relative;
 grid-template-rows:minmax(0,1fr);
}
@media(max-height:595px){
 #root .layout>.table-wrap{--power-gap:.24rem;--power-height:6px}
}
@media(max-height:475px){
 #root .layout>.table-wrap{
  --meter-gap:5px;--health-font:.63rem;--health-height:6px;--health-gap:2px;
  --power-gap:3px;--power-height:5px;
 }
}
#root .layout>.table-wrap>.felt{grid-row:1;grid-column:1}
#root .layout>.table-wrap>:is(.table-head,.action-panel){
 position:absolute;inset-inline:0;z-index:6;background:var(--panel) url("/paper.svg");
 padding-block-start:var(--tray-top-pad);
 border-block-start:var(--tray-rule) solid #745f47;
}
#root .layout>.table-wrap>.table-head{
 inset-block-start:0;block-size:auto;align-items:start;padding-block-end:var(--meter-gap);
 border-block-start-color:#923a2c;border-block-end:var(--tray-rule) solid #745f47;
}
#root .layout>.table-wrap>.table-head:empty{display:none}
#root .layout>.table-wrap>.action-panel{
 inset-block-end:0;inset-block-start:auto;block-size:var(--table-actions);
}
.action-panel[data-tray-mode=player]>.health-side{margin-block-end:var(--meter-gap)}
#root .layout>.table-wrap>.action-panel[hidden]{display:none}
/* Stretch the oval between the trays, with the same fitted clearance at both ends. */
#root .layout>.table-wrap>.felt{
 --outline-gap:11px;
 --outline-start:calc(var(--dealer-tray-depth) + var(--outline-gap));
 --outline-end:calc(var(--table-actions) + var(--outline-gap));
 padding-block-start:calc(var(--outline-start) + 3px);
 padding-block-end:calc(var(--outline-end) - 10px);
}
#root .layout>.table-wrap>.felt>.dealer{align-self:start}
#root .layout .dealer-cards{min-block-size:var(--table-card-height)}
#root .layout .dealer>.shoe-pile{inset-block-start:clamp(13px,2.6dvh,20px)}
#root .layout>.table-wrap>.felt>.felt-lines{
 inset-block:var(--outline-start) var(--outline-end);
 border-radius:40% / 36%;
}
@media (hover:none) and (pointer:coarse) and (max-height:440px) and (orientation:landscape),
       (hover:hover) and (pointer:fine) and (max-height:570px){
 #root .layout>.table-wrap>.felt{padding-block-start:calc(var(--outline-start) + 1px);padding-block-end:var(--table-actions)}
}

/* Lobby controls sit on the felt, not in an empty action tray. */
.lobby-center{
 position:absolute;z-index:3;inset-block-start:50%;inset-inline-start:50%;
 transform:translate(-50%,-50%);width:min(360px,calc(100% - 34px));
 display:grid;gap:.45rem;text-align:center;color:#f8edce;
}
.lobby-title{display:grid;gap:.1rem}
.lobby-title>span,.lobby-center>p{color:#d8d8ba;font-size:.82rem}
.lobby-center .key{min-width:0;padding-inline:.4rem}
@media(max-height:440px){
 #root .layout>.table-wrap:has(.lobby-center)>.felt>.player{visibility:hidden}
 .lobby-center{gap:.3rem}
 .lobby-center .key{min-height:40px}
}

/* Closing snapshots keep the paper visible just long enough to fold away. */
.tray-fold-ghost{
 position:absolute;inset-inline:0;box-sizing:border-box;z-index:5;
 pointer-events:none;user-select:none;backface-visibility:hidden;
}
.tray-fold-ghost[data-fold-edge=top]{inset-block-start:0}
.tray-fold-ghost[data-fold-edge=bottom]{inset-block-end:0}
[data-tray-folding]{backface-visibility:hidden}

/* Progression takes the center of the felt; the tray stays devoted to combat. */
.signal-copy{display:grid;justify-items:center;gap:.12rem;min-width:0}
.signal[data-result]{position:relative;z-index:3;gap:.25rem;pointer-events:none}
.signal[data-result] .result-actions button{pointer-events:auto}
.result-actions .controls{justify-content:center;grid-template-columns:repeat(2,auto)}
.result-actions .controls:has(>button:only-child){grid-template-columns:auto}
.result-actions .key{min-height:40px;padding:.3rem .65rem}
.result-actions .key span{color:inherit}
@media (hover:none) and (pointer:coarse){
 .result-actions .key{min-height:36px}
}
@media(max-height:440px){
 .result-actions .key{min-height:34px;padding:.22rem .48rem;font-size:.77rem}
 .signal[data-result]{gap:.17rem}
}

.action-panel .action-grid .key:disabled{filter:grayscale(1)}

/* The gold edge is independent of the button fill and the keyboard focus ring. */
#root .key[data-recommended]:enabled,#reward-view .key[data-recommended]:enabled{
 border-color:#ab7618;
 box-shadow:inset 0 0 0 1px #f3cb6a,0 0 0 1px #dca731;
}

/* The dedicated guide scrolls independently; the game remains in place behind it. */
#root[hidden],#guide-page[hidden],#progress-page[hidden]{display:none!important}
 #guide-page,#progress-page{
 position:fixed;inset:0;
 overflow-y:auto;overscroll-behavior:contain;
 background:url("/paper.svg"),#efe2c7;color:#342c23;
 padding:clamp(1rem,4vw,2.3rem) clamp(.85rem,4vw,2rem) max(2rem,env(safe-area-inset-bottom));
}
.guide-shell{max-width:46rem;margin-inline:auto}
.guide-back,.score-guide-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.guide-back{min-height:44px;color:#7b382b;font-weight:800;margin-bottom:.72rem}
.guide-shell h1{font:850 clamp(1.9rem,6vw,2.65rem)/1.1 var(--serif);margin:.18rem 0 .6rem}
.guide-shell p{line-height:1.45}
.guide-section{margin-block:1rem;padding:clamp(.7rem,2.7vw,1.1rem);border:1px solid #b49b73;border-radius:8px;background:#fff4dc82}
.guide-section h2{font:850 1.29rem/1.2 var(--serif);margin-bottom:.28rem}
.guide-section p{font-size:.86rem;color:#625241}
.guide-section .score-list{margin-top:.5rem}
.guide-section .score-list li{padding-block:.45rem}
.guide-section .score-list small{line-height:1.4}

.battle-scopes{
 display:grid;grid-template-columns:1fr 1fr;gap:.35rem;padding:.45rem .72rem;
 border-bottom:1px solid #b39e7f;
}
.battle-scopes .key{min-height:38px;padding:.25rem .4rem;font-size:.8rem}
.battle-scopes [aria-pressed=true]{background:#3f4b3c;color:#fff2d3;border-color:#354135}
.battle-body{overscroll-behavior:contain}
.battle-hand+.battle-hand{margin-top:1.1rem}
.battle-hand ol{list-style:none;padding:0;margin:.4rem 0}
.battle-hand li{display:grid;grid-template-columns:3.5rem minmax(0,1fr);gap:.45rem;padding:.46rem 0;border-bottom:1px solid #99795c4a;font-size:.83rem;line-height:1.3}
.battle-hand li b{color:#78382a;font-size:.7rem;align-self:baseline}
.battle-hand li[data-battle-kind=outcome]{font-weight:700}
.battle-footer{padding:.55rem .75rem;border-top:1px solid #b39e7f}
.battle-footer .score-guide-link{color:#78382a;font-size:.82rem;font-weight:800;min-height:32px}
@media(max-height:440px){
 .battle-scopes{padding:.25rem .55rem}
 .battle-scopes .key{min-height:32px}
 .battle-footer{padding:.22rem .6rem}
}

.signal .trial-label{color:#e0c78a;font-family:var(--serif);letter-spacing:.025em}
.trial-lesson small{display:block;margin-top:.15rem}
@media(hover:none) and (pointer:coarse) and (max-height:440px) and (orientation:landscape){
 .trial-lesson{display:none}
}

.journey-summary{margin-block:1rem;color:#5b4735}
.journey-summary label{font-weight:800}
.journey-summary progress{width:100%;height:.55rem;margin:.45rem 0;background:#d5c5a4}
.journey-summary progress::-webkit-progress-bar{background:#d5c5a4}
.journey-summary progress::-webkit-progress-value{background:#426449}
.journey-summary progress::-moz-progress-bar{background:#426449}
.journey-trials{margin:0;padding:0;list-style:none}
.journey-trial{display:grid;grid-template-columns:2rem minmax(0,1fr);align-items:start;gap:.65rem}
.journey-node{display:grid;place-items:center;min-height:2rem;background:#e6d5b5;border-radius:50%;font-weight:850;color:#514431}
.journey-trial[data-trial-status=cleared] .journey-node{background:#426449;color:#fff2d3}
.journey-trial[aria-current=step]{border-color:#9c632c;box-shadow:inset 3px 0 #b78238}
.journey-trial .challenger-name{font-weight:800;color:#3a3429}
@media(hover:none) and (pointer:coarse) and (max-height:440px){
 #header-menu-panel button{min-height:35px}
}

#deck-picker{overflow:auto}
.picker-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
.deck-choice,.forge-options .reward-option{align-content:start;gap:.3rem;text-align:center;padding:.65rem .4rem}
.deck-choice strong,.forge-options strong{font-size:.92rem}
.deck-choice small,.forge-options small{color:#733825;font-size:.74rem}
.deck-choice span,.forge-options span{font-weight:550;line-height:1.3}
.forge-result{display:flex;align-items:center;gap:.85rem;background:#ede0c1;border:1px solid #a58d65;border-radius:8px;padding:.7rem}
.forge-result .playing{flex:none;width:48px;height:65px}
.forge-result p{margin:.15rem 0 0}
.playing .forge-mark{position:absolute;top:.2em;right:.3em;color:#886022;font-size:.8em}
@media(max-width:420px){
 .forge-options{grid-template-columns:1fr}
 .forge-options .reward-option{justify-items:start;text-align:left;padding:.45rem .6rem;row-gap:.2rem}
}
.forge-actions{display:flex;justify-content:flex-end;gap:.5rem;flex-wrap:wrap}
.forge-actions .key{padding-inline:.75rem}
.forge-targets{display:grid;grid-template-columns:repeat(auto-fit,minmax(48px,1fr));gap:.35rem;max-height:min(34dvh,245px);overflow:auto;overscroll-behavior:contain;padding:.3rem;border:1px solid #a58d65;border-radius:8px}
.forge-target{display:grid;place-items:center;min-width:0;padding:.25rem;border-radius:6px;border:1px solid transparent;background:transparent;color:inherit}
.forge-target:hover,.forge-target:focus-visible,.forge-target[aria-pressed=true]{border-color:#855328;background:#e2c991}
.forge-target[aria-pressed=true]{box-shadow:inset 0 0 0 1px #855328}
.forge-target .playing{width:min(100%,44px);height:auto;aspect-ratio:5/7;pointer-events:none}
.forge-target .playing strong{font-size:1.28rem}
#reward-view .forge-preview{min-height:1.25em;font-weight:650}

/* The burst stays centered on the hand; only the card being counted jiggles. */
#root .cards:has(>.card-score-pop){position:relative;z-index:12}
#root .cards>.card-scoring{
 outline:2px solid #efc469;outline-offset:1px;z-index:1;
 animation:score-card-jiggle 280ms ease-out;
}
@keyframes score-card-jiggle{
 0%,100%{transform:none}
 22%{transform:translate(-3px,-2px) rotate(-6deg)}
 44%{transform:translate(3px,-2px) rotate(5deg)}
 66%{transform:translate(-2px,-1px) rotate(-3deg)}
 84%{transform:translate(1px,0) rotate(1deg)}
}
.card-score-pop{
 --burst-edge:#321b1a;
 --burst-offset:#bd3e30;
 --burst-outer:polygon(50% 0%,61% 18%,79% 4%,81% 26%,97% 22%,92% 43%,100% 53%,85% 63%,96% 83%,73% 78%,67% 100%,52% 84%,31% 97%,28% 77%,6% 84%,16% 65%,0% 54%,13% 44%,3% 22%,25% 27%,29% 5%,41% 21%);
 position:absolute;left:50%;top:0;translate:-50% -77%;isolation:isolate;display:grid;place-content:center;z-index:2;
 width:2.5em;height:1.88em;font:950 italic clamp(1.38rem,4.9vmin,2rem)/1 system-ui,sans-serif;
 color:#fff8d9;letter-spacing:-.09em;padding-right:.1em;
 -webkit-text-stroke:.075em var(--burst-edge);paint-order:stroke fill;
 text-shadow:.09em .105em var(--burst-offset),.105em .14em var(--burst-edge);
 filter:drop-shadow(.1em .1em 0 #1e110fbd);
 pointer-events:none;animation:score-card-pop 420ms cubic-bezier(.2,.75,.3,1) both;
}
.dealer-cards>.card-score-pop{top:auto;bottom:0;translate:-50% 77%}
.card-score-pop::before,.card-score-pop::after{
 content:"";position:absolute;clip-path:var(--burst-outer);
}
.card-score-pop::before{z-index:-2;inset:0;background:var(--burst-edge)}
.card-score-pop::after{
 z-index:-1;inset:.12em;
 background:radial-gradient(circle,#b3412744 .045em,transparent .055em) 0 0/.19em .19em,
  radial-gradient(ellipse,#ffeaa2 26%,#ffc849 73%,#f09538 94%);
}
@keyframes score-card-pop{
 0%{transform:scale(.35) rotate(-16deg);opacity:0}
 29%{transform:scale(1.26) rotate(8deg);opacity:1}
 47%{transform:scale(.95) rotate(-8deg);opacity:1}
 59%,81%{transform:scale(1) rotate(-6deg);opacity:1}
 100%{transform:scale(.9) rotate(-6deg);opacity:0}
}
@media(prefers-reduced-motion:reduce){.card-score-pop,#root .cards>.card-scoring{animation:none}}

/* Trial cards: visible even at table size and never shown on a hidden card. */
.playing.royal-disabled{isolation:isolate}
.royal-cross{position:absolute;inset:0;z-index:3;pointer-events:none}
.royal-cross::before,.royal-cross::after{content:"";position:absolute;left:5%;top:calc(50% - 3px);width:90%;height:6px;border-radius:2px;background:#b42125;box-shadow:0 0 1px 1px #4b1517;transform:rotate(52deg)}
.royal-cross::after{transform:rotate(-52deg)}
.playing.bomb-card{background:radial-gradient(ellipse at 50% 65%,#6e3924,#281d1b 68%);border-color:#dd9253;color:#ffe5aa}
.playing.bomb-card b,.draw-flight .playing.bomb-card b{font-size:clamp(.45rem,1.4vmin,.85rem);letter-spacing:.07em}
.playing.bomb-card strong{color:#ffc66d;text-shadow:0 0 .2em #be4e2a}
.draw-flight.bomb-insert .playing.bomb-card{transform:none}
.boss-effect-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.boss-rule{color:#ffdf9d;line-height:1.3}
.jm-intro .boss-rule{max-width:40ch;color:#ffdf9d}
.bomb-burst{position:absolute;z-index:45;inset:0;display:grid;place-items:center;pointer-events:none}
.bomb-blast,.bomb-impact{grid-area:1/1;text-align:center}
.bomb-blast{position:relative;display:grid;place-items:center;width:min(68vw,36vh,340px);aspect-ratio:1;animation:slipcut-blast .84s ease-out both}
.bomb-blast i{position:absolute;inset:3%;border-radius:50%;border:5px solid #f0a453;box-shadow:0 0 30px #fa693c,inset 0 0 45px #f1ab59;background:radial-gradient(circle,#f9d78d 5%,#e87038 36%,#762723 57%,transparent 72%)}
.bomb-blast b{z-index:1;color:#ffbf66;text-shadow:0 0 .2em #fff0b3;font-size:min(48vw,26vh,240px);line-height:1}
.bomb-impact{z-index:1;display:grid;gap:3px;padding:8px 14px;border:2px solid #e8934a;color:#ffe8b6;background:#351f1a;border-radius:6px;box-shadow:0 3px 18px #241610}
.bomb-impact strong{font-size:clamp(1.25rem,4.5vmin,2rem);line-height:1;letter-spacing:.08em}
.bomb-impact span{font-size:clamp(.68rem,2.25vmin,1rem)}
@keyframes slipcut-blast{0%{opacity:0;transform:scale(.18) rotate(-13deg)}25%{opacity:.95;transform:scale(1) rotate(0)}100%{opacity:0;transform:scale(1.45) rotate(9deg)}}
@media(prefers-reduced-motion:reduce){.bomb-blast{display:none}}
