:root{
  --table:#dce9e0;
  --surface:#f8f0dc;
  --surface-edge:#c8b998;
  --ink:#243d34;
  --accent:#2b6352;
  font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif;
  color:var(--ink);background:var(--table);font-synthesis:none;
}
*{box-sizing:border-box}
body{margin:0;overflow:hidden}
button,input{font:inherit;color:inherit}
button{cursor:pointer;border:1px solid var(--surface-edge);background:var(--surface);border-radius:.7em;padding:.45em .95em;white-space:nowrap}
button:not(.card){min-height:44px;min-width:44px;font-weight:650;touch-action:manipulation}
button:hover,button:focus-visible{background:#fff}
button.primary{color:white;background:var(--accent);border-color:var(--accent)}
button.active{background:#e3b982;border-color:#b98e5d}
button:not(.card){transition:transform 120ms ease-out,background-color 120ms ease-out}
button:not(.card):active{transform:scale(.97);transition-duration:0ms}
.motion-ghost{position:absolute!important;inset:0;pointer-events:none!important;z-index:7}
.motion-ghost *{pointer-events:none!important}
.confetti-layer{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:20}
.confetti-layer span{position:absolute;top:0;border-radius:1px;pointer-events:none}
#app{position:absolute;width:100dvw;height:100dvh;overflow:hidden;container-type:size;font-size:clamp(15px,4dvh,22px)}
@media (orientation:portrait){#app{width:100dvh;height:100dvw;transform-origin:0 0;transform:translateX(100dvw) rotate(90deg);font-size:clamp(15px,4dvw,22px)}}
.home,.table{width:100%;height:100%;position:relative;background:radial-gradient(ellipse,#edf4e9,var(--table))}
.home{display:grid;place-content:center;text-align:center}
.home h1{margin:0 0 .6em;font-size:3em;letter-spacing:.13em}
.main-menu{display:flex;flex-direction:column;align-items:center;justify-content:safe center;padding:.6em;overflow:auto}
.home.main-menu h1{flex-shrink:0;font-size:clamp(1.7em,9cqh,3em);margin:0 0 .4em}
.main-menu #boot-status{max-width:min(88cqw,32em);overflow-wrap:anywhere}
.menu{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5em;width:min(88cqw,29em);flex-shrink:0}
.menu button{min-width:0;width:100%}
.records-page{display:flex;flex-direction:column;padding:.5em .8em;gap:.4em;text-align:left;overflow:auto}
.records-page header{display:flex;align-items:center;justify-content:space-between;gap:1em}
.records-page h2,.record-mode h3{margin:0}
.records-page h2{font-size:1.3em}
.records-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5em;flex:1;min-height:min-content}
.record-mode{background:var(--surface);border:1px solid var(--surface-edge);border-radius:.7em;padding:.45em .65em;min-width:0}
.record-mode h3{font-size:1em;margin-bottom:.3em;color:var(--accent)}
.record-mode table{width:100%;border-collapse:collapse;font-size:.85em;font-variant-numeric:tabular-nums}
.record-mode th,.record-mode td{padding:.22em .15em;text-align:right;white-space:nowrap}
.record-mode th:first-child{text-align:left}
.record-mode thead{color:#52685f;font-weight:400;border-bottom:1px solid var(--surface-edge)}
.record-mode tbody tr:nth-child(2){border-bottom:1px solid var(--surface-edge)}
.record-mode tbody tr:nth-child(n+3) th{padding-left:.7em;font-weight:400}
.records-note{font-size:.65em;line-height:1.5;margin:0;color:#52685f}
.mode-panel{width:min(88cqw,30em);padding:1.1em;border-radius:1em;background:var(--surface);border:1px solid var(--surface-edge)}
.mode-panel h2{margin:0 0 .8em}
.mode-panel p{font-size:.85em;line-height:1.5}
.mode-option{display:flex;align-items:center;justify-content:space-between;gap:1em;min-height:48px;font-weight:650;cursor:pointer}
.mode-option input{appearance:none;width:54px;height:32px;background:#9ba9a2;border-radius:999px;position:relative;margin:0;flex:none;cursor:pointer}
.mode-option input::after{content:'';position:absolute;top:3px;left:3px;width:26px;height:26px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0003;transition:transform 180ms ease-out}
.mode-option input:checked{background:var(--accent)}
.mode-option input:checked::after{transform:translateX(22px)}
.mode-option input:focus-visible{outline:3px solid #a97b31;outline-offset:3px}
.table{display:grid;--action-height:0px;--hand-height:max(64px,25%);--seat-header-height:3.9em;--avatar-size:2.15em;grid-template-columns:minmax(52px,12%) minmax(0,1fr) minmax(0,2.3fr) minmax(0,1fr) minmax(52px,12%);grid-template-rows:var(--seat-header-height) minmax(0,1fr) var(--action-height) var(--hand-height);gap:.28em;padding:.32em .45em}
.table{isolation:isolate}
.back{grid-area:1/1;align-self:start;justify-self:start}
.seat{position:absolute;width:11%;height:var(--avatar-size);text-align:center;line-height:1.1}
.seat b{display:inline-grid;place-items:center;min-width:var(--avatar-size);height:var(--avatar-size);max-width:100%;padding:.3em .4em;border:1px solid var(--surface-edge);border-radius:999px;background:var(--surface);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}
.seat b.bid-up{background:#a62d37;border-color:#81212a;color:#fff}
.seat b.bid-down{background:#d5d8da;border-color:#9da4a8;color:#3d454a}
.seat b.team-banker{background:#234e65;border-color:#183e53;color:#fff}
.seat b.team-defender{background:#a34e24;border-color:#843c1a;color:#fff}
.seat .turn{outline:3px solid #648d7a;outline-offset:2px}
.seat small{position:absolute;top:calc(100% + .18em);left:0;width:100%;display:block}
.up{color:#a62d37}.down{color:#236547}
.tags{position:absolute;top:calc(var(--avatar-size) / .69 + 1.55em);left:50%;transform:translateX(-50%);width:max-content;max-width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:.22em;white-space:nowrap;font-size:.69em;color:#304f44}
.individual-score{background:#f4efe0;border-radius:999px;padding:.18em .45em;font-variant-numeric:tabular-nums}
.friend-tag{background:#694489;color:#fff;border-radius:999px;padding:.25em .55em;font-size:1.2em}
.banker-tag{background:#234e65;color:#fff;border-radius:999px;padding:.25em .55em;font-size:1.2em}
.seat-0{left:.45em;bottom:calc(12.5% + .32em);transform:translateY(50%)}
.seat-1{left:.45em;top:42%;transform:translateY(-50%)}
.seat-2{left:25%;top:.6em;transform:translateX(-50%)}
.seat-3{left:75%;top:.6em;transform:translateX(-50%)}
.seat-4{right:.45em;top:42%;transform:translateY(-50%)}
.table-info{display:contents}
.table-meta{position:absolute;top:.4em;right:.45em;width:18.5%;font-size:1em;line-height:1.2;z-index:2;text-align:right}
.table-meta .trump-line{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:.2em .3em;min-width:0;margin-bottom:.3em}
.table-meta .trump-line:empty{display:none}
.status-points{position:absolute;top:.55em;left:50%;transform:translateX(-50%);font-size:1em;text-align:center;white-space:nowrap;line-height:1.3;z-index:2;padding:.15em .45em}
.status-points b{font-size:1em;margin-left:.25em;font-variant-numeric:tabular-nums}
.individual-score{position:relative}
.score-delta{position:absolute;left:100%;top:0;margin-left:.2em;color:#236547;font-size:.9em;font-weight:800;line-height:1;pointer-events:none;white-space:nowrap;z-index:4}
.bid-source{font-size:.82em;overflow:hidden;text-overflow:ellipsis}
.trump-faces{display:inline-flex;gap:.16em;font-size:.8em}
.trump-faces .card{height:1.95em;width:1.55em;--corner-size:.73em}
.trump-faces .star{display:none}
.stage{grid-area:2/2/4/5;min-width:0;min-height:0;display:grid;align-content:safe center;gap:.25em;overflow:auto;position:relative;isolation:isolate}
.center{width:100%;display:grid;justify-items:center;text-align:center;gap:.25em}
.bid-hint{display:flex;justify-content:center;gap:.8em;flex-wrap:wrap}
.deal-direction{position:absolute;inset:0;display:grid;place-items:center;z-index:-1;pointer-events:none;color:var(--accent)}
.deal-direction svg,.deal-direction span{grid-area:1/1}
.deal-direction svg{width:5em;height:5em;max-height:100%;opacity:.32;fill:none;stroke:currentColor;stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round}
.deal-direction span{font-size:.78em;font-weight:700;opacity:.72}
.stage:has(.deal-direction):not(.has-trick){align-content:start}
.bottom-cards,.failed-cards{width:min(100%,46rem);font-size:clamp(10px,min(2.45cqw,5.5cqh),23px)}
.bottom-cards .cards{gap:.12em}
.bottom-cards .cards .card + .card{margin-left:0}
.actions{position:absolute;bottom:0;left:0;right:0;z-index:3;display:flex;align-items:center;justify-content:center;gap:.35em;pointer-events:none}
.actions button{pointer-events:auto}
.cards{display:flex;align-items:end;justify-content:center;width:100%;min-width:0}
.card{--card-width:2.7em;border:1px solid #a9b4aa;border-radius:.31em;background:#fffefa;color:#1e2825;box-shadow:0 .12em .28em #263e3424;display:block;text-align:left;flex:0 0 auto;position:relative;width:var(--card-width);height:3.65em;padding:0;overflow:hidden;touch-action:auto}
.card .corner{position:absolute;top:.14em;left:.17em;font-size:var(--corner-size,1em);line-height:1;white-space:nowrap}
.card.red{color:#b72e3e}.card.blue{color:#1769bb}
.card .mark{display:block;font-weight:800;letter-spacing:-.045em;font-variant-numeric:tabular-nums}.card .suit{display:block;margin-top:.08em}
.card .star{position:absolute;left:.25em;bottom:.18em;color:#a16b19;font-size:.73em}
.card[data-joker] .corner{bottom:.95em}
.card .joker{display:block;width:.77em;height:100%;fill:currentColor}
.joker text{font:900 9px system-ui,sans-serif;text-anchor:middle}
.cards .card + .card{margin-left:calc(min(var(--step,1.25em),(100% - var(--card-width)) / var(--gaps)) - var(--card-width))}
.hand{grid-area:4/2/5/6;min-width:0;font-size:clamp(20px,4.5cqw,34px);display:flex;align-items:end;touch-action:none;user-select:none;background:#f8f0dc8f;border-radius:.55em;padding:.12em .2em}
.hand .cards{--step:2em}
.hand .card{--card-width:2.4em;height:min(2.95em,19cqh);--corner-size:clamp(12px,calc((82cqw - var(--card-width)) / var(--gaps) * 1.03),25px)}
.hand .card.selected{transform:translateY(-.32em)}
.hand .card.bid-ready{transform:translateY(-.26em);border-color:#3a806b}
.hand .card.bid-ready.selected{transform:translateY(calc(-1 * min(.6em,5cqh)))}
.card.selected{transform:translateY(-.65em);background:#fff4d3}
.stage.has-trick{align-content:stretch;grid-template-rows:minmax(0,1fr) 1.5em;overflow:hidden}
.stage.has-trick .trick-board{grid-row:1}
.stage.has-trick .notice{grid-row:2;align-self:center}
.stage.has-trick:has(.center){grid-template-rows:auto minmax(0,1fr) 1.5em}
.stage.has-trick:has(.center) .trick-board{grid-row:2}
.stage.has-trick:has(.center) .notice{grid-row:3}
.trick-board{position:relative;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:.15em .35em;min-height:0;container-type:size}
.played{position:relative;display:flex;align-items:center;justify-content:center;gap:.25em;min-width:0;font-size:clamp(15px,19cqh,25px)}
.played.is-peeking{z-index:4}
.played.is-peeking .card{box-shadow:0 .15em .55em #263e3466}
.played-2{grid-area:1/2/2/4}.played-3{grid-area:1/4/2/6}
.played-1{grid-area:2/1/3/3}.played-0{grid-area:2/3/3/5}.played-4{grid-area:2/5/3/7}
.bidding-board .played-0{align-self:start;transform:translateY(-.45em)}
.played-stack{flex:1;min-width:0;display:grid;justify-items:center;container-type:inline-size}
.played-cards{display:grid;gap:1px;width:min(75%,calc(2.1em + 1.25em * (var(--columns) - 1)));transform:scale(1);transform-origin:center;transition:transform 180ms cubic-bezier(.2,.8,.2,1)}
.is-leading .played-cards{transform:scale(1.3)}
.is-leading .card{outline:2px solid #ae7a2d;outline-offset:1px;box-shadow:0 .18em .6em #65461455}
.played-cards .cards{--step:1.25em;justify-content:flex-start}
.played .card{--card-width:min(2.1em,24cqw);height:min(2.35em,calc(((50cqh - 3px) / var(--rows) - 1px) / 1.3))}
.played .card{--corner-size:min(1.02em,calc((min(1.25em,(100cqw - var(--card-width)) / var(--gaps)) - 1px) * .86),calc(17.5cqh / var(--rows)))}
.played .card .corner{top:1px;left:1px;line-height:.88}
.played .card .suit{margin:0}
.played .card:has(.star){border-color:#a97b31;background:#fffbeb}
.played .star{left:1px;bottom:0;font-size:calc(var(--corner-size) * .45);line-height:1}
.notice{justify-self:center;border-radius:.6em;background:#29443a;color:white;padding:.24em .55em;text-align:center;font-size:.85em}
.overlay{position:absolute;z-index:30;inset:0;background:#20383051;display:grid;place-items:center}
.panel{background:var(--surface);border:1px solid var(--surface-edge);border-radius:1em;padding:.65em 1em;width:min(90%,52em);max-height:94%;overflow:auto;text-align:center}
.panel h2{margin:0 0 .5em}.panel p{margin:.45em 0}
.panel footer{display:flex;justify-content:center;flex-wrap:wrap;gap:.6em;margin-top:.7em}
.tutorial-overlay{z-index:35}
.panel.tutorial{width:96%;height:95%;max-height:95%;padding:0;display:flex;flex-direction:column;overflow:hidden;text-align:center}
.tutorial-header{display:flex;align-items:center;justify-content:space-between;padding:.12em .6em .12em 1em;flex-shrink:0;font-size:.75em;color:#52685f}
.tutorial-close{font-size:1.8em;line-height:1;background:transparent;border:0;padding:0}
.tutorial-track{display:flex;flex:1;min-height:0;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain;touch-action:auto}
.tutorial-track::-webkit-scrollbar{display:none}
.tutorial-slide{flex:0 0 100%;min-width:0;height:100%;padding:.1em 1.1em .3em;scroll-snap-align:start;scroll-snap-stop:always;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-width:thin}
.tutorial-slide h2{font-size:1.3em;letter-spacing:.02em;margin:0 0 .2em}
.tutorial-slide p{font-size:.75em;line-height:1.5;margin:.35em 0}
.tutorial-slide .lesson-subtitle{color:#52685f;font-size:.75em;margin:0 0 .55em}
.lesson-body{display:grid;gap:.35em;align-content:center;min-height:0}
.lesson-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7em}
.lesson-block{background:#fffaf085;border:1px solid #c8b99880;border-radius:.65em;padding:.4em;min-width:0}
.lesson-block h4{font-size:.8em;margin:0 0 .4em;color:var(--accent)}
.lesson-cards{display:flex;align-items:center;justify-content:center;gap:.4em;min-width:0}
.lesson-card{display:inline-flex;flex-direction:column;align-items:center;gap:.15em;font-size:clamp(16px,5.5cqh,28px);flex-shrink:0}
.tutorial .card{touch-action:auto;width:2.35em;height:3.3em;--corner-size:.85em;box-shadow:0 .12em .25em #263e3420}
.lesson-card small{font-size:.54em;color:var(--ink);line-height:1.35;white-space:nowrap}
.lesson-greater,.lesson-arrow{font-size:1.4em;color:#728a7d;flex-shrink:0}
.lesson-order .lesson-cards{gap:.35em}
.lesson-order .lesson-card{font-size:clamp(12px,3.8cqh,23px)}
.lesson-ranks{display:grid;gap:.3em;background:#fffaf085;padding:.45em;border-radius:.6em;font-size:.8em}
.lesson-ranks small{color:#52685f}
.lesson-badge{display:inline-block;background:#e4ede3;color:var(--accent);padding:.35em .6em;border-radius:.5em;font-size:.8em;font-weight:700}
.lesson-teams{display:flex;align-items:center;justify-content:center;gap:1.1em;padding:.5em 0}
.lesson-team{display:flex;align-items:center;justify-content:center;gap:.35em;flex-wrap:wrap;width:40%;color:#694489}
.lesson-team.idle{color:#ac622c}
.lesson-team strong{flex-basis:100%;font-size:.8em;margin-top:.4em}
.lesson-person{display:inline-grid;place-items:center;width:2.7em;height:2.7em;border-radius:50%;background:#69448918;border:2px solid #69448955;color:#694489;font-weight:750}
.idle .lesson-person{color:#ac622c;border-color:#ac622c66;background:#ac622c18}
.lesson-link{width:1.7em;height:2px;background:#69448966}
.lesson-vs{font-weight:800;color:#8b9d91}
.lesson-goal{display:flex;justify-content:center;align-items:center;gap:.5em;flex-wrap:wrap}
.lesson-goal span{background:#fffaf0;border-radius:.35em;padding:.2em .45em;font-weight:750}
.lesson-goal strong{font-size:.85em;margin-left:.4em;color:var(--accent)}
.lesson-goal b{font-weight:400;color:#8b9d91}
.lesson-bid-order{font-size:.85em;line-height:1.65}
.lesson-steps{display:flex;align-items:center;justify-content:center;gap:.65em;font-size:.8em}
.lesson-steps span{background:#e4ede3;border-radius:.4em;padding:.3em .6em}
.lesson-shapes{display:grid;grid-template-columns:.8fr 1fr 1.9fr;gap:.5em}
.lesson-note{font-size:.75em;line-height:1.5;padding:.45em .8em;background:#e4ede3;border-radius:.6em}
.lesson-friend{display:flex;align-items:center;justify-content:center;gap:.8em;position:relative}
.lesson-friend-link{height:2px;background:#69448988;margin:.5em 0;transform-origin:left}
[data-active="true"] .lesson-friend-link{animation:lesson-connect 1s ease-out both}
@keyframes lesson-connect{from{transform:scaleX(0)}to{transform:scaleX(1)}}
.lesson-score{display:grid;grid-template-columns:1fr 1fr;gap:.7em}
.lesson-score>div{display:flex;align-items:center;justify-content:center;gap:.7em;padding:.4em;border-radius:.6em;background:#69448912;color:#694489}
.lesson-score>div+div{background:#ac622c12;color:#9b5423}
.lesson-score strong{font-size:1.7em}
.lesson-score span{font-size:.85em}
.lesson-multipliers{display:flex;justify-content:center;gap:2em;font-size:.9em}
.lesson-multipliers small{display:block;font-size:.7em;color:#52685f;margin-top:.2em}
.tutorial-slide:last-child .lesson-body{grid-template-columns:1fr 1fr;gap:.3em .7em;min-height:0}
.tutorial-slide:last-child .lesson-multipliers{gap:.8em;align-items:center;font-size:.8em}
.tutorial-slide:last-child .lesson-body>button{grid-column:1/-1;justify-self:center}
.panel .tutorial-nav{flex-shrink:0;display:flex;justify-content:center;align-items:center;gap:.6em;margin:0;padding:.15em .5em}
.tutorial-nav>button{background:transparent;border:0;font-size:1.4em;padding:0}
.tutorial-nav button:disabled{opacity:.2;cursor:default}
.tutorial-dots{display:flex;gap:.1em;align-items:center}
.tutorial-dots button{display:grid;place-items:center;border:0;background:transparent;min-width:28px;min-height:36px;padding:0}
.tutorial-dots span{display:block;width:7px;height:7px;border-radius:999px;background:#aebcaf;transition:width 180ms ease,background-color 180ms ease}
.tutorial-dots [aria-current="step"] span{width:21px;background:var(--accent)}
@media(prefers-reduced-motion:reduce){.lesson-friend-link{animation:none}.tutorial-dots span{transition:none}}
.panel.rulebook{width:96%;height:95%;max-height:95%;padding:.5em .85em;display:flex;flex-direction:column;overflow:hidden}
.rulebook>header{display:flex;align-items:center;justify-content:space-between;gap:1em;flex-shrink:0}
.rulebook>header h2{font-size:1.2em;margin:0}
.rulebook>footer{flex-shrink:0;margin-top:.35em}
.rules{text-align:left;white-space:normal;overflow-wrap:anywhere;font:inherit;font-size:.85em;line-height:1.7;overflow-y:auto;min-height:0;padding:.2em .4em .6em;overscroll-behavior:contain;scrollbar-width:thin;overflow-anchor:none}
.rules h3{font-size:1.3em;color:var(--accent);margin:1.3em 0 .6em;padding-bottom:.25em;border-bottom:1px solid var(--surface-edge);scroll-margin-top:.3em}
.rules h4{font-size:1.06em;margin:1.15em 0 .4em;color:#446053}
.rules p{margin:.55em 0;line-height:1.8}
.rules ul{padding-left:1.5em}
.rules-toc{display:flex;flex-wrap:wrap;gap:.35em;margin:.4em 0 .8em}
.rules-toc button{font-size:.85em;min-height:40px;font-weight:500;text-align:left;background:#e4ede3}
.rules-table{width:100%;overflow:auto;margin:.8em 0;border:1px solid var(--surface-edge);border-radius:.5em}
.rules table{width:100%;border-collapse:collapse;min-width:28em;line-height:1.6}
.rules th,.rules td{padding:.55em .75em;text-align:left;border-bottom:1px solid #c8b99866;vertical-align:top}
.rules th{background:#e4ede3;color:var(--accent);font-weight:700;white-space:nowrap}
.rules tbody tr:last-child td{border-bottom:0}
.rules tbody tr:nth-child(even){background:#fffaf080}
.rule-figure{margin:1em 0;padding:.8em;background:#edf1e570;border:1px solid #c8b99888;border-radius:.7em;overflow-x:auto}
.rule-figure .lesson-cards{gap:.55em;width:max-content;min-width:100%;padding:.2em}
.rule-figure .lesson-card{font-size:clamp(16px,5cqh,26px)}
.rule-figure .lesson-card small{font-size:.64em}
.rule-figure .card{width:2.35em;height:3.3em;--corner-size:.9em}
.rule-figure-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1em;text-align:center;min-width:30em}
.rule-figure-columns strong{font-size:.9em;color:var(--accent)}
.rule-figure figcaption{font-size:.85em;color:#52685f;line-height:1.6;margin-top:.7em;text-align:center}
.calling{inset:0 0 25%}
.call-grid{display:grid;grid-template-columns:1fr;gap:.4em}
.call-grid.notrump{grid-template-columns:1fr 1fr}
.call-grid .cards{font-size:clamp(13px,4cqh,20px);--step:1.75em}
.call-grid .card{height:max(44px,3.2em)}
.panel.result-grid{display:grid;width:fit-content;height:auto;max-width:94%;max-height:94%;grid-template-columns:minmax(7.2em,.85fr) minmax(0,1.45fr) minmax(9em,1.15fr);grid-template-rows:auto auto auto;gap:.55em .65em;align-items:center;padding:.7em .85em}
.result-grid h2{grid-area:1/2;font-size:clamp(22px,6.6cqh,40px);margin:0;overflow-wrap:anywhere}
.result-bottom{grid-area:2/2;min-width:0}
.result-bottom .bottom-cards{width:100%;font-size:clamp(13px,4.3cqh,23px)}
.result-bottom .cards{display:grid;grid-template-columns:repeat(var(--bottom-columns,5),minmax(0,2.7em));gap:.2em}
.result-bottom .card{width:100%;height:3.15em}
.result-grid footer{grid-area:3/2;margin:0}
.result-score{grid-area:1/1/4/2}
.result-list{grid-area:1/3/4/4}
.result-score,.result-list{min-width:0;margin:0;padding:.45em .5em;border-radius:.55em;background:#fffaf0;text-align:left;font-size:1em}
.result-score div,.result-list li{display:flex;justify-content:space-between;gap:.35em;padding:.18em 0}
.result-score dd{margin:0;font-weight:750}
.result-list li > span:first-child{min-width:0;overflow-wrap:anywhere}
.result-list li > span:last-child{white-space:nowrap}
.result-list .up{font-weight:750}
.result-list .down{font-weight:400}
.experience-hint{font-size:.85em;color:#4f665d}
.experience-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6em;text-align:left;font-size:.85em}
.experience-grid article{background:#fffaf0;border-radius:.6em;padding:.65em}
.experience-grid h3{margin:0}
.experience-grid ul{margin:.3em 0 0;padding-left:1.25em}
.experience-grid summary{cursor:pointer;line-height:1.5;padding:.4em 0}
.experience-grid h4{margin:.65em 0 .25em;font-size:1em;color:var(--accent)}
.experience-grid li{line-height:1.6;margin-bottom:.45em}
.experience-conclusion{background:#e4ede3;border-left:3px solid var(--accent);padding:.6em;border-radius:.35em;line-height:1.7}
.experience-public{text-align:left;font-size:.85em;padding:.6em;background:#edf1e5;border-radius:.6em;margin:.7em 0}
.experience-public h3{margin:0 0 .4em;font-size:1.1em}
.experience-public summary{cursor:pointer;line-height:1.5;padding:.4em 0}
.experience-public li{line-height:1.6;margin:.4em 0}
.panel.replay-panel{width:97%;height:96%;max-height:96%;display:flex;flex-direction:column;overflow:hidden;padding:.4em .65em;text-align:left}
.replay-panel>header{display:flex;align-items:center;justify-content:space-between;gap:.5em;flex-shrink:0}
.replay-panel h2{font-size:1.15em;margin:0}
.replay-panel select{font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--surface-edge);border-radius:.5em;padding:.3em;max-width:45%;min-height:40px}
.replay-content{flex:1;min-height:0;overflow:auto;padding:.25em .1em;scrollbar-width:thin;overscroll-behavior:contain}
.replay-note,.replay-content p{font-size:.75em;line-height:1.6}
.replay-opening{background:#e4ede3;border-radius:.5em;padding:.35em .65em;font-size:.8em;margin:.35em 0}
.replay-panel summary{cursor:pointer;padding:.2em 0;line-height:1.5}
.replay-panel h3{font-size:.95em;margin:.5em 0}
.replay-panel h4{font-size:.85em;margin:.3em 0}
.replay-plays{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.4em;align-items:start}
.replay-plays article{background:#fffaf0;border:1px solid var(--surface-edge);border-radius:.55em;padding:.3em;text-align:center;min-width:0}
.replay-plays article.replay-winner{border:2px solid #b58a35;background:#fff5d8}
.replay-plays h4{display:flex;align-items:center;justify-content:center;gap:.35em;flex-wrap:wrap}
.replay-plays small{font-size:.7em;font-weight:400;color:#52685f}
.replay-cards{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:.16em;font-size:clamp(13px,3.5cqh,18px);padding:.15em 0}
.replay-cards .card{width:2.25em;height:3.1em;--corner-size:.92em}
.replay-plays details{font-size:.65em}
.replay-analysis{font-size:.8em;padding:.4em;margin-top:.5em;background:#edf1e5;border-radius:.5em}
.replay-panel>footer{flex-shrink:0;margin:.3em 0 0;gap:.35em;font-size:.8em}
.replay-panel button:disabled{opacity:.35;cursor:default}
@container (max-height: 350px){
  .home h1{font-size:2.35em;margin-bottom:.4em}
  .menu{gap:.3em}
  .seat{font-size:.88em}
  .call-grid .card{height:44px}
  .calling .panel h2{font-size:1em;margin-bottom:.3em}
  .panel footer{margin-top:.4em}
}
@media (prefers-reduced-motion:reduce){
  button:not(.card){transition:none}
  .played-cards{transition:none}
  .mode-option input::after{transition:none}
}

.replay-trick{padding:.55em 0 .85em;border-top:1px solid var(--surface-edge);margin-top:.6em}.replay-trick>h3{margin-top:0}.replay-panel>footer .replay-note{margin-right:auto}.replay-content{overflow-x:hidden;scroll-behavior:smooth}
@media(prefers-reduced-motion:reduce){.replay-content{scroll-behavior:auto}}

/* Only the interactive hand owns drag selection; reading surfaces keep native panning. */
.hand .card{touch-action:none}
.replay-content,.tutorial-track,.tutorial-slide,.rules{touch-action:auto;-webkit-overflow-scrolling:touch}
.replay-content .card,.tutorial .card,.rules .card{touch-action:auto}

/* Touch scrolling is routed in app coordinates; mouse/keyboard native scrolling remains available. */
.replay-content,.replay-content *,.tutorial-track,.tutorial-track *{touch-action:none}
.tutorial-track,.replay-content{min-width:0}

.bid-history{position:relative;font-size:.8em}.bid-history summary{cursor:pointer;white-space:nowrap;padding:.25em}.bid-history>div{position:absolute;top:100%;left:0;min-width:12em;max-width:55cqw;padding:.6em;background:var(--surface);border:1px solid var(--surface-edge);border-radius:.5em;box-shadow:0 .2em .6em #243d3430;z-index:12;line-height:1.6}.table-meta:has(.bid-history[open]){z-index:12}

.records-title{display:flex;align-items:center;gap:.12em;min-width:0}.records-name{max-width:35cqw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.records-title .edit-name{display:inline-flex;align-items:center;justify-content:center;padding:0;background:transparent;border:0;flex:none;color:var(--accent)}

/* Archive and read-only re-enactment share the existing table colours. */
.replay-library{display:flex;flex-direction:column;justify-content:flex-start;place-content:normal;padding:.55em .8em;gap:.4em;text-align:left;min-height:0}
.replay-library>header,.reenactment>header{display:flex;align-items:center;justify-content:space-between;gap:.5em;flex:none}
.replay-library h2,.reenactment h2{margin:0;font-size:1.2em}
.library-filters{display:flex;align-items:center;gap:.4em;flex-wrap:wrap;font-size:.8em}
.library-filters select{font:inherit;background:var(--surface);border:1px solid var(--surface-edge);border-radius:.6em;padding:.3em;min-height:44px;color:var(--ink)}
.library-filters [aria-pressed=true]{background:var(--accent);color:white}
.library-list{width:100%;min-height:0}
.replay-library-row{display:flex;align-items:center;justify-content:space-between;gap:.6em;background:var(--surface);border:1px solid var(--surface-edge);border-radius:.7em;padding:.5em .65em;margin-bottom:.4em}
.replay-library-row h3{font-size:.9em;margin:0}.replay-library-row p{margin:.3em 0 0;font-size:.65em}
.library-row-actions{display:flex;gap:.3em;font-size:.75em;flex:none}.library-empty{padding:1em}
.reenactment{width:100%;height:100%;display:flex;flex-direction:column;gap:.3em;padding:.4em .6em;background:radial-gradient(ellipse,#edf4e9,var(--table))}
.reenactment>header p{font-size:.65em;margin:.25em 0 0;line-height:1.5}
.reenactment>header>div:last-child{display:flex;gap:.3em;font-size:.7em;flex:none}
.reenact-board{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:minmax(0,1fr) auto minmax(0,1fr);gap:.35em;flex:1;min-height:0}
.reenact-player,.reenact-out{background:#f8f0dcbd;border:1px solid var(--surface-edge);border-radius:.6em;padding:.25em;min-width:0;min-height:0;overflow:hidden}
.reenact-player h3,.reenact-out h3{font-size:.7em;line-height:1.5;margin:0 0 .2em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reenact-player h3 small{font-size:.85em;font-weight:400;margin-left:.4em}
.reenact-hand,.reenact-cards{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));grid-auto-rows:3em;padding-right:1.2em;row-gap:.12em;font-size:clamp(11px,3.3cqh,16px)}
.reenact-hand .card,.reenact-cards .card{width:2.15em;height:3em;--corner-size:.95em}
.reenact-out.replay-winner{border:2px solid #b58a35;background:#fff5d8}
.reenact-out>small{font-size:.55em}
.reenact-controls{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:.65em;position:relative;padding:.1em 0}
.reenact-controls button{width:48px;height:44px;min-height:44px;padding:0;font-size:1.25em;border-radius:999px}
.reenact-controls>span{position:absolute;left:calc(50% + 105px);right:0;font-size:.6em;line-height:1.5}
.reenact-bottom{position:relative;flex:none;font-size:.65em}.reenact-bottom summary{cursor:pointer;min-height:26px;padding:.15em}
.reenact-bottom>div{position:absolute;bottom:100%;left:0;right:0;z-index:4;display:flex;align-items:center;gap:.15em;padding:.5em;background:var(--surface);border:1px solid var(--surface-edge);border-radius:.5em}
.reenact-bottom .card{font-size:14px;width:2.2em;height:3.1em;--corner-size:.9em}.reenact-bottom>div>span:last-child{margin-left:.6em}
@container(max-height:350px){.reenactment{gap:.1em;padding:.2em .5em}.reenact-player h3 small{display:block;margin-left:0}.reenact-player h3{line-height:1.2}.reenact-controls button{height:40px;min-height:40px}.reenact-hand,.reenact-cards{font-size:11px;grid-auto-rows:2.8em}.reenact-hand .card,.reenact-cards .card{height:2.8em}}

@container(max-height:350px){.reenact-board{gap:.2em}.reenact-player h3,.reenact-out h3{font-size:.6em;margin-bottom:.1em}.reenact-player h3 small{display:inline;margin-left:.25em}.reenact-hand,.reenact-cards{grid-auto-rows:2.5em}.reenact-hand .card,.reenact-cards .card{height:2.5em}.reenact-bottom summary{min-height:22px}}

.reenact-score{position:absolute;left:0;right:calc(50% + 110px);text-align:center;font-size:.75em;line-height:1.35}
.reenact-score b{font-size:1.35em;margin-left:.25em}.reenact-score small{display:block;font-size:.8em;min-height:1.2em}
.reenact-score .reenact-score-delta{position:absolute;top:-.4em;right:.5em;font-size:1em;font-weight:750;color:var(--accent);animation:replay-score-rise 1800ms ease-out both}
.reenact-out.reenact-latest .reenact-cards{animation:replay-card-appear 200ms ease-out both}
@keyframes replay-score-rise{0%{opacity:0;transform:translateY(.5em)}15%,65%{opacity:1}100%{opacity:0;transform:translateY(-.7em)}}
@keyframes replay-card-appear{from{opacity:.45;transform:translateY(.3em)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.reenact-score .reenact-score-delta,.reenact-out.reenact-latest .reenact-cards{animation:none}}

.table-meta .bid-history>div{left:auto;right:0;max-width:65cqw;text-align:left}.table-meta .bid-source{max-width:100%}.table-meta .trump-faces{flex:none}.table .back{z-index:3}


.table-meta .bid-source,.table-meta .bid-history{font-size:1em}.table-meta .trump-faces{font-size:1em}.table-meta .trump-faces .card{--corner-size:.85em}

.table-meta .bid-source,.table-meta .friend-call{font-weight:400}
.table-meta .seen-count,.table-meta .bid-history{font-size:.88em;font-weight:400}
.table-meta .bid-history[data-compact=false]{flex-basis:100%;width:100%;margin-top:.08em}
.table-meta .bid-history[data-compact=false]>summary{display:none}
.table-meta .bid-history[data-compact=false]>div{display:block;position:static;min-width:0;max-width:none;padding:0;border:0;border-radius:0;box-shadow:none;background:none;text-align:right;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
.table-meta .bid-history[data-compact=true]{flex:none}
.table-meta .bid-history[data-compact=true]>div{max-width:min(65cqw,28em)}

.played .star{left:auto;right:1px;bottom:1px}

.result-overlay{z-index:40}.result-heading{grid-area:1/2;text-align:center;min-width:0}.result-heading p{font-size:1em;font-weight:650;margin:.25em 0 0}.result-heading small{display:block;font-size:.75em;margin-top:.2em}.result-bottom .cards .card + .card{margin-left:0}.result-grid footer{flex-wrap:wrap;gap:.35em;font-size:.9em}.result-list{font-size:.98em}

.status-cards{display:inline-flex;align-items:center;gap:.3em;font-weight:400;white-space:nowrap}.status-card-label{display:inline-flex;align-items:baseline;gap:.08em;white-space:nowrap}.status-suit.red,.status-joker.red{color:#b72e3e}.status-suit.black{color:#1e2825}.status-joker.blue{color:#1769bb}

.actions .bid-intent:disabled{background:#d5dcd6;color:#78877e;border-color:#c1cac2;cursor:default;box-shadow:none;opacity:.7}.bid-paused{color:var(--accent);font-weight:650}.bid-hint:has(.bid-paused){font-size:.9em}
.stage:has(.bid-hint){z-index:3}

.replay-round-title{display:flex;align-items:center;gap:.4em;min-width:0}.replay-outcome{display:inline-grid;place-items:center;font-size:1.8em;font-weight:800;line-height:1;flex:none}.replay-outcome.win{color:#236547}.replay-outcome.loss{color:#b72e3e}.replay-outcome.unknown{color:#6d7d73;font-size:1.2em}.replay-round-title>span:last-child{min-width:0}

.result-score dt{white-space:nowrap}

.card.illustrated-joker .corner{top:.15em;left:.1em;bottom:.35em;width:.5em;z-index:2}
.card.illustrated-joker .joker{display:block;width:100%;height:100%}
.card .joker-art{position:absolute;left:.62em;top:.18em;width:calc(100% - .7em);height:calc(100% - .36em);object-fit:contain;pointer-events:none;user-select:none;-webkit-user-drag:none}
.card.illustrated-joker .star{z-index:3}
.reenact-hand .joker-art{display:none}.reenact-hand .card.illustrated-joker .corner{left:.12em;top:.12em;bottom:.2em;width:.8em}

.library-round-info{flex:1;min-width:0}.replay-final-score{flex:none;min-width:3.5em;text-align:right;line-height:1.1;font-variant-numeric:tabular-nums}.replay-final-score strong{display:block;font-size:1.62em;font-weight:800}.replay-final-score small{display:block;font-size:.65em;margin-top:.25em}
.reenactment>header>.reenact-header-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;max-width:55%;font-size:.8em;gap:.35em}
.reenactment .reenact-call{display:flex;align-items:center;gap:.3em;margin:0;font-size:1em;line-height:1.3;white-space:nowrap}
.reenact-player.team-banker,.reenact-out.team-banker{background:#efe7f5;border-color:#694489}
.reenact-player.team-defender,.reenact-out.team-defender{background:#fff1d6;border-color:#a34e24}
.reenact-player.team-banker h3,.reenact-out.team-banker h3{color:#694489}.reenact-player.team-defender h3,.reenact-out.team-defender h3{color:#843c1a}
.reenact-out.replay-winner{box-shadow:inset 0 0 0 2px #b58a35}
.reenact-banker-badge{display:inline-block;margin-right:.3em;padding:.15em .3em;border-radius:.35em;background:#694489;color:#fff;font-size:1em;line-height:1.15;font-weight:800;vertical-align:middle}
.reenact-player.is-banker{border-width:2px}.reenact-player h3{display:flex;align-items:center;gap:.15em}.reenact-player h3>span{overflow:hidden;text-overflow:ellipsis;min-width:0}.reenact-player h3 small{flex:none}

.call-announcement{display:inline-flex;align-items:center;justify-content:center;gap:.2em;white-space:nowrap;font-size:clamp(18px,3.4cqw,28px);line-height:1.4;color:var(--ink);background:#f8f0dcbb;border:1px solid var(--surface-edge);border-radius:.65em;padding:.5em .85em;max-width:100%}

.reenactment .reenact-call{font-size:1.2em;padding:.25em .5em;border:2px solid #b58a35;border-radius:.55em;background:#fff4d9;box-shadow:0 1px 4px #60491c18}.reenact-call>.status-card-label{font-size:1.45em;font-weight:800}.reenact-personal-score{display:inline-flex;align-items:baseline;gap:.1em;flex:none;white-space:nowrap;margin-left:auto;padding:.12em .3em;border-radius:999px;background:#fffaf0;border:1px solid #d1c4a7;color:var(--ink);line-height:1.1}.reenact-personal-score b{font-size:1.08em;font-variant-numeric:tabular-nums}

/* Optional trace table. Current plays and history keep independent coordinates. */
.settings{overflow-y:auto;place-content:safe center;padding:.5em}
.settings .mode-panel{padding:.65em 1em}.settings .mode-panel h2{margin-bottom:.3em}.settings .mode-panel p{margin:.25em 0;font-size:.72em}
:is(.trace-table,.trace-avatar-table) .seat{width:7%;height:auto;transform:none;z-index:2}
:is(.trace-table,.trace-avatar-table) .seat b{width:100%;min-width:0;border-radius:.55em .55em .15em .15em;height:2.15em}
:is(.trace-table,.trace-avatar-table) .seat small{position:static;background:#f8f0dcc9;padding:.2em 0;border-radius:0 0 .4em .4em;font-size:.75em}
:is(.trace-table,.trace-avatar-table) .seat .tags{top:0;left:100%;transform:none;font-size:.57em;max-width:160%;width:max-content;gap:.1em}
:is(.trace-table,.trace-avatar-table) .seat-0{left:1%;bottom:2%;top:auto}:is(.trace-table,.trace-avatar-table) .seat-0 .tags{top:auto;bottom:calc(100% + .2em);left:50%;transform:translateX(-50%)}
:is(.trace-table,.trace-avatar-table) .seat-1{left:1%;top:40%;bottom:auto}:is(.trace-table,.trace-avatar-table) .seat-2{left:10%;top:1%;bottom:auto}
:is(.trace-table,.trace-avatar-table) .seat-3{left:auto;right:14.5%;top:1%;bottom:auto}:is(.trace-table,.trace-avatar-table) .seat-4{left:auto;right:1%;top:40%;bottom:auto}
:is(.trace-table,.trace-avatar-table) .seat-4 .tags{left:auto;right:100%}
:is(.trace-table,.trace-avatar-table) .seat-2 .tags,:is(.trace-table,.trace-avatar-table) .seat-3 .tags{top:100%;left:0;transform:none;font-size:.5em}
:is(.trace-table,.trace-avatar-table) .seat b.team-banker{background:#694489;border-color:#50316d}
.trace-table .table-meta{top:1%;right:.5%;width:13%;font-size:clamp(9px,calc(32cqh / (var(--trace-info-lines) * 1.2)),15px);line-height:1.1;text-align:left;z-index:2}
.trace-meta>div{margin:0;overflow-wrap:anywhere}.trace-meta .trace-info-title{color:#4c655a}.trace-meta .status-card-label{display:inline-flex;gap:.1em}.trace-meta .seen-count{font-size:.88em}
.trace-table .status-points{top:1%;left:42%;font-size:1em}.trace-table .status-points b{display:block;font-size:1.35em;margin:0}
.trace-table .hand{position:absolute;left:10%;right:1%;bottom:1%;height:19%;grid-area:auto}.trace-table .hand .card{height:min(2.95em,17cqh)}
.trace-table .stage{position:absolute;left:26%;right:26%;top:26%;bottom:34%;grid-area:auto;overflow:visible;display:block;isolation:isolate}
.trace-table .stage .trick-board{position:absolute;inset:0;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:.2em}
.trace-table .stage .actions,.trace-table .stage:not(.has-trick) .actions{position:absolute;bottom:0;left:0;right:0;gap:.2em;flex-wrap:nowrap;font-size:.82em}
.trace-table .stage .actions button{min-height:36px;min-width:44px;padding:.22em .45em;border-radius:.45em}
.trace-table .stage .notice{position:absolute;left:0;right:0;bottom:100%;font-size:.68em;z-index:4}
.trace-table .stage .center{position:absolute;inset:0;display:grid;place-content:center;font-size:.85em}.trace-table .stage .failed-cards{font-size:14px}
.trace-table .played{font-size:clamp(18px,3cqw,25px)}
.trace-table .played-2,.trace-table .played-3{transform:translateY(-1.1em)}
.trace-table .played-cards{width:90%}.trace-table .played .card{height:calc(2.35em / var(--rows));--card-width:min(2.1em,40cqw);--corner-size:min(1.02em,calc((100cqw - var(--card-width)) / var(--gaps) * .85),calc(1.1em / var(--rows) + .1em))}
.trace-table .played-3 .cards,.trace-table .played-4 .cards{justify-content:flex-end}
.trace-pile{position:absolute;pointer-events:none;z-index:0;font-size:clamp(10px,1.55cqw,15px);--trace-width:2.1em;--trace-height:3em;--trace-step:1.1em;width:0;height:0}
.trace-pile-1,.trace-pile-4{--trace-width:min(2.1em,2.8cqw)}
.trace-card{position:absolute;left:calc(var(--trace-column) * var(--trace-step));top:0;display:block;width:var(--trace-width);height:var(--trace-height)}
.trace-card.trace-next-row{left:calc(var(--trace-second-x) + var(--trace-column) * var(--trace-step));top:var(--trace-second-y)}
.trace-pile .card{width:var(--trace-width);height:var(--trace-height);--corner-size:1em;border-radius:.22em;box-shadow:0 1px 2px #263e3420;transform:none}
.trace-pile .card .corner{left:.5px;right:auto;top:1px;line-height:.88;text-align:left}
.trace-pile .card .mark{letter-spacing:-.1em;transform:scaleX(.9);transform-origin:left center}
.trace-pile .card .star{left:1px;right:auto;bottom:1px;font-size:.5em;line-height:1}
.trace-card:not(:last-child) .card{clip-path:inset(0 calc(100% - var(--trace-step)) 0 0);box-shadow:none}
.trace-pile .joker-art{opacity:.6}.trace-pile .trace-scored .card{filter:grayscale(1) brightness(.73);opacity:.68}
.trace-pile-0{left:29%;bottom:23%;top:auto;height:var(--trace-height)}
.trace-flight{z-index:6;overflow:visible}.trace-flight .card{transform-origin:top left}
@media(max-height:420px){.trace-pile{--trace-height:2.45em;font-size:clamp(10px,1.55cqw,13px)}:is(.trace-table,.trace-avatar-table) .seat b{height:1.8em}:is(.trace-table,.trace-avatar-table) .seat .tags{font-size:.5em}.trace-table .back button{padding:.35em .65em}}

:is(.trace-table,.trace-avatar-table) .seat:not(.seat-0) .tags{top:calc(100% + var(--trace-label-offset,44px));left:0;right:auto;transform:none}
.trace-table .played{font-size:clamp(20px,19cqh,25px)}
.trace-table .played-3{padding-right:.8em}
.trace-table .played-1{padding-left:.8em}
.trace-table .played-4{transform:translateY(.4em)}

/* Right-side players extend both history rows toward the center. */
.trace-pile-3 .trace-card,.trace-pile-4 .trace-card{left:calc(-1 * var(--trace-column) * var(--trace-step))}
.trace-pile-3 .trace-card.trace-next-row,.trace-pile-4 .trace-card.trace-next-row{left:calc(var(--trace-second-x) - var(--trace-column) * var(--trace-step))}
.trace-pile-3 .card .corner,.trace-pile-4 .card .corner{left:auto;right:.5px;text-align:right}
.trace-pile-3 .card .mark,.trace-pile-4 .card .mark{transform-origin:right center}
.trace-pile-3 .card .star,.trace-pile-4 .card .star{left:auto;right:1px}
.trace-pile-3 .trace-card:not(:last-child) .card,.trace-pile-4 .trace-card:not(:last-child) .card{clip-path:inset(0 0 0 calc(100% - var(--trace-step)))}

/* Larger trace faces; the upper first rows begin at the phone edges. */
.trace-pile{font-size:clamp(12px,2cqw,18px)}
.trace-pile-1,.trace-pile-4{--trace-width:min(2.1em,3.4cqw)}
.trace-pile-0{left:20%}
.trace-table .played-4{transform:translateY(.65em)}
@media(max-height:420px){.trace-pile{font-size:clamp(12px,2cqw,16px)}}

.trace-table .status-points{left:47%}
.trace-table .played-1{padding-left:1.4em}

/* Center the user's actual trace pack, keeping the same face size. */
.trace-pile-0{--trace-step:.95em}
.trace-pile-0 .card .mark{transform:scaleX(.8)}
.trace-pile-0 .card .suit{transform:scaleX(.85);transform-origin:left center}
.trace-table .status-points{left:50%}
.trace-table .played-0 .cards{justify-content:center}
.trace-table .stage .actions button{min-height:30px;min-width:54px;padding:.12em .7em}
.trace-table .table-meta{width:14%;font-size:clamp(12px,1.8cqw,16px)}
:is(.trace-table,.trace-avatar-table) .seat-3{right:15%}
:is(.trace-table,.trace-avatar-table) .seat-4{top:31%}
.trace-table .played-3{padding-right:2.4em}
.trace-table .played-4{transform:translateY(.1em)}
@container(max-width:700px){.trace-table .status-points{font-size:.88em}}

.trace-table .played-3{padding-right:0;transform:translate(-1.85em,-1.1em)}
.trace-table .played-4{transform:translateY(-.05em)}

.trace-table .status-points{padding:.15em 0}
@container(max-width:700px){.trace-table .status-points{font-size:.84em}}

/* Roles sit below each avatar, before that player's first trace row. */
:is(.trace-table,.trace-avatar-table) .seat .tags,:is(.trace-table,.trace-avatar-table) .seat:not(.seat-0) .tags,:is(.trace-table,.trace-avatar-table) .seat-0 .tags{top:calc(100% + 2px);bottom:auto;left:50%;right:auto;transform:translateX(-50%);justify-content:center}
:is(.trace-table,.trace-avatar-table) .seat-0{bottom:8%}
.trace-table .table-meta{font-size:.82em;max-height:calc(30cqh - 3px);overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
.trace-table .table-meta .seen-count{font-size:1em}

.trace-table .table-meta{scrollbar-width:none}
.trace-table .table-meta::-webkit-scrollbar{display:none}

.trace-table .trace-meta{display:flex;flex-direction:column;overflow:hidden}
.trace-meta>div{flex:none}
.trace-meta .trace-bid-lines{flex:0 1 auto;min-height:0;overflow-y:auto;touch-action:pan-y;overscroll-behavior:contain;scrollbar-width:none}
.trace-bid-lines::-webkit-scrollbar{display:none}

/* Trace history exposes only rank/suit, while live played cards retain their stars. */
.trace-pile,.trace-pile-0{--trace-step:.9em}
.trace-pile .card .star{display:block}
.trace-pile .card .mark{transform:scaleX(.8)}
.trace-pile .card .suit{transform:scaleX(.85);transform-origin:left center}
.trace-pile-3 .card .suit,.trace-pile-4 .card .suit{transform-origin:right center}

:is(.trace-table,.trace-avatar-table) .seat-0,:is(.trace-table,.trace-avatar-table) .seat-1,.trace-pile-0,.trace-pile-1{transform:translateY(var(--trace-lower-shift,.9em))}

/* Role text belongs inside the avatar, to the right of the player's name. */
.seat b .seat-name{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.seat b:has(.avatar-role){display:inline-flex;justify-content:center;align-items:center;gap:.2em;padding:.2em .3em}
.seat b:has(.avatar-role) .seat-name{flex:0 1 auto}
.seat .avatar-role{flex:none;writing-mode:vertical-rl;text-orientation:upright;font-size:.62em;line-height:1.05;letter-spacing:.02em;color:inherit}

:is(.trace-table,.trace-avatar-table) .seat b:has(.avatar-role){padding:.16em .08em;gap:.1em}

/* Names wrap and fit within the fixed avatar, preserving full text and role space. */
.seat b .seat-name{display:block;width:100%;max-width:100%;max-height:none;min-width:0;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;word-break:break-all;line-height:1.05;text-align:center}
.seat b:has(.avatar-role) .seat-name{flex:1 1 0}

.seat b:has(.seat-name){padding:.16em .08em}

:is(.trace-table,.trace-avatar-table) .seat-4,.trace-pile-4{transform:translateY(var(--trace-ding-shift,1.8em))}

:is(.trace-table,.trace-avatar-table) .seat-2{transform:translateX(var(--trace-yi-avatar-shift,1em))}

/* The current-turn outline encloses the name, internal role and level together. */
.seat .avatar-frame{display:inline-flex;flex-direction:column;align-items:stretch;max-width:100%;vertical-align:top;border-radius:.6em}
.seat .avatar-frame>small{position:static;width:100%;margin-top:.18em}
:is(.trace-table,.trace-avatar-table) .avatar-frame{width:100%;border-radius:.55em .55em .4em .4em}
:is(.trace-table,.trace-avatar-table) .avatar-frame>small{margin-top:0}
.seat .avatar-frame.turn{outline:3px solid #648d7a;outline-offset:2px}

.trace-pile .trace-row-end{z-index:1}
.trace-pile .trace-row-end .card{clip-path:none;box-shadow:0 1px 2px #263e3420}

/* User history starts at the far right and grows leftwards. */
.trace-pile-0 .trace-card{left:calc(-1 * var(--trace-column) * var(--trace-step))}
.trace-pile-0 .card .corner{left:auto;right:.5px;text-align:right}
.trace-pile-0 .card .mark,.trace-pile-0 .card .suit{transform-origin:right center}
.trace-pile-0 .card .star{left:auto;right:1px}
.trace-pile-0 .trace-card:not(:last-child) .card{clip-path:inset(0 0 0 calc(100% - var(--trace-step)))}

:is(.trace-table,.trace-avatar-table) .seat-3{transform:translateX(calc(-1 * var(--trace-bing-avatar-shift,1em)))}

.seat .avatar-role{transform:translateX(-.5em)}

.trace-pile-0{transform:translateY(calc(var(--trace-lower-shift,.9em) - 1em))}

.table .table-meta{text-align:center}
.table-meta .trump-line{justify-content:center}
.table-meta .bid-history[data-compact=false]>div{text-align:center}
.trace-meta .trace-bid-lines>div{text-align:center}

.trace-table .trace-pile-0{bottom:auto;transform:none}

/* Center polish: keep all manually positioned seats and history areas untouched. */
.trace-table .stage{left:24%;right:24%;top:25%;bottom:32%}
.trace-table .stage .play-actions{gap:12px;align-items:center}
.trace-table .stage .play-actions>button{min-width:64px;min-height:40px;padding:.35em .85em;border-radius:.55em}
.trace-table .stage .play-actions>button.primary{min-width:78px;min-height:42px;box-shadow:0 3px 8px #234e6526}
.trace-table .stage .play-actions>button.primary:active{box-shadow:0 1px 3px #234e6520}
.trace-table .play-aux{position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);display:flex;justify-content:center;pointer-events:auto}
.trace-table .stage .play-aux button{min-height:36px;min-width:54px;padding:.25em .65em;border-radius:.5em;background:#f8f0dce6}
.trace-table .played{font-size:clamp(24px,7.5cqw,28px)}
.trace-table .played-cards{width:96%}
.trace-table .played .card{height:calc(2.45em / var(--rows));--card-width:min(2.1em,43cqw);--corner-size:min(1.06em,calc((100cqw - var(--card-width)) / var(--gaps) * .88),calc(1.1em / var(--rows)))}
.trace-table .played-1{padding-left:.4em}
.trace-table .played-4{transform:translate(-.7em,-.05em)}

/* Stable central slots keep multi-card plays away from controls and one another. */
.trace-table .played-2,.trace-table .played-3,.trace-table .played-1,.trace-table .played-4{position:absolute;grid-area:auto;padding:0}
.trace-table .played-2{left:5%;top:0;width:32%;height:50%;transform:translateY(-1.1em)}
.trace-table .played-3{left:54%;top:0;width:31%;height:50%;transform:translateY(-1.1em)}
.trace-table .played-1{left:3%;top:50%;width:23%;height:50%;transform:none}
.trace-table .played-4{left:73%;top:50%;width:24%;height:50%;transform:none}
.trace-table .played .cards{justify-content:center}
.trace-table .is-leading .played-cards:has(.card:nth-child(3)){transform:scale(1.15)}
.trace-table .played-cards:has(>.cards:only-child>.card:only-child) .card{--card-width:min(2.1em,90cqw)}
@container(max-width:700px){.trace-table .stage .play-actions>button{min-width:60px}.trace-table .stage .play-actions>button.primary{min-width:74px}}

.trace-table .stage.bottom-preview .play-aux{visibility:hidden}
.trace-table .stage:has(.notice) .play-aux{visibility:hidden}
.trace-table .stage .notice{left:30%;right:30%;top:calc(100% - 90px);bottom:auto;padding:.3em .45em;line-height:1.3}

.trace-table .stage.bottom-preview .center{bottom:60px}
.trace-table .stage.bottom-preview .bottom-cards{width:80%;font-size:clamp(13px,2.1cqw,17px)}
.trace-table .stage.bottom-preview .bottom-cards .cards{display:grid;grid-template-columns:repeat(var(--bottom-preview-cols),minmax(0,1fr));gap:3px;justify-items:center}
.trace-table .stage.bottom-preview .bottom-cards .card{--card-width:2.4em;height:2.75em;margin:0}
.trace-table .stage.bottom-preview .bottom-cards .star{left:auto;right:2px;bottom:1px;font-size:.55em}

.trace-pile .trace-card.trace-row-end .card{clip-path:none}

/* Complete left endpoints use the normal face, not the right-edge stack corner. */
:is(.trace-pile-0,.trace-pile-3,.trace-pile-4) .trace-row-end .card .corner{left:.5px;right:auto;text-align:left}
:is(.trace-pile-0,.trace-pile-3,.trace-pile-4) .trace-row-end .card .mark,:is(.trace-pile-0,.trace-pile-3,.trace-pile-4) .trace-row-end .card .suit{transform:none;transform-origin:left center}
:is(.trace-pile-0,.trace-pile-3,.trace-pile-4) .trace-row-end .card .mark{letter-spacing:-.045em}
:is(.trace-pile-0,.trace-pile-3,.trace-pile-4) .trace-row-end .card .star{left:1px;right:auto}

/* Inspect one public trick across all five history areas without changing layout. */
button.trace-card{min-width:0;min-height:0;padding:0;border:0;border-radius:0;background:transparent;font:inherit;color:inherit;pointer-events:auto;touch-action:manipulation;transition:transform 160ms cubic-bezier(.2,.8,.2,1)}
button.trace-card:hover,button.trace-card:active{background:transparent}
button.trace-card:active{transform:none}
.trace-pile.is-inspecting{z-index:5}
.trace-pile .trace-card.is-lifted{transform:translateY(-.65em);z-index:4}
.trace-pile .trace-card.is-lifted .card{clip-path:none;outline:2px solid #b58a35;outline-offset:1px;box-shadow:0 3px 9px #344b4155}
.trace-card:focus-visible{outline:2px solid #648d7a;outline-offset:2px}
@media(prefers-reduced-motion:reduce){button.trace-card{transition:none}}

/* Full lower-row endpoints keep a regular 5:7 card face without changing the stack anchors. */
.trace-pile .trace-normal-bottom-end .card{width:calc(var(--trace-height) * 5 / 7);height:var(--trace-height);clip-path:none}
.trace-pile-4 .trace-normal-bottom-end .card{margin-left:calc(var(--trace-width) - var(--trace-height) * 5 / 7)}

/* One continuous rounded frame encloses each player's avatar and level. */
.seat .avatar-frame{border-radius:.55em;box-shadow:0 0 0 1px #65796b99;overflow:hidden;background:var(--surface)}
:is(.trace-table,.trace-avatar-table) .avatar-frame{border-radius:.55em}
.seat .avatar-frame>b{border-radius:0;border:0}
.seat .avatar-frame>small{margin-top:0;border-radius:0}

/* Mirrored landing slots around the central vertical axis. */
.trace-table .played-2{left:8%;width:32%}
.trace-table .played-3{left:60%;width:32%}
.trace-table .played-1{left:3%;width:24%}
.trace-table .played-4{left:73%;width:24%}
.trace-pile .trace-card.is-lifted.trace-scored .card{filter:grayscale(1) brightness(.73);opacity:1}

/* All five live card faces share a 5:7 ratio; only uniform scaling marks the leader. */
.played .card{--played-face-height:min(2.35em,calc(((50cqh - 3px) / var(--rows) - 1px) / 1.3));--card-width:min(calc(var(--played-face-height) * 5 / 7),24cqw);height:auto;aspect-ratio:5 / 7}
.trace-table .played .card{--played-face-height:calc(2.45em / var(--rows));--card-width:min(calc(var(--played-face-height) * 5 / 7),43cqw);height:auto;aspect-ratio:5 / 7}
.trace-table .played-cards:has(>.cards:only-child>.card:only-child) .card{--card-width:min(calc(var(--played-face-height) * 5 / 7),90cqw)}

/* Pastel team pigments blend behind every interactive element. */
.team-wash{position:absolute;inset:0;width:100%;height:100%;z-index:-1;pointer-events:none;opacity:1}
.table:has(.team-wash) .hand{background:#fffdf530}
.table:has(.team-wash) .seat b.team-banker{background:#694489;border-color:#50316d}

/* Keep a separator between every name/avatar and level, including unassigned players. */
.seat .avatar-frame>small{box-shadow:inset 0 1px 0 #65796b99}

/* Bottom-card peeking uses measured hand dimensions, independent of the stage width. */
.table .stage.bottom-preview .center{z-index:5}
.table .stage.bottom-preview .bottom-cards{width:max-content;max-width:none;font-size:var(--bottom-peek-font)}
.table .stage.bottom-preview .bottom-cards .cards{display:grid;grid-template-columns:repeat(var(--bottom-preview-cols),var(--bottom-peek-width));gap:3px;justify-items:center}
.table .stage.bottom-preview .bottom-cards .card{width:var(--bottom-peek-width);--card-width:var(--bottom-peek-width);height:var(--bottom-peek-height);--corner-size:var(--bottom-peek-corner);margin:0}
/* Multiplayer additions preserve the existing table layout. */
.main-menu .menu{grid-template-columns:repeat(3,minmax(0,1fr));width:min(94cqw,43em);gap:.7em}.menu-column{display:flex;flex-direction:column;gap:.5em;min-width:0}.menu-column button{font-size:clamp(14px,3.5cqh,22px);padding:.65em .55em}.record-scope{display:flex;gap:.5em;margin:.3em 0}.records-page .records-grid{min-height:0}.records-page .record-scope+ .records-grid{flex:1}.online-entry,.online-lobby{height:100%;box-sizing:border-box;overflow:auto}.online-entry{display:flex;flex-direction:column;align-items:center;gap:1em}.online-entry header,.online-lobby header{display:flex;align-items:center;justify-content:space-between;gap:1em;width:100%}.online-entry h2,.online-lobby h2{margin:.2em}.online-entry input[type=text],#room-code{font-size:1.4em;width:7em;letter-spacing:.2em;border-radius:.4em;border:1px solid #85a596;padding:.3em}.online-modes{display:flex;flex-direction:column;gap:.7em}.online-modes label{display:flex;align-items:center;gap:.35em;font-size:clamp(15px,3.5cqh,21px)}.online-modes input{width:1.35em;height:1.35em;accent-color:#547b69}.online-lobby-body{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);align-items:center;gap:1em;flex:1;min-height:0}.online-lobby{display:flex;flex-direction:column;padding:.7em}.online-lobby aside>p{font-size:.85em;margin:.6em 0}.seat-picker{position:relative;width:100%;height:66cqh;max-height:430px;min-height:180px}.seat-picker svg{position:absolute;width:100%;height:100%;fill:#a8bfb080;stroke:#77978a;stroke-width:2}.lobby-seat{position:absolute;transform:translate(-50%,-50%);border-radius:50%;width:clamp(60px,14cqh,95px);height:clamp(60px,14cqh,95px);padding:.3em;overflow-wrap:anywhere;font-size:clamp(13px,3.4cqh,19px)}.lobby-seat small{display:block;font-size:.65em}.lobby-seat-0{left:50%;top:85%}.lobby-seat-1{left:15%;top:62%}.lobby-seat-2{left:28%;top:20%}.lobby-seat-3{left:72%;top:20%}.lobby-seat-4{left:85%;top:62%}.online-error{color:#a33b35;font-size:.9em;margin:.2em}.online-flash{position:fixed;left:20%;right:20%;bottom:10%;z-index:10000;background:#fff8e9;padding:1em;border-radius:.7em;text-align:center;box-shadow:0 4px 24px #20382b33}.online-seat-tag{display:block;font-size:clamp(10px,2.5cqh,15px);text-align:center;background:#fff9;border-radius:.3em;white-space:nowrap}.hand{position:relative}.auto-cover{position:absolute;inset:0;z-index:9;border-radius:inherit;background:#dce9e2c9;backdrop-filter:blur(2px);display:flex;justify-content:center;align-items:center;gap:1em;font-size:clamp(17px,4cqh,25px)}.auto-cover button{font-size:.8em}.online-timer{position:absolute;left:50%;transform:translateX(-50%);top:16%;font-size:clamp(12px,3cqh,18px);pointer-events:none;color:#355c4d;z-index:4;background:#f7fff5bf;padding:.15em .5em;border-radius:.4em}.online-lobby .panel{max-height:85cqh;overflow:auto}.online-lobby .panel footer{flex-wrap:wrap}.online-lobby .panel select{font-size:1em;max-width:12em}
.lobby-seat:active{transform:translate(-50%,-50%) scale(.97)!important}.lobby-seat:disabled{cursor:default;opacity:.75}.online-entry{padding:.7em}.online-entry>p{font-size:.8em;margin:0}.online-entry .online-modes{gap:.55em}.online-lobby select{font:inherit}.online-lobby .online-error{flex-shrink:0}.table:has(.auto-cover) .calling{display:none}
.seat-picker svg{inset:0;pointer-events:none}

.online-deal:disabled{background:#c5cdc8;color:#65736a;border-color:#b5c0b9;cursor:default;opacity:1}.online-room-code{display:block;margin-top:.35em;font-size:clamp(11px,2.8cqh,16px);line-height:1.2;white-space:nowrap;text-align:center;font-variant-numeric:tabular-nums}.online-disconnect-alerts{position:absolute;top:23%;left:50%;transform:translateX(-50%);z-index:2000;display:grid;gap:.4em;max-width:80%;pointer-events:none;text-align:center}.online-disconnect-alerts>div{padding:.65em 1em;border:1px solid #d0bca1;border-radius:.7em;background:#fff7e8;color:#58483a;box-shadow:0 5px 22px #253e3426;font-size:clamp(15px,4cqh,22px);overflow-wrap:anywhere}

.online-modes .mode-option{justify-content:space-between;gap:1em;min-height:44px;font-weight:400}.online-modes .mode-option input{width:54px;height:32px;appearance:none}.online-modes .mode-option input:disabled{opacity:.5;cursor:default}.online-modes .mode-option:has(input:disabled){cursor:default}

/* Regular pentagon and seats beyond each side. Square coordinates preserve equal sides. */
.seat-picker{width:min(100%,70cqh,430px);height:auto;aspect-ratio:1;min-height:0;max-height:none;margin:auto;flex:none}.seat-picker svg{width:100%;height:100%}.lobby-seat{width:16%;height:auto;aspect-ratio:1;min-width:44px;min-height:44px;overflow:visible;white-space:normal;font-size:clamp(12px,3cqh,18px)}.lobby-seat-0{left:50%;top:85.5%}.lobby-seat-1{left:16.24%;top:60.97%}.lobby-seat-2{left:29.13%;top:21.28%}.lobby-seat-3{left:70.87%;top:21.28%}.lobby-seat-4{left:83.76%;top:60.97%}
.seat-badges{position:absolute;left:-7px;top:-8px;z-index:5;display:flex;gap:2px;pointer-events:none}.seat-badge{width:clamp(15px,4cqh,23px);height:clamp(15px,4cqh,23px);display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:#fff7e9;box-shadow:0 1px 3px #203c3426}.seat-badge svg{width:85%;height:85%}.host-badge svg{fill:#e5b44e;stroke:#9e752b;stroke-width:1}.robot-badge svg{fill:#dbe9e0;stroke:#426657;stroke-width:1.6;stroke-linecap:round}.sleep-badge{font-size:clamp(10px,2.9cqh,15px);font-style:italic;font-weight:700;color:#6863a0;letter-spacing:-1px}.result-grid footer{align-items:center}.result-wait{display:flex;align-items:center;justify-content:center;min-height:44px;align-self:center;line-height:1.3}.shared-bid-pause{display:flex;flex-direction:column;align-items:center;gap:.25em}.shared-bid-pause #shared-bid-countdown{font-variant-numeric:tabular-nums}.online-timer:empty{display:none}

.seat .avatar-shell{display:inline-block;position:relative;vertical-align:top;max-width:100%}:is(.trace-table,.trace-avatar-table) .avatar-shell{width:100%}

.lobby-seat.occupied{background:#668d7f;color:#fff;border-color:#416858;opacity:1}.lobby-seat.occupied.active{background:#dfb778;color:#354638;border-color:#aa8048}.lobby-seat.occupied:hover,.lobby-seat.occupied:focus-visible{background:#547d6d}.lobby-seat.occupied.active:hover,.lobby-seat.occupied.active:focus-visible{background:#e8c58c}.seat-badges{left:-9px;top:-10px;gap:3px}.seat-badge{width:clamp(20px,5cqh,30px);height:clamp(20px,5cqh,30px);background:transparent;border-radius:0;box-shadow:none}.seat-badge svg{width:100%;height:100%}.sleep-badge{font-size:clamp(14px,3.8cqh,21px)}:is(.trace-table,.trace-avatar-table) :is(.seat-2,.seat-3) .seat-badges{top:0}

.seat-badge svg{overflow:visible;filter:drop-shadow(1px 0 0 #fff7e6) drop-shadow(-1px 0 0 #fff7e6) drop-shadow(0 1px 0 #fff7e6) drop-shadow(0 -1px 0 #fff7e6)}.sleep-badge{-webkit-text-stroke:.7px #fff7e6;paint-order:stroke fill}.online-room-code{font-weight:700}

/* Keep the hand cover in the same pastel family as the visible team wash. */
.auto-cover[data-team="banker"]{background:rgba(222,206,238,.82);color:#50316d}.auto-cover[data-team="defender"]{background:rgba(250,223,177,.82);color:#805122}.auto-cover[data-team="unknown"]{background:rgba(220,233,226,.79);color:var(--ink)}
.bid-hint{flex-direction:column;align-items:center;flex-wrap:nowrap;gap:.4em}.bid-levels{display:block}.shared-bid-pause{display:flex;flex-direction:column;align-items:center;gap:.4em}.shared-bid-pause #shared-bid-countdown{display:block}
/* V6.1 proportions: ordinary 2.15em; trace width 7% and original responsive height. */
.table .seat .avatar-shell{width:var(--avatar-size);max-width:100%}.table .seat .avatar-frame{width:100%}.table .seat .avatar-frame>b{width:100%;min-width:0;height:var(--avatar-size);aspect-ratio:auto;flex:none}
:is(.trace-table,.trace-avatar-table) .seat .avatar-shell{width:100%}:is(.trace-table,.trace-avatar-table) .seat .avatar-frame>b{height:2.15em}
@media(max-height:420px){:is(.trace-table,.trace-avatar-table) .seat .avatar-frame>b{height:1.8em}}

.room-title{display:flex;align-items:center;gap:.45em;flex-wrap:wrap}.copy-room-button{font-size:clamp(12px,2.9cqh,16px)!important;font-weight:500!important}.room-title .copy-room-button,.online-room-code .copy-room-button{min-height:32px;min-width:44px;padding:.2em .45em;line-height:1.2;flex:none}.online-room-code{display:flex;align-items:center;justify-content:center;gap:.3em}.online-room-code>span{user-select:text}

/* Compact secondary controls stay in the far-left column. */
.table .back{display:flex;flex-direction:column;align-items:flex-start;gap:2px}.table .back .online-auto-toggle{min-height:28px;min-width:58px;padding:.15em .5em;font-size:clamp(12px,3.2cqh,17px);line-height:1.25}.online-auto-toggle[aria-pressed="true"]{background:#e5d8ef;border-color:#9c82ad}.table .online-room-code{margin-top:0;gap:1px;font-size:clamp(11px,2.8cqh,14px)}
.room-title .copy-room-button,.online-room-code .copy-room-button{width:24px;height:24px;min-width:24px;min-height:24px;padding:3px;display:inline-flex;align-items:center;justify-content:center;background:transparent;border:0;border-radius:.25em;box-shadow:none;flex:none}.copy-room-button svg{width:18px;height:18px;display:block}.copy-room-button:hover,.copy-room-button:focus-visible{background:#e0e9de;outline:1px solid #779687;outline-offset:1px}
.table .back .copy-room-button{width:24px;height:24px;min-width:24px;min-height:24px;padding:3px}.copy-room-button svg{flex:none}

.device-storage-warning{position:fixed;z-index:100000;left:50%;bottom:8px;transform:translateX(-50%);width:max-content;max-width:90vw;display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:12px;background:#fff4d9;color:#62451b;box-shadow:0 2px 12px #0002;font-size:13px}.device-storage-warning button{flex-shrink:0;padding:6px 10px;font-size:13px}
