:root {
  color-scheme: dark;
  --ink:#fff2db; --soft:#d1c8ed; --gold:#ffd590; --deep:#11132b;
  font-family:"Trebuchet MS",system-ui,sans-serif;
  background:var(--deep); color:var(--ink);
}
*,*::before,*::after {box-sizing:border-box}
html,body {margin:0; width:100%; height:100%; overflow:hidden; overscroll-behavior:none}
button {font:inherit; color:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; touch-action:manipulation}
button:focus-visible {outline:3px solid #fff1a7; outline-offset:4px}
button:disabled {cursor:default}
[hidden] {display:none!important}
#app,.screen {position:relative; width:100%;height:100%}
#app {height:100dvh; isolation:isolate}
.home {overflow:hidden; background:#171735}
.hero-art,.hero-shade {position:absolute; inset:0; pointer-events:none}
.hero-art {background:url("./art/cover.webp") 60% 48% / cover no-repeat}
.hero-shade {background:linear-gradient(90deg,#10132cf7 0%,#151636dc 21%,#15163642 51%,transparent 75%),linear-gradient(0deg,#0c1026de,transparent 36%)}
.top {display:flex; position:absolute; inset:0 0 auto; align-items:center; justify-content:space-between; z-index:1; padding:max(18px,env(safe-area-inset-top)) max(22px,env(safe-area-inset-right)) 12px max(22px,env(safe-area-inset-left));}
.mark {display:grid; place-items:center; height:46px; width:46px; border:1px solid #ffe3ad72; border-radius:16px; color:#ffde95; background:#252145bf; font-size:29px; box-shadow:inset 0 0 16px #ffc87c29,0 5px 22px #110d2299}
.round {display:grid;place-items:center; height:49px;width:49px;border-radius:17px;border:1px solid #f6dbff61; background:#241c48dc; font-weight:900; font-size:29px; box-shadow:0 3px 0 #08081b6c,inset 0 1px #ffffff17; backdrop-filter:blur(8px);}
.round svg {width:23px;height:23px}
.hero-copy {position:absolute; z-index:1; left:clamp(30px,8vw,150px); top:50%; transform:translateY(-39%); width:min(510px,58vw);}
.hero-name h1 {font:900 clamp(74px,11vw,169px)/.78 Georgia,serif; letter-spacing:-.08em; margin:0; color:#fff2cc; text-shadow:0 5px #754782,0 10px 24px #110e2bc9}
.hero-name h1 span {display:block; font:italic 700 clamp(31px,4.3vw,62px)/1.14 Georgia,serif; letter-spacing:-.045em; margin:12px 0 0 4px; color:#ffda9d; text-shadow:0 4px 16px #290f3f;}
.hero-copy p {font-size:clamp(17px,1.6vw,23px); line-height:1.35; font-weight:700; margin:24px 0 27px; text-shadow:0 3px 10px #0e1030}
.actions {display:flex; align-items:center; gap:11px; flex-wrap:wrap;}
.primary,.glass {padding:14px 25px; min-height:54px; border-radius:18px; font-weight:900; font-size:18px; transition:transform .15s,filter .15s; }
.primary {border:1px solid #ffeeca; background:linear-gradient(180deg,#fff0b9,#ffc177 87%); color:#321d42; box-shadow:0 5px 0 #ac5e5e,0 11px 24px #0d092565,inset 0 1px #fff9df}
.primary span {margin-left:8px;color:#824573}
.glass {border:1px solid #dfc3fb87; background:#271e4fc9; box-shadow:inset 0 1px #fff2,0 4px 0 #11122b60;}
@media (hover:hover) {button:not(:disabled):hover {filter:brightness(1.12)}}
.primary:active,.glass:active,.round:active {transform:translateY(3px)}
.home-progress {margin-top:19px; font-size:15px; font-weight:800; color:#ffe5b8; min-height:21px}
.page {overflow:auto; background:radial-gradient(ellipse at 48% -5%,#413365,#17182f 66%,#101329);}
.bar {position:sticky;top:0; background:#181531e8; border-bottom:1px solid #ddc2ff2f; backdrop-filter:blur(12px);}
.bar>span:not(.mark) {font:700 clamp(21px,4vw,30px) Georgia,serif; color:#ffe5bb}
.page-body {max-width:930px; margin:0 auto; padding:24px 16px calc(35px + env(safe-area-inset-bottom))}
.map-intro {display:flex; justify-content:space-between; align-items:center; gap:12px; margin:2px 0 17px}
.map-intro h2 {font:700 clamp(32px,6vw,53px)/1 Georgia,serif; letter-spacing:-.04em; margin:0}
.map-intro p {font-size:15px;color:var(--soft); margin:4px 0;text-align:right}
#world-list,#badges {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;}
.world {position:relative; overflow:hidden; border-radius:20px; padding:18px 13px 14px; border:1px solid #dbb9f46e; background:#29264f; box-shadow:0 8px 19px #100b254f; isolation:isolate}
.world::before {content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(0deg,#141226 3%,#14122677 57%,#30243d66),var(--world-art) center 47% / cover;}
.world-heading {display:flex;justify-content:space-between;align-items:start;gap:6px;min-height:74px}
.world h3 {font:700 25px/1.02 Georgia,serif; margin:0 0 5px; text-shadow:0 2px 8px #110f20}
.world p {margin:0; font-size:15px;font-weight:700;color:#fbe7ec}
.world-symbol {font-size:26px; display:grid; place-items:center; min-width:42px; height:42px; background:#261b47b0; border:1px solid #fff4;border-radius:13px;}
.levels {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}
.step {display:flex;align-items:center;justify-content:center; flex-direction:column; gap:1px; min-height:52px; background:#ebe0ff25; border:1px solid #d7bcfc75; border-radius:12px; font-weight:900;font-size:19px; line-height:1;}
.step small {font-size:12px;letter-spacing:-.06em;line-height:1.1;color:var(--gold)}
.step.now {background:linear-gradient(#fff0b9,#ffc47d);color:#362447;border-color:#fff0bd;box-shadow:0 2px #c77664}
.step:disabled {background:#171329b8;border-color:#ddc2ff33;color:#e6d4f993}
.book-button {grid-column:1/-1; justify-self:center;margin-top:5px}
.badge {background:#211c40;border:1px solid #8b70b1;border-radius:16px;padding:14px;display:grid;gap:3px;grid-template-columns:54px 1fr;align-items:center;}
.badge span {grid-row:span 2;font-size:30px; text-align:center}
.badge small {color:#d8c6fa;font-size:14px}
.badge.locked {opacity:.68}
.game {overflow:hidden;background:#211a41;user-select:none;-webkit-user-select:none;touch-action:none;}
canvas {display:block;width:100%;height:100%;}
.hud {position:absolute;top:max(12px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));display:flex;justify-content:space-between;align-items:flex-start;gap:8px;pointer-events:none}
.hud button {pointer-events:auto}
.level-tag,.counter,.guide {color:#fff2db;background:#181536de;border:1px solid #e5c9ff65;box-shadow:0 3px 12px #110a2c66}
.level-tag {min-width:140px;max-width:calc(100% - 133px);padding:7px 15px 8px;border-radius:15px;text-align:center;display:grid;gap:3px}
.level-tag strong {font-size:clamp(14px,3vw,18px);line-height:1.1}
.level-tag small {color:#f9d5ff; font-size:12px;line-height:1.1;font-weight:700}
.journey {height:4px;background:#76649c;border-radius:7px;overflow:hidden;margin-top:3px}
.journey i {display:block;background:#ffca79;width:100%;height:100%;transform-origin:left;transform:scaleX(0)}
.counter {border-radius:15px;padding:8px 10px;min-height:44px;display:flex;align-items:center;gap:5px;font-variant-numeric:tabular-nums;}
.counter span {font-size:21px;color:#ffda75;text-shadow:0 0 12px #ffc174}
.guide {position:absolute;left:50%;transform:translateX(-50%);top:calc(max(12px,env(safe-area-inset-top)) + 72px);min-width:min(280px,90vw);max-width:min(540px,92vw);width:max-content;padding:5px 6px 5px 14px;border-radius:14px;display:flex;gap:8px;align-items:center;justify-content:space-between;font-size:clamp(14px,2.8vw,18px);font-weight:800}
.guide-speak {background:#62449d;border:1px solid #e6caff88;border-radius:9px;min-width:44px;min-height:42px;padding:3px;white-space:nowrap}
.controls {position:absolute;inset:auto max(12px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));display:flex;justify-content:space-between;align-items:flex-end;pointer-events:none;}
.dpad,.moves {display:flex;align-items:flex-end;gap:8px}
.pad {height:clamp(55px,15vw,76px);width:clamp(53px,14vw,75px);border-radius:22px;border:1.5px solid #f7dbff8f;background:linear-gradient(145deg,#4f3c78ee,#251841ee);box-shadow:inset 0 2px #fff2,0 5px #151029bb,0 6px 16px #0e102da0;font-size:43px;font-weight:900;line-height:1;pointer-events:auto;touch-action:none;user-select:none;}
.pad.jump {width:clamp(58px,16vw,85px);display:grid;place-content:center;gap:0;color:#3a2342;border-color:#fff0ce;background:linear-gradient(#ffeca9,#ffbc75);box-shadow:0 5px #a25d62,0 6px 16px #0e102da0;font-size:30px}
.pad.jump span {font-size:12px;letter-spacing:.09em;font-weight:950;padding-top:2px}
.pad.magic {font-size:29px;width:clamp(48px,12vw,57px);height:clamp(48px,12vw,57px);border-radius:clamp(14px,4vw,21px);color:#ffeeff;background:linear-gradient(#9a6cd6,#592d9a)}
.pad.held,.pad:active {transform:translateY(4px);filter:brightness(1.26);box-shadow:inset 0 2px #0c0d252f}
dialog {color:var(--ink);padding:0;width:min(92vw,430px);max-height:92dvh;overflow:auto;border-radius:27px;border:1px solid #f5d9fbb2;background:radial-gradient(ellipse at 50% 0%,#554277,#211b43 75%);box-shadow:0 22px 85px #090619b0;}
dialog::backdrop {background:#0b0a27a8;backdrop-filter:blur(5px)}
#modal-content {display:grid;gap:12px;text-align:center;padding:clamp(17px,4vw,27px);}
#modal-content h2 {font:700 clamp(28px,7vw,46px)/1.02 Georgia,serif; margin:0;color:#ffe4ab;letter-spacing:-.03em}
#modal-content p {line-height:1.4;font-weight:700; font-size:16px;margin:0}
.modal-symbol,.result-stars {font-size:41px;color:var(--gold);letter-spacing:.06em;line-height:1.05;text-shadow:0 0 19px #eead6aa5}
.modal-actions {display:grid;gap:10px;grid-template-columns:1fr}
.modal-row {display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.modal-row .glass {font-size:15px;padding:8px 12px;min-height:44px}
.answers {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;}
.answers button {font-size:17px;padding:8px 4px;}
.clock-face {width:100px;height:100px;margin:0 auto;display:block}
.sr-only {position:absolute; width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media (orientation:portrait) {
  .hero-art {background-image:url("./art/cover-phone.webp");background-position:center 35%}
  .hero-shade {background:linear-gradient(0deg,#13142ccc 2%,#15163455 39%,transparent 65%),linear-gradient(180deg,#120f3444,transparent 21%)}
  .hero-copy {width:calc(100% - 36px);left:18px;top:auto;bottom:max(28px,env(safe-area-inset-bottom));transform:none;text-align:center}
  .hero-name h1 {font-size:clamp(74px,19vw,138px)}
  .hero-name h1 span {font-size:clamp(31px,8.8vw,56px);margin-top:9px}
  .hero-copy p {margin:16px 0 17px;}
  .actions {justify-content:center}
  .home-progress {margin-top:14px;}
  #world-list {grid-template-columns:1fr;}
}
@media (max-width:380px) {.pad {border-radius:17px}.dpad,.moves{gap:5px}.top{padding-left:13px;padding-right:13px}.map-intro p{font-size:13px}#badges{grid-template-columns:1fr}.hero-copy{bottom:20px}}
@media (orientation:landscape) and (max-height:510px) {
  .hero-copy{top:auto;bottom:11px;transform:none;}
  .hero-name h1{font-size:clamp(60px,18vh,103px)}
  .hero-name h1 span{font-size:clamp(28px,9vh,48px);margin-top:6px}
  .hero-copy p{margin:12px 0;font-size:16px}
  .home-progress{margin-top:9px}
  .top{padding-top:max(8px,env(safe-area-inset-top))}
  .controls{bottom:max(9px,env(safe-area-inset-bottom))}
  .pad{width:59px;height:53px;border-radius:17px;font-size:34px}
  .pad.jump{width:64px;font-size:24px}
  .guide{top:calc(max(12px,env(safe-area-inset-top)) + 61px)}
  #modal-content{gap:8px;padding:12px 18px}
  #modal-content h2{font-size:30px}.modal-symbol,.result-stars{font-size:31px}
  .clock-face{width:74px;height:74px}
}
@media (prefers-reduced-motion:reduce) {button{transition:none!important}}
