*{box-sizing:border-box}
:root{color-scheme:light;--paper:#f6f3e9;--ink:#21372d;--muted:#626b5e;--gold:#c8ac70;--edge:#d8d5c7;--felt:#174c3c;--serif:"Baskervville","Palatino Linotype",Georgia,serif;--sans:"DM Sans","Segoe UI",Arial,sans-serif;--fan:clamp(21px,1.93vw,29px)}
body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.45 var(--sans);-webkit-tap-highlight-color:transparent}
button,a{touch-action:manipulation}button{font:inherit;color:inherit;cursor:pointer}button{border:0;background:none}button:disabled{cursor:default;opacity:.44}
button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:3px solid #f4b72b;outline-offset:3px}
svg{display:block}i[data-icon],button>svg,.icon-box{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}i[data-icon] svg,button>svg{width:19px;height:19px}
.masthead{border-bottom:1px solid var(--edge);background:#fbf9f1}
.mast-inner,.layout{max-width:1650px;margin:auto;padding-inline:clamp(16px,4vw,72px)}
.mast-inner{display:flex;align-items:center;height:75px;gap:clamp(26px,5.5vw,95px)}
.brand{display:flex;align-items:center;gap:11px;color:var(--ink);text-decoration:none;white-space:nowrap;font:600 clamp(22px,2vw,29px)/1 var(--serif);letter-spacing:-1.1px}
.brand-mark{width:33px;height:38px;color:#927643}.brand-mark svg{width:100%;height:100%}
nav{display:flex;align-self:stretch;gap:clamp(10px,2.6vw,42px)}.nav-item{display:flex;align-items:center;gap:9px;position:relative;padding:0 2px;color:#637065;font-size:14px;font-weight:570}.nav-item.active{color:#234a37}.nav-item.active:after{content:"";position:absolute;bottom:-1px;left:0;right:0;height:3px;background:#426248}.nav-item:hover,.icon-button:hover{color:#9c772f}.nav-item i svg{width:17px;height:17px}
.utilities{margin-left:auto;display:flex;gap:5px}.icon-button{width:44px;height:44px;border-radius:50%;display:grid;place-items:center}.utilities .icon-button:hover{background:#eae6d8}
.title-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:clamp(19px,2.2vw,34px) 1px clamp(18px,1.8vw,29px)}
.eyebrow,.felt-label,.deal-number,.hud-label{font-size:11px;font-weight:650;letter-spacing:.17em;text-transform:uppercase}.eyebrow{display:flex;align-items:center;gap:9px;color:#8c7447;letter-spacing:.23em}.rule{height:1px;width:23px;background:#ae945f}.rule:before{content:"";width:4px;height:4px;background:#ae945f;display:block;transform:rotate(45deg) translate(-1px,-1px)}
h1,h2,h3,p{margin:0}h1{font:500 clamp(45px,4.8vw,76px)/1.08 var(--serif);letter-spacing:-.056em;margin-top:3px}
.deal-controls{display:flex;gap:12px;align-items:center}.primary,.secondary,.mode,.guide-btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;border-radius:7px;font-size:14px;font-weight:600;min-height:44px;padding:0 18px}
.primary{background:#254a38;color:#fffdf5;border:1px solid #244431;box-shadow:inset 0 1px 0 #ffffff17,0 2px 4px #3643260a}.primary:hover{background:#326046}.secondary,.mode,.guide-btn{border:1px solid #c9cabb;background:#fbf9f1}.secondary:hover,.mode:hover,.guide-btn:hover{background:#eeeadd}
.mode{padding:0 12px;background:transparent}.mode svg{width:13px;height:13px}.mode-dot{height:7px;width:7px;border-radius:50%;background:#7d9266}
.felt{isolation:isolate;position:relative;border-radius:16px;background:radial-gradient(ellipse at 34% 35%,#265c47 0%,#1c503d 53%,#153f32 100%);color:#f7f1df;box-shadow:0 10px 20px -14px #1839268c,inset 0 0 0 1px #173c2e;overflow:hidden;padding:clamp(19px,2.2vw,35px) clamp(17px,2.2vw,39px) 22px}
.felt:before{content:"";position:absolute;inset:0;z-index:-1;opacity:.26;pointer-events:none;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.79' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' opacity='.52' d='M0 0h180v180H0z'/%3E%3C/svg%3E");background-size:124px}
.felt:after{position:absolute;content:"";inset:8px;pointer-events:none;border:1px solid #ccb57b60;border-radius:10px;z-index:-1}
.corner{position:absolute;pointer-events:none;width:36px;height:36px;color:#bfa96f99;border-top:1px solid;border-left:1px solid;border-radius:3px 0 0 0}.corner:before{content:"";position:absolute;left:4px;top:4px;width:10px;height:10px;border:1px solid;border-radius:1px 9px}.corner:after{content:"";position:absolute;top:3px;left:19px;width:3px;height:3px;transform:rotate(45deg);background:currentColor}
.tl{top:12px;left:12px}.tr{top:12px;right:12px;transform:rotate(90deg)}.br{bottom:12px;right:12px;transform:rotate(180deg)}.bl{bottom:12px;left:12px;transform:rotate(270deg)}
.felt-top{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 7px 0 8px}
.deal-number{display:flex;align-items:center;gap:7px;color:#ddcca1;font-size:12px;letter-spacing:.14em}.deal-number svg{width:14px;height:18px}
.counters{display:flex;align-items:center;gap:22px;margin-top:12px}.counters>div{display:flex;flex-direction:column}.hud-label{font-size:10px;letter-spacing:.14em;color:#d4ddcc}.counters strong{font:400 clamp(26px,2.4vw,38px)/1.1 var(--serif);font-variant-numeric:lining-nums tabular-nums;margin-top:2px}.counters small{font:400 16px var(--serif);color:#ced7c7}.hud-rule{height:34px;width:1px;background:#c1c6a348}
.foundation-area{width:calc((100% - 12 * var(--gap,10px)) / 13 * 4 + 3 * var(--gap,10px));max-width:405px;min-width:225px}
.felt-label{display:flex;align-items:center;gap:10px;justify-content:center;color:#d4c6a1;font-size:10px;letter-spacing:.2em;margin-bottom:9px}
.felt-label span{height:1px;width:22px;background:#c5b78777}
#foundations{display:grid;grid-template-columns:repeat(4,1fr);gap:var(--gap,10px)}
.home-slot{position:relative;width:100%;aspect-ratio:5/6.25;padding:0;border-radius:7px;background:#092d222c;border:1px dashed #c7ceab83;display:grid;place-items:center;box-shadow:inset 0 0 0 3px #173e301c}
.home-slot>span{font:normal clamp(24px,2.7vw,42px)/1 Georgia,serif;color:#b5c4a778}.home-slot.filled{border:0}
.table-divider{display:flex;align-items:center;gap:8px;padding:clamp(13px,1.3vw,20px) 0 4px}.table-divider span{height:1px;background:#d7c69446;flex:1}.table-divider b{font-size:8px;color:#bfaa76;font-weight:400}
#columns{--gap:clamp(5px,.69vw,12px);display:grid;grid-template-columns:repeat(13,minmax(0,1fr));gap:var(--gap);align-items:start;min-height:clamp(188px,18.2vw,295px)}
.column{position:relative;min-width:0;outline:none;border-radius:5px;min-height:100%;padding-top:27px}.col-num{position:absolute;top:3px;left:0;right:0;text-align:center;font:500 11px/16px var(--sans);letter-spacing:.12em;color:#d1d4b8}.pile{width:100%;aspect-ratio:5/7;position:relative;margin-bottom:var(--extra,0px)}
.card,.empty-slot{position:absolute;left:0;width:100%;aspect-ratio:5/7;border-radius:6px}.card{display:block;overflow:hidden;top:var(--offset,0px);padding:0;border:1px solid #b4b6a5;color:#24342d;background:linear-gradient(120deg,#fffdf5,#f5f1e4);box-shadow:0 2px 3px #0b261f40;user-select:none}
.card[data-suit="1"],.card[data-suit="2"]{color:#a03437}
.four-color .card[data-suit="0"]{color:#257243}.four-color .card[data-suit="1"]{color:#245eaa}
.card.top{cursor:pointer;touch-action:none}.card.top:hover,.card.top:focus-visible{filter:brightness(1.035);box-shadow:0 1px 0 2px #dbc286,0 5px 10px #102d2680;z-index:2}
.card.can-move{border-color:#c9b782;box-shadow:0 1px 0 1px #e7c97650,0 3px 5px #09271f36}
.card.selected,.card.hinted,.home-slot.hinted,.hint-outline{outline:3px solid #ffcb56;outline-offset:1px}
.column.target .top,.home-slot.target,.empty-slot.target{outline:3px dashed #a4e1e3;outline-offset:1px}
.empty-slot{top:0;border:1px dashed #d6ddbf4d;display:grid;place-items:center;color:#d1d1ad40;font-size:20px}.home-slot .card{position:absolute;inset:0;height:100%;width:100%;aspect-ratio:auto}
.table-controls{display:flex;justify-content:center;margin:clamp(17px,1.8vw,30px) 0 2px}.toolset{display:inline-flex;align-items:center;padding:2px 4px;border:1px solid #b8c1a668;background:#173e30bb;border-radius:8px;box-shadow:0 2px 5px #14312436}
.toolset button{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:550;min-height:43px;padding:0 15px;border-radius:4px}.toolset button:hover:not(:disabled){background:#e6deb31a}.toolset svg{width:17px;height:17px;color:#d9cba2}.tool-rule{width:1px;height:20px;background:#c1c6a341}
#notice{position:absolute;left:50%;bottom:78px;transform:translateX(-50%);width:max-content;max-width:90%;font-size:14px;background:#fffaf0;color:var(--ink);box-shadow:0 4px 18px #10221944;padding:7px 14px;border-radius:6px;text-align:center;pointer-events:none;z-index:4}
#notice:empty{display:none}.guide{display:flex;align-items:center;gap:17px;margin-top:20px;border:1px solid #d6d3c3;background:#faf8ef;border-radius:9px;padding:18px 23px}
.guide-icon{align-self:center;flex-shrink:0;display:grid;place-items:center;background:#e8ecde;border:1px solid #d6deca;border-radius:50%;width:42px;height:42px;color:#4d684b}.guide-icon svg{width:21px;height:21px}.guide-heading{display:flex;align-items:baseline;gap:12px}.guide h2{font:600 22px/1.2 var(--serif);letter-spacing:-.55px}.guide p{font-size:14px;color:#535f52;margin-top:4px;max-width:78ch}.guide-copy{flex:1}.guide-btn{min-height:42px;background:transparent;font-size:13px;padding:0 14px}.guide-btn svg{width:13px;height:13px}.guide-actions,#guide-actions{display:flex;align-items:center;gap:6px}#step-count{font-size:12px;color:#717969}
footer{display:flex;align-items:center;gap:12px;margin:23px 1px;color:#817d68}.footer-rule{height:1px;flex:1;background:#dcd9ca}.footer-suits{letter-spacing:.22em;font:16px Georgia,serif;color:#737f6b;word-spacing:4px}.footer-suits em{font-style:normal;color:#ae8276}footer button{font-size:12px;color:#656d5e;min-height:36px}
dialog{padding:0;width:min(438px,calc(100vw - 30px));max-height:90dvh;border:1px solid #c3baa0;border-radius:16px;color:var(--ink);background:#faf8ef;box-shadow:0 28px 100px #061c2466}
dialog::backdrop{background:#10271ed1;backdrop-filter:blur(3px)}#modal-content{padding:29px}.modal-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:17px}.modal-head h2{font:500 34px/1.08 var(--serif);letter-spacing:-.04em}.modal-head button{width:38px;height:38px}.modal-head button svg{width:17px;height:17px}.modal-body p{font-size:15px;line-height:1.6;color:#535e51;margin:8px 0 14px}.modal-buttons{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:22px}.modal-list{display:grid;gap:6px}.modal-list button,.difficulty-choice{padding:11px 14px;display:flex;align-items:center;gap:12px;border:1px solid var(--edge);background:#f5f3e8;border-radius:7px;text-align:left;min-height:46px}.modal-list button:hover,.difficulty-choice:hover,.difficulty-choice.chosen{background:#e8eddf;border-color:#879a7d}
.difficulty-choice{width:100%;margin:7px 0}.difficulty-choice .radio{flex-shrink:0;width:17px;height:17px;border:1px solid #8f9987;border-radius:50%}.difficulty-choice.chosen .radio{border:5px solid #406c47}.difficulty-choice b,.difficulty-choice small{display:block}.difficulty-choice small{font-size:13px;color:var(--muted);margin-top:2px}
.setting,.stat-row{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--edge);gap:15px;padding:12px 0;font-size:15px}.setting{cursor:pointer;min-height:47px}.setting input{appearance:none;border-radius:20px;background:#b7bbae;width:38px;height:22px;border:1px solid #979e90;flex-shrink:0;position:relative;cursor:pointer}.setting input:checked{background:#3d694a;border-color:#3d694a}.setting input:before{content:"";position:absolute;width:14px;height:14px;background:#fffdf3;border-radius:50%;left:3px;top:3px;box-shadow:0 1px 2px #26392c44}.setting input:checked:before{left:19px}.stat-row strong{font:600 21px var(--serif)}.text-btn{font-size:13px;text-decoration:underline;text-underline-offset:3px;padding:8px}.modal-body ol{padding-left:21px}.modal-body li{margin:8px 0;color:#4d594d}.modal-body h3{font:600 22px var(--serif);margin-top:18px}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;clip-path:inset(50%);overflow:hidden;white-space:nowrap}.drag-card{position:fixed;pointer-events:none!important;z-index:20;margin:0;transform:rotate(-3deg);box-shadow:0 10px 17px #0e211c4d}.drag-source{opacity:.35}
.contrast .felt{background:#000}.contrast .card{background:white;color:#000}.contrast .card[data-suit="1"],.contrast .card[data-suit="2"]{color:#b00017}.contrast .hud-label,.contrast .col-num,.contrast .felt-label{color:white}.contrast .home-slot{border-color:white}.contrast .home-slot>span{color:#eee}
@media(min-width:1700px){:root{--fan:29px}#columns{min-height:290px}}
@media(max-width:950px){.mast-inner{gap:30px}.mast-inner,.layout{padding-inline:22px}nav{gap:18px}.nav-item{gap:6px}.felt{padding-inline:19px}.foundation-area{min-width:205px}.guide{padding:15px}.toolset button{padding:0 12px}}
@media(max-width:760px){.mast-inner,.layout{padding-inline:13px}.mast-inner{height:60px;gap:12px}.brand{font-size:23px}.brand-mark{width:26px;height:32px}nav{margin-left:auto;gap:0}nav .nav-item{width:42px;justify-content:center}.nav-item span{display:none}.utilities{margin:0;gap:0}.icon-button{width:40px}.felt{padding:19px 13px 18px;border-radius:12px}.guide{gap:10px}.title-row{padding:17px 0}.foundation-area{min-width:190px}.table-controls{margin-top:13px}#columns{grid-template-columns:repeat(7,minmax(0,1fr));gap:8px 6px;min-height:0}.col-num{top:1px}.column{padding-top:19px}.table-divider{padding:10px 0 3px}:root{--fan:clamp(17px,3.7vw,24px)}.card{border-radius:4px}.felt-top{padding-inline:5px}.home-slot{aspect-ratio:5/5.9}.guide p{font-size:13px}.guide h2{font-size:20px}.counters{gap:15px}.guide-icon{width:34px;height:34px}}
@media(max-width:520px){.mast-inner,.layout{padding-inline:9px}.mast-inner{padding-inline:13px;gap:6px}.brand{font-size:21px;gap:7px}.nav-item.active{display:none}.nav-item{min-width:32px}.icon-button,nav .nav-item{width:33px;height:44px}.utilities{border-left:1px solid var(--edge);padding-left:3px}.title-row{padding:16px 3px}.eyebrow{font-size:9px}h1{font-size:clamp(33px,9.2vw,46px);margin-top:4px}.deal-controls{gap:5px}.deal-controls .primary{font-size:12px;padding:0 9px;gap:4px}.deal-controls .primary svg{width:15px;height:15px}.mode{font-size:12px;gap:5px;padding:0 6px}.mode-dot{width:5px;height:5px}.mode svg{width:10px;height:10px}.felt{padding:18px 10px 15px}.felt:after{inset:4px}.corner{width:16px;height:16px}.tl,.tr{top:7px}.bl,.br{bottom:7px}.tl,.bl{left:7px}.tr,.br{right:7px}.corner:after{display:none}.corner:before{width:5px;height:5px;top:2px;left:2px}.felt-top{gap:6px;padding:0 3px}.deal-number{font-size:10px;gap:3px;letter-spacing:.04em}.deal-number svg{width:10px}.hud-label,.felt-label{font-size:9px}.foundation-area{width:53%;min-width:0}.felt-label{margin-bottom:4px}.counters{margin-top:5px;gap:10px}.counters strong{font-size:24px}.counters small{font-size:13px}.hud-rule{height:23px}#foundations{gap:4px}.home-slot{border-radius:4px;min-height:44px}.table-controls{margin-top:14px}.toolset{padding:0 1px}.toolset button{gap:5px;font-size:13px;padding:0 10px;min-height:42px}.toolset svg{width:15px;height:15px}#columns{gap:5px 3px}.col-num{font-size:10px}.guide{align-items:start;flex-wrap:wrap;padding:12px;gap:6px 9px;margin-top:11px}.guide-icon{width:29px;height:29px}.guide-icon svg{width:16px;height:16px}#guide-actions{margin-left:38px;flex-wrap:wrap}.guide-btn{font-size:12px;padding:0 9px;min-height:36px}.guide-copy{min-width:70%}.guide-heading{gap:8px}#step-count{font-size:11px}footer{margin:11px 4px}.tool-rule{height:16px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
.felt-top{position:relative}
.felt-top:before{content:"";position:absolute;left:42%;top:50%;width:clamp(115px,12vw,190px);height:100%;transform:translate(-50%,-50%);background:url("table-seal.svg") center/contain no-repeat;opacity:.46;pointer-events:none}
.card.covered .bd-face-art{visibility:hidden}
@media(max-width:520px){
  .title-row{padding-block:12px}
  .title-row h1,.deal-controls .primary{white-space:nowrap}
  .deal-controls{display:grid;justify-items:end;gap:0}
  .deal-controls .primary{grid-row:1;min-height:42px;padding-inline:12px}
  .deal-controls .mode{min-height:28px;border:0;padding-inline:4px}
}
@media(max-width:760px){.felt-top:before{display:none}}
[hidden]{display:none!important}
.lesson-arrow{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:3;filter:drop-shadow(0 1px 2px #2f3217)}
