:root{color-scheme:dark;--page:#102e25;--text:#f5f1e5;--sub:#b6c8b9;--gold:#e9ca83;--rule:rgba(222,228,201,.16);--cream:#faf7ec;--black:#222b29;--red:#ac3d39;--font:"Instrument Sans","Segoe UI",Arial,sans-serif;--serif:"Baskervville",Georgia,"Times New Roman",serif;--column-gap:clamp(5px,.9vw,15px)}
*{box-sizing:border-box}
html{min-height:100%;background:var(--page)}
body{min-height:100vh;margin:0;color:var(--text);font:16px/1.45 var(--font);background:radial-gradient(ellipse at 49% 36%,#1b4032 0%,#112f26 65%,#0e291f 100%);-webkit-font-smoothing:antialiased}
button,a,input,select{font:inherit}
button,a{touch-action:manipulation}
button{cursor:pointer;color:inherit;background:none;border:0}
button:disabled{cursor:default;opacity:.45}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible{outline:3px solid #f3d58b;outline-offset:3px}
button{transition:background .14s,color .14s,border-color .14s,box-shadow .14s}
button:active:not(:disabled){filter:brightness(.95)}
button>svg,i[data-icon]>svg,.notice>svg{width:18px;height:18px;flex:none;vertical-align:middle}
i[data-icon]{display:inline-flex;align-items:center;justify-content:center;font-style:normal}
.masthead{height:70px;background:#0d271f;border-bottom:1px solid var(--rule)}
.header-inner,main{width:min(1456px,calc(100% - clamp(32px,8vw,144px)));margin:auto}
.header-inner{height:100%;display:flex;align-items:center;gap:clamp(28px,4vw,68px)}
.brand{display:flex;align-items:center;gap:10px;color:#f3ecda;text-decoration:none;font:600 28px/1 var(--serif);letter-spacing:-1.3px}
.brand img{height:42px;width:41px}
nav,.header-tools{display:flex;align-items:center;height:100%}
nav{gap:26px}
.nav-item{position:relative;display:flex;align-items:center;gap:8px;height:100%;padding:0;color:#aac0b1;font-size:14px;font-weight:550}
.nav-item.active{color:#f4e3b6}
.nav-item.active:after{content:"";position:absolute;bottom:0;height:2px;background:#d7b570;left:0;right:0}
.nav-item:hover,.header-tools button:hover,.page-footer button:hover{color:#f5e0a6}
.header-tools{gap:4px;margin-left:auto}
.icon-button,.menu-button{min-width:40px;min-height:42px;display:grid;place-items:center;border-radius:6px;color:#c4d1c3}
.icon-button:hover,.menu-button:hover{background:rgba(255,255,255,.07)}
.header-rule,.tiny-rule{width:1px;height:18px;background:var(--rule);flex:none}
.header-rule{margin:0 14px}
.help-link{display:flex;align-items:center;gap:9px;font-size:14px;font-weight:550;color:#d9dfd2;min-height:44px;padding:0 2px}
.game-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:30px 0 25px}
h1,h2,h3,p{margin:0}
h1{font:normal clamp(39px,3.65vw,63px)/1.12 var(--serif);letter-spacing:-2.1px}
h1 em{font-weight:400;color:#eee3c8}
.game-heading p{font-size:15px;color:var(--sub);margin-top:6px;letter-spacing:.05px}
.gold-button,.plain-button,.table-button,.restart-button{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:42px;padding:9px 17px;border-radius:6px;font-weight:600;font-size:14px}
.gold-button{background:var(--gold);color:#233427;border:1px solid #eace8c;box-shadow:0 2px 3px #001d181a}
.gold-button:hover{background:#f5dca3}
.new-button{padding:11px 20px}
.game-shell{position:relative;border:1px solid #526854;border-radius:13px;overflow:hidden;background:#173d30;box-shadow:0 10px 25px #05190e26}
.game-bar,.action-bar{background:#17392e;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:0 clamp(14px,2.2vw,35px);border-bottom:1px solid var(--rule)}
.game-bar{height:59px}
.game-meta,.metrics,.metric,.level,.deal-id{display:flex;align-items:center}
.game-meta{gap:15px}
.level{min-height:34px;gap:8px;border-radius:6px;border:1px solid #687d60;background:#264a37;color:#efdeb0;font-weight:600;font-size:13px;padding:5px 10px}
.level:hover{background:#365b41}
.level .suit{width:13px;height:15px}
.level svg:last-child:not(.suit){width:14px;height:14px}
.deal-id{font-size:13px;letter-spacing:.4px;color:#c1cbbd;font-variant-numeric:tabular-nums;gap:7px}
.metrics{gap:19px}
.metric{gap:9px}
.metric>span,.row-label>span{font-size:11px;letter-spacing:1.65px;font-weight:650;text-transform:uppercase;color:#cad7c8}
.metric b{font-family:var(--serif);font-size:22px;font-weight:500;line-height:1;font-variant-numeric:lining-nums tabular-nums}
.menu-button{min-width:32px;min-height:38px;margin-left:-5px}
.felt{position:relative;isolation:isolate;padding:22px clamp(14px,2.2vw,35px) 23px;background:radial-gradient(ellipse at 50% 30%,#2b674d 0%,#235a43 58%,#1d503d 100%)}
.felt:before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:.2;mix-blend-mode:soft-light;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.77' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.8' filter='url(%23n)'/%3E%3C/svg%3E")}
.stock-row{display:flex;justify-content:space-between;align-items:flex-start;gap:6px}
.row-label{display:flex;align-items:center;gap:9px;margin:0 0 9px;min-height:18px}
.row-label b{font-size:12px;font-weight:550;color:#e6e6cf;font-variant-numeric:tabular-nums}
.foundation-group .row-label b{padding:0 7px;border-radius:30px;background:#173e2f80}
#foundations{display:flex;gap:7px}
.foundation{width:clamp(34px,3.6vw,53px);aspect-ratio:5/6.55;border:1px dashed #a8c1a078;border-radius:5px;display:grid;place-items:center;position:relative;background:#1b4c3780;color:#a1b99a87}
.foundation>.suit{width:43%;height:auto;opacity:.58}
.foundation.filled{background:#e7e4d4;border:1px solid #d8d7c3;box-shadow:0 2px 3px #072c2459;border-radius:4px}
.foundation.filled .suit{color:var(--black);width:43%;opacity:.96}
.foundation.filled[data-suit=H] .suit,.foundation.filled[data-suit=D] .suit{color:var(--red)}
.foundation.filled:before,.foundation.filled:after{content:"K";position:absolute;top:2%;left:8%;font:normal 12px Georgia,serif;color:var(--black)}
.foundation.filled:after{top:auto;left:auto;bottom:2%;right:8%;transform:rotate(180deg)}
.foundation.filled[data-suit=H]:before,.foundation.filled[data-suit=H]:after,.foundation.filled[data-suit=D]:before,.foundation.filled[data-suit=D]:after{color:var(--red)}
.stock-group{display:flex;flex-direction:column;align-items:flex-end}
.stock-label{justify-content:flex-end}
#stock{height:clamp(45px,4.72vw,70px);min-width:45px;position:relative;padding:0;display:flex;align-items:center;border-radius:5px}
.stock-card{height:100%;aspect-ratio:5/7;background:#e9e3cf url("../assets/stock.svg") center/100% 100%;display:block;border-radius:4px;box-shadow:0px 1px 2px #0b2c1f80}
.stock-card+.stock-card{margin-left:clamp(-32px,-2.35vw,-19px)}
#stock:hover .stock-card:last-child{transform:translateY(-2px)}
#stock.blocked{opacity:.6}
#stock.empty{width:clamp(34px,3.6vw,53px);border:1px dashed #abcd9c8f;color:#c6d1b8}
.table-rule{display:flex;align-items:center;gap:7px;opacity:.59;height:35px}
.table-rule:before,.table-rule:after{content:"";height:1px;background:#b8c5a35e;flex:1}
.table-rule span{width:5px;height:5px;border:1px solid #d2c391;transform:rotate(45deg)}
#tableau{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:var(--column-gap);min-height:clamp(245px,31.8vh,368px);touch-action:none;user-select:none;-webkit-user-select:none}
.column{position:relative;min-width:0;isolation:isolate;outline:0;border-radius:5px}
.col-number{text-align:center;display:block;color:#c4d5c0;font:500 12px/16px "Segoe UI",sans-serif;font-variant-numeric:tabular-nums;letter-spacing:1.4px;margin:0 0 9px}
.pile{position:relative;width:100%}
.pile:before{content:"";display:block;position:absolute;left:0;top:0;width:100%;aspect-ratio:5/7;box-sizing:border-box;border:1px dashed #a7c1a178;border-radius:7px;background:#133f2e25}
.card{position:absolute;top:var(--y,0);left:0;width:100%;aspect-ratio:5/7;container-type:inline-size;touch-action:none;user-select:none;-webkit-user-select:none;outline:0;transition:filter .1s;background:var(--cream);color:var(--black);border:1px solid #ebe6d6;border-radius:clamp(3px,.5vw,7px);box-shadow:0 2px 3px #0f352852,0 0 0 .5px #1d332748}
.card[data-suit=H],.card[data-suit=D]{color:var(--red)}
.four-color .card[data-suit=D]{color:#235f97}.four-color .card[data-suit=C]{color:#216438}
.card.back{background:#253f50 url("../assets/stock.svg") center/100% 100%;border:0}
.card.mobile-movable,.card.movable{cursor:grab}
.card.movable:hover{filter:brightness(1.015)}
.corner{position:absolute;top:4%;left:6%;display:flex;flex-direction:column;align-items:center;font:normal 24cqw/.92 var(--serif);letter-spacing:-.08em}
.corner span{padding-right:.07em}
.corner .suit{width:10cqw;height:10cqw;margin-top:2cqw}
.corner.bottom{inset:auto 6% 4% auto;transform:rotate(180deg)}
.pip{position:absolute;width:18%;aspect-ratio:1;transform:translate(-50%,-50%) rotate(var(--flip));line-height:0}
.pip.ace{width:44%}
.pip svg,.court-art{width:100%;height:100%}
.card .court-art{position:absolute;inset:0}
.card.picked,.card.lesson-source{outline:3px solid #eed088;outline-offset:0;z-index:2}
.column.target .col-number,.column.lesson-target .col-number{color:#ffe9b1}
.column.target .pile:before,.column.lesson-target .card:last-child{outline:2px dashed #edce7e;outline-offset:2px}
.card.hinted,#stock.hinted,.column.hint-target .card:last-child,.column.hint-target .pile:before{outline:3px solid #77d1ee;outline-offset:2px}
.column.drag-over .pile:before,.column.drag-over .card:last-child{outline:3px solid #f4cf78;outline-offset:2px}
.drag-ghost{position:fixed;pointer-events:none;z-index:1000;filter:drop-shadow(0 7px 6px #102c234d)}
.drag-source{opacity:.25}
.action-bar{height:67px;border-bottom:0;border-top:1px solid var(--rule)}
.play-actions{display:flex;gap:9px}
.table-button,.plain-button{border:1px solid #76887588;background:#284b3a;color:#f0f0df}
.table-button:hover,.plain-button:hover{background:#365942}
.table-button{min-width:90px;min-height:37px;padding:7px 12px;font-size:14px}
kbd{display:inline-block;font:11px/16px var(--font);border:1px solid #8a9f8a66;border-radius:3px;color:#becbb9;min-width:17px;text-align:center;padding:0 3px}
.table-button kbd{margin-left:5px}
.restart-button{color:#d4dece;padding:8px 0;font-weight:500}
.restart-button svg{width:16px;height:16px}
.restart-button:hover{color:#f7df9c}
.guide{display:flex;align-items:center;gap:15px;position:relative;padding:14px 18px;margin-top:14px;border:1px solid #576c51;border-radius:8px;background:#213f30}
.guide-icon{background:#bfaa6830;color:var(--gold);border:1px solid #b99e5f55;border-radius:7px;display:grid;place-items:center;flex:none;width:37px;height:37px}
.guide-icon svg{width:19px;height:19px}
.guide-copy{flex:1;min-width:0}
.guide-copy strong{font-weight:600;font-size:14px;color:#f2e8c9}
.guide-copy small{margin-left:10px;font-size:12px;color:#bfcbad}
.guide-copy p{margin-top:2px;font-size:14px;color:#cfdbca}
.guide-actions{display:flex;align-items:center;gap:12px}
.guide-actions button{min-height:36px;font-size:13px}
.guide-actions .next{background:#e8cb88;color:#263a28;font-weight:650;border-radius:5px;padding:6px 15px}
.guide-actions .back,.guide-actions .skip{color:#d9dfca;text-decoration:underline;text-underline-offset:3px}
.page-footer{min-height:57px;display:flex;justify-content:space-between;align-items:center;color:#aabbab;gap:14px}
.page-footer button{display:flex;align-items:center;gap:8px;font-size:12px;padding:5px 0}
.page-footer button svg{width:15px;height:15px}
.footer-ornament{display:flex;align-items:center;gap:10px;color:#9cac91;font:15px Georgia,serif;opacity:.8}
.footer-ornament b{color:#bca776;font-weight:normal}
.notice{position:absolute;z-index:8;left:50%;bottom:8px;transform:translateX(-50%);width:max-content;max-width:90%;border-radius:8px;box-shadow:0 4px 16px #0d2d2150;border:1px solid #a1b18980;background:#102e25f5;color:#fff7da;padding:9px 15px;font-size:14px;text-align:center;pointer-events:none}
[hidden]{display:none!important}
.sr-only{clip-path:inset(50%);position:absolute;width:1px;height:1px;overflow:hidden;white-space:nowrap}
dialog{border:1px solid #9f997c;background:#f6f3e9;color:#22372c;width:min(445px,calc(100% - 26px));padding:0;border-radius:13px;box-shadow:0 24px 90px #061c17a8;max-height:90dvh;color-scheme:light}
dialog::backdrop{background:#051b14ad;backdrop-filter:blur(3px)}
#dialog-content{padding:28px}
.modal-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:19px}
.modal-head h2{font:normal 33px/1.1 var(--serif);letter-spacing:-1.3px}
.close-button{height:36px;width:36px;border-radius:50%;display:grid;place-items:center;color:#526253}
.close-button:hover{background:#dce2d4}
.modal-copy{font-size:15px;line-height:1.6;color:#4e6355;margin:5px 0 14px}
.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:22px;flex-wrap:wrap}
dialog .plain-button{color:#293b2c;border:1px solid #afbaa8;background:#ecefe4}
dialog .plain-button:hover{background:#dfe6d9}
dialog .gold-button{color:white;background:#244c39;border:1px solid #244c39}
dialog .gold-button:hover{background:#346547}
fieldset{border:0;padding:0;margin:0 0 20px}
legend,.field-label{font-size:13px;font-weight:650;letter-spacing:.5px;margin-bottom:7px;display:block}
.choices{display:flex;gap:7px}
.choices button{flex:1;padding:10px 4px;border:1px solid #aeb9a6;border-radius:6px;color:#3a4f3e;font-size:14px}
.choices button[aria-pressed=true]{background:#254c39;color:#f8f5e6;border-color:#244c38}
input[type=number]{background:white;border:1px solid #a0ae9b;border-radius:6px;padding:10px 12px;width:100%;color:#26392b}
.input-error{font-size:13px;color:#9c302d;margin:6px 0}
.setting-row,.stat-row,.menu-row{display:flex;align-items:center;justify-content:space-between;padding:12px 0;border-bottom:1px solid #cbd2c4;gap:12px}
.setting-row b{font-weight:600;font-size:15px}.setting-row small{display:block;color:#566c5c;margin-top:2px;font-size:13px}
.toggle{width:42px;height:25px;padding:3px;background:#a7b2a2;border-radius:18px;flex:none}
.toggle:before{content:"";display:block;background:#fffdf1;border-radius:50%;width:19px;height:19px;box-shadow:0 1px 3px #354d3b33;transition:transform .12s}
.toggle[aria-checked=true]{background:#386246}.toggle[aria-checked=true]:before{transform:translateX(17px)}
.menu-row{width:100%;font-size:15px;justify-content:flex-start;text-align:left}.menu-row:hover{color:#38754c;background:#e8ecdf}
.stat-row b{font:normal 22px var(--serif)}.stat-row{font-size:14px}
.rules-list{padding-left:21px;color:#435a49;font-size:15px;line-height:1.55}.rules-list li{padding-left:4px;margin:.5em 0}
.key-list kbd{color:#374c3a;background:#e6eadf;border-color:#b6c1ad;margin-right:4px}
.deal-form .field-label{margin-top:16px}
.lesson-line{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:7}
.reveal{animation:appear .17s ease-out}.dealt{animation:arrive .18s cubic-bezier(.2,.8,.2,1) backwards;animation-delay:var(--delay,0ms)}
@keyframes appear{from{transform:scaleX(.35)}to{transform:scaleX(1)}}
@keyframes arrive{from{transform:translateY(-22px);opacity:.55}to{transform:translateY(0);opacity:1}}
.reduced-motion *, .reduced-motion *:before{animation-duration:1ms!important;animation-delay:0ms!important;transition-duration:1ms!important}
@media(min-width:1600px){.game-heading{padding:34px 0 30px}.felt{padding-top:26px}.table-rule{height:43px}}
@media(max-width:900px){.header-inner,main{width:calc(100% - 40px)}.header-inner{gap:27px}nav{gap:17px}.metrics{gap:10px}.felt{padding:17px 15px}.game-heading{padding:24px 0 21px}.guide{gap:10px}.guide-actions{gap:6px}}
@media(max-width:660px){.masthead{height:57px}.header-inner,main{width:calc(100% - 24px)}.brand{font-size:24px;gap:6px}.brand img{width:33px;height:36px}.header-inner{gap:14px}nav{gap:4px}.nav-item{font-size:0;width:36px;justify-content:center;gap:0}.nav-item svg{width:17px;height:17px}.header-rule{margin:0 4px}.header-tools{gap:0}.help-link{font-size:0;gap:0;min-width:34px;justify-content:center}.icon-button{min-width:32px}.game-heading{padding:23px 0 20px}.game-heading p{font-size:13px}.new-button{padding:8px 11px;font-size:13px;gap:4px;min-height:39px}h1{font-size:36px}.game-bar{padding:0 9px;height:48px;gap:6px}.game-meta{gap:7px}.deal-id{font-size:11px;letter-spacing:0}.level{font-size:11px;gap:4px;padding:4px 6px;min-height:29px}.metrics{gap:7px}.metric{gap:4px}.metric>span{font-size:9px;letter-spacing:.7px}.metric b{font-size:17px}.game-meta .tiny-rule{display:none}.menu-button{min-width:23px}.felt{padding:13px 5px 12px}.stock-row{padding:0 5px}.row-label{gap:4px}.row-label>span{font-size:9px;letter-spacing:1px}.row-label b{font-size:10px}#foundations{gap:3px}.foundation{width:clamp(21px,5.5vw,34px)}.stock-card{border-radius:2px}.stock-card+.stock-card{margin-left:-21px}#stock{height:40px;min-height:40px}.stock-label{gap:5px}.table-rule{height:27px}:root{--column-gap:3px}#tableau{min-height:clamp(219px,32vh,285px)}.col-number{font-size:10px;letter-spacing:0;margin-bottom:7px}.card{border-radius:3px}.corner{font-size:29cqw;left:4%;top:4%}.corner .suit{width:14cqw;height:14cqw}.corner.bottom{right:4%;bottom:4%}.action-bar{height:57px;padding:0 10px}.table-button{min-height:38px;min-width:68px;padding:6px 9px;font-size:13px}.table-button kbd{display:none}.restart-button{font-size:12px;gap:4px}.guide{padding:12px;display:grid;grid-template-columns:30px 1fr;gap:8px;margin-top:10px}.guide-icon{width:29px;height:31px;align-self:start}.guide-copy p{font-size:13px}.guide-actions{grid-column:2;justify-content:flex-end}.page-footer{min-height:52px}.footer-ornament{display:none}.page-footer button{font-size:11px}.foundation.filled:before,.foundation.filled:after{font-size:8px}}
@media(max-width:440px){main{width:calc(100% - 10px)}.game-heading,.page-footer{margin-left:7px;margin-right:7px}.game-heading{gap:5px}.game-heading p{font-size:12px}.game-shell{border-radius:9px}.metric{flex-direction:column;align-items:flex-start;gap:0}.metric>span{line-height:14px}.deal-id svg{display:none}.game-meta{gap:7px}.game-bar{height:51px}.game-heading h1{font-size:32px}.stock-row{padding:0 5px}.corner{font-size:32cqw}.guide{margin-left:2px;margin-right:2px}.guide-actions .back,.guide-actions .skip{font-size:12px}.guide-actions{gap:9px}}
@media(max-height:650px) and (min-width:661px){.masthead{height:52px}.game-heading{padding:12px 0}.game-heading h1{font-size:36px}.game-heading p{margin:1px 0 0}.game-bar{height:42px}.felt{padding-top:10px;padding-bottom:10px}.table-rule{height:17px}.foundation{width:28px}#stock{height:37px}.row-label{margin-bottom:4px}.action-bar{height:47px}.guide{padding:8px 12px;margin-top:9px}}
@media(prefers-reduced-motion:reduce){*,*:before{scroll-behavior:auto!important}}
.covered.face .corner:first-child{top:2px;flex-direction:row;gap:3px;font-size:var(--exposed-rank);line-height:1}
.covered.face .corner:first-child .suit{width:.54em;height:.54em;margin:0}
.covered.face .pip,.covered.face .court-art{visibility:hidden}
.learning .action-bar{display:none}
.game-shell .guide{margin:0;border:0;border-top:1px solid var(--rule);border-radius:0;padding:14px clamp(14px,2.2vw,35px);background:#1a3b2e}
@media(min-width:661px) and (min-height:651px) and (max-height:950px){
  .masthead{height:61px}
  .game-heading{padding:21px 0 20px}
  .game-heading h1{font-size:clamp(39px,3.5vw,52px)}
  .game-bar{height:51px}
  .felt{padding-top:17px;padding-bottom:16px}
  .table-rule{height:28px}
  .foundation{width:clamp(33px,3.2vw,47px)}
  #stock{height:clamp(45px,4.2vw,62px)}
  .page-footer{min-height:48px}
}
@media(max-width:660px){
  .table-button,.restart-button,.icon-button,.new-button,.menu-button{min-height:44px}
  .game-shell .guide{padding:12px 13px}
  .guide-actions button{min-height:40px}
  .covered.face .corner:first-child{top:1px;gap:1px}
  .card.face:not(.covered) .corner:not(.bottom){font-weight:600}
}
