.adventure-bar{display:flex;gap:20px;align-items:center;padding:17px 22px;margin-bottom:14px;border:1px solid #9dba8f66;border-radius:14px;background:linear-gradient(100deg,#091b13ef,#293c29e6);box-shadow:inset 0 1px #e2d6a333,0 5px 18px #0004}.hero-crest{font:38px Georgia;color:#e8cd8a;text-shadow:0 0 18px #ffcc7944}.hero-info{min-width:190px}.hero-info>div{display:flex;align-items:center;gap:12px}.hero-info strong{color:#ffe1a5;font-size:17px}.hero-info span{font-size:12px;color:#d7d9ba}.xp-track{height:4px;background:#08150d;margin:7px 0 4px;border-radius:4px;overflow:hidden}.xp-track i{height:100%;display:block;background:linear-gradient(90deg,#61bda2,#e4d393)}.hero-info small{color:#9fb39c;font-size:10px}.hero-currency{margin-left:auto}.hero-currency small{display:block;font-size:10px;color:#b5bea1}.hero-currency strong{display:block;color:#f1cd7d;font-size:23px;white-space:nowrap}.adventure-actions{display:flex;gap:8px}.adventure-actions button{font-size:12px;padding:10px 13px}.relic-shelf{display:flex;gap:5px}.relic-badge{display:inline-flex;align-items:center;justify-content:center;width:30px;height:34px;border:1px solid #8a99714d;border-radius:7px;color:#6f806d;background:#0b1b10;font:22px Georgia}.relic-badge.found{color:#ffe5a3;border-color:#d4b36a;box-shadow:inset 0 0 8px #cfae4433,0 0 9px #f3ce5c22}.story-card{display:flex;gap:16px;align-items:center;padding:16px 21px;border:1px solid #adad7a55;background:linear-gradient(105deg,#263226eb,#172b20ed);border-radius:12px;margin:0 0 18px;box-shadow:inset 3px 0 #bea370}.story-symbol{color:#c6ab71;font:34px Georgia}.story-card small{font-size:10px;letter-spacing:1px;color:#a8c0a4}.story-card h2{font-size:17px;margin:4px 0 5px;color:#e9d1a4}.story-card p{margin:0;color:#ccd1b8;font-size:12px;line-height:1.9;max-width:830px}.story-card button{margin-left:auto;white-space:nowrap;font-size:11px;padding:8px 12px}.story-card>div:nth-child(2){flex:1}.section-label{font-size:11px;color:#b9c7aa;letter-spacing:2px;margin:22px 0 12px}.adventure-dialog{max-width:760px;width:calc(100% - 28px);max-height:88vh;padding:28px;overflow:auto;text-align:left;overscroll-behavior:contain}.adventure-dialog h2{font-size:26px;margin:8px 0 14px}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:14px}.dialog-heading small{font-size:10px;letter-spacing:3px;color:#b5c6a9}.dialog-heading button{padding:6px 11px;font-size:12px}.adventure-dialog p{line-height:1.95;font-size:14px;color:#d4dbc2}.dialog-note{font-size:11px!important;color:#a8bba0!important}.codex-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.codex-relic{display:flex;gap:13px;padding:14px;background:#091c124d;border:1px solid #889f7244;border-radius:10px}.codex-relic>span{font:35px Georgia;color:#6f8266;align-self:center}.codex-relic.unlocked{border-color:#c6a46b77;background:#6b59301f}.codex-relic.unlocked>span{color:#efd191}.codex-relic h3{font-size:13px;margin:2px 0 5px}.codex-relic p{font-size:11px;margin:0;color:#b2c0a5;line-height:1.7}.memory-entry{border-bottom:1px solid #93ad7b33;padding:12px 0}.memory-entry summary{font-size:13px;cursor:pointer;color:#e0d5b6;display:flex;justify-content:space-between;gap:10px}.memory-entry summary span{font-size:10px;color:#9eb696}.memory-entry[inert]{opacity:.45}.memory-entry p{font-size:12px;margin:12px 0 0}.memory-reveal{color:#f1dbb4!important;border-left:2px solid #c4aa70;padding-left:15px}.shop-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.shop-item{display:flex;flex-direction:column;padding:16px;background:linear-gradient(145deg,#29392be0,#101e16);border:1px solid #a7a17255;border-radius:12px}.shop-item h3{font-size:13px;margin:12px 0 3px}.shop-item p{font-size:11px;margin:0 0 14px;color:#b1c2a6;line-height:1.8;flex:1}.shop-item button{font-size:11px;padding:9px 5px}.swatches{display:flex;gap:4px;min-height:34px;align-items:center}.swatches i{display:block;width:23px;height:23px;border:1px solid #ffffb344;border-radius:5px;box-shadow:inset 0 -3px #0002}.swatches>span{font:30px Georgia;color:#cebd83}.swatches[data-swatch="aurora"]{color:#89d5ff;text-shadow:0 0 14px #4cbdff}.swatches[data-swatch="dawn"]{color:#ffe68e;text-shadow:0 0 14px #ffd54c}.swatches[data-swatch="aurora"] span,.swatches[data-swatch="dawn"] span{color:inherit}.swatches[data-swatch="mosaic"] span{color:#72d5bc}.swatches[data-swatch="gold"] span{color:#f2cf77}.title-picker{display:flex;align-items:center;gap:12px;margin:10px 0 20px;font-size:12px}.title-picker select{max-width:100%}#shopBalance{font-size:13px;color:#ebcd85;margin:4px 0 18px}#result{max-width:560px;width:calc(100% - 28px);max-height:90vh;overflow:auto;padding:28px}.reward-tokens{display:flex;justify-content:center;gap:10px;margin:12px 0}.reward-tokens span{border:1px solid #b6ad6655;border-radius:9px;background:#101f15;padding:9px 15px;font-size:13px;color:#f2d599}.earned-stars{color:#e9cc84;letter-spacing:8px;font-size:24px}#rewardSummary small{font-size:10px;color:#b8c8a7}.relic-announcement{font-size:12px;color:#f7db9f;margin:12px 0}.memory-reward{padding:18px;text-align:left;margin:20px 0;background:#091a1055;border:1px solid #bdb27a55;border-radius:12px}.memory-reward small{font-size:10px;letter-spacing:3px;color:#abc6a5}.memory-reward h3{font-size:16px;margin:8px 0}.memory-reward p{font-size:13px;line-height:1.95;margin:0}.ending-teaser{color:#f7dc9c;font-size:13px;line-height:1.9;margin-bottom:16px}#result button{margin:4px}#endingDialog{max-width:760px;min-height:470px;text-align:center;background:radial-gradient(ellipse at top,#cda65c55,#163c26 60%,#10271b);box-shadow:0 0 120px #d8c26455;padding:32px}#endingDialog .dialog-heading{text-align:left}#endingTitle{font-size:32px;margin:26px 0 20px}#endingText{max-width:560px;margin:0 auto 28px;line-height:2.1;font-size:16px;color:#f0e3c0;white-space:pre-line}#endingChapter{font-size:10px;color:#c5cd9b;letter-spacing:4px;margin:20px 0 0}#endingSigils{display:flex;justify-content:center;gap:20px;padding:28px 0 8px}#endingSigils span{font:40px Georgia;color:#f4d88f;text-shadow:0 0 25px #ffe3a888;animation:memoryGlow 3s ease-in-out infinite alternate}.temple-restored{background-blend-mode:screen;background-color:#243c22}body[data-glow="aurora"] .board{filter:drop-shadow(0 0 9px #79c9ff88)}body[data-glow="dawn"] .board{filter:drop-shadow(0 0 9px #f9d76788)}body[data-frame="mosaic"] .boardwrap{border-color:#387b66;outline:2px dashed #9db88a}body[data-frame="gold"] .boardwrap{border-color:#aa8950;box-shadow:inset 0 0 0 2px #f3da8b,inset 0 4px 18px #000d,0 0 18px #f2cf6544}@keyframes memoryGlow{to{opacity:.6;transform:translateY(-3px)}}[hidden]{display:none!important}@media(prefers-reduced-motion:reduce){#endingSigils span{animation:none}}@media(max-width:900px){.adventure-bar{flex-wrap:wrap;gap:12px;padding:15px}.hero-info{min-width:170px;flex:1}.relic-shelf{margin-left:auto}.hero-currency{margin-left:0}.adventure-actions{margin-left:auto}.story-card{padding:14px}.story-card p{font-size:11px}.shop-grid{grid-template-columns:1fr 1fr}}@media(max-width:600px){.hero-crest{display:none}.hero-info{min-width:150px}.relic-shelf{order:3;margin-left:0}.adventure-actions{order:4}.hero-currency strong{font-size:20px}.story-symbol{display:none}.story-card{display:block}.story-card button{margin-top:12px}.codex-grid{grid-template-columns:1fr}.shop-grid{gap:8px}.shop-item{padding:12px}.adventure-dialog{padding:20px}.adventure-dialog h2{font-size:23px}#endingDialog{padding:22px;min-height:0}#endingText{font-size:14px}#endingTitle{font-size:27px}#endingSigils{gap:17px}#endingSigils span{font-size:30px}.reward-tokens span{padding:9px 12px}}

.story-card{box-shadow:inset 3px 0 #bea370,0 0 calc(10px + 20px * var(--restoration,0)) rgb(113 229 169 / calc(.03 + .15 * var(--restoration,0)))}

.layout{align-items:start}.layout>aside{position:sticky;top:15px}.story-buttons{display:flex;gap:8px;margin-left:auto;flex:none!important}.story-buttons button{margin-left:0}.layout>section{scroll-margin-top:15px}@media(max-width:760px){.layout>aside{position:static}.story-buttons{margin-top:8px}.story-buttons button{margin-top:0}}

.shop-category{margin:22px 0 28px}.category-title{font-size:18px;color:#f0d698;margin:0 0 4px}.category-description{font-size:12px!important;color:#b8c7aa!important;margin:0 0 13px!important}.cosmetic-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:radial-gradient(ellipse,#34462a,#101d14);border-radius:8px;padding:17px 8px 10px;min-height:143px}.preview-board{display:grid;grid-template-columns:repeat(3,21px);gap:3px;border:5px solid;padding:6px;background:#18281b;border-radius:8px}.preview-board i{height:21px;width:21px;border-radius:3px;box-shadow:inset 0 1px 2px #fff5,inset 0 -3px 2px #0005}.cosmetic-preview small{font-size:9px;color:#b0bfa3;letter-spacing:1px}.shop-item h3{margin-top:14px}

.board-heading{flex-wrap:wrap;gap:10px}.board-heading>span{white-space:nowrap}.board-heading .stage-strip{margin:0 0 0 auto;padding:0;background:none;border:0;border-radius:0;box-shadow:none;gap:8px;flex-wrap:nowrap}.board-heading .stage-strip>div:first-child{flex:none;gap:0}.board-heading .stage-strip>div:first-child>small,.board-heading #stageDescription,.board-heading .stage-summary{display:none}.board-heading .stage-strip strong{font-size:12px;white-space:nowrap;letter-spacing:0}.board-heading .stage-nav{order:initial;width:auto;gap:5px}.board-heading .stage-nav select{min-width:0;width:145px;max-width:40vw;padding:8px 6px;font-size:11px}.board-heading .stage-nav button{padding:4px 9px!important;font-size:17px!important}.board-heading #difficulty{font-size:11px;max-width:150px}@media(max-width:1050px) and (min-width:761px){.board-heading .stage-strip{width:100%;justify-content:space-between}.board-heading .stage-nav select{width:145px}}@media(max-width:480px){.board-heading .stage-strip{width:100%;justify-content:space-between}.board-heading .stage-nav select{width:155px}}

.board-heading .game-options{margin:0 0 0 auto;padding:0;background:none;border:0;gap:7px;flex-wrap:nowrap}.board-heading .game-options .mode-note{display:none}.board-heading .game-options select{font-size:11px;padding:8px 6px}.board-heading .game-options label{font-size:11px;white-space:nowrap}.stage-above-pieces{border-bottom:1px solid #b9ae7655;margin:0 0 18px;padding-bottom:15px}.stage-above-pieces .stage-strip{padding:0;margin:0;gap:8px;border:0;background:none;box-shadow:none;flex-wrap:wrap}.stage-above-pieces .stage-strip>div:first-child{flex:none}.stage-above-pieces .stage-strip>div:first-child small,.stage-above-pieces #stageDescription,.stage-above-pieces .stage-summary{display:none}.stage-above-pieces .stage-strip strong{font-size:12px;letter-spacing:0;white-space:nowrap}.stage-above-pieces .stage-nav{order:initial;width:auto;margin-left:auto;gap:5px}.stage-above-pieces .stage-nav select{min-width:0;width:145px;font-size:11px;padding:8px 6px}.stage-above-pieces .stage-nav button{padding:4px 8px!important;font-size:17px!important}@media(max-width:1050px) and (min-width:761px){.stage-above-pieces .stage-nav{width:100%;justify-content:space-between;margin-top:5px}.stage-above-pieces .stage-nav select{flex:1;width:100px}}

/* Match both game cards edge to edge. */
.layout{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}.layout>.panel{min-width:0;height:100%}.layout>aside{position:static;top:auto}.boardwrap{container-type:inline-size}.board{--s:min(44px,calc((100cqw - 28px)/8))}@media(max-width:760px){.layout{grid-template-columns:1fr}.layout>.panel{height:auto}}

/* Let the playable grid fill the enlarged card, including its drag preview. */
.boardwrap{min-height:460px;padding:24px 16px}.board{--s:min(64px,calc((100cqw - (var(--board-cols,8) - 1)*4px)/var(--board-cols,8)),calc((408px - (var(--board-rows,7) - 1)*4px)/var(--board-rows,7)))}@media(max-width:760px){.boardwrap{min-height:370px;padding:20px 12px}.board{--s:min(56px,calc((100cqw - (var(--board-cols,8) - 1)*4px)/var(--board-cols,8)),calc((316px - (var(--board-rows,7) - 1)*4px)/var(--board-rows,7)))}}

.game-panel-title,.stage-above-pieces #stageHeading{font-family:inherit;font-size:12px;font-weight:700;letter-spacing:0;color:#f1d8a6;line-height:1.5}

/* Shared rhythm inside both game frames. */
.layout{gap:20px}.layout>.panel{padding:24px;display:flex;flex-direction:column}.layout>.panel>.top{min-height:36px;gap:12px;flex-shrink:0}.layout .boardwrap{margin:16px 0;flex:1;padding:24px}.layout .stage-above-pieces{margin:0 0 16px;padding:0 0 16px}.layout .pieces{margin:16px 0 0;gap:12px;flex:1;grid-auto-rows:minmax(120px,1fr)}.layout .piece{height:auto;min-height:120px}.layout .controls{margin:16px 0 0;gap:12px}.layout .progress{margin:16px 0 0;flex-shrink:0}.layout .status{margin:12px 0 0;min-height:40px}.layout .help{margin:16px 0 0;padding:16px 0 0;gap:20px}.layout .actions{gap:10px;margin:0}.layout .note{margin:12px 0 0;line-height:1.8}.layout .relic-clock{margin:16px auto 0;flex-shrink:0}.adventure-bar{padding:11px 20px;gap:16px}.adventure-bar .hero-crest{font-size:32px}.adventure-bar .xp-track{margin:5px 0 3px}.adventure-bar .hero-info>div{gap:10px}.adventure-bar .adventure-actions button{padding:8px 12px}
@media(max-width:900px){.layout>.panel{padding:20px}.adventure-bar{padding:10px 16px;gap:10px}}
@media(max-width:760px){.layout{gap:16px}.layout>.panel{padding:18px}.layout .boardwrap{padding:20px;flex:none}.layout .pieces{flex:none;grid-auto-rows:112px;gap:10px}.layout .piece{min-height:112px}.layout .help{gap:16px}.adventure-bar{padding:10px 14px}}

.intro-story-line{letter-spacing:normal;line-height:1.8}.intro>div:first-child{min-width:0}@media(min-width:1000px){.intro{flex-wrap:wrap}.intro>div:first-child{flex:1 1 auto}.intro-story-line{white-space:nowrap}}

.hero-avatar{width:48px;height:58px;flex:none;padding:0!important;border:2px solid #cbb37b!important;border-radius:9px!important;background-image:url('assets/mason.png')!important;background-size:500% 100%!important;background-color:#183024!important;background-repeat:no-repeat!important;box-shadow:0 0 10px #c8aa4b33!important}.character-sheet{display:flex;gap:25px;align-items:center;margin:22px 0}.character-sheet>div:last-child{flex:1}#characterPortrait,.outfit-mini{background-image:url('assets/mason.png');background-size:500% 100%;background-repeat:no-repeat;border:1px solid #cbb37b88;border-radius:12px}#characterPortrait{width:180px;height:260px;flex:none}#outfitProgress{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.outfit-step{display:flex;flex-direction:column;gap:8px;opacity:.4}.outfit-step.unlocked{opacity:1}.outfit-mini{height:130px}.outfit-step strong{font-size:11px;line-height:1.7}.outfit-step small{font-size:10px;color:#a9bfa1}.story-art{display:block;aspect-ratio:1.5;margin:12px 0 20px;background-size:300% 200%;background-repeat:no-repeat;background-color:#203329;border:1px solid #c1b57a66;border-radius:10px;box-shadow:inset 0 0 25px #0003}.memory-entry .story-art{max-width:480px}.memory-reward .story-art{margin-top:0}#endingArt .story-art{max-height:280px;margin:10px auto;aspect-ratio:1.5}#endingDialog{max-height:90vh;overflow:auto}#endingSigils{padding-top:12px}#endingSigils span{font-size:30px}
body[data-pattern="veins"],.preview-board[data-pattern="veins"]{--stone-pattern:repeating-linear-gradient(125deg,transparent 0 12px,#e4ffc955 13px,#173d2833 15px,transparent 17px),linear-gradient(140deg,#fff3,#0002)}body[data-pattern="mosaicStone"],.preview-board[data-pattern="mosaicStone"]{--stone-pattern:repeating-linear-gradient(0deg,transparent 0 8px,#34251177 9px,transparent 10px),repeating-linear-gradient(90deg,transparent 0 8px,#f3e5bc66 9px,transparent 10px),linear-gradient(140deg,#fff3,#0002)}.cell.filled,.mini i,.drag-piece i,.preview-board i{background-image:var(--stone-pattern,linear-gradient(140deg,#fff3,#0002))!important;position:relative}.mini i{display:block}body[data-pattern="runes"] .cell.filled::after,body[data-pattern="runes"] .mini i::after,body[data-pattern="runes"] .drag-piece i::after,.preview-board[data-pattern="runes"] i::after{content:'⌘';position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:clamp(11px,2vw,26px);color:#2c271aaa;text-shadow:0 1px #ffedb688;pointer-events:none}.preview-board[data-pattern="runes"] i::after{font-size:14px}body[data-stone-light="ember"],.preview-board[data-stone-light="ember"]{--stone-shine:#ffd16bbb}body[data-stone-light="spirit"],.preview-board[data-stone-light="spirit"]{--stone-shine:#6fffe3bb}.cell.filled,.mini i,.drag-piece i,.preview-board i{filter:drop-shadow(0 0 5px var(--stone-shine,transparent))}body[data-stone-light="spirit"] .cell.filled,body[data-stone-light="spirit"] .mini i,body[data-stone-light="spirit"] .drag-piece i,.preview-board[data-stone-light="spirit"] i{animation:stoneBreathe 2.5s ease-in-out infinite alternate}@keyframes stoneBreathe{to{filter:drop-shadow(0 0 8px #6fffe3) brightness(1.2)}}@media(prefers-reduced-motion:reduce){body[data-stone-light="spirit"] .cell.filled,body[data-stone-light="spirit"] .mini i,body[data-stone-light="spirit"] .drag-piece i,.preview-board[data-stone-light="spirit"] i{animation:none}}@media(max-width:600px){.character-sheet{gap:14px}#characterPortrait{width:110px;height:180px}#outfitProgress{grid-template-columns:repeat(3,1fr)}.outfit-mini{height:120px}.hero-avatar{width:40px;height:50px}}

.preview-board{--stone-pattern:linear-gradient(140deg,#fff3,#0002);--stone-shine:transparent}.hero-avatar{background-size:500% auto!important}#characterPortrait{width:150px;height:280px}.outfit-mini{height:150px}@media(max-width:600px){#characterPortrait{width:100px;height:180px}.outfit-mini{height:140px}}

.preview-board i:last-child{filter:none;animation:none}.preview-board i:last-child::after{display:none}

.seal-lock{display:inline-block;position:relative;width:20px;height:16px;margin-top:8px;border:2px solid #9da58a;border-radius:3px;background:#344536}.seal-lock::before{content:'';position:absolute;width:10px;height:10px;border:2px solid #9da58a;border-bottom:0;border-radius:8px 8px 0 0;left:3px;top:-11px}.seal-lock::after{content:'';position:absolute;background:#b9bb9e;width:3px;height:6px;left:7px;top:4px;border-radius:2px}.codex-relic>span .seal-lock{margin:12px 8px}.restart-actions{display:flex;flex-wrap:wrap;gap:12px}.story-art{height:clamp(110px,23dvh,210px);aspect-ratio:auto;background-image:none!important;overflow:hidden;margin:10px 0 14px}.story-art svg{display:block;width:100%;height:100%}.memory-entry .story-art{max-width:none}#result{padding:18px;max-height:calc(100dvh - 24px)}#result .medal{font-size:28px}#result h2{font-size:25px;margin:8px 0}#resultText{font-size:12px;margin:8px 0}.memory-reward{padding:12px;margin:12px 0}.memory-reward p{font-size:12px;line-height:1.7}.memory-reward h3{font-size:14px;margin:6px 0}.reward-tokens{margin:8px 0}.reward-tokens span{padding:6px 12px}.earned-stars{font-size:20px}.adventure-dialog{max-height:calc(100dvh - 24px)}#prologueDialog{padding:20px}#prologueDialog p{font-size:13px;line-height:1.7}#prologueDialog h2{margin:8px 0;font-size:25px}#endingArt .story-art{height:clamp(110px,23dvh,210px);aspect-ratio:auto}#endingDialog{padding:20px}#endingTitle{font-size:25px;margin:12px 0}#endingText{font-size:14px;line-height:1.8;margin-bottom:16px}#endingSigils{padding:8px 0}#endingSigils span{font-size:24px}@media(max-height:720px){.story-art,#endingArt .story-art{height:120px}#result .medal,#endingSigils{display:none}.adventure-dialog p,#prologueDialog p{line-height:1.5}#prologueDialog p{margin:8px 0}#result .memory-reward p{font-size:11px}.relic-announcement{margin:6px 0;font-size:11px}}

.adventure-bar .hero-avatar{width:50px;height:60px;background-position-y:top!important;background-size:500% auto!important}.relic-image{display:inline-block;width:34px;height:42px;background-image:url('assets/relics.png');background-size:500% 100%;background-repeat:no-repeat;border-radius:5px;vertical-align:middle;flex:none}.relic-badge.found{width:34px;height:42px}.relic-badge .relic-image{width:100%;height:100%}.codex-relic>span .relic-image{width:78px;height:100px}.relic-announcement .relic-image{width:34px;height:42px;margin-right:8px}#endingSigils .relic-image{width:52px;height:68px}@media(max-width:600px){.adventure-bar .hero-avatar{width:46px;height:56px}.codex-relic>span .relic-image{width:60px;height:80px}#endingSigils .relic-image{width:40px;height:52px}}

header .brand{text-decoration:none;display:inline-block;cursor:pointer}header .brand:hover{filter:brightness(1.15)}header .brand:focus-visible{outline:2px solid #e4c391;outline-offset:7px;border-radius:4px}
/* Mobile play surface: keep board, tray and controls together. */
#mobileMenu{display:none}button,select,a{touch-action:manipulation}.board,.pieces,.controls{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.stage-above-pieces{min-width:0}.board-heading{flex-wrap:wrap;gap:8px}.board-heading .game-options{margin:0}.layout>*{min-width:0}.dragging{overscroll-behavior:none}.dragging .layout{touch-action:none}
@media(max-width:760px), (max-width:1000px) and (max-height:520px){
 body{min-height:100dvh;background-attachment:scroll}header{padding:6px 12px;min-height:44px;gap:10px}.brand{font-size:22px;letter-spacing:2px}header .brand small{display:none!important}#mobileMenu{display:block;padding:7px 10px;font-size:11px;min-height:34px}main{padding:6px 10px calc(10px + env(safe-area-inset-bottom))}.intro,footer{display:none}
 .adventure-bar{margin:0 0 6px;padding:5px 9px;gap:8px;border-radius:10px;flex-wrap:nowrap;min-height:43px}.adventure-bar .hero-avatar{width:28px;height:34px;border-radius:5px!important}.hero-info{min-width:0;flex:1}.hero-info>div{gap:7px}.hero-info strong{font-size:13px}.hero-info span{font-size:10px;white-space:nowrap}.hero-info small{display:none}.xp-track{margin:4px 0 0;height:3px}.hero-currency{margin-left:auto}.hero-currency small{display:none}.hero-currency strong{font-size:16px}.relic-shelf,.adventure-actions{display:none}
 .stage-strip{padding:6px 9px;margin:0 0 6px;gap:6px;flex-wrap:nowrap;border-width:1px;border-radius:9px;min-height:45px}.stage-strip>div:first-child{flex:none;gap:1px}.stage-strip small,.stage-summary,.stage-strip #stageDescription{display:none}.stage-strip strong{font-size:12px;letter-spacing:0}.stage-nav{order:0;width:auto;flex:1;min-width:0;gap:5px;justify-content:flex-end}.stage-nav select{min-width:0;max-width:185px;width:100%;font-size:11px;padding:6px 3px;min-height:32px}.stage-nav button{padding:2px 8px!important;min-width:32px;min-height:32px}
 .layout{display:grid;grid-template-columns:1fr;gap:6px}.panel{padding:8px 10px;border-radius:12px;border-width:1px}.panel::after{inset:3px;border-radius:9px}.board-heading,.relic-clock{display:none}.boardwrap{min-height:0;height:clamp(140px,37dvh,330px);padding:9px 4px;margin:0 0 6px;border-width:3px;border-radius:11px}.board{--s:min(44px,calc((100vw - 62px - (var(--board-cols) - 1)*4px)/var(--board-cols)),calc((37dvh - 28px - (var(--board-rows) - 1)*4px)/var(--board-rows)))}
 .actions{gap:5px;display:grid;grid-template-columns:repeat(4,1fr)}.actions button{padding:7px 2px;min-height:36px;font-size:11px;white-space:nowrap}.note{display:none}.layout aside.panel{padding:7px 9px}.layout aside>.top{font-size:11px;min-height:15px}.top #count{font-size:10px!important}.pieces{grid-template-columns:repeat(var(--piece-columns,4),minmax(0,1fr));gap:5px;margin-top:5px}.piece{height:clamp(55px,10dvh,78px);padding:2px;border-radius:8px}.piece b{font-size:8px;left:4px;top:3px}.mini i{width:min(18px,calc((100vw - 108px)/16));height:min(18px,calc((100vw - 108px)/16));border-radius:3px}.mini{gap:3px;filter:drop-shadow(1px 2px 2px #0006)}.controls{margin-top:6px;gap:6px}.controls button{min-height:40px;font-size:13px;padding:7px}.controls small{display:none}.progress{margin:6px 0 0;height:4px}.status{margin:5px 0 0;min-height:30px;font-size:11px;line-height:1.35}.help{display:none}
 body.mobile-expanded .intro{display:block;margin:8px 0 12px}body.mobile-expanded .intro h1{font-size:28px}body.mobile-expanded .stats{margin-top:8px}body.mobile-expanded .stat{padding:7px}body.mobile-expanded .stat strong{font-size:18px}body.mobile-expanded .adventure-bar{flex-wrap:wrap}body.mobile-expanded .adventure-actions{display:flex;width:100%;margin:4px 0 0;gap:5px}body.mobile-expanded .adventure-actions button{flex:1;padding:8px 4px;min-height:38px;font-size:11px}body.mobile-expanded .board-heading{display:flex;margin-bottom:8px;font-size:12px}body.mobile-expanded .board-heading .game-options{padding:5px;font-size:11px}body.mobile-expanded .help{display:flex;margin-top:10px;padding-top:8px}body.mobile-expanded footer{display:block}dialog{overscroll-behavior:contain}.adventure-dialog{padding:16px}
}
@media(max-width:1000px) and (orientation:landscape) and (max-height:520px){
 header{min-height:36px;padding-top:2px;padding-bottom:2px}.adventure-bar{display:none}.stage-strip{min-height:33px;margin-bottom:4px;padding:3px 8px}.layout{grid-template-columns:1.15fr 1fr;align-items:start}.boardwrap{height:calc(100dvh - 143px)}.board{--s:min(40px,calc((52vw - 55px - (var(--board-cols) - 1)*4px)/var(--board-cols)),calc((100dvh - 167px - (var(--board-rows) - 1)*4px)/var(--board-rows)))}.piece{height:clamp(48px,15dvh,68px)}.mini i{width:14px;height:14px}.controls button{min-height:36px}.status{min-height:24px}body.mobile-expanded .adventure-bar{display:flex}
}
@media(max-width:760px), (max-width:1000px) and (max-height:520px){
 .stage-above-pieces{margin:0 0 6px;padding:0;border:0}.stage-above-pieces .stage-strip{min-height:38px;flex-wrap:nowrap;gap:5px;padding:2px 0}.stage-above-pieces .stage-nav{flex:1;min-width:0}.stage-above-pieces .stage-nav select{width:100%;max-width:185px;padding:5px 3px}.stage-above-pieces .stage-nav button{padding:2px 7px!important}.layout{gap:6px;align-items:start}.layout>.panel{display:block;padding:8px 9px;height:auto}.layout>.panel>.top{min-height:15px;gap:5px}.layout .boardwrap{margin:0 0 6px;padding:9px 4px;flex:none}.layout .pieces{margin:5px 0 0;gap:5px;grid-auto-rows:auto;flex:none}.layout .piece{min-height:0;height:clamp(55px,10dvh,78px)}.layout .controls{margin:6px 0 0;gap:6px}.layout .progress{margin:6px 0 0}.layout .status{margin:5px 0 0;min-height:30px}.layout .actions{gap:5px}.layout .help{margin:8px 0 0;padding:8px 0 0}.adventure-bar .xp-track{margin:4px 0 0}
 #mobileTimer{display:inline;font-size:12px;font-variant-numeric:tabular-nums;color:#ffe3a5;margin-left:auto;margin-right:4px;white-space:nowrap}.mobile-gesture{display:block;font-size:10px;line-height:1.4;color:#d6d6bb;margin:4px 0 0}
}
#mobileTimer,.mobile-gesture{display:none}
@media(max-width:760px), (max-width:1000px) and (max-height:520px){#mobileTimer{display:inline}.mobile-gesture{display:block}}
@media(max-width:760px) and (max-height:650px) and (orientation:portrait){.adventure-bar{display:none}.boardwrap{height:32dvh}.board{--s:min(42px,calc((100vw - 62px - (var(--board-cols) - 1)*4px)/var(--board-cols)),calc((32dvh - 28px - (var(--board-rows) - 1)*4px)/var(--board-rows)))}.layout .piece{height:55px}body.mobile-expanded .adventure-bar{display:flex}}
@media(max-width:760px) and (orientation:portrait){
 body{--board-space:max(140px,calc(37dvh - (var(--tray-rows,1) - 1)*78px))}.layout .boardwrap{height:var(--board-space)}.board{--s:min(44px,calc((100vw - 62px - (var(--board-cols) - 1)*4px)/var(--board-cols)),calc((var(--board-space) - 28px - (var(--board-rows) - 1)*4px)/var(--board-rows)))}
}
@media(max-width:760px) and (max-height:650px) and (orientation:portrait){body{--board-space:max(128px,calc(32dvh - (var(--tray-rows,1) - 1)*60px))}}

@media(max-width:1000px) and (max-height:520px) and (orientation:landscape){.layout{grid-template-columns:1.15fr 1fr}.layout .boardwrap{height:calc(100dvh - 143px)}.layout .piece{height:clamp(48px,15dvh,68px)}.layout .pieces{grid-auto-rows:auto}.layout .mini i{width:14px;height:14px}}
