@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');
:root{--ink:#203b35;--green:#185c4c;--cream:#f6f5ef;--muted:#7d8981;--line:#e2e5db;--gold:#dab478;--red:#bd493f;--card-w:54px;--card-h:82px;font-family:'DM Sans','Noto Sans SC',sans-serif;color:var(--ink);background:var(--cream);font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;transition:background .16s,box-shadow .16s,transform .16s}button:disabled{opacity:.38;cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #d0a452;outline-offset:3px}button:not(:disabled):active{transform:translateY(1px)}a{color:inherit;text-decoration:none}button{color:inherit}h1,h2,h3,p{margin:0}.topbar{height:88px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 4.2vw;background:#fbfaf6}.brand{display:flex;align-items:center;gap:12px;font-size:22px;letter-spacing:-.6px}.brand b{font-weight:400;color:#6a7c70}.brand small{display:block;font-size:9px;letter-spacing:2px;color:#7b857b;margin-top:5px}.brand-mark{background:var(--green);color:#f5ebd3;font-size:35px;width:47px;height:47px;display:grid;place-items:center;border-radius:12px}.topbar nav{display:flex;align-items:center;gap:22px}.version{font-size:11px;color:#8b958b;font-weight:600;letter-spacing:1px}.version span{border:1px solid #d9dfd4;border-radius:4px;padding:3px 5px;margin-left:4px}.nav-button,.language-button,.settings-button{border:0;background:transparent;font-size:12px;font-weight:600}.language-button{border-left:1px solid var(--line);padding-left:24px}.settings-button{font-size:22px}main{max-width:1640px;margin:auto;padding:34px 4.2vw 0}.page-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:28px;gap:20px}.eyebrow{font-size:10px;font-weight:600;letter-spacing:2px;color:#839184}h1{font-weight:500;font-size:32px;letter-spacing:-1px;margin:7px 0 10px}.page-heading p{font-size:12px;color:#7b877d}.heading-actions{display:flex;gap:10px}.primary,.secondary,.gold-button,.small-primary{border:1px solid transparent;border-radius:7px;padding:11px 17px;font-size:12px;font-weight:600;white-space:nowrap}.primary,.small-primary{background:var(--green);color:white}.primary:hover,.small-primary:hover{background:#24715e}.secondary{background:#fffefa;border-color:#dce2d7}.secondary:hover{background:#eef1e8}.gold-button{background:#e7cf9e;color:#574a2d;border-color:#ddc38f}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:23px;align-items:start}.table-column{min-width:0}.table{background:radial-gradient(ellipse at 50% 60%,#246b58 0%,#155142 72%);height:362px;border-radius:15px;position:relative;overflow:hidden;color:#e7f0df;box-shadow:inset 0 0 0 1px #ffffff13,0 6px 15px #1d3c2912}.table:before{content:'';position:absolute;inset:22px 32px;border:1px solid #c4dac314;border-radius:44%;pointer-events:none}.table-top{position:absolute;left:22px;right:22px;top:18px;display:flex;justify-content:space-between;align-items:center;z-index:2}.table-mode{font-size:9px;color:#a5c1ad;letter-spacing:1px;display:flex;align-items:center;gap:7px}.table-mode i,.live-dot{height:5px;width:5px;border-radius:50%;background:#b3cb9c;display:inline-block}.level-chip{display:flex;align-items:center;gap:10px;font-size:10px;color:#c3d3bf;background:#123d3380;padding:7px 10px;border-radius:6px}.level-chip b{font-size:21px;color:#ebdcb7;font-family:Georgia,serif}.level-chip span{border-left:1px solid #c6d5ba30;padding-left:10px;color:#e7b4a2}.seat{position:absolute;z-index:1;width:150px}.seat-2{top:53px;left:50%;transform:translateX(-50%);width:235px}.seat-3{top:143px;left:26px}.seat-1{top:143px;right:26px}.seat-head{display:flex;align-items:center;gap:8px;justify-content:center}.avatar{width:30px;height:30px;border-radius:50%;background:#ffffff10;border:1px solid #b3c9af38;display:grid;place-items:center;color:#c5cfb9;font-size:11px}.avatar.partner{background:#d6c99b24;color:#ebd8a4}.seat-head strong{font-size:11px;font-weight:500}.seat-head small{font-size:9px;color:#a1bba6;display:block;margin-top:3px}.acting .avatar{box-shadow:0 0 0 3px #e1c38a54;border-color:#e1c38a}.eye{background:transparent;border:0;color:#b3c6b0;font-size:15px;padding:4px}.card-backs{display:flex;justify-content:center;margin-top:13px;height:41px}.card-backs i{width:28px;height:39px;margin-left:-10px;border:1px solid #b2c9b260;border-radius:4px;background:repeating-linear-gradient(45deg,#4c7a64,#4c7a64 2px,#416b58 2px,#416b58 5px);box-shadow:0 1px 3px #082f2a55;transform:rotate(-5deg)}.card-backs i:nth-child(3){transform:rotate(0)}.card-backs i:nth-child(4){transform:rotate(5deg)}.card-backs i:nth-child(5){transform:rotate(10deg)}.seat-cards{display:flex;flex-wrap:wrap;gap:2px;justify-content:center;max-height:132px;overflow:auto;margin-top:9px;padding:3px}.seat-cards .card.mini{width:24px;height:34px}.seat-cards .card-corner b{font-size:10px}.seat-cards .card-corner span{font-size:9px}.seat-cards .card-corner{top:2px;left:3px}.seat-cards .card-pip{display:none}.seat-cards .wild-badge,.seat-cards .level-badge{font-size:6px;padding:1px;right:1px;top:auto;bottom:1px}.table-center{position:absolute;top:163px;left:50%;transform:translateX(-50%);text-align:center;width:42%;max-width:340px}.table-watermark{font-size:52px;color:#b1ceb32a;line-height:1;margin-bottom:8px}.center-caption{font-size:10px;letter-spacing:1px;color:#acc5ad;margin-bottom:12px}.turn-label{font-size:10px;border:1px solid #c4d5b82a;border-radius:20px;padding:5px 12px;display:inline-block;margin-top:8px;color:#d8dfc8}.played-cards{display:flex;justify-content:center}.played-cards .card{margin-left:-9px}.played-cards .card:first-child{margin-left:0}.table-bottom{position:absolute;left:22px;right:22px;bottom:17px;display:flex;justify-content:space-between;font-size:8px;color:#8fb39a;gap:10px}.table-bottom b{font-weight:400;color:#bed1b8}.playback{display:flex;justify-content:space-between;align-items:center;padding:13px 2px 16px;gap:8px}.playback-left{display:flex;align-items:center;gap:8px}.playback .secondary{font-size:11px;padding:8px 12px}.text-button{border:0;background:transparent;font-size:11px;color:#667e6b;padding:8px}.auto-button{background:transparent;border:0;color:var(--green);font-size:11px;font-weight:600;padding:8px 0}.icon-button{width:30px;height:30px;display:inline-grid;place-items:center;background:transparent;border:1px solid var(--line);border-radius:6px;font-size:17px}.hand-panel{background:#fffefa;border:1px solid var(--line);border-radius:12px;padding:18px 19px 12px}.hand-heading,.hand-heading>div{display:flex;align-items:center;gap:8px}.hand-heading{justify-content:space-between}.hand-heading h2{font-size:14px;font-weight:600}.you-dot{height:6px;width:6px;background:#427b60;border-radius:50%}.count-pill{font-size:10px;border-radius:5px;background:#eff1e9;color:#6f806d;padding:3px 6px}.segmented{background:#f1f2eb;border-radius:6px;padding:3px;gap:0!important}.segmented button{background:transparent;border:0;padding:6px 10px;font-size:10px;border-radius:4px;color:#8b9487}.segmented .active{background:#fffefa;box-shadow:0 1px 4px #283d2410;color:#31563e}.flush-tools{display:flex;align-items:center;gap:7px;margin:17px 0 13px;font-size:10px;color:#87927f}.suit-button{height:27px;min-width:27px;padding:2px 5px;border-radius:5px;border:1px solid #dee3d5;background:#fafbf6;color:#243e32;font-size:19px;position:relative}.suit-button.red{color:var(--red)}.suit-button sup{font-size:8px;margin-left:2px}.suit-button.available{background:#f4f6ec;border-color:#c9d5bd}.hint-status{margin-left:auto;font-size:9px}.hand-scroll{overflow-x:auto;padding:8px 0 7px;min-height:151px;scrollbar-width:thin;scrollbar-color:#d7ddcd transparent}.rank-hand{display:flex;gap:5px;align-items:flex-end;min-width:max-content;padding:7px 1px 3px}.rank-stack{position:relative;width:var(--card-w);height:calc(var(--card-h) + (var(--count) - 1)*25px);flex-shrink:0}.rank-stack>div{position:absolute;top:calc(var(--i)*25px);left:0}.card{width:var(--card-w);height:var(--card-h);background:#fffef9;border:1px solid #d3d9ca;box-shadow:0 2px 3px #243c2910;border-radius:5px;position:relative;display:inline-block;flex-shrink:0;color:#283e35;padding:0;vertical-align:middle}.card.red{color:var(--red)}.card-corner{position:absolute;top:5px;left:6px;display:flex;align-items:center;gap:2px}.card-corner b{font-size:19px;letter-spacing:-1px;font-family:Georgia,serif;font-weight:700}.card-corner span{font-size:14px}.card-pip{position:absolute;bottom:9px;left:0;right:0;text-align:center;font-size:31px;line-height:1}.wild-badge,.level-badge{position:absolute;right:3px;top:28px;background:#e6c78b;color:#644e2a;font-size:8px;font-style:normal;padding:2px 3px;border-radius:3px}.level-badge{background:#e4ebdc;color:#486449}.card.selected{background:#f4e9cc;border-color:#a88844;box-shadow:0 0 0 2px #cba565;transform:translateY(-7px);z-index:5}.card.highlighted{background:#eff5dc;border-color:#7ba258;box-shadow:0 0 0 2px #9bb96c}.card:hover:not(span){border-color:#829d6f}.card.mini{width:38px;height:55px;border-radius:4px}.card.mini .card-corner{left:4px;top:4px}.card.mini .card-corner b{font-size:15px}.card.mini .card-corner span{font-size:10px}.card.mini .card-pip{font-size:20px;bottom:5px}.card.mini .wild-badge,.card.mini .level-badge{font-size:6px;top:22px;padding:1px 2px}.assignment{position:absolute;bottom:2px;left:0;right:0;background:#e9d7b7;font-size:9px;text-align:center;color:#695638}.group-hand{display:flex;gap:9px;align-items:flex-start;min-width:max-content;padding-top:6px}.hand-group,.ungrouped{background:#f5f6ed;border:1px solid #e4e8da;border-radius:7px;padding:6px}.hand-group.locked{border-color:#c8ad70;background:#f8f3e5}.group-label{height:25px;display:flex;align-items:center;gap:4px;font-size:9px;color:#819077}.group-label span{margin-right:auto}.icon{border:0;background:transparent;padding:1px 4px;color:#8d947d;font-size:15px}.group-cards{display:flex}.group-cards .card+.card{margin-left:-20px}.loose-cards{display:flex;gap:3px}.empty-small{padding:20px;color:#9aaa8a}.hand-footer{display:flex;justify-content:space-between;border-top:1px solid #ebeee2;padding-top:13px;margin-top:10px;gap:10px;flex-wrap:wrap}.arrange-actions,.play-actions{display:flex;gap:6px;align-items:center}.hand-footer .primary,.hand-footer .secondary,.hand-footer .gold-button{font-size:10px;padding:8px 10px}.hand-help{font-size:9px;color:#8d9686;margin-top:12px;line-height:1.7}.hint-preview{display:flex;align-items:center;gap:10px;padding:7px 9px;background:#edf2e3;font-size:10px;border-radius:5px}.hint-preview span{margin-right:auto}.small-primary{font-size:10px;padding:5px 8px}.analysis-panel{background:#fffefa;border:1px solid var(--line);border-radius:12px;overflow:hidden}.panel-tabs{display:flex;border-bottom:1px solid var(--line);padding:0 17px;gap:20px}.panel-tabs button{background:transparent;border:0;border-bottom:2px solid transparent;font-size:12px;color:#8c9686;padding:17px 3px 14px}.panel-tabs button.active{color:#315d41;border-bottom-color:#315d41;font-weight:600}.panel-body{padding:22px 20px}.score-hero{display:flex;align-items:center;justify-content:space-between}.score-hero .eyebrow{font-size:9px;letter-spacing:1px}.score-number{font-size:53px;font-weight:500;line-height:1.2;letter-spacing:-2px;margin-top:7px}.score-number small{font-size:13px;letter-spacing:0;color:#9da58f;margin-left:5px;font-weight:400}.score-ring{width:61px;height:61px;background:conic-gradient(#9cae7e var(--score),#ecf0e4 0);border-radius:50%;display:grid;place-items:center;transform:rotate(-30deg)}.score-ring span{background:#fffefa;border-radius:50%;width:51px;height:51px;display:grid;place-items:center;font-size:28px;color:#95a47f;transform:rotate(30deg)}.score-note{font-size:9px;color:#9b9f8e;margin:8px 0 21px}.metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;background:#f3f5ec;border-radius:7px;padding:13px 5px;margin-bottom:21px}.metric-grid div{text-align:center}.metric-grid b{display:block;font-weight:500;font-size:20px;color:#526a42}.metric-grid span{font-size:8px;color:#8a977a;display:block;margin-top:5px}.insight{display:flex;align-items:flex-start;gap:10px;margin-bottom:18px}.insight-icon{display:grid;place-items:center;width:24px;height:24px;flex-shrink:0;background:#eaf0df;color:#7b9761;border-radius:50%;font-size:16px}.insight strong{font-size:11px;font-weight:600}.insight p{font-size:10px;line-height:1.9;color:#89927f;margin-top:5px}.insight.subtle .insight-icon{background:#f5eedf;color:#b89d64}.section-label{font-size:9px;color:#809070;letter-spacing:1px;display:flex;justify-content:space-between;align-items:center;border-top:1px solid #e9ecdf;padding-top:19px;margin-top:19px;margin-bottom:11px}.section-label span{font-size:8px;letter-spacing:0;color:#a1a694}.suggestion{display:flex;width:100%;justify-content:space-between;align-items:center;padding:12px 10px;border:1px solid #e4e8d9;border-radius:7px;background:#fffefa;text-align:left;margin-bottom:8px;gap:10px}.suggestion:hover{background:#f2f5e9;border-color:#c5d3b7}.suggestion strong{display:block;font-size:11px;font-weight:500}.suggestion small{display:block;font-size:9px;color:#8f9a82;margin-top:5px;line-height:1.6}.suggestion-score{font-size:16px;color:#6d8553;display:flex;align-items:center;gap:11px}.suggestion-score i{font-size:13px;font-style:normal;color:#9eae8c}.position-note{font-size:10px;line-height:1.8;color:#718665;margin-top:21px}.position-note .live-dot{margin-right:5px;background:#9ab97d}.position-note small{display:block;font-size:8px;color:#9bA48d;margin-top:5px}.coach-strip{display:flex;align-items:center;gap:13px;border:1px solid #e1e5d6;background:#f0f2e7;border-radius:8px;padding:13px 16px;margin-top:14px}.coach-strip>span:first-child{font-size:24px;color:#8a9f71}.coach-strip strong{font-size:10px;font-weight:500}.coach-strip p{font-size:10px;color:#819173;line-height:1.7;margin-top:4px}.coach-label{font-size:8px;color:#a0aa92;margin-left:auto;white-space:nowrap}footer{display:flex;justify-content:space-between;gap:15px;color:#a0a690;font-size:10px;margin-top:29px;padding:18px 0 23px;border-top:1px solid var(--line)}.footer-divider{padding:0 8px;color:#bec5b2}.muted{font-size:11px;color:#8b967d;line-height:1.8}.history-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.history-heading h3{font-size:15px;font-weight:500}.history-heading>span{font-size:10px;color:#93a17f}.history-list{list-style:none;padding:0;max-height:520px;overflow-y:auto;margin:10px 0}.history-list li button{display:flex;gap:10px;align-items:flex-start;width:100%;text-align:left;border:0;background:transparent;padding:12px 5px;border-bottom:1px solid #edf0e5}.history-list li.current{background:#eff3e5}.history-index{font-size:10px;background:#edf1e4;color:#91a176;min-width:23px;border-radius:4px;padding:3px}.history-list strong{font-size:10px;font-weight:500}.history-list small{font-size:9px;line-height:1.7;display:block;color:#899779;margin-top:5px}.branch-button{display:block;background:#f1f4e9;border:1px solid #dfe7d4;border-radius:6px;font-size:11px;padding:9px;margin-bottom:7px;width:100%;text-align:left}.lesson{border-bottom:1px solid #e6eadc;padding:12px 0}.lesson summary{font-size:11px;cursor:pointer;line-height:1.8;list-style:none}.lesson summary span{font-size:10px;color:#a4b08c;margin-right:10px}.lesson p{font-size:10px;line-height:1.9;color:#879477;padding:9px 0 0 23px}.source-note{font-size:9px;line-height:1.8;color:#a0aa90;margin-top:20px}.source-note a{text-decoration:underline}.analysis-empty{text-align:center;padding:55px 0;color:#8c9d77}.analysis-empty>span{font-size:45px}.analysis-empty h3{font-size:15px;margin:20px 0 10px}.analysis-empty p{font-size:11px;line-height:1.8}dialog{border:1px solid #dce3d2;border-radius:15px;width:min(520px,calc(100% - 30px));max-height:85vh;background:#fffefa;color:var(--ink);padding:25px;box-shadow:0 20px 100px #0b2d3150}dialog::backdrop{background:#0a292a8c;backdrop-filter:blur(3px)}.modal-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:22px}.modal-head h2{font-size:19px;font-weight:500}label{display:block;font-size:12px;color:#607754;margin:16px 0}input:not([type=checkbox]),select{display:block;width:100%;border:1px solid #d8e0cb;background:#fbfcf6;border-radius:6px;padding:11px;margin-top:8px;color:var(--ink);font-size:13px}input[type=checkbox]{accent-color:var(--green);width:17px;height:17px}.toggle-row{display:flex;align-items:center;justify-content:space-between}.modal-submit{width:100%;margin-top:12px}.preset-buttons{display:flex;gap:6px;flex-wrap:wrap}.preset-buttons .secondary{font-size:10px;padding:9px}.rules-content{font-size:12px;line-height:1.9;color:#708465}.rules-content h3{font-size:13px;color:#375a3d;margin:22px 0 8px}.rules-content p{margin:10px 0}.rules-content a{text-decoration:underline}.danger{color:#a65b4d}#toast{position:fixed;bottom:25px;left:50%;transform:translate(-50%,20px);background:#173f35;color:#f5f2e6;padding:13px 20px;z-index:20;border-radius:8px;font-size:12px;box-shadow:0 5px 30px #123d3525;opacity:0;pointer-events:none;transition:.2s;max-width:90vw;line-height:1.7}#toast.show{opacity:1;transform:translate(-50%,0)}
@media(min-width:1500px){:root{--card-w:61px;--card-h:89px}.table{height:390px}.table-center{top:180px}.seat-1,.seat-3{top:160px}.hand-panel{padding:21px 23px 14px}.workspace{grid-template-columns:minmax(0,1fr) 335px}}
@media(max-width:1150px){main{padding-left:24px;padding-right:24px}.workspace{gap:15px;grid-template-columns:minmax(0,1fr) 280px}.panel-body{padding:20px 15px}.seat-1{right:10px}.seat-3{left:10px}.seat{width:105px}.seat-2{width:210px}.table-bottom{font-size:7px}.coach-label{display:none}.hand-footer .secondary,.hand-footer .primary,.hand-footer .gold-button{padding:8px}.hand-heading .segmented button{padding:6px}.hint-status{display:none}}
@media(max-width:900px){.workspace{grid-template-columns:1fr}.analysis-panel .panel-body{max-height:650px;overflow:auto}.analysis-panel{margin-top:5px}.score-hero{max-width:300px}.metric-grid{max-width:500px}.suggestions{display:flex;gap:9px}.suggestion{flex:1;min-width:0}.table{height:350px}.panel-body{padding:20px}.topbar{height:75px;padding:0 24px}.page-heading h1{font-size:28px}.heading-actions{flex-shrink:0}.topbar nav{gap:12px}.version{display:none}}
@media(max-width:600px){main{padding:24px 12px 0}.topbar{height:69px;padding:0 16px}.brand{font-size:18px;gap:9px}.brand-mark{width:36px;height:36px;border-radius:9px;font-size:27px}.brand small{font-size:7px}.topbar nav{gap:7px}.nav-button{display:none}.language-button{padding-left:10px;font-size:10px}.page-heading{align-items:flex-start;flex-direction:column;gap:17px;margin-bottom:19px}.page-heading h1{font-size:28px}.page-heading p{font-size:10px;line-height:1.7}.heading-actions{width:100%}.heading-actions button{flex:1}.table{height:340px;border-radius:11px}.table-top{left:13px;right:13px;top:13px}.table-mode{font-size:7px;letter-spacing:0}.level-chip{font-size:8px;gap:5px;padding:5px 7px}.level-chip b{font-size:17px}.level-chip span{padding-left:5px}.seat-2{top:60px;width:170px}.seat-1,.seat-3{top:150px;width:85px}.seat-head{gap:4px;flex-wrap:wrap}.seat-head strong{font-size:9px}.avatar{width:23px;height:23px;font-size:8px}.eye{font-size:12px;padding:1px}.seat-head small{font-size:8px}.table-center{top:186px;width:45%}.table-watermark{font-size:37px}.center-caption{font-size:8px;letter-spacing:0}.table-bottom{left:12px;right:12px;bottom:13px;flex-direction:column;gap:4px}.played-cards .card.mini{width:28px;height:43px}.played-cards .card-corner b{font-size:11px}.played-cards .card-corner span{font-size:8px}.played-cards .card-pip{font-size:15px}.turn-label{font-size:8px;padding:4px 7px}.hand-panel{padding:14px 12px 10px}.hand-heading h2{font-size:12px}.segmented button{font-size:9px!important}.flush-tools{margin:14px 0 8px}.hand-footer{flex-direction:column;gap:12px}.play-actions{justify-content:flex-end}.arrange-actions{justify-content:space-between}.hand-help{font-size:8px}.playback-left{gap:3px}.playback .secondary,.text-button,.auto-button{font-size:10px}.suggestions{flex-direction:column;gap:0}.coach-strip{padding:10px}.coach-strip p{font-size:9px}footer{font-size:8px;line-height:1.8}.footer-divider{padding:0 3px}.table:before{inset:20px 10px}.seat-cards{max-height:120px}.seat-cards .card.mini{width:21px;height:30px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

/* Keep every stacked card header visible, including mixed selections. */
.rank-stack{height:calc(var(--card-h) + var(--stack-extra,0px));isolation:isolate}
.rank-stack>.stack-slot{top:var(--offset);z-index:var(--layer)}
.rank-stack .card.selected{transform:none;z-index:auto}
.group-hand{align-items:flex-end}
.hand-group,.ungrouped{flex-shrink:0}
.group-label .remaining-count{margin:0 0 0 8px;font-variant-numeric:tabular-nums}
