:root{color-scheme:dark;--page:#102d27;--surface:#163c32;--cream:#f5f0de;--gold:#dfc18a;--line:#a98e564b;--muted:#b5c5b9;--black:#28332d;--red:#a63536;--body:Inter,"Segoe UI",Arial,sans-serif;--serif:Georgia,"Times New Roman",serif}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#102d27;color:var(--cream);font-family:var(--body)}body{background:radial-gradient(ellipse at 50% 30%,#1b3b32 0,#112e27 62%,#102923 100%);font-size:16px}
button,input,select{font:inherit}button{color:inherit;cursor:pointer}button:disabled{cursor:default}button:focus-visible,input:focus-visible{outline:3px solid #f8d68e;outline-offset:4px}button{-webkit-tap-highlight-color:transparent}button:disabled{opacity:.44}
#app{min-height:100svh;display:flex;flex-direction:column}#header{height:85px;flex:none;background:#102923bd;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 clamp(20px,5.4vw,110px);gap:16px}
.wordmark{display:flex;align-items:center;gap:12px;background:none;border:none;padding:0}.brand-mark{width:48px;height:48px;color:var(--gold)}.brand-type{display:grid;gap:2px;text-align:left}.brand-type strong{font:28px/.95 var(--serif);letter-spacing:-1.1px}.brand-type small{color:var(--gold);font-weight:600;font-size:9px;letter-spacing:2.7px;text-transform:uppercase}
.nav,.toolrow,.actions,.footlinks{display:flex;align-items:center;gap:12px}.nav{gap:20px}.nav button,.footlinks button,.textbtn{border:none;background:none;color:#d6dfd2;padding:8px 3px;font-size:14px;display:inline-flex;align-items:center;justify-content:center;gap:8px}.nav button:hover,.footlinks button:hover,.textbtn:hover{color:#f3d59b}.nav button.nav-icon{height:38px;width:38px;padding:9px;border:1px solid var(--line);border-radius:50%}.nav .separator{height:22px;width:1px;background:var(--line)}.icon{display:inline-block;width:19px;height:19px;flex-shrink:0}
main{flex:1;width:min(1260px,89.2%);margin:0 auto;display:flex;flex-direction:column;justify-content:center;padding:clamp(24px,4.1vh,52px) 0;gap:20px}
.heading{display:flex;justify-content:space-between;align-items:flex-end;gap:12px}.eyebrow,.step-count{font-size:11px;letter-spacing:2.45px;text-transform:uppercase;font-weight:650;color:var(--gold);display:flex;align-items:center;gap:10px}.eyebrow:before{content:"";width:29px;height:1px;background:var(--gold)}h1,h2,h3,p{margin:0}h1{font:normal clamp(42px,4.25vw,70px)/1.08 var(--serif);letter-spacing:-2.5px;margin-top:10px}h2{font:normal 34px/1.12 var(--serif);letter-spacing:-.9px}
.textbtn.skip{border:1px solid var(--line);border-radius:7px;padding:10px 15px;gap:9px;color:#e3e3d4}.textbtn.skip .icon{width:15px;height:15px}
.table{isolation:isolate;position:relative;border:1px solid #a38b59;border-radius:14px;box-shadow:inset 0 0 0 5px #183b32,inset 0 0 0 6px #a98b5055,0 10px 25px #03120c38;background:radial-gradient(ellipse at 44% 30%,#2f644e,#27563f 55%,#1b4535 100%)}.table:before{content:"";position:absolute;z-index:-2;pointer-events:none;inset:0;border-radius:inherit;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 175 175' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' opacity='.27' d='M0 0h175v175H0z'/%3E%3C/svg%3E");opacity:.35}
.corner{pointer-events:none;position:absolute;width:clamp(64px,9vw,145px);height:90px;background:url(../assets/corner.svg) no-repeat 0 0/contain;opacity:.76}.c1{top:10px;left:10px}.c2{top:10px;right:10px;transform:scaleX(-1)}.c3{bottom:10px;left:10px;transform:scaleY(-1)}.c4{bottom:10px;right:10px;transform:scale(-1)}
.lesson-table{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(15px,2.4vh,27px);min-height:340px;height:clamp(335px,44.5vh,535px);overflow:hidden}.foliage{position:absolute;z-index:-1;bottom:9px;left:9px;height:85%;width:24%;background:url(../assets/botanical.svg) no-repeat left bottom/contain;opacity:.15;pointer-events:none}.foliage.right{left:auto;right:9px;transform:scaleX(-1)}.table-label{display:flex;align-items:center;gap:13px;font-size:10px;letter-spacing:3.6px;font-weight:600;text-transform:uppercase;color:#e7d3a8}.table-label:before,.table-label:after{content:"";width:42px;height:1px;background:linear-gradient(90deg,transparent,#d2b77d)}.table-label:after{transform:rotate(180deg)}
.lesson-row{display:flex;align-items:center;justify-content:center;gap:clamp(12px,1.8vw,30px);width:100%;padding:10px 20px 4px;min-height:190px}.card{--tilt:0deg;position:relative;display:block;padding:0;border:1px solid #d0c8b5;border-radius:6px;background:linear-gradient(110deg,#fffdf2,#f7f0df);box-shadow:0 2px 0 #d3c9b2,0 5px 7px #081c1844;color:var(--black);aspect-ratio:100/144;transform:rotate(var(--tilt));transition:transform .12s ease-out,box-shadow .12s;user-select:none;touch-action:manipulation}
.card-art{display:block;width:100%;height:100%;pointer-events:none}.suit-1,.suit-2{color:var(--red)}.four-color .suit-0{color:#286a41}.four-color .suit-1{color:#245d96}
.lesson-row .card{width:clamp(67px,min(9.25vw,16.2vh),156px);border-radius:8px;box-shadow:0 3px 0 #d7cdb6,0 9px 13px #0a211866}.card:hover:enabled{transform:translateY(-3px) rotate(var(--tilt))}.card.selected,.card.selected:hover{outline:3px solid #ffcb62;outline-offset:3px;transform:translateY(-6px);z-index:2}.card.target{outline:3px dashed #9be7ea;outline-offset:2px}.card.guide{box-shadow:0 0 0 3px #e6c984,0 9px 13px #0a211866}.depth,.distance{position:absolute;font:600 12px/1 var(--body);padding:3px 4px;border-radius:4px}.depth{bottom:4px;left:3px;background:#1a3c31;color:var(--cream)}.distance{right:-4px;top:-6px;background:#a1ebeb;color:#153b34}.filigree{width:143px;height:26px;color:var(--gold);opacity:.82}
.lesson-panel{display:flex;justify-content:space-between;align-items:center;gap:25px;padding:21px 25px;border:1px solid var(--line);border-radius:10px;background:#183b31}.lesson-info{display:flex;gap:17px;align-items:center}.info-emblem{display:grid;place-items:center;flex:none;width:46px;height:46px;border:1px solid #ad945369;border-radius:50%;background:#244636;color:var(--gold)}.info-emblem .icon{width:23px;height:23px}.lesson-info p{font:normal clamp(17px,1.48vw,23px)/1.34 var(--serif);margin-top:5px;max-width:780px}.progress{display:flex;gap:5px;align-items:center}.progress i{display:block;width:17px;height:3px;background:#63907450;border-radius:4px}.progress i.on{background:var(--gold)}.progress i.current{width:30px;background:#ebcf98}.steps{display:flex;gap:15px;align-items:center}.step-count{font-size:10px;letter-spacing:1.85px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;background:#234638;color:var(--cream);border:1px solid #7184669c;padding:12px 18px;min-height:44px;border-radius:7px;font-size:14px;font-weight:600;white-space:nowrap}.btn:hover:enabled{background:#305b47}.btn.primary{background:#e4c48b;border-color:#edcf97;color:#1f3329;box-shadow:inset 0 1px 0 #f8deb1}.btn.primary:hover:enabled{background:#f2d7a5}.btn .icon{width:17px;height:17px}.lesson-panel .primary{min-width:112px}
#footer{border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:13px 5.4vw;min-height:59px;background:#0e2822a3}.footname{font:italic 15px var(--serif);color:#aebeb0}.footer-suits{display:flex;align-items:center;gap:10px;color:#c9b383;font:17px Georgia,serif}.footer-suits span:nth-child(even){color:#9aab98}.footlinks{gap:19px}.footlinks button{font-size:12px;min-height:32px}
.main-menu{display:grid;grid-template-columns:1fr 1.03fr;align-items:center;gap:6%;padding:clamp(35px,5vw,75px)}.menu-copy h1{font-size:clamp(45px,6vw,90px)}.subtitle{color:var(--gold);font:italic clamp(24px,3vw,44px) var(--serif);margin:4px 0 25px}.menu-actions{display:grid;gap:10px;max-width:360px}.menu-actions .btn{justify-content:flex-start;min-height:52px}.menu-actions small{font-size:12px;font-weight:400;white-space:normal;display:block;color:#cbd8c9;margin:3px 0 1px}.menu-actions .primary small{color:#3a4939}.menu-actions .btn span{text-align:left}.menu-fan{position:relative;min-height:320px;display:flex;justify-content:center;align-items:center}.menu-fan .card{position:absolute;width:clamp(110px,12vw,190px);pointer-events:none}.menu-fan .card:nth-child(1){transform:translate(-53%,4%) rotate(-20deg)}.menu-fan .card:nth-child(2){transform:translate(50%,3%) rotate(18deg)}.menu-fan .card:nth-child(3){transform:translateY(-6%) rotate(-2deg)}
.game-heading h1{font-size:clamp(33px,3vw,49px);margin-top:5px}.game-heading{align-items:center}.game-meta{display:flex;align-items:center;gap:16px}.counter{display:flex;gap:7px;align-items:center;border:1px solid var(--line);border-radius:20px;padding:7px 13px;font-size:13px;color:var(--cream)}.counter .icon{color:var(--gold);width:16px;height:16px}
main.game{justify-content:flex-start;gap:13px;padding:18px 0 14px}.game-table{--cols:13;padding:clamp(16px,1.7vw,27px);flex:1;min-height:0;display:flex;align-items:flex-start}.grid{display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));gap:clamp(5px,.7vw,11px);width:100%;align-content:start;justify-items:center}.grid .card{width:min(100%,calc((100svh - 290px) / 5.79));min-width:44px;max-width:100px}.game-table .corner{width:55px;height:41px;opacity:.45}.game-table .c1,.game-table .c2{top:5px}.game-table .c3,.game-table .c4{bottom:5px}.game-table .c1,.game-table .c3{left:5px}.game-table .c2,.game-table .c4{right:5px}
.controls{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:55px}.status{color:#e6e8d7;font-size:14px;line-height:1.4}.status.warn{color:#ffd9a0}.empty-deck{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;margin:auto;text-align:center;padding:32px 16px}.deckback{width:76px;aspect-ratio:100/144;border-radius:5px;border:4px double #e3c68f;background:repeating-linear-gradient(45deg,transparent 0 6px,#e3c68f34 6px 7px),repeating-linear-gradient(-45deg,#284938 0 6px,#e3c68f3b 6px 7px);color:#e3c68f;font:42px Georgia;display:grid;place-items:center;box-shadow:3px 3px #d5c9aa,6px 6px #213c30}
dialog{padding:0;border:1px solid #9e8d62;border-radius:15px;color:var(--cream);background:#19392f;width:min(480px,calc(100vw - 32px));max-height:89svh;box-shadow:0 24px 90px #04100de0}dialog::backdrop{background:#051b16bd;backdrop-filter:blur(5px)}#panel{padding:30px;position:relative}.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 20px}.dialog-head h2{font-size:31px}.dialog-close{background:none;color:var(--muted);border:none;display:grid;place-items:center;min-width:36px;min-height:36px}.dialog-body{display:grid;gap:14px}.dialog-body p{line-height:1.55;color:#d6e0d5}.dialog-body .actions{flex-wrap:wrap}.dialog-body label{line-height:1.4}.dialog-body input[type=text]{background:#112b23;border:1px solid #8c9a7d;border-radius:6px;padding:12px;color:var(--cream);width:100%}.segmented{display:flex;gap:6px}.segmented .btn{flex:1}.setting{display:flex;align-items:center;justify-content:space-between;gap:14px;border-bottom:1px solid var(--line);padding:4px 0 12px}.setting small{display:block;color:var(--muted);margin-top:4px;font-size:13px}.switch{min-width:54px;border:1px solid #95a18b;border-radius:20px;padding:5px 9px;background:#203c30;color:#d5ded0;font-size:13px}.switch[aria-checked=true]{background:#e0c18c;color:#25392c;border-color:#e0c18c}.result-decoration{display:grid;place-items:center;color:var(--gold);font:56px Georgia}.result-decoration .filigree{width:120px}.shake{animation:shake .15s}.flash{animation:pulse .6s ease-in-out 2}.deal-pulse{box-shadow:0 0 0 2px #e6c58482}.win-effect{animation:shine 1.2s ease-out}.hint-arrow{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:4;overflow:visible}
@keyframes shake{25%{translate:-4px}75%{translate:4px}}@keyframes pulse{50%{filter:brightness(1.16);box-shadow:0 0 12px #f9d995}}@keyframes shine{25%{transform:scale(1.1);filter:brightness(1.5)}}.reduced *,.reduced *::before,.reduced *::after{animation-duration:0s!important;transition-duration:0s!important}
@media(min-width:1000px) and (max-height:740px){#header{height:65px}main{padding:16px 0;gap:13px}.lesson-table{min-height:280px;height:43vh}.lesson-row{min-height:140px}.lesson-panel{padding:14px 18px}#footer{min-height:43px;padding-block:5px}.game-table .card{width:min(100%,calc((100svh - 243px) / 5.8))}}
@media(min-width:600px) and (max-width:999px){main{width:94%}.game-table{--cols:9}.grid .card{width:min(100%,calc((100svh - 300px) / 8.75))}.lesson-info{gap:11px}.lesson-panel{padding:18px 16px}.main-menu{grid-template-columns:1.1fr 1fr}}
@media(max-width:599px){#header{height:65px;padding:0 16px}.brand-mark{width:38px;height:38px}.wordmark{gap:7px}.brand-type strong{font-size:24px}.brand-type small{font-size:8px;letter-spacing:2px}.nav{gap:9px}.nav .nav-text,.nav .separator{display:none}.nav button.nav-icon{width:35px;height:35px}.nav .icon{width:17px;height:17px}main{width:calc(100% - 28px);padding:22px 0;gap:15px}.heading h1{font-size:42px}.eyebrow{font-size:10px;letter-spacing:1.8px}.eyebrow:before{width:20px}.textbtn.skip{font-size:12px;padding:9px 10px}.lesson-table{min-height:225px;height:34vh;max-height:350px;gap:19px}.lesson-row{min-height:86px;padding:7px 13px;gap:clamp(4px,1.5vw,9px)}.lesson-row .card{width:min(16.2%,78px);border-radius:4px}.lesson-table .filigree{width:104px;height:18px}.table-label{font-size:9px;letter-spacing:2.6px}.table-label:before,.table-label:after{width:26px}.lesson-panel{display:grid;padding:17px 15px;gap:15px}.lesson-info{gap:11px}.info-emblem{width:36px;height:36px}.info-emblem .icon{width:18px}.lesson-panel .actions{justify-content:flex-end}.lesson-info p{font-size:18px}.progress i{width:11px}.progress i.current{width:17px}.step-count{font-size:9px}.steps{gap:8px}#footer{padding:10px 16px;min-height:44px}.footname{display:none}.footlinks{gap:13px}.footer-suits{gap:6px;font-size:14px}.main-menu{display:flex;flex-direction:column-reverse;gap:4px;padding:21px 20px 30px}.menu-fan{width:100%;min-height:156px}.menu-fan .card{width:78px}.menu-copy{width:100%}.menu-copy h1{font-size:48px}.subtitle{font-size:25px;margin-bottom:18px}.menu-actions{max-width:none}.game #menu-button{font-size:0}.game-heading h1{font-size:28px;margin-top:3px;letter-spacing:-1px}.game-meta{gap:5px}.counter{font-size:11px;gap:4px;padding:6px 8px}.counter .icon{width:13px}.game-heading .eyebrow{font-size:9px}.game-heading .eyebrow:before{width:12px}body:has(main.game) #header{height:51px}body:has(main.game) #footer{display:none}main.game{width:calc(100% - 12px);gap:7px;padding:8px 0 4px}.game-heading{padding:0 5px}.game-table{--cols:7;padding:8px 4px;border-radius:8px;box-shadow:inset 0 0 0 2px #183b32}.game-table .corner{display:none}.grid{column-gap:3px;row-gap:5px}.grid .card{width:min(100%,calc((100svh - 218px) / 11.52));min-width:min(44px,100%);border-radius:4px}.grid .card-art text{font-size:23px}.grid .depth{font-size:9px;padding:2px}.grid .distance{font-size:10px}.controls{flex-direction:column;align-items:stretch;gap:5px;padding:0 3px}.status{min-height:20px;font-size:12px;line-height:1.25}.controls .toolrow{justify-content:flex-end;gap:6px}.controls .btn{padding:8px 12px;min-height:40px;font-size:13px}.controls .selected{transform:translateY(-3px)}#panel{padding:23px}.dialog-head h2{font-size:28px}}
@media(max-width:359px){main{width:calc(100% - 16px)}.lesson-panel{padding:13px 10px}.lesson-panel .actions{gap:5px}.textbtn.skip{padding:9px 6px}.nav{gap:5px}}
.compact-face{display:none}.grid .card{touch-action:none}.controls .btn{min-height:48px}
@media(max-width:599px){.grid .card-art>:not(.inner-border){display:none}.grid .compact-face{position:absolute;inset:5px 5px 4px;display:grid;grid-template-rows:auto 1fr;align-items:center;justify-items:center}.compact-face b{font:normal clamp(17px,4.7vw,23px)/1 Georgia,serif;justify-self:start}.compact-face svg{width:55%;height:100%;max-height:30px;align-self:center}.nav button.nav-icon{width:44px;height:44px}.nav{gap:4px}}

