:root{--paper:#f6f3eb;--ink:#252c29;--muted:#788078;--line:#dcded4;--blue:#3464df;--green:#217955;--red:#db493f;--yellow:#f1c64b;--radius:18px;font-family:'DM Sans',sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:disabled{cursor:default}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid var(--blue);outline-offset:5px}button[hidden],[hidden]{display:none!important}button{touch-action:manipulation}a{color:inherit;text-decoration:none}.game-shell{max-width:1240px;margin:auto;padding:0 42px}.masthead{display:flex;align-items:center;justify-content:space-between;height:94px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:11px;font-family:'Space Grotesk',sans-serif;font-size:25px;font-weight:700;letter-spacing:-1.2px}.brand-icon{display:grid;place-items:center;background:var(--blue);color:white;border-radius:9px;width:35px;height:39px;transform:rotate(-9deg);font-size:32px;line-height:1}.brand-period{color:var(--blue)}.header-actions{display:flex;align-items:center;gap:24px}.edition,.eyebrow{font-size:10px;font-weight:700;letter-spacing:1.8px}.edition{color:var(--muted)}.quiet{border:0;background:none;color:var(--ink);font-size:12px;font-weight:600;padding:9px 0;white-space:nowrap}.quiet span{margin-left:7px}.quiet:hover{color:var(--blue)}.quiet:disabled{opacity:.3}.icon-button{border:1px solid var(--line);border-radius:50%;background:transparent;width:34px;height:34px;font-size:22px;color:var(--ink)}.intro{display:flex;justify-content:space-between;align-items:center;padding:35px 0 30px}.eyebrow{margin:0 0 12px;color:var(--muted)}h1{font-family:'Space Grotesk',sans-serif;font-size:48px;line-height:1.02;letter-spacing:-2.7px;margin:0;font-weight:600}h1 span{color:var(--green)}.intro-note{font-size:13px;line-height:1.7;color:#69716b;padding-right:5px}.color-key{display:flex;gap:6px;margin-top:14px}.key{display:grid;place-items:center;width:25px;height:25px;border-radius:6px;font-size:21px;font-weight:500;color:#fff}.add{--card-color:var(--blue);--card-ink:#fff;background:var(--blue);color:#fff}.multiply{--card-color:var(--green);--card-ink:#fff;background:var(--green);color:#fff}.subtract{--card-color:var(--red);--card-ink:#fff;background:var(--red);color:#fff}.divide{--card-color:var(--yellow);--card-ink:#342f1b;background:var(--yellow);color:#342f1b}.zero{--card-color:#292b2d;--card-ink:#fff;background:#292b2d;color:#fff}.game-board{background:#e8ece2;border:1px solid #dce1d5;border-radius:21px;overflow:hidden;position:relative}.scorebar{display:flex;align-items:center;justify-content:space-between;padding:19px 27px;border-bottom:1px solid #d9dfd2}.player-score{display:flex;align-items:center;gap:12px;min-width:190px}.avatar{width:36px;height:36px;border:1px solid #c7cec0;border-radius:50%;display:grid;place-items:center;font-size:14px;font-weight:600}.you{background:#f6f8f2}.bot{background:#d9e0d1;font-size:22px}.player-score strong{font-size:12px}.player-score>b{font-size:27px;font-family:'Space Grotesk',sans-serif;margin-left:8px}.rival{text-align:right;justify-content:flex-end}.rival>b{margin-left:0;margin-right:8px}.points{display:flex;gap:4px;margin-top:6px}.rival .points{justify-content:flex-end}.points i{width:6px;height:6px;border:1px solid #aebaa3;border-radius:50%}.points i.filled{background:var(--green);border-color:var(--green)}.round-indicator{text-align:center}.round-indicator>span{font-size:11px;letter-spacing:1.8px;font-weight:700}.round-indicator small{display:block;font-size:8px;letter-spacing:1.2px;color:var(--muted);margin-top:5px}.opponent-row{display:flex;justify-content:center;align-items:center;gap:12px;height:57px;font-size:10px;color:#7b8478}.opponent-cards{display:flex;padding-left:7px}.mini-back{width:20px;height:28px;border-radius:4px;background:repeating-linear-gradient(45deg,#526c54 0 2px,#5e795e 2px 4px);border:2px solid #e8ece2;margin-left:-7px;transform:rotate(-5deg)}.thinking{color:var(--green);font-weight:700;position:absolute;right:27px}.thinking span{animation:pulse 1s infinite}.arena{display:grid;grid-template-columns:120px 1fr 150px;align-items:center;min-height:178px;padding:0 32px 22px;gap:12px}.deck-column{text-align:center}.deck-card{width:61px;height:85px;border:4px solid #f5f6ed;border-radius:9px;margin:0 auto 10px;box-shadow:3px 3px 0 #aebba6,6px 6px 0 #c3cdbb;background:#425d47;color:#c4d1bc;display:grid;grid-template-columns:1fr 1fr;align-content:center;font-size:26px;line-height:1.15;transform:rotate(-6deg)}.deck-column strong{font-size:12px}.deck-column small{display:block;font-size:8px;letter-spacing:1px;color:#7b8478;margin-top:3px}.table-center{text-align:center;min-width:0}.empty-table .table-mark{font-family:'Space Grotesk',sans-serif;font-size:48px;font-weight:400;color:#9ead98;letter-spacing:9px;margin-bottom:9px}.empty-table h3{font-size:15px;margin:0 0 7px;font-weight:600}.empty-table p{font-size:11px;color:#7a8575;margin:0}.target-column{text-align:center;border-left:1px solid #d3dbcc;padding-left:20px}.target-column .eyebrow{font-size:8px;letter-spacing:1.2px;display:block;margin-bottom:2px}.target-column>strong{font-family:'Space Grotesk',sans-serif;font-size:63px;font-weight:500;line-height:1.1;letter-spacing:-3px}.target-column small{display:block;font-size:10px;line-height:1.4;margin-top:5px;color:#737e6d}.status-bar{text-align:center;border-top:1px solid #d9dfd2;padding:12px 18px;font-size:12px;background:#e1e7d9;min-height:41px;line-height:1.5}.status-bar.attack-status{background:#f9e9d4;color:#754716}.status-bar.win-status{background:#d4e6cb;color:#315a31}.hand-section{padding-top:24px}.hand-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:19px}h2{font-family:'Space Grotesk',sans-serif;font-size:16px;letter-spacing:-.3px;margin:0}h2>span{font-family:'DM Sans',sans-serif;font-size:10px;background:#e8e8df;color:#72766c;border-radius:5px;padding:3px 6px;margin-left:6px;vertical-align:middle}.hand-header p{font-size:11px;color:var(--muted);margin:5px 0 0}.hand{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;padding:7px 0 17px;min-height:155px}.playing-card{position:relative;flex:0 0 auto;width:94px;height:132px;border:0;border-radius:10px;padding:0;box-shadow:0 3px 0 color-mix(in srgb,var(--card-color),black 20%),0 6px 9px #252c2910;transition:transform .17s,box-shadow .17s;isolation:isolate;color:var(--card-ink)}.playing-card::before{content:'';position:absolute;inset:6px;border:1px solid currentColor;opacity:.22;border-radius:5px;pointer-events:none}.playing-card:hover:not(:disabled){transform:translateY(-7px)}.playing-card.selected{transform:translateY(-11px);box-shadow:0 0 0 3px var(--paper),0 0 0 5px var(--ink),0 10px 14px #252c2920}.playing-card.selected:hover{transform:translateY(-13px)}.card-corner{position:absolute;left:11px;top:7px;font-size:22px;line-height:1}.card-corner.bottom{left:auto;top:auto;right:11px;bottom:8px;transform:rotate(180deg)}.card-value{position:absolute;inset:0;display:grid;place-items:center;font-family:'Space Grotesk',sans-serif;font-size:58px;font-weight:500;letter-spacing:-4px;padding-right:4px}.card-name{position:absolute;bottom:26px;left:0;right:0;font-size:7px;font-weight:600;letter-spacing:1px;opacity:.75}.card-badge{position:absolute;top:-10px;right:5px;font-size:8px;letter-spacing:.6px;background:var(--ink);color:white;padding:4px 6px;border-radius:4px;z-index:2}.card-badge.fresh{background:var(--paper);color:var(--green);border:1px solid #bac5b0}.playing-card:disabled{cursor:default}.table-cards{display:flex;justify-content:center;gap:8px;margin-bottom:10px}.table-cards .playing-card{width:65px;height:91px;box-shadow:0 2px 0 color-mix(in srgb,var(--card-color),black 20%)}.table-cards .card-value{font-size:40px}.table-cards .card-corner{font-size:15px;left:9px;top:6px}.table-cards .card-corner.bottom{left:auto;top:auto;right:9px;bottom:6px}.table-cards .card-name{display:none}.table-equation{font-size:13px;font-family:'Space Grotesk',sans-serif;font-weight:600;letter-spacing:.3px}.table-owner{font-size:9px;color:#7b8478;margin-top:4px}.play-builder{display:flex;justify-content:space-between;align-items:center;gap:20px;border:1px solid var(--line);background:#fdfbf5;border-radius:14px;min-height:108px;padding:19px 23px}.preview-section{min-width:0}.preview-section .eyebrow{font-size:9px;letter-spacing:1.3px;margin-bottom:7px;display:block}.calculation{font-family:'Space Grotesk',sans-serif;font-size:22px;letter-spacing:-.7px;line-height:1.3}.preview-placeholder{display:inline;margin-left:7px;color:#a9aaa0;font-size:15px;letter-spacing:-.3px}.selection-help{color:var(--muted);font-size:10px;margin-top:6px;line-height:1.4}.selection-help.invalid{color:#b24339}.calculation .result{color:var(--green);font-weight:700}.play-actions{display:flex;align-items:center;gap:16px;flex-shrink:0}.primary,.secondary{border-radius:8px;padding:13px 20px;border:1px solid var(--ink);font-size:12px;font-weight:600;white-space:nowrap}.primary{background:var(--ink);color:#fff}.primary:hover{background:#3b4b3e}.primary span{margin-left:12px}.primary:disabled{background:#e4e6dc;border-color:#e4e6dc;color:#a0a598}.secondary{background:transparent;border-color:#d7dbcf;color:#67705f}.secondary:hover{background:#e9ecdf}.secondary:disabled{opacity:.4}footer{display:flex;justify-content:space-between;align-items:center;padding:14px 0 20px;color:#858a7d;font-size:8px;letter-spacing:1px}footer .quiet{color:#7c8376;font-size:10px}.live-dot{display:inline-block;width:5px;height:5px;background:var(--green);border-radius:50%;margin-right:6px;vertical-align:1px}.history-panel{padding:20px 0 30px;border-top:1px solid var(--line)}.history-panel ol{padding-left:18px;font-size:12px;color:#6a7567;line-height:2}.history-panel li b{color:var(--ink)}dialog{background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:20px;padding:28px;width:min(540px,calc(100% - 32px));max-height:85vh;box-shadow:0 30px 100px #0003}dialog::backdrop{background:#1b291c70;backdrop-filter:blur(4px)}.dialog-header{display:flex;align-items:center;justify-content:space-between}.dialog-header .eyebrow{margin:0}dialog h2{font-size:32px;line-height:1.1;margin:20px 0;letter-spacing:-1.3px}dialog p{font-size:13px;line-height:1.7;color:#6a7464}.rule-types{margin:20px 0}.rule-types p{display:flex;gap:13px;align-items:center;margin:14px 0;font-size:12px;line-height:1.5}.rule-types strong{display:block;color:var(--ink);font-size:12px;margin-bottom:2px}.rule-symbol{display:grid;place-items:center;flex-shrink:0;width:36px;height:45px;border-radius:5px;font-size:25px}.rule-example{background:#e7ecdf;border-radius:9px;padding:16px;font-size:12px}.rule-example p{margin:8px 0}.rule-example small{font-size:10px;color:#788270}.full-width{width:100%;margin-top:22px}details{font-size:12px;color:#6a7464}summary{cursor:pointer}.dialog-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.round-result h3{font-family:'Space Grotesk',sans-serif;font-size:28px;letter-spacing:-1px;margin:0 0 10px}.round-result p{font-size:12px;color:#6b7964;margin:0;line-height:1.5}.round-result .result-symbol{display:block;color:var(--green);font-size:26px;margin-bottom:6px}.toast-message{color:#b24339}@keyframes pulse{50%{opacity:.3}}@media(min-width:1400px){.intro{padding:42px 0 34px}.arena{min-height:200px}.playing-card{width:104px;height:144px}.hand{min-height:166px}.card-value{font-size:64px}}@media(max-width:900px){.game-shell{padding:0 24px}.edition{display:none}.playing-card{width:78px;height:112px}.card-value{font-size:48px}.hand{gap:9px;min-height:135px}.card-name{font-size:6px;bottom:23px}.card-corner{font-size:19px}.preview-placeholder{display:none}.play-actions{gap:10px}.primary,.secondary{padding:12px 14px}.arena{grid-template-columns:85px 1fr 110px;padding:0 18px 20px}.target-column{padding-left:12px}.target-column>strong{font-size:53px}.player-score{min-width:150px}.play-builder{padding:16px}.calculation{font-size:20px}}@media(max-width:600px){.game-shell{padding:0 16px}.masthead{height:73px}.brand{font-size:22px;gap:9px}.brand-icon{width:28px;height:32px;font-size:27px}.header-actions{gap:13px}.header-actions .quiet{font-size:10px}.icon-button{width:29px;height:29px;font-size:19px}.intro{padding:26px 0 23px}.intro .eyebrow{font-size:7px;letter-spacing:1.25px;margin-bottom:10px}h1{font-size:37px;letter-spacing:-2px}.intro-note{font-size:9px;padding:0;line-height:1.6}.color-key{gap:4px;margin-top:10px}.key{width:21px;height:21px;font-size:18px}.scorebar{padding:15px 13px}.player-score{min-width:0;gap:7px}.avatar{width:27px;height:27px;font-size:10px}.bot{font-size:17px}.player-score strong{font-size:10px}.player-score>b{font-size:21px;margin-left:0}.rival>b{margin-right:0}.points{gap:3px}.points i{width:5px;height:5px}.round-indicator>span{font-size:8px;letter-spacing:1px}.round-indicator small{font-size:6px;letter-spacing:.6px}.opponent-row{height:47px;font-size:8px}.thinking{right:12px;font-size:8px}.arena{grid-template-columns:49px 1fr 76px;gap:7px;padding:0 12px 18px;min-height:149px}.deck-card{width:39px;height:58px;border-width:3px;font-size:17px;margin-bottom:9px;border-radius:7px}.deck-column small{font-size:6px;letter-spacing:.5px}.deck-column strong{font-size:10px}.target-column{padding-left:8px}.target-column .eyebrow{font-size:6px;letter-spacing:.4px}.target-column>strong{font-size:44px}.target-column small{font-size:8px}.empty-table .table-mark{font-size:31px;letter-spacing:5px}.empty-table h3{font-size:12px}.empty-table p{font-size:9px;max-width:140px;margin:auto;line-height:1.5}.table-cards{gap:4px}.table-cards .playing-card{width:44px;height:64px;border-radius:6px}.table-cards .playing-card:before{inset:4px;border-radius:3px}.table-cards .card-value{font-size:29px;letter-spacing:-2px;padding-right:2px}.table-cards .card-corner{font-size:11px;left:6px;top:4px}.table-cards .card-corner.bottom{right:6px;bottom:4px}.table-equation{font-size:10px}.table-owner{font-size:7px}.status-bar{font-size:10px;padding:10px 12px;min-height:36px}.hand-section{padding-top:21px}.hand-header{margin-bottom:19px}.hand-header h2{font-size:14px}.hand-header p{font-size:9px;max-width:220px}.hand-header .quiet{font-size:10px}.hand{gap:9px 7px;padding:6px 0 17px;min-height:120px;justify-content:center}.playing-card{width:calc((100vw - 64px)/5);max-width:78px;height:103px;border-radius:8px}.card-value{font-size:43px}.card-name{font-size:5px;letter-spacing:.6px;bottom:22px}.card-corner{font-size:17px;left:9px;top:7px}.card-corner.bottom{right:9px;bottom:7px}.card-badge{font-size:7px;right:1px;padding:3px 4px}.play-builder{display:block;padding:16px;min-height:156px}.calculation{font-size:22px}.selection-help{font-size:9px;min-height:13px}.play-actions{justify-content:flex-end;margin-top:17px;gap:13px}.play-actions .quiet{margin-right:auto;font-size:11px}.primary,.secondary{padding:12px 14px;font-size:11px}.primary span{margin-left:8px}footer{font-size:6px;letter-spacing:.6px;padding-top:9px}footer>span:last-child{display:none}.round-result h3{font-size:21px}.round-result p{font-size:10px}.round-result .result-symbol{font-size:22px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
@media(min-width:601px) and (max-height:900px){.masthead{height:70px}.intro{padding:20px 0}.intro h1{font-size:35px;letter-spacing:-1.7px;line-height:1.1}.intro h1 br{display:none}.intro h1 span{margin-left:8px}.intro .eyebrow{margin-bottom:8px;font-size:8px}.intro-note{font-size:11px}.color-key{margin-top:6px}.key{height:21px;width:21px;font-size:18px}.scorebar{padding:13px 23px}.opponent-row{height:44px}.arena{min-height:145px;padding-bottom:15px}.status-bar{padding:9px 16px;min-height:36px}.hand-section{padding-top:19px}.hand-header{margin-bottom:15px}.hand{min-height:145px}.play-builder{min-height:98px;padding:15px 20px}footer{padding:6px 0 9px}.playing-card{width:88px;height:122px}.card-value{font-size:54px}}
@media(max-width:600px){.intro h1{font-size:30px;letter-spacing:-1.7px}.intro>div:first-child{flex-shrink:0}.intro-note{max-width:130px;margin-left:12px}.intro .eyebrow{font-size:6.5px;letter-spacing:1px}}

/* Wrap table cards and longer equations on narrow screens. */
.table-cards{flex-wrap:wrap}.table-equation,.calculation{overflow-wrap:anywhere}.target-column>strong{font-size:clamp(25px,4vw,53px);letter-spacing:-1.5px;overflow-wrap:anywhere}.play-builder{flex-wrap:wrap}.preview-section{flex:1 1 280px}.arena{padding-top:10px}.table-center{padding:8px 0}.hand-help{line-height:1.4}@media(max-width:600px){.target-column>strong{font-size:29px}.hand-header p{max-width:215px}.calculation{font-size:19px}}

/* Demo reference: quick rules on the left, full deck contents on the right. */
.demo-reference{display:grid;grid-template-columns:1.15fr 1fr;gap:38px;border-top:1px solid var(--line);padding:25px 0 32px;margin-top:4px;font-size:12px;line-height:1.5}
.demo-reference h2{font-size:18px;letter-spacing:-.5px}
.reference-note{font-size:11px;color:#697365;margin:6px 0 14px}
.quick-steps{margin:0;padding-left:20px;line-height:1.9}
.quick-steps li::marker{color:#7d8974;font-weight:600}
.quick-win{margin:12px 0 18px;max-width:430px}
.quick-win strong{color:var(--green)}
.quick-types{display:grid;grid-template-columns:1fr 1fr;gap:13px 18px;margin:0}
.quick-types dt{display:flex;align-items:center;gap:7px;font-weight:600}
.quick-types dd{margin:4px 0 0;color:#697365;font-size:11px}
.reference-symbol{display:inline-grid;place-items:center;flex-shrink:0;width:23px;height:27px;border-radius:5px;font-family:'Space Grotesk',sans-serif;font-size:20px;line-height:1}
.math-order{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;margin:15px 0 0;font-size:15px;font-weight:600;line-height:1.6;color:var(--ink)}
.operation-sequence{display:inline-flex;align-items:center;gap:6px}
.math-order .reference-symbol{width:28px;height:28px;font-size:23px}
.order-arrow{color:var(--muted);font-size:16px;font-weight:400}
.reference-symbol.divide,.key.divide{color:#fff}
.playing-card.divide{--card-ink:#fff;color:#fff}
.playing-card.divide .card-name{opacity:1}
.deck-guide{border-left:1px solid var(--line);padding-left:36px}
.reference-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.deck-total{font-size:10px;color:#697365;background:#e8ecdf;padding:4px 8px;border-radius:5px;white-space:nowrap}
.deck-contents{margin:10px 0 0}
.deck-contents>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid #e3e5da}
.deck-contents>div:last-child{border-bottom:0}
.deck-contents dt{display:flex;align-items:center;gap:10px;min-width:0}
.deck-contents strong{font-size:12px;font-weight:600}
.deck-contents small{display:block;font-size:10px;color:#697365;margin-top:1px}
.deck-contents dd{font-family:'Space Grotesk',sans-serif;font-size:18px;font-weight:500;margin:0;flex-shrink:0}
@media(max-width:700px){.demo-reference{grid-template-columns:1fr;gap:23px;padding-top:22px}.deck-guide{padding:22px 0 0;border-left:0;border-top:1px solid var(--line)}.quick-win{max-width:none}.demo-reference h2{font-size:17px}}

/* State changes animate once; choosing cards does not replay turn animations. */
.turn-event{min-height:22px;padding:0 14px 5px;text-align:center;font-size:11px;font-weight:600;line-height:1.5;color:var(--green)}
.game-board.motion-active{overflow:visible;z-index:5}
.motion-active .table-cards .playing-card{z-index:6;will-change:transform,opacity}
.hand .playing-card{will-change:transform}
.round-result{transform-origin:center}
#target-score,#your-score,#bot-score,#round-number,#deck-count{display:inline-block}
@media(max-width:600px){.turn-event{font-size:10px;padding-bottom:6px}}
@media(prefers-reduced-motion:reduce){.hand .playing-card,.motion-active .table-cards .playing-card{will-change:auto}}

/* Keep the target, arithmetic and controls together above the hand. */
.arena{grid-template-columns:120px minmax(0,1fr) 120px}
.play-builder{display:grid;grid-template-columns:160px minmax(0,1fr);gap:14px 24px;margin-top:18px}
.play-builder .preview-section{padding:16px 20px;background:#fffef9;border:1px solid #e0e4d8;border-radius:10px;min-width:0}
.play-builder .preview-section .eyebrow{font-size:11px;color:var(--ink);margin-bottom:8px}
.play-builder .selection-help{font-size:12px;line-height:1.5}
.play-builder .play-actions{grid-column:2;justify-content:flex-end;margin:0}
.play-builder .target-column{grid-row:span 2;border-left:0;border-right:1px solid var(--line);padding:0 20px 0 0;min-width:0}
.play-builder .target-column .eyebrow{font-size:9px;letter-spacing:1px}
.play-builder .target-column>strong{font-size:56px;line-height:1.15}
.play-builder .target-column small{font-size:10px}
#target-equation{font-size:12px;line-height:1.7;margin:4px 0;letter-spacing:0}
#target-equation .math-term{padding:0 3px}
.play-builder .calculation{font-size:34px;line-height:1.65;letter-spacing:-.5px}
.math-term{display:inline-block;padding:0 5px;border-radius:5px;font-weight:600;white-space:nowrap}
.math-add{color:var(--blue);background:#3464df0d}
.math-subtract{color:#bc332b;background:#db493f12}
.math-multiply{color:var(--green);background:#2179550e}
.math-divide{color:#805e00;background:#f1c64b40}
@media(max-width:1000px){
  .arena{grid-template-columns:85px minmax(0,1fr) 85px}
  .play-builder{grid-template-columns:140px minmax(0,1fr);gap:14px 20px}
  .play-builder .target-column{grid-row:span 2}
  .play-builder .play-actions{grid-column:2;justify-content:flex-end;margin:0}
}
@media(max-width:600px){
  .arena{grid-template-columns:49px minmax(0,1fr) 49px}
  .play-builder{display:grid;grid-template-columns:74px minmax(0,1fr);align-items:center;gap:12px;margin-top:14px}
  .play-builder .target-column{display:block;grid-row:1;text-align:center;border:0;padding:0}
  .play-builder .target-column .eyebrow{margin:0;font-size:8px;letter-spacing:.5px}
  .play-builder .target-column>strong{font-size:36px}
  .play-builder .target-column small{margin-top:5px;font-size:9px;line-height:1.4}
  #target-equation{margin:5px 0;text-align:center;font-size:10px;line-height:1.6}
  .play-builder .preview-section{flex:initial;padding:12px}
  .play-builder .preview-section .eyebrow{font-size:9px;letter-spacing:.7px}
  .play-builder .selection-help{font-size:10px}
  .play-builder .play-actions{grid-column:1/-1;margin:0;justify-content:flex-end}
  .play-builder .calculation{font-size:24px;line-height:1.65}
}

/* One separate card back for every card in Riley's hand. */
.opponent-row{display:block;height:auto;margin:18px 24px 12px;color:var(--ink)}
.opponent-hand-header{position:relative;display:flex;align-items:center;justify-content:center;gap:12px;margin-bottom:12px}
.opponent-hand-header h2{font-size:14px}
.opponent-row .thinking{position:absolute;right:0;font-size:11px}
.opponent-cards{display:flex;justify-content:center;flex-wrap:wrap;gap:9px;padding:0}
.opponent-cards:empty{display:none}
.opponent-cards .mini-back{position:relative;z-index:6;display:block;flex:0 0 48px;width:48px;height:68px;margin:0;transform:none;border:2px solid #f5f6ed;border-radius:7px;background:#425d47;box-shadow:0 2px 0 #aebba6;color:#c4d1bc;font-style:normal}
.opponent-cards .mini-back::before{content:'';position:absolute;inset:4px;border:1px solid #c4d1bc55;border-radius:3px}
.opponent-cards .mini-back::after{content:'+ ×\a− ÷';white-space:pre;position:absolute;inset:0;display:grid;place-content:center;text-align:center;font-size:17px;line-height:1.25}
@media(max-width:600px){
  .opponent-row{margin:14px 12px 10px}
  .opponent-hand-header{margin-bottom:10px}
  .opponent-cards{gap:7px}
  .opponent-cards .mini-back{flex-basis:34px;width:34px;height:48px;border-radius:5px}
  .opponent-cards .mini-back::before{inset:3px;border-radius:2px}
  .opponent-cards .mini-back::after{font-size:12px}
}

/* Empty operations keep their place without competing with active values. */
.math-term.math-empty{background:transparent;opacity:.65}

/* Your score is the main action; Riley's reply is its smaller follow-on. */
.move-previews{display:grid;grid-template-columns:minmax(0,1fr) 180px;gap:24px;min-width:0;align-items:start}
.move-stack{display:grid;gap:12px;min-width:0}
.play-builder .your-preview{padding:20px 24px}
.play-builder .your-preview .calculation{font-size:40px;line-height:1.5}
.play-builder .opponent-preview{margin-left:20px;padding:12px 16px;background:#f6f8f0;border-color:#e5e8de}
.play-builder .opponent-preview .eyebrow{font-size:9px;color:var(--muted);margin-bottom:4px;letter-spacing:1px}
.play-builder .opponent-preview .calculation{font-size:23px;line-height:1.5}
.play-builder .opponent-preview .selection-help{font-size:11px;margin-top:4px}
.reply-arrow{font-size:16px;vertical-align:-1px;margin-right:3px}
.unknown-result{color:var(--muted);font-weight:600}

/* The equals sign and total show whether the selected play is ready. */
.result-total{display:inline-block;white-space:nowrap}
.result-total.result-neutral{color:var(--ink)}
.result-total.result-valid{color:var(--green)}
.result-total.result-invalid{color:#bc332b}
.calculation .result-total .result{color:inherit}

/* Keep the target beside your primary move, with controls above your hand. */
.play-builder{grid-template-columns:minmax(0,1fr)}
.play-builder .play-actions{grid-column:1}
.move-previews .target-column{grid-row:auto;align-self:start;border:0;padding:20px 8px 0;text-align:center}
@media(max-width:900px){
  .move-previews{grid-template-columns:minmax(0,1fr) 140px;gap:16px}
  .play-builder .your-preview{padding:16px}
  .play-builder .your-preview .calculation{font-size:32px}
}
@media(max-width:600px){
  .move-previews{grid-template-columns:minmax(0,1fr);gap:14px}
  .move-previews .target-column{grid-row:1;padding:0}
  .play-builder .your-preview{padding:14px}
  .play-builder .your-preview .calculation{font-size:27px}
  .play-builder .opponent-preview{margin-left:12px;padding:10px 12px}
  .play-builder .opponent-preview .calculation{font-size:20px}
  .play-builder .opponent-preview .selection-help{font-size:10px}
}

/* Show all four parts of the completed score, including neutral values. */
#target-equation{font-size:13px;line-height:1.8}

/* Phone play surface: compact context, readable cards, reachable controls. */
@media(max-width:700px){
  .game-shell{padding:0 max(12px,env(safe-area-inset-left)) 0 max(12px,env(safe-area-inset-right))}
  .masthead{height:60px;border-bottom:0}
  .brand{font-size:21px;gap:8px}
  .brand-icon{width:26px;height:30px;font-size:26px}
  .header-actions{gap:8px}
  .header-actions .quiet{font-size:11px;min-height:44px}
  .header-actions .icon-button{width:44px;height:44px;font-size:22px}
  .intro{display:none}
  .game-board{border-radius:14px}
  .scorebar{padding:10px 12px}
  .player-score{min-width:0}
  .opponent-row{margin:10px 10px 6px;height:auto}
  .opponent-hand-header{margin-bottom:6px}
  .opponent-hand-header h2{font-size:12px}
  .opponent-row .thinking{font-size:9px}
  .opponent-cards{gap:5px}
  .opponent-cards .mini-back{flex-basis:27px;width:27px;height:38px;border-radius:4px}
  .opponent-cards .mini-back::before{inset:2px}
  .opponent-cards .mini-back::after{font-size:10px}
  .turn-event{font-size:10px;min-height:0;padding:2px 10px 4px}
  .turn-event:empty{display:none}
  .arena{grid-template-columns:35px minmax(0,1fr);gap:8px;min-height:82px;padding:4px 10px 8px}
  .deck-card{width:29px;height:40px;border-width:2px;border-radius:5px;font-size:14px;margin-bottom:5px;box-shadow:2px 2px 0 #aebba6,4px 4px 0 #c3cdbb}
  .deck-column small{font-size:6px;letter-spacing:0}
  .table-center{padding:3px 0}
  .empty-table .table-mark{display:none}
  .empty-table p{max-width:none}
  .table-cards{gap:5px;margin-bottom:5px}
  .table-cards .playing-card{width:36px;height:50px;border-radius:5px}
  .table-cards .card-value{font-size:27px;letter-spacing:-1px}
  .table-cards .card-corner{font-size:10px;left:5px;top:4px}
  .table-cards .card-corner.bottom{left:auto;top:auto;right:5px;bottom:4px}
  .table-owner{font-size:8px}
  .status-bar{font-size:10px;padding:6px 10px;min-height:0}
  .player-area{display:grid;grid-template-columns:minmax(0,1fr);padding-top:10px;isolation:isolate}
  .play-builder{display:contents}
  .move-previews{order:0;position:sticky;top:0;z-index:8;grid-template-columns:minmax(0,1fr);gap:6px;padding:8px 0;background:var(--paper);align-self:start}
  .move-stack{gap:6px}
  .move-previews .target-column{display:grid;grid-row:1;grid-template-columns:auto minmax(0,1fr);gap:0 12px;align-items:center;padding:0 10px 6px;border-bottom:1px solid var(--line);text-align:left}
  .play-builder .target-column .eyebrow{grid-column:1;grid-row:1;font-size:8px;margin:0}
  .play-builder .target-column>strong{grid-column:1;grid-row:2;font-size:30px;line-height:1.1}
  #target-equation{grid-column:2;grid-row:1 / span 2;text-align:right;margin:0;font-size:12px;line-height:1.5}
  .play-builder .target-column small{grid-column:2;grid-row:3;text-align:right;margin-top:1px;font-size:10px}
  .play-builder .your-preview{padding:10px 12px}
  .play-builder .your-preview .eyebrow{font-size:10px;margin-bottom:4px}
  .play-builder .your-preview .calculation{font-size:clamp(23px,6.4vw,32px);line-height:1.4}
  .play-builder .selection-help{font-size:11px;margin-top:3px;line-height:1.4}
  .math-term{padding:0 3px}
  .play-builder .opponent-preview{margin-left:12px;padding:7px 10px}
  .play-builder .opponent-preview .eyebrow{font-size:8px;margin-bottom:1px;letter-spacing:.6px}
  .play-builder .opponent-preview .calculation{font-size:19px;line-height:1.35}
  .play-builder .opponent-preview .selection-help{font-size:10px;line-height:1.3;margin-top:2px}
  .hand-section{order:1;padding-top:8px;min-width:0}
  .hand-header{margin-bottom:12px;gap:8px}
  .hand-header h2{font-size:15px}
  .hand-header p{font-size:10px;max-width:225px}
  .hand-header .quiet{min-height:44px;font-size:11px}
  .hand{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:17px 10px;padding:8px 5px 12px;min-height:0;max-width:440px;margin:auto}
  .hand .playing-card{width:100%;max-width:none;height:auto;aspect-ratio:3 / 4;scroll-margin-block:290px 90px}
  .hand .card-value{font-size:clamp(38px,11vw,52px);letter-spacing:-2px}
  .hand .card-name{font-size:6px;bottom:21px;letter-spacing:.4px}
  .hand .card-corner{font-size:17px;left:8px;top:6px}
  .hand .card-corner.bottom{left:auto;top:auto;right:8px;bottom:6px}
  .hand .playing-card.selected,.hand .playing-card.selected:hover{transform:translateY(-5px)}
  .hand .card-badge{font-size:7px;right:2px;padding:3px 4px}
  .play-builder .play-actions{order:2;position:sticky;bottom:0;z-index:9;display:grid;grid-template-columns:44px 1fr 1.2fr;gap:8px;margin:0;padding:10px 0 max(10px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--paper);box-shadow:0 -6px 12px #f6f3ebcc}
  .play-actions button{min-height:44px;font-size:12px;padding:10px 8px}
  .play-actions .quiet{margin:0}
  .play-actions .primary{grid-column:3}
  .play-actions .primary span{margin-left:4px}
  footer{padding-top:8px}
  .demo-reference{margin-top:0}
}
@media(max-width:700px) and (max-height:600px){
  .move-previews{position:static}
}
@media(hover:none){
  .playing-card:hover:not(:disabled){transform:none}
  .playing-card.selected:hover:not(:disabled){transform:translateY(-5px)}
}

/* A non-interactive copy carries a selection into its calculation. */
.selection-ghost{position:fixed!important;z-index:100;pointer-events:none!important;margin:0;min-width:0;max-width:none!important;aspect-ratio:auto;transform-origin:center;transition:none!important;will-change:transform,opacity}
.selection-ghost .card-name{display:none}

/* A compact, full-width no-win notice sits directly above the hand. */
.hand-layout{min-width:0}
.hand-layout .hand{min-width:0}
.hand-notice{display:flex;align-items:center;gap:8px 16px;flex-wrap:wrap;padding:12px 16px;margin-bottom:18px;background:#fffef9;border:1px solid var(--line);border-radius:10px;color:#bc332b;box-shadow:0 3px 0 #252c290a}
.hand-notice strong{font-size:14px;line-height:1.3}
.hand-notice p{font-size:12px;line-height:1.5;margin:0}
@media(max-width:700px){
  .hand-notice{padding:10px 12px;gap:4px}
  .hand-notice strong{font-size:13px}
  .hand-notice p{font-size:12px}
}

/* A short practice round uses the same cards, previews, and play controls. */
.tutorial-coach{padding:18px 20px;margin:0 0 20px;background:#eaf0e3;border:1px solid #cbd8c2;border-radius:12px}
.tutorial-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.tutorial-heading .eyebrow{color:var(--green);margin:0}
.tutorial-heading .quiet{font-size:11px;padding:6px 0}
.tutorial-coach h2{font-size:21px;margin-top:5px}
.tutorial-coach h2:focus{outline:none}
.tutorial-coach p{font-size:14px;line-height:1.6;margin:8px 0 0;max-width:720px}
.tutorial-coach>.primary{margin-top:14px}
.tutorial-active .hand .playing-card:disabled{opacity:.35}
.tutorial-active .hand .tutorial-pick{box-shadow:0 0 0 2px var(--paper),0 0 0 4px var(--green),0 5px 10px #252c2920}
.tutorial-active .hand .tutorial-pick.selected{box-shadow:0 0 0 3px var(--paper),0 0 0 5px var(--ink),0 10px 14px #252c2920}
.tutorial-active .demo-reference,.tutorial-active footer{display:none}
.tutorial-active .play-actions:not(:has(button:not([hidden]))){display:none}
#tutorial-welcome .dialog-actions{flex-wrap:wrap}
@media(max-width:700px){
  .tutorial-coach{padding:12px 14px;margin-bottom:14px}
  .tutorial-heading .quiet{min-height:44px;padding:5px 0}
  .tutorial-coach h2{font-size:18px;margin-top:0}
  .tutorial-coach p{font-size:12px;line-height:1.5;margin-top:6px}
  .tutorial-coach>.primary{width:100%;min-height:44px;margin-top:10px}
  .tutorial-active .play-actions #play-button{grid-column:2 / 4}
}

/* The shared table holds the target on the left and draw pile on the right. */
.move-previews{grid-template-columns:minmax(0,1fr)}
.arena{grid-template-columns:180px minmax(0,1fr) 180px}
.arena .deck-column{width:120px;max-width:100%;justify-self:end}
.arena .target-column{min-width:0;padding:0 16px 0 0;border-left:0;border-right:1px solid #d3dbcc;text-align:center}
.arena .target-column .eyebrow{font-size:9px;letter-spacing:1px;margin-bottom:3px}
.arena .target-column>strong{font-size:56px;line-height:1.1}
.arena .target-column small{font-size:10px;line-height:1.4}
.arena #target-equation{font-size:12px;line-height:1.7;text-align:center;margin:5px 0}
@media(max-width:1000px){
  .arena{grid-template-columns:150px minmax(0,1fr) 150px}
  .arena .deck-column{width:85px}
}
@media(max-width:700px){
  .arena{grid-template-columns:90px minmax(0,1fr) 90px;gap:10px;padding:8px 10px 12px}
  .arena .deck-column{width:35px}
  .arena .target-column{padding-right:8px}
  .arena .target-column .eyebrow{font-size:7px;letter-spacing:.5px}
  .arena .target-column>strong{font-size:38px}
  .arena .target-column small{font-size:9px}
  .arena #target-equation{font-size:11px;line-height:1.6;margin:4px 0}
}

/* Desktop spacing grows with the viewport instead of switching at 850px. */
@media(min-width:701px){
  .masthead{height:clamp(48px,6dvh,72px)}
  .brand{font-size:22px}
  .brand-icon{width:28px;height:32px;font-size:27px}
  .header-actions .quiet,.header-actions .icon-button{min-height:44px}
  .scorebar{padding:clamp(7px,1dvh,12px) 20px}
  .avatar{width:28px;height:28px;font-size:12px}
  .player-score>b{font-size:23px}
  .round-indicator small{margin-top:2px}
  .opponent-row{height:auto;margin:clamp(8px,1.1dvh,14px) 20px 5px}
  .opponent-hand-header{margin-bottom:5px}
  .opponent-hand-header h2{font-size:12px}
  .opponent-cards{gap:7px}
  .opponent-cards .mini-back{flex-basis:clamp(28px,3.5dvh,38px);width:clamp(28px,3.5dvh,38px);height:clamp(39px,4.9dvh,53px);border-radius:5px}
  .opponent-cards .mini-back::before{inset:3px}
  .opponent-cards .mini-back::after{font-size:10px}
  .turn-event{min-height:0;font-size:10px;padding:0 12px 3px;line-height:1.3}
  .turn-event:empty{display:none}
  .arena{min-height:0;padding:clamp(5px,1dvh,14px) 24px clamp(9px,1.4dvh,20px);grid-template-columns:160px minmax(0,1fr) 160px}
  .arena .target-column>strong{font-size:38px}
  .arena .target-column .eyebrow{font-size:8px;margin-bottom:0}
  .arena #target-equation{font-size:11px;margin:1px 0;line-height:1.5}
  .arena .target-column small{font-size:9px;margin-top:2px}
  .arena .deck-column{width:90px}
  .deck-card{width:39px;height:54px;border-width:3px;border-radius:6px;font-size:18px;margin-bottom:5px}
  .deck-column small{font-size:7px;margin-top:1px}
  .table-center{padding:3px 0}
  .table-cards{gap:6px;margin-bottom:5px}
  .table-cards .playing-card{width:clamp(43px,6dvh,64px);height:clamp(60px,8.4dvh,90px);border-radius:6px}
  .table-cards .card-value{font-size:30px;letter-spacing:-2px}
  .table-cards .card-corner{font-size:12px;left:6px;top:5px}
  .table-cards .card-corner.bottom{left:auto;top:auto;right:6px;bottom:5px}
  .table-owner{font-size:8px}
  .empty-table .table-mark{display:none}
  .empty-table h3{font-size:14px;margin-bottom:4px}
  .status-bar{font-size:10px;min-height:0;padding:5px 12px;line-height:1.4}
  .play-builder{grid-template-columns:minmax(0,1fr) 134px;gap:12px;margin-top:clamp(10px,1.5dvh,20px);padding:clamp(10px,1.4dvh,18px) 12px;min-height:0}
  .move-previews{gap:0}
  .move-stack{gap:6px}
  .play-builder .your-preview{padding:clamp(8px,1.2dvh,16px) 12px}
  .play-builder .your-preview .eyebrow{font-size:10px;margin-bottom:3px}
  .play-builder .your-preview .calculation{font-size:clamp(29px,3.4dvh,38px);line-height:1.3}
  .play-builder .selection-help{font-size:11px;line-height:1.4;margin-top:3px}
  .play-builder .opponent-preview{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:2px 12px;padding:6px 10px;margin-left:16px}
  .play-builder .opponent-preview .eyebrow{font-size:8px;letter-spacing:.6px;margin:0}
  .play-builder .opponent-preview .calculation{font-size:20px;line-height:1.3}
  .play-builder .opponent-preview .selection-help{grid-column:1/-1;font-size:10px;line-height:1.3;margin:0}
  .play-builder .play-actions{grid-column:2;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:6px;margin:0}
  .play-actions button{min-height:44px;padding:10px 12px}
  .hand-section{padding-top:10px}
  .hand-header{margin-bottom:8px}
  .hand-header p{margin-top:3px;font-size:10px}
  .hand-header .quiet{min-height:44px}
  .hand{gap:10px;min-height:0;padding:9px 5px 12px}
  .hand .playing-card{width:clamp(76px,9.5dvh,102px);height:clamp(104px,13dvh,140px)}
  .hand .card-value{font-size:clamp(45px,5.6dvh,58px);letter-spacing:-2px}
  .hand .card-name{font-size:6px;bottom:21px}
  .hand .card-corner{font-size:17px;left:8px;top:6px}
  .hand .card-corner.bottom{left:auto;top:auto;right:8px;bottom:6px}
  .hand .playing-card.selected,.hand .playing-card.selected:hover{transform:translateY(-5px)}
  .hand-notice{padding:8px 12px;margin-bottom:12px}
  .hand-notice strong{font-size:13px}
  .hand-notice p{font-size:11px}
  .tutorial-coach{padding:10px 14px;margin-bottom:12px}
  .tutorial-coach h2{font-size:18px;margin-top:2px}
  .tutorial-coach p{font-size:12px;line-height:1.45;margin-top:5px}
  .tutorial-coach>.primary{margin-top:8px;min-height:44px}
  footer{padding:0 0 6px}
}
@media(min-width:900px){
  .tutorial-active .hand-section{display:grid;grid-template-columns:clamp(200px,20vw,260px) minmax(0,1fr);gap:0 16px;align-items:start}
  .tutorial-active .tutorial-coach{grid-column:1;grid-row:1 / 3;margin:0}
  .tutorial-active .hand-header,.tutorial-active .hand-layout{grid-column:2}
  .tutorial-active .hand{display:grid;grid-template-columns:repeat(8,minmax(0,76px));justify-content:center;gap:8px}
  .tutorial-active .hand .playing-card{width:100%;height:auto;aspect-ratio:3 / 4}
}
/* Very short screens scroll naturally; no tall sticky preview covers the hand. */
@media(max-height:650px){
  .move-previews{position:static}
  .tutorial-coach{scroll-margin-top:12px}
}
@media(min-width:701px) and (max-height:650px){
  .masthead{height:44px}
  .opponent-row{margin-top:5px;margin-bottom:3px}
  .opponent-cards .mini-back{height:33px;flex-basis:24px;width:24px}
  .hand .playing-card{width:70px;height:96px}
  .hand .card-value{font-size:41px}
  .hand-section{padding-top:6px}
  .hand-header{margin-bottom:5px}
}
@media(min-width:701px) and (max-height:650px){
  .scorebar{padding:4px 20px}
  .round-indicator>span{font-size:9px;letter-spacing:1px}
  .round-indicator small{font-size:6px;letter-spacing:.8px}
  .status-bar:not(.attack-status):not(.win-status){display:none}
  .play-builder{grid-template-columns:minmax(0,1fr) 220px;padding:8px 10px}
  .play-builder .your-preview{padding:6px 10px}
  .play-builder .your-preview .calculation{font-size:26px}
  .play-builder .selection-help{font-size:10px;line-height:1.3}
  .play-builder .opponent-preview{padding:4px 8px;gap:1px 10px}
  .play-builder .play-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
  .play-actions .primary{grid-column:1 / -1}
}
/* Keep the new-match control circular, including inside a narrow header. */
.header-actions .icon-button{flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:50%;display:grid;place-items:center;line-height:1}

/* Phones keep the table, both calculations, and a normal hand close together. */
@media(max-width:700px){
  .masthead{height:44px}
  .brand{font-size:19px}
  .brand-icon{width:23px;height:27px;font-size:24px}
  .header-actions{gap:6px}
  .header-actions .quiet{font-size:11px}
  .scorebar{padding:5px 10px}
  .avatar{display:none}
  .player-score{gap:9px}
  .player-score>b{font-size:23px}
  .round-indicator small{margin-top:2px}
  .opponent-row{margin:5px 10px 3px;height:auto}
  .opponent-hand-header{margin-bottom:3px}
  .opponent-hand-header h2{font-size:10px}
  .opponent-cards{gap:5px}
  .opponent-cards .mini-back{width:20px;flex-basis:20px;height:27px;border-radius:4px}
  .opponent-cards .mini-back::before{inset:2px}
  .opponent-cards .mini-back::after{font-size:8px}
  .turn-event{font-size:9px;line-height:1.3;padding:1px 8px 2px}
  .arena{min-height:0;grid-template-columns:78px minmax(0,1fr) 78px;gap:6px;padding:4px 8px 7px}
  .arena .target-column{padding-right:4px}
  .arena .target-column>strong{font-size:29px}
  .arena .target-column .eyebrow{font-size:6px;margin:0}
  .arena #target-equation{font-size:9px;line-height:1.3;margin:2px 0}
  .arena .target-column small{font-size:8px;margin-top:2px}
  .arena .deck-column{width:33px}
  .deck-card{width:25px;height:35px;margin-bottom:3px;font-size:12px}
  .deck-column strong{font-size:11px}
  .deck-column small{font-size:6px;margin-top:2px}
  .table-cards{flex-wrap:nowrap;gap:3px;margin-bottom:4px}
  .table-cards .playing-card{width:30px;height:43px;flex-shrink:0;border-radius:5px}
  .table-cards:has(.playing-card:nth-child(4)) .playing-card+.playing-card{margin-left:-11px}
  .table-cards .card-value{font-size:25px;letter-spacing:-1px}
  .table-cards .card-corner{font-size:10px;left:4px;top:3px}
  .table-cards .card-corner.bottom{left:auto;top:auto;right:4px;bottom:3px}
  .table-owner{font-size:7px}
  .empty-table .table-mark{display:none}
  .empty-table h3{font-size:11px;margin-bottom:0}
  .empty-table p{display:none}
  .round-result .result-symbol{font-size:22px}
  .round-result h3{font-size:14px}
  .round-result p{font-size:10px}
  .status-bar:not(.win-status){display:none}
  .status-bar.win-status{font-size:10px;padding:5px 8px}
  .player-area{padding-top:5px}
  .move-previews{position:static;padding:0;gap:4px}
  .move-stack{gap:4px}
  .play-builder .your-preview{padding:7px 10px}
  .play-builder .your-preview .eyebrow{font-size:9px;margin-bottom:2px}
  .play-builder .your-preview .calculation{font-size:clamp(22px,6.1vw,27px);line-height:1.25}
  .play-builder .selection-help{font-size:10px;line-height:1.3;margin-top:3px}
  .play-builder .your-preview[data-empty="true"] .selection-help:not(.invalid){display:none}
  .play-builder .opponent-preview{padding:5px 8px;margin-left:10px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:2px 6px}
  .play-builder .opponent-preview .eyebrow{font-size:7px;letter-spacing:.3px;margin:0;max-width:85px}
  .play-builder .opponent-preview .reply-arrow{display:none}
  .play-builder .opponent-preview .calculation{font-size:18px;line-height:1.3}
  .play-builder .opponent-preview .selection-help{grid-column:1/-1;font-size:9px;line-height:1.25;margin:0}
  .hand-section{padding-top:4px}
  .hand-header{margin-bottom:3px;min-height:36px}
  .hand-header h2{font-size:13px}
  .hand-header p{display:none}
  .hand-header .quiet{font-size:10px;padding:4px 0}
  .hand{display:flex;flex-wrap:wrap;justify-content:center;gap:12px 8px;max-width:382px;padding:7px 4px 8px}
  .hand .playing-card{width:calc((100% - 32px) / 5);max-width:68px;height:auto;aspect-ratio:3 / 4;scroll-margin-block:12px 80px}
  .hand .card-value{font-size:clamp(28px,8vw,37px);letter-spacing:-1px}
  .hand .card-corner{font-size:12px;left:6px;top:5px}
  .hand .card-corner.bottom{left:auto;top:auto;right:6px;bottom:5px}
  .hand .card-name{font-size:5px;letter-spacing:0;bottom:14px}
  .hand .card-badge{font-size:6px;padding:2px 3px}
  .hand-notice{padding:7px 10px;gap:2px;margin-bottom:9px}
  .hand-notice strong{font-size:12px}
  .hand-notice p{font-size:11px;line-height:1.3}
  .play-builder .play-actions{padding-top:6px;padding-bottom:max(6px,env(safe-area-inset-bottom));gap:6px}
  .tutorial-coach{padding:7px 10px;margin-bottom:8px}
  .tutorial-coach h2{font-size:16px}
  .tutorial-coach p{font-size:11px;line-height:1.35;margin-top:3px}
  .tutorial-coach>.primary{margin-top:6px}
}
.sound-icon{width:20px;height:20px}
#sound-button[aria-pressed="true"] .sound-muted,#sound-button[aria-pressed="false"] .sound-waves{display:none}
#sound-button[aria-pressed="false"]{color:var(--muted)}
.header-actions .rules-full,.header-actions .rules-short{margin:0}
.rules-short{display:none}
@media(max-width:400px){
  .brand{font-size:17px;gap:6px}
  .brand-icon{width:21px;height:25px}
  .header-actions{gap:4px}
  #rules-button{min-width:44px}
  .rules-full,.rules-arrow{display:none}
  .rules-short{display:inline}
}
.discarding-hand #play-button{background:var(--red);color:white}
.discarding-hand .your-preview{border-color:var(--red)}
.discarding-hand .your-preview .calculation{font-size:clamp(20px,3vw,29px)}

/* Raise the Sum: an outlined wordmark stays crisp without a font request. */
.masthead .brand{flex:0 0 auto;gap:0;line-height:1}
.brand-logo{display:block;width:158px;height:auto;max-height:58px}
@media(min-width:701px) and (max-height:1100px){.brand-logo{width:122px;max-height:42px}}
@media(max-width:700px){.brand-logo{width:120px;max-height:42px}}
@media(max-width:360px){.brand-logo{width:112px;max-height:40px}}

/* Seats stay in clockwise order; the table remains between opponents and you. */
.match-size-button{border:0;background:transparent;color:var(--green);font-size:10px;font-weight:700;padding:3px 6px;min-height:24px;white-space:nowrap}
.match-size-button:hover{text-decoration:underline}
.opponent-row{position:relative}
.opponents{display:grid;grid-template-columns:repeat(var(--opponents),minmax(0,1fr));gap:14px}
.opponent-seat{min-width:0;padding:4px 6px 7px;border-radius:10px;border:1px solid transparent}
.opponent-seat.seat-current{border-color:#21795555;background:#f6f8f250}
.opponent-seat.seat-passed .opponent-cards{opacity:.32}
.opponent-hand-header{flex-wrap:wrap;gap:3px 7px}
.opponent-state{font-size:10px;color:var(--muted)}
.opponent-seat.seat-current .opponent-state{color:var(--green);font-weight:700}
.opponent-seat.seat-passed .opponent-state{color:var(--red);font-weight:700}
.multiplayer .thinking{display:none}
.multiplayer-scorebar{display:grid;grid-template-columns:repeat(var(--seats),minmax(0,1fr));gap:7px 12px}
.multiplayer-scorebar .round-indicator{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:12px}
.multiplayer-scorebar .round-indicator small{margin:0}
.multiplayer-scorebar .player-score{min-width:0;justify-content:center;gap:8px;text-align:left;padding:4px 6px;border-radius:8px}
.multiplayer-scorebar .points{justify-content:flex-start}
.multiplayer-scorebar .player-score>b{margin:0;font-size:24px}
.multiplayer-scorebar .seat-current{background:#d7e6d2}
.multiplayer-scorebar .seat-passed{opacity:.55}
.seat-state{display:block;font-size:9px;margin-top:3px;color:var(--muted)}
.multiplayer .opponent-cards{flex-wrap:wrap;gap:4px;min-height:37px;align-content:flex-start;padding:0}
.multiplayer .opponent-cards .mini-back{width:24px;flex-basis:24px;height:34px;border-radius:4px}
.multiplayer .opponent-cards .mini-back::after{font-size:10px}
.multiplayer .opponent-hand-header h2{font-size:12px}
.multiplayer .opponent-hand-header h2>span{font-size:9px;margin-left:3px;padding:2px 4px}
.spectating .your-preview .calculation{font-size:26px}
.spectating .play-actions{display:none}
.spectating .hand .playing-card{opacity:.7}
.player-count-picker{border:0;padding:0;margin:20px 0;display:grid;gap:8px}
.player-count-picker legend{font-weight:700;font-size:13px;margin-bottom:10px}
.player-count-picker label{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:10px;padding:13px;cursor:pointer}
.player-count-picker label:has(input:checked){background:#e8ece2;border-color:var(--green)}
.player-count-picker input{accent-color:var(--green);width:18px;height:18px;flex-shrink:0}
.player-count-picker b,.player-count-picker small{display:block;font-size:13px}
.player-count-picker small{font-size:11px;color:var(--muted);margin-top:3px}
.match-setup-note{font-size:12px!important}
@media(max-width:700px){
 .match-size-button{font-size:9px;padding:2px 4px;min-height:24px}
 .opponents{gap:3px}
 .opponent-seat{padding:3px 2px 5px}
 .multiplayer-scorebar{padding:4px 8px;gap:2px}
 .multiplayer-scorebar .player-score{padding:4px 2px;gap:5px}
 .multiplayer-scorebar .player-score .avatar{display:none}
 .multiplayer-scorebar .player-score>b{font-size:21px}
 .multiplayer-scorebar .player-score strong{font-size:10px}
 .multiplayer-scorebar .seat-state{font-size:8px}
 .multiplayer .opponent-row{margin:5px 6px 3px}
 .multiplayer .opponent-hand-header{display:block;text-align:center;margin-bottom:3px}
 .multiplayer .opponent-hand-header h2{font-size:10px;line-height:1.5}
 .multiplayer .opponent-hand-header h2>span{display:block;width:max-content;margin:1px auto 0;font-size:8px;background:transparent;padding:0}
 .multiplayer .opponent-state{font-size:9px;line-height:1.3;display:block}
 .multiplayer .opponent-cards{gap:3px;max-width:90px;min-height:40px;margin:auto}
 .multiplayer .opponent-cards .mini-back{width:17px;flex-basis:17px;height:23px;border-width:1px;box-shadow:0 1px 0 #aebba6}
 .multiplayer .opponent-cards .mini-back::before{inset:2px}
 .multiplayer .opponent-cards .mini-back::after{font-size:7px}
 .multiplayer footer{font-size:7px;letter-spacing:0}
 .spectating .your-preview .calculation{font-size:23px}
}
.scorebar:not(.multiplayer-scorebar) .round-indicator{display:grid;grid-template-columns:auto auto;column-gap:8px;align-items:center}
.scorebar:not(.multiplayer-scorebar) .round-indicator>span,.scorebar:not(.multiplayer-scorebar) .round-indicator small{grid-column:1}
.scorebar:not(.multiplayer-scorebar) .match-size-button{grid-column:2;grid-row:1/3}
@media(max-width:700px){
 .multiplayer .opponent-hand-header h2>span{display:inline;margin-left:3px;font-size:8px}
 .multiplayer .opponent-cards{min-height:49px}
 .multiplayer .hand .playing-card{max-width:56px}
}
@media(max-width:700px){
 #new-dialog{padding:20px}
 #new-dialog h2{font-size:28px;line-height:1.1;margin-bottom:10px}
 #new-dialog p{font-size:12px;line-height:1.45;margin:10px 0}
 #new-dialog .player-count-picker{margin:14px 0;gap:6px}
 #new-dialog .player-count-picker label{padding:10px}
 #new-dialog .match-setup-note{font-size:11px!important}
}

/* Compare the target with both move previews in one place. */
.arena{grid-template-columns:90px minmax(0,1fr) 90px}
.arena .table-center{grid-column:2}
.arena .deck-column{grid-column:3}
.move-previews{grid-template-columns:150px minmax(0,1fr);gap:16px;align-items:stretch}
.move-previews .target-column{display:flex;flex-direction:column;align-items:center;justify-content:center;grid-column:1;grid-row:1;align-self:stretch;padding:14px 10px;border:0;border-radius:10px;background:#e8ece2;text-align:center}
.move-previews .move-stack{grid-column:2;min-width:0}
.move-previews .target-column .eyebrow{font-size:9px;line-height:1.5;letter-spacing:.8px;margin:0 0 3px}
.move-previews .target-column>strong{font-size:58px;line-height:1.1;letter-spacing:-2px}
.move-previews .target-column #target-equation{font-size:11px;line-height:1.7;text-align:center;margin:5px 0;max-width:100%}
.move-previews .target-column small{font-size:10px;line-height:1.4;margin:2px 0 0;text-align:center}
@media(min-width:701px) and (max-width:1000px){
 .move-previews{grid-template-columns:120px minmax(0,1fr);gap:12px}
 .play-builder .opponent-preview{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:700px){
 .arena{grid-template-columns:35px minmax(0,1fr) 35px}
 .move-previews{grid-template-columns:72px minmax(0,1fr);gap:7px}
 .move-previews .target-column{padding:8px 4px;border:0}
 .move-previews .target-column .eyebrow{font-size:8px;letter-spacing:.3px;line-height:1.4}
 .move-previews .target-column>strong{font-size:38px;letter-spacing:-1.5px}
 .move-previews .target-column #target-equation{font-size:9px;line-height:1.6;margin:4px 0}
 .move-previews .target-column #target-equation .math-term{padding:0 1px}
 .move-previews .target-column small{font-size:9px;line-height:1.35}
 .play-builder .your-preview{padding:8px}
 .play-builder .your-preview .eyebrow{font-size:8px;letter-spacing:.4px}
 .play-builder .your-preview .calculation{font-size:clamp(18px,5.2vw,27px);line-height:1.35}
 .play-builder .opponent-preview{display:block;margin-left:6px;padding:6px 7px}
 .play-builder .opponent-preview .eyebrow{max-width:none;display:block;margin-bottom:3px}
 .play-builder .opponent-preview .calculation{font-size:clamp(16px,4.6vw,22px);line-height:1.4}
 .play-builder .opponent-preview .selection-help{margin-top:3px}
 .move-stack .math-term{padding:0 1px}
}
