/* SAICRAFT — UI styles */
:root {
  --display: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --line: #0b0f1c;
  --green: #5ad13a; --green-l: #8ff06b; --green-d: #2f8a19;
  --blue: #3d9bff; --blue-l: #85c4ff; --blue-d: #1d5fb4;
  --yellow: #ffc928; --yellow-l: #ffe27a; --yellow-d: #c58a00;
  --orange: #ff8a2a; --orange-l: #ffb46e; --orange-d: #b9560a;
  --purple: #a463ff; --purple-l: #c9a3ff; --purple-d: #6630c0;
  --red: #ff4d5e; --red-l: #ff8f9a; --red-d: #b51f30;
  --dark: #414b6e; --dark-l: #66729c; --dark-d: #262c47;
  --gold: #ffd23f;
  --panel-a: rgba(42, 50, 82, 0.95);
  --panel-b: rgba(22, 27, 48, 0.97);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #141a2a; color: #fff; font-family: var(--body); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; touch-action: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#ui { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#ui button, #ui input, #ui .panel, #ui .pe, #ui .player-card, #ui label { pointer-events: auto; }
#world-ui { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; transition: opacity .2s; }
body.quiz-open #world-ui { opacity: 0; }
button { font: inherit; color: inherit; }
b, strong { font-weight: 900; }
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; }
.star-ico path { fill: currentColor; }

/* ---------------- loading ---------------- */
#loading { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 35%, #2d5fae 0%, #182446 55%, #0d1224 100%); transition: opacity .6s, visibility .6s; }
#loading::before { content: ''; position: absolute; inset: 0; background-image: var(--tex-dirt); background-size: 64px; image-rendering: pixelated; opacity: .08; }
#loading.hide { opacity: 0; visibility: hidden; }
.load-inner { position: relative; text-align: center; padding: 20px; width: min(560px, 92vw); }
.load-logo { font-family: var(--display); font-size: clamp(54px, 13vw, 110px); line-height: .9; letter-spacing: 2px; filter: drop-shadow(0 8px 0 rgba(0,0,0,.35)); animation: bob 2.6s ease-in-out infinite; }
.load-logo .l-sai { color: var(--gold); -webkit-text-stroke: 4px #6a3f00; paint-order: stroke fill; text-shadow: 0 6px 0 #b8700a; }
.load-logo .l-craft { color: #7ff3ff; -webkit-text-stroke: 4px #0d4a5a; paint-order: stroke fill; text-shadow: 0 6px 0 #1a8aa0; }
.load-sub { font-family: var(--display); font-size: clamp(20px, 4vw, 30px); color: #fff; opacity: .9; margin-top: 6px; letter-spacing: 1px; }
.load-bar { margin: 34px auto 18px; height: 26px; border: 4px solid var(--line); border-radius: 14px; background: #1b2238; overflow: hidden; box-shadow: 0 6px 0 rgba(0,0,0,.3); }
.load-fill { height: 100%; width: 5%; background: repeating-linear-gradient(45deg, #5ad13a 0 14px, #4bbd2c 14px 28px); transition: width .4s; box-shadow: inset 0 3px 0 rgba(255,255,255,.35); }
.load-tip { font-weight: 800; opacity: .85; min-height: 1.4em; font-size: 17px; }
.start-btn { margin: 34px auto 18px; display: block; animation: pulse 1.4s ease-in-out infinite; pointer-events: auto; }

/* ---------------- buttons ---------------- */
.btn { --c: var(--green); --l: var(--green-l); --d: var(--green-d); position: relative; font-family: var(--display); font-size: 20px; letter-spacing: .4px; color: #fff; padding: 11px 20px 13px; border: 3px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, var(--l) 0%, var(--c) 45%, var(--d) 100%); box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -4px 0 rgba(0,0,0,.18), 0 6px 0 var(--line), 0 10px 18px rgba(0,0,0,.3); text-shadow: 0 2px 0 rgba(0,0,0,.35); cursor: pointer; transition: transform .08s, box-shadow .08s, filter .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.08) saturate(1.05); transform: translateY(-2px); }
.btn:active { transform: translateY(5px); box-shadow: inset 0 3px 0 rgba(255,255,255,.3), inset 0 -2px 0 rgba(0,0,0,.18), 0 1px 0 var(--line), 0 3px 8px rgba(0,0,0,.3); }
.btn:disabled { filter: grayscale(.6) brightness(.8); cursor: default; transform: none; }
.btn-blue { --c: var(--blue); --l: var(--blue-l); --d: var(--blue-d); }
.btn-yellow { --c: var(--yellow); --l: var(--yellow-l); --d: var(--yellow-d); }
.btn-orange { --c: var(--orange); --l: var(--orange-l); --d: var(--orange-d); }
.btn-purple { --c: var(--purple); --l: var(--purple-l); --d: var(--purple-d); }
.btn-red { --c: var(--red); --l: var(--red-l); --d: var(--red-d); }
.btn-dark { --c: var(--dark); --l: var(--dark-l); --d: var(--dark-d); }
.btn-big { font-size: 26px; padding: 14px 30px 16px; border-radius: 18px; }
.btn-huge { font-size: clamp(32px, 5vw, 46px); padding: 14px 64px 18px; border-radius: 22px; border-width: 4px; box-shadow: inset 0 4px 0 rgba(255,255,255,.4), inset 0 -6px 0 rgba(0,0,0,.2), 0 9px 0 var(--line), 0 16px 30px rgba(0,0,0,.4); }
.btn-huge .bi { display: inline-block; transform: translateY(-2px); }
.btn-small { font-size: 16px; padding: 7px 14px 9px; border-radius: 11px; }
.btn-icon { padding: 10px 14px 12px; font-size: 22px; }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px 6px 8px; background: rgba(12, 16, 30, .78); border: 3px solid var(--line); border-radius: 999px; font-family: var(--display); font-size: 22px; box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 4px 0 rgba(0,0,0,.3); }
.pill .ico { width: 28px; height: 28px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.pill.bump { animation: bump .35s; }
.currencies { display: flex; gap: 10px; align-items: center; }

.panel { background: linear-gradient(180deg, var(--panel-a), var(--panel-b)); border: 4px solid var(--line); border-radius: 22px; box-shadow: inset 0 2px 0 rgba(255,255,255,.12), inset 0 0 0 2px rgba(255,255,255,.04), 0 10px 0 rgba(0,0,0,.25), 0 22px 44px rgba(0,0,0,.45); padding: 18px 22px; }

/* ---------------- screens ---------------- */
#screen { position: absolute; inset: 0; opacity: 0; transition: opacity .25s; }
#screen.show { opacity: 1; }
.topbar { position: absolute; top: calc(12px + var(--safe-t)); left: calc(14px + var(--safe-l)); right: calc(14px + var(--safe-r)); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tr-group { display: flex; gap: 10px; align-items: center; }
.scr-title { font-family: var(--display); font-size: clamp(22px, 3.4vw, 34px); text-shadow: 0 3px 0 rgba(0,0,0,.45); text-align: center; flex: 1; letter-spacing: 1px; }
.scr-title small { font-size: .6em; opacity: .8; }

.player-card { display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; background: rgba(12,16,30,.8); border: 3px solid var(--line); border-radius: 18px; box-shadow: 0 5px 0 rgba(0,0,0,.3); cursor: pointer; }
.pc-face-wrap { position: relative; }
.pc-face-wrap .face { width: 52px; height: 52px; border-radius: 10px; border: 3px solid var(--line); image-rendering: pixelated; background: #222; display: block; }
.pc-lvl { position: absolute; right: -8px; bottom: -8px; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 13px; background: var(--gold); color: #3a2500; font-family: var(--display); font-size: 16px; display: grid; place-items: center; border: 3px solid var(--line); }
.pc-name { font-family: var(--display); font-size: 24px; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.rank { font-size: 13px; padding: 2px 9px 3px; border-radius: 8px; background: var(--rc); color: #10131f; letter-spacing: .5px; text-shadow: none; border: 2px solid var(--line); }
.xpbar { position: relative; width: 210px; height: 20px; background: #10142a; border: 3px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 4px; }
.xpbar.big { width: min(420px, 70vw); height: 28px; border-radius: 14px; }
.xpfill { height: 100%; background: linear-gradient(180deg, #a6ff6a, #4fd12a 55%, #2e9a12); transition: width .9s cubic-bezier(.2,.9,.3,1); box-shadow: inset 0 2px 0 rgba(255,255,255,.4); }
.xpbar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 900; text-shadow: 0 1px 2px #000; }
.xpbar.big span { font-size: 15px; }

.daily-btn.ready { animation: wiggle 1.2s ease-in-out infinite; --c: var(--yellow); --l: var(--yellow-l); --d: var(--yellow-d); }
.daily-btn.ready::after { content: '!'; position: absolute; top: -10px; right: -10px; width: 24px; height: 24px; border-radius: 50%; background: var(--red); border: 3px solid var(--line); font-size: 15px; display: grid; place-items: center; }

/* main menu */
.menu-bottom { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tagline { font-family: var(--display); font-size: clamp(20px, 2.8vw, 28px); text-shadow: 0 3px 0 rgba(0,0,0,.5), 0 0 20px rgba(0,0,0,.4); }
.menu-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; padding: 0 12px; }
.menu-foot { font-weight: 800; opacity: .9; text-shadow: 0 2px 3px rgba(0,0,0,.7); font-size: 15px; }
.scr-main .btn-huge { animation: pulse 2.2s ease-in-out infinite; }

/* worlds */
.w-title { text-align: center; flex: 1; }
.w-num { font-family: var(--display); font-size: 18px; color: var(--wc); text-shadow: 0 2px 0 rgba(0,0,0,.6); letter-spacing: 2px; }
.w-name { font-family: var(--display); font-size: clamp(30px, 5vw, 50px); line-height: 1; text-shadow: 0 4px 0 rgba(0,0,0,.45), 0 0 30px rgba(0,0,0,.35); -webkit-text-stroke: 1.5px rgba(0,0,0,.4); }
.w-arrow { position: absolute; top: 42%; width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--line); background: rgba(255,255,255,.92); color: #1a2030; font-size: 26px; cursor: pointer; box-shadow: 0 6px 0 rgba(0,0,0,.35); transition: transform .1s; }
.w-arrow:hover { transform: scale(1.08); }
.w-arrow:disabled { opacity: .25; cursor: default; transform: none; }
.w-arrow.left { left: calc(16px + var(--safe-l)); }
.w-arrow.right { right: calc(16px + var(--safe-r)); }
.w-bottom { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); width: min(940px, 94vw); padding: 14px 18px 12px; }
.w-blurb { text-align: center; font-weight: 800; font-size: 17px; margin-bottom: 12px; opacity: .92; }
.w-levels { display: flex; align-items: center; justify-content: center; gap: 0; }
.ln-link { flex: 0 1 34px; height: 8px; background: repeating-linear-gradient(90deg, #fff6 0 8px, transparent 8px 14px); border-radius: 4px; }
.lvl-node { position: relative; width: 160px; max-width: 22vw; padding: 10px 8px 9px; border-radius: 18px; border: 4px solid var(--line); background: linear-gradient(180deg, #4a5684, #2a3150); cursor: pointer; text-align: center; box-shadow: inset 0 3px 0 rgba(255,255,255,.18), 0 6px 0 rgba(0,0,0,.35); transition: transform .12s; }
.lvl-node:hover { transform: translateY(-4px); }
.lvl-node.done { background: linear-gradient(180deg, var(--wc), #2a3150 160%); }
.lvl-node.current { animation: glowPulse 1.6s ease-in-out infinite; background: linear-gradient(180deg, #ffe27a, #e09a00); color: #2a1800; }
.lvl-node.current .ln-name { text-shadow: none; }
.lvl-node.locked { filter: grayscale(.85) brightness(.6); }
.lvl-node.boss { background: linear-gradient(180deg, #ff6a6a, #8a1a2a); }
.lvl-node.boss.current { background: linear-gradient(180deg, #ff8a5a, #c42a2a); color: #fff; }
.ln-num { font-family: var(--display); font-size: 34px; line-height: 1; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.ln-name { font-family: var(--display); font-size: 15px; margin-top: 2px; text-shadow: 0 2px 0 rgba(0,0,0,.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-stars { display: flex; justify-content: center; gap: 2px; margin-top: 4px; font-size: 20px; color: #20263c; }
.ln-stars .on { color: var(--gold); filter: drop-shadow(0 0 4px rgba(255,210,63,.8)); }
.ln-lock { position: absolute; top: -12px; right: -10px; font-size: 26px; }
.ln-best { font-size: 12px; font-weight: 800; opacity: .8; margin-top: 2px; }
.w-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-family: var(--display); font-size: 18px; }
.w-dots { display: flex; gap: 8px; }
.w-dots i { width: 14px; height: 14px; border-radius: 4px; background: #fff3; border: 2px solid var(--line); }
.w-dots i.on { background: var(--wc); transform: scale(1.25); }
.w-locked .w-levels { opacity: .6; }

/* locker */
.scr-locker .locker-panel { position: absolute; left: calc(16px + var(--safe-l)); top: calc(88px + var(--safe-t)); bottom: calc(16px + var(--safe-b)); width: min(600px, 56vw); display: flex; flex-direction: column; padding: 12px 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { flex: 1; font-family: var(--display); font-size: 17px; padding: 9px 8px 10px; border-radius: 12px; border: 3px solid var(--line); background: #2a3150; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.3); white-space: nowrap; }
.tab.on { background: linear-gradient(180deg, var(--yellow-l), var(--yellow)); color: #3a2500; transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; overflow-y: auto; padding: 4px 4px 10px; flex: 1; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.item-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border-radius: 16px; border: 3px solid var(--line); background: linear-gradient(180deg, #3a4470, #252b4a); cursor: pointer; box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 5px 0 rgba(0,0,0,.3); transition: transform .1s; }
.item-card:hover { transform: translateY(-3px); }
.item-card.equipped { background: linear-gradient(180deg, #4fd12a, #237a12); }
.item-card.owned:not(.equipped) { background: linear-gradient(180deg, #3d7bd8, #1d3f80); }
.item-card.locked { filter: grayscale(.7) brightness(.75); }
.ic-prev { height: 92px; display: grid; place-items: center; }
.ic-img { image-rendering: pixelated; }
.ic-img.skin { height: 90px; width: 45px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.35)); }
.ic-img.sword { height: 68px; width: 68px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.35)); }
.ic-emoji { font-size: 54px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.35)); }
.ic-name { font-family: var(--display); font-size: 16px; text-align: center; line-height: 1.1; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.ic-desc { font-size: 11.5px; font-weight: 800; opacity: .8; text-align: center; line-height: 1.15; }
.ic-tag { font-family: var(--display); font-size: 14px; padding: 3px 10px; border-radius: 9px; background: rgba(0,0,0,.4); display: flex; align-items: center; gap: 4px; }
.ic-tag .ico { width: 16px; height: 16px; }
.ic-tag.eq { background: #fff; color: #237a12; }
.ic-tag.poor { color: #ff9aa6; }
.look h3 { font-family: var(--display); font-weight: 400; margin: 10px 0 8px; font-size: 20px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 52px; height: 52px; border-radius: 12px; border: 4px solid var(--line); cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.swatch.on { outline: 4px solid #fff; transform: scale(1.08); }
.locker-hint { position: absolute; right: 24px; bottom: calc(22px + var(--safe-b)); font-family: var(--display); font-size: 18px; opacity: .85; text-shadow: 0 2px 3px #000; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.wrap { margin-top: 8px; }
.chip { font-family: var(--display); font-size: 15px; padding: 7px 13px 8px; border-radius: 11px; border: 3px solid var(--line); background: #2a3150; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.chip.on { background: linear-gradient(180deg, var(--green-l), var(--green)); color: #0f2a05; }

/* big panels (badges / stats) */
.big-panel { position: absolute; left: 50%; transform: translateX(-50%); top: calc(84px + var(--safe-t)); bottom: calc(16px + var(--safe-b)); width: min(1100px, 95vw); overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.badge { text-align: center; padding: 12px 10px; border-radius: 16px; border: 3px solid var(--line); background: #252b4a; filter: grayscale(1) brightness(.6); }
.badge.got { filter: none; background: linear-gradient(180deg, #5a3fa8, #2d2060); box-shadow: 0 0 0 2px #ffd23f inset; }
.b-icon { font-size: 44px; }
.b-name { font-family: var(--display); font-size: 18px; margin-top: 4px; }
.b-desc { font-size: 13px; font-weight: 800; opacity: .85; min-height: 2.4em; }
.b-rw { font-family: var(--display); font-size: 14px; margin-top: 6px; display: flex; gap: 4px; justify-content: center; align-items: center; }
.b-rw .ico { width: 18px; height: 18px; }

.stat-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.sc { text-align: center; padding: 10px; border-radius: 14px; background: #252b4a; border: 3px solid var(--line); }
.sc b { display: block; font-family: var(--display); font-size: 30px; font-weight: 400; color: var(--gold); }
.sc span { font-size: 13px; font-weight: 800; opacity: .85; }
.stats-cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; }
.stats-cols h3 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 4px 0 10px; }
.stats-cols h3 small { font-family: var(--body); font-size: 13px; font-weight: 800; opacity: .8; }
.topic { display: grid; grid-template-columns: 30px 1fr auto 46px; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(255,255,255,.05); margin-bottom: 6px; font-weight: 800; }
.topic.off { opacity: .4; }
.t-ico { font-size: 20px; }
.t-lvl { display: flex; gap: 3px; }
.t-lvl i { width: 14px; height: 14px; border-radius: 4px; background: #1a1f36; border: 2px solid var(--line); }
.t-lvl i.on { background: var(--gold); }
.t-acc { text-align: right; opacity: .85; }
.tt-grid { display: grid; grid-template-columns: 42px repeat(12, 1fr); gap: 3px; }
.tt-h { font-family: var(--display); font-size: 13px; text-align: center; opacity: .8; display: grid; place-items: center; }
button.tt-row { border: 2px solid var(--line); border-radius: 7px; background: var(--purple); cursor: pointer; opacity: 1; color: #fff; padding: 2px; }
.tt-c { font-size: 11px; font-weight: 900; text-align: center; padding: 5px 0; border-radius: 5px; color: rgba(255,255,255,.9); }
.tt-c.m0, .tt-key .m0 { background: #2a3150; color: #fff6; }
.tt-c.m1, .tt-key .m1 { background: #d9495a; }
.tt-c.m2, .tt-key .m2 { background: #e2a31a; }
.tt-c.m3, .tt-key .m3 { background: #3cbf4a; }
.tt-key { margin-top: 10px; font-size: 13px; font-weight: 800; opacity: .9; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tt-key span { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }

/* settings */
.settings-wrap { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; }
.settings-panel { width: min(760px, 94vw); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.set-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.set-head h2 { font-family: var(--display); font-weight: 400; font-size: 30px; margin: 0; }
.set-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding-right: 4px; }
.settings-panel section { padding: 10px 14px 12px; margin-bottom: 10px; border-radius: 14px; background: rgba(255,255,255,.05); }
.settings-panel h3 { font-family: var(--display); font-weight: 400; font-size: 21px; margin: 2px 0 8px; }
.settings-panel h3 small { font-family: var(--body); font-size: 13px; font-weight: 800; opacity: .75; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0; font-weight: 800; font-size: 16px; }
.row.col { flex-direction: column; align-items: flex-start; }
.row small { font-weight: 700; opacity: .7; }
input[type=range] { width: min(260px, 45vw); accent-color: var(--green); height: 28px; }
.toggle { width: 62px; height: 34px; border-radius: 17px; border: 3px solid var(--line); background: #2a3150; position: relative; cursor: pointer; flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.toggle.on { background: var(--green); }
.toggle.on::after { left: 31px; }
.name-input, .code-input { font: 800 17px var(--body); padding: 8px 12px; border-radius: 10px; border: 3px solid var(--line); background: #10142a; color: #fff; width: 210px; -webkit-user-select: text; user-select: text; touch-action: manipulation; }
.code-input { text-transform: uppercase; width: 250px; }
.code-row { display: flex; gap: 10px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.save-code { font: 400 22px var(--display); letter-spacing: 2px; padding: 6px 14px; border-radius: 10px; background: #10142a; border: 3px dashed var(--gold); color: var(--gold); -webkit-user-select: all; user-select: all; }
.hint { font-size: 14px; font-weight: 700; opacity: .8; margin: 6px 0; }
.about { text-align: center; font-weight: 800; opacity: .6; }
.restore-msg { font-weight: 800; min-height: 1em; }

/* ---------------- modals ---------------- */
#modal { position: absolute; inset: 0; display: none; place-items: center; z-index: 30; padding: 16px; }
#modal.show { display: grid; pointer-events: auto; }
.modal-back { position: absolute; inset: 0; background: rgba(8, 10, 22, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-body { position: relative; animation: popIn .32s cubic-bezier(.2,1.5,.4,1); max-width: 100%; }
.confirm-panel, .pause-panel, .daily-panel, .intro-panel, .blitz-panel { text-align: center; width: min(560px, 92vw); }
.confirm-panel h2, .pause-panel h2, .daily-panel h2, .blitz-panel h2 { font-family: var(--display); font-weight: 400; font-size: 34px; margin: 4px 0 10px; text-shadow: 0 3px 0 rgba(0,0,0,.4); }
.confirm-panel p { font-weight: 800; font-size: 18px; }
.pause-panel .btn-big { width: 100%; margin: 6px 0; }
.pause-goals { font-weight: 800; font-size: 15px; opacity: .9; margin-bottom: 12px; }
.controls-help { margin-top: 16px; font-size: 13.5px; font-weight: 800; opacity: .75; }
.modal-settings .modal-body { width: min(760px, 94vw); }

.daily-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin: 14px 0; }
.dd { position: relative; padding: 8px 2px; border-radius: 12px; background: #252b4a; border: 3px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; }
.dd small { font-weight: 800; opacity: .8; font-size: 11px; }
.dd-ico { font-size: 28px; }
.dd b { font-family: var(--display); font-weight: 400; font-size: 13px; }
.dd.done { opacity: .45; }
.dd.done i { position: absolute; top: 2px; right: 6px; color: var(--green-l); font-style: normal; font-weight: 900; }
.dd.today { background: linear-gradient(180deg, var(--yellow-l), var(--yellow-d)); color: #2a1800; animation: glowPulse 1.4s ease-in-out infinite; transform: scale(1.08); }
.dd.mega { background: linear-gradient(180deg, #a463ff, #4a1a8a); }
.dd.mega.today { background: linear-gradient(180deg, #ffe27a, #a463ff); }
.daily-streak { font-family: var(--display); font-size: 20px; margin-bottom: 12px; color: var(--orange-l); }
.claim-btn { animation: pulse 1.2s ease-in-out infinite; }

.intro-panel { padding: 30px 26px 24px; }
.intro-ico { font-size: 84px; animation: bob 2s ease-in-out infinite; }
.intro-panel p { font-size: 22px; font-weight: 800; line-height: 1.35; margin: 12px 0 20px; }
.intro-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.intro-dots i { width: 12px; height: 12px; border-radius: 4px; background: #fff3; }
.intro-dots i.on { background: var(--gold); }

.modal-levelup .modal-back { background: rgba(10, 6, 30, .7); }
.levelup { position: relative; text-align: center; padding: 30px 40px; }
.lu-rays { position: absolute; left: 50%; top: 50%; width: 900px; height: 900px; margin: -450px 0 0 -450px; background: repeating-conic-gradient(rgba(255,210,63,.18) 0 10deg, transparent 10deg 20deg); border-radius: 50%; animation: spin 14s linear infinite; mask: radial-gradient(circle, #000 20%, transparent 65%); -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%); pointer-events: none; }
.lu-text { position: relative; font-family: var(--display); font-size: clamp(48px, 9vw, 86px); color: var(--gold); -webkit-text-stroke: 4px #6a3f00; paint-order: stroke fill; text-shadow: 0 7px 0 #b8700a, 0 0 40px rgba(255,210,63,.6); animation: popIn .5s cubic-bezier(.2,1.6,.4,1); }
.lu-num { position: relative; font-family: var(--display); font-size: clamp(90px, 16vw, 150px); line-height: 1; color: #fff; text-shadow: 0 8px 0 rgba(0,0,0,.4); animation: popIn .6s .15s cubic-bezier(.2,1.6,.4,1) both; }
.lu-rank { position: relative; font-family: var(--display); font-size: 28px; margin: 8px 0; text-shadow: 0 3px 0 rgba(0,0,0,.5); }
.lu-rank.sub { font-size: 18px; opacity: .85; }
.lu-reward { position: relative; font-family: var(--display); font-size: 30px; margin-bottom: 18px; display: flex; gap: 8px; justify-content: center; align-items: center; }
.lu-reward .ico { width: 34px; height: 34px; }

.blitz-modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0; }
.blitz-mode { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 16px; border: 3px solid var(--line); background: linear-gradient(180deg, #8a5aff, #4a22a8); font-family: var(--display); font-size: 21px; cursor: pointer; box-shadow: inset 0 3px 0 rgba(255,255,255,.25), 0 5px 0 rgba(0,0,0,.35); transition: transform .1s; }
.blitz-mode:hover { transform: translateY(-3px) scale(1.02); }
.bm-ico { font-size: 34px; }
.blitz-best { font-weight: 800; font-size: 16px; opacity: .9; }

/* results */
.res-wrap { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; }
.res-panel { width: min(720px, 94vw); text-align: center; max-height: calc(100vh - 28px); overflow-y: auto; }
.res-banner { font-family: var(--display); font-size: clamp(36px, 6vw, 58px); color: var(--gold); -webkit-text-stroke: 3px #6a3f00; paint-order: stroke fill; text-shadow: 0 5px 0 #b8700a; animation: popIn .5s cubic-bezier(.2,1.6,.4,1); line-height: 1.05; }
.res-sub { font-family: var(--display); font-size: 22px; margin: 4px 0 10px; }
.res-stars { display: flex; justify-content: center; gap: 18px; margin: 6px 0 12px; }
.rs { width: 150px; }
.rs-star { font-size: 76px; color: #1a1f36; opacity: 0; transform: scale(.2); transition: transform .45s cubic-bezier(.2,1.8,.4,1), opacity .2s; height: 82px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.4)); }
.rs-star .ico { width: 76px; height: 76px; }
.rs-star.show { opacity: 1; transform: scale(1); }
.rs-star.earn.show { color: var(--gold); filter: drop-shadow(0 4px 0 #b8700a) drop-shadow(0 0 18px rgba(255,210,63,.75)); animation: starSpin .6s; }
.rs small { font-weight: 800; font-size: 13px; opacity: .9; }
.res-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.res-stats div { background: #252b4a; border: 3px solid var(--line); border-radius: 12px; padding: 7px 6px; display: flex; flex-direction: column; gap: 2px; }
.res-stats span { font-size: 13px; font-weight: 800; opacity: .85; display: flex; justify-content: center; gap: 4px; align-items: center; }
.res-stats b { font-family: var(--display); font-weight: 400; font-size: 24px; }
.res-stats small { font-size: 13px; opacity: .8; }
.nb { color: var(--green-l); }
.res-xp { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0; }
.xpgain { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--green-l); }
.res-unlocks .unlock { font-weight: 800; font-size: 17px; margin: 6px auto; padding: 8px 14px; border-radius: 12px; background: linear-gradient(90deg, rgba(164,99,255,.35), rgba(61,155,255,.35)); border: 2px solid rgba(255,255,255,.25); width: fit-content; animation: popIn .5s .8s both; }
.res-btns { display: flex; gap: 12px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.blitz-score { font-family: var(--display); font-size: 84px; line-height: 1; color: #fff; text-shadow: 0 6px 0 rgba(0,0,0,.4); margin: 6px 0 10px; }

/* ---------------- HUD ---------------- */
#hud { position: absolute; inset: 0; display: none; }
#hud.show { display: block; }
.hud-tl { position: absolute; top: calc(12px + var(--safe-t)); left: calc(14px + var(--safe-l)); }
.hud-hearts { display: flex; gap: 4px; }
.hud-hearts .heart-ico { width: 38px; height: 38px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.45)); }
.hud-hearts.shake { animation: shake .4s; }
.hud-powers { display: flex; gap: 6px; margin-top: 8px; }
.power { display: flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 10px; background: rgba(12,16,30,.8); border: 2px solid var(--line); font-family: var(--display); font-size: 17px; animation: popIn .3s; }
.hud-tc { position: absolute; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); text-align: center; }
.hud-level { font-family: var(--display); font-size: 20px; text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 12px rgba(0,0,0,.5); display: flex; gap: 8px; justify-content: center; align-items: center; white-space: nowrap; }
.hud-wl { font-size: 14px; padding: 2px 8px; border-radius: 8px; background: rgba(0,0,0,.45); }
.hud-progress { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.hp-track { position: relative; width: min(300px, 34vw); height: 14px; border-radius: 8px; background: rgba(12,16,30,.75); border: 3px solid var(--line); }
.hp-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #5ad13a, #ffd23f); width: 0; }
.hp-sai { position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); transition: left .3s; }
.hp-face { width: 28px; height: 28px; border-radius: 7px; border: 3px solid var(--line); image-rendering: pixelated; display: block; }
.hp-end { font-size: 22px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.5)); }
.hud-time { font-family: var(--display); font-size: 16px; margin-top: 4px; text-shadow: 0 2px 2px rgba(0,0,0,.7); opacity: .9; }
.hud-tr { position: absolute; top: calc(12px + var(--safe-t)); right: calc(14px + var(--safe-r)); display: flex; gap: 8px; align-items: center; }
.hud-stars { display: flex; gap: 2px; font-size: 30px; color: rgba(12,16,30,.75); filter: drop-shadow(0 2px 0 rgba(0,0,0,.45)); }
.hud-stars .hs1 { display: none; }
.hud-stars .on { color: var(--gold); filter: drop-shadow(0 0 6px rgba(255,210,63,.9)); }
.hud-stars .pop { animation: starSpin .7s; }
.hud-btn { width: 50px; height: 50px; border-radius: 14px; border: 3px solid var(--line); background: rgba(12,16,30,.8); font-size: 24px; cursor: pointer; display: grid; place-items: center; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.hud-btn .ico { width: 24px; height: 24px; }
.hud-streak { position: absolute; left: calc(14px + var(--safe-l)); top: calc(110px + var(--safe-t)); display: flex; align-items: center; gap: 6px; padding: 6px 14px 6px 10px; border-radius: 14px; background: linear-gradient(90deg, rgba(255,90,40,.85), rgba(255,180,40,.85)); border: 3px solid var(--line); font-family: var(--display); font-size: 24px; opacity: 0; transform: scale(.6); transition: transform .25s cubic-bezier(.2,1.6,.4,1), opacity .2s; }
.hud-streak.show { opacity: 1; transform: scale(1); }
.hud-streak small { font-size: 13px; opacity: .9; }
.hud-streak.hot { animation: firePulse .6s ease-in-out infinite alternate; }
.coin-fly { position: fixed; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; z-index: 40; pointer-events: none; transition: transform .5s cubic-bezier(.5,-0.3,.6,1), opacity .5s; }
.coin-fly .ico { width: 26px; height: 26px; }

/* title card + GO */
#title-card { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -20px); text-align: center; opacity: 0; transition: opacity .4s, transform .4s; pointer-events: none; width: 92vw; }
#title-card.show { opacity: 1; transform: translate(-50%, 0); }
.tc-world { font-family: var(--display); font-size: 22px; letter-spacing: 3px; color: var(--gold); text-shadow: 0 3px 0 rgba(0,0,0,.6); }
.tc-name { font-family: var(--display); font-size: clamp(44px, 8vw, 86px); line-height: 1.05; -webkit-text-stroke: 3px rgba(0,0,0,.55); paint-order: stroke fill; text-shadow: 0 6px 0 rgba(0,0,0,.45), 0 0 40px rgba(0,0,0,.4); }
.tc-goals { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.tc-goals span { font-weight: 900; font-size: 16px; padding: 6px 12px; border-radius: 10px; background: rgba(10,14,28,.72); border: 2px solid rgba(255,255,255,.2); }
.tc-skip { margin-top: 14px; font-weight: 800; opacity: .75; text-shadow: 0 2px 3px #000; font-size: 14px; }
#go-splash { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(0); font-family: var(--display); font-size: clamp(90px, 18vw, 180px); color: var(--gold); -webkit-text-stroke: 5px #6a3f00; paint-order: stroke fill; text-shadow: 0 10px 0 #b8700a; opacity: 0; pointer-events: none; }
#go-splash.show { animation: goSplash 1.1s ease-out forwards; }

/* toasts */
#toasts { position: absolute; left: 50%; top: calc(96px + var(--safe-t)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 35; width: 92vw; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 14px; border: 3px solid var(--line); background: rgba(20,24,42,.94); font-weight: 900; font-size: 16px; box-shadow: 0 6px 0 rgba(0,0,0,.3); transform: translateY(-16px) scale(.9); opacity: 0; transition: transform .3s cubic-bezier(.2,1.5,.4,1), opacity .3s; max-width: 640px; text-align: center; display: flex; align-items: center; gap: 10px; }
.toast.show { transform: none; opacity: 1; }
.toast .ico { width: 18px; height: 18px; }
.t-purple { background: linear-gradient(90deg, #7a3ae0, #4a1aa0); }
.t-blue { background: linear-gradient(90deg, #2a7ae0, #1a4aa0); }
.t-green { background: linear-gradient(90deg, #3aa82a, #1f6a12); }
.t-badge { background: linear-gradient(90deg, #ffcf3a, #ff8a2a); color: #2a1400; text-align: left; }
.t-badge .bt-ico { font-size: 40px; }
.t-badge small { display: block; font-size: 12px; letter-spacing: 1px; }
.t-badge b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; }
.t-badge span { display: flex; align-items: center; gap: 4px; font-size: 14px; }

#flash { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0; }
#flash.go { animation: flash .45s ease-out; }
#fade { position: fixed; inset: 0; z-index: 60; background: #0b0f1c; opacity: 0; pointer-events: none; transition: opacity .28s; }
#fade.on { opacity: 1; }

/* boss HUD: slim health bar on top, question banner at the bottom so the boss stays visible */
#boss-hud { position: absolute; inset: 0; display: none; pointer-events: none; }
#boss-hud.show { display: block; }
.bh-head { position: absolute; left: 0; right: 0; text-align: center; top: calc(64px + var(--safe-t)); font-family: var(--display); font-size: 20px; text-shadow: 0 3px 0 rgba(0,0,0,.6); letter-spacing: 1px; white-space: nowrap; }
.bh-bar { position: absolute; left: 0; right: 0; margin: 0 auto; top: calc(92px + var(--safe-t)); width: min(460px, 70vw); height: 20px; border-radius: 12px; border: 4px solid var(--line); background: #2a0a12; overflow: hidden; box-shadow: 0 5px 0 rgba(0,0,0,.35); }
.bh-fill { height: 100%; background: linear-gradient(180deg, #ff7a7a, #e0203a 60%, #a0101f); transition: width .5s cubic-bezier(.2,1,.3,1); box-shadow: inset 0 3px 0 rgba(255,255,255,.35); }
.bh-segs i { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--line); }
.bh-bar.hit { animation: shake .4s; }
.bh-q { position: absolute; left: 0; right: 0; margin: 0 auto; bottom: calc(18px + var(--safe-b)); width: min(520px, 56vw); padding: 10px 16px; border-radius: 18px; border: 4px solid var(--line); background: linear-gradient(180deg, rgba(60,30,120,.95), rgba(30,15,70,.95)); box-shadow: 0 8px 0 rgba(0,0,0,.3); display: none; text-align: center; }
.bh-q.show { display: block; animation: popIn .35s cubic-bezier(.2,1.5,.4,1); }
.bh-qtext { font-family: var(--display); font-size: clamp(30px, 5vw, 48px); line-height: 1.05; }
.bh-qsub { font-weight: 800; font-size: 14px; opacity: .9; margin-top: 4px; }
.bh-timer { height: 8px; border-radius: 4px; background: rgba(0,0,0,.4); margin-top: 8px; overflow: hidden; }
.bh-timer div { height: 100%; background: var(--gold); transition: width .2s linear; }
.bh-msg { position: absolute; left: 0; right: 0; margin: 0 auto; width: fit-content; top: calc(124px + var(--safe-t)); transform: translateY(-6px); font-weight: 900; font-size: 17px; padding: 7px 14px; border-radius: 12px; background: rgba(10,14,28,.82); border: 2px solid rgba(255,255,255,.2); opacity: 0; transition: opacity .25s, transform .25s; max-width: 90vw; text-align: center; }
.bh-msg.show { opacity: 1; transform: none; }
body.touch-mode .bh-q { width: min(480px, 50vw); }

/* blitz HUD */
#blitz-hud { position: absolute; inset: 0; display: none; }
#blitz-hud.show { display: block; }
.bz-top { position: absolute; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; width: min(900px, 96vw); justify-content: space-between; }
.bz-box { min-width: 110px; padding: 6px 14px; border-radius: 16px; border: 4px solid var(--line); background: rgba(12,16,30,.85); text-align: center; box-shadow: 0 5px 0 rgba(0,0,0,.35); }
.bz-box small { font-weight: 900; font-size: 12px; opacity: .8; letter-spacing: 1px; }
.bz-time, .bz-score { font-family: var(--display); font-size: 38px; line-height: 1; }
.bz-timebox.low { background: rgba(160,20,40,.9); animation: pulse .5s ease-in-out infinite; }
.bz-q { flex: 1; font-family: var(--display); font-size: clamp(36px, 6.5vw, 64px); text-align: center; text-shadow: 0 5px 0 rgba(0,0,0,.5), 0 0 30px rgba(0,0,0,.5); -webkit-text-stroke: 2px rgba(0,0,0,.5); paint-order: stroke fill; line-height: 1.05; }
.bz-q.pop { animation: popIn .3s cubic-bezier(.2,1.6,.4,1); }
.bz-combo { position: absolute; top: calc(104px + var(--safe-t)); left: 50%; transform: translateX(-50%); font-family: var(--display); font-size: 30px; color: var(--orange-l); text-shadow: 0 3px 0 rgba(0,0,0,.6); }
.bz-hint { position: absolute; bottom: calc(160px + var(--safe-b)); left: 50%; transform: translateX(-50%); padding: 10px 16px; border-radius: 14px; background: rgba(10,14,28,.88); border: 3px solid var(--line); font-weight: 800; font-size: 17px; opacity: 0; transition: opacity .25s; max-width: 90vw; text-align: center; }
.bz-hint.show { opacity: 1; }
.bz-count { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(0); font-family: var(--display); font-size: clamp(80px, 16vw, 160px); color: #fff; -webkit-text-stroke: 5px rgba(0,0,0,.6); paint-order: stroke fill; opacity: 0; white-space: nowrap; }
.bz-count.go { animation: goSplash .9s ease-out forwards; }
.bz-help { position: absolute; bottom: calc(14px + var(--safe-b)); left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 14px; opacity: .8; text-shadow: 0 2px 3px #000; white-space: nowrap; }

/* ---------------- quiz ---------------- */
#quiz { position: absolute; inset: 0; display: none; place-items: center; z-index: 25; padding: 12px; background: radial-gradient(ellipse at center, rgba(10,8,30,.35), rgba(10,8,30,.7)); }
#quiz.show { display: grid; pointer-events: auto; }
.quiz-panel { width: min(760px, 96vw); max-height: calc(100vh - 24px); overflow-y: auto; padding: 14px 18px 12px; }
.quiz-panel.pop { animation: popIn .35s cubic-bezier(.2,1.5,.4,1); }
.quiz-head { display: flex; align-items: center; gap: 12px; }
.quiz-avatar { width: 54px; height: 54px; border-radius: 12px; border: 3px solid var(--line); image-rendering: pixelated; background: #6b3fa0; flex: none; }
.quiz-title { font-family: var(--display); font-size: 26px; line-height: 1.05; }
.quiz-sub { font-weight: 800; font-size: 14.5px; opacity: .85; }
.quiz-head-text { flex: 1; }
.quiz-pips { display: flex; gap: 6px; }
.pip { width: 22px; height: 22px; border-radius: 6px; border: 3px solid var(--line); background: #1a1f36; }
.pip.on { background: var(--green); box-shadow: 0 0 10px rgba(90,209,58,.8); }
.quiz-body { margin-top: 10px; text-align: center; }
.quiz-prompt { font-weight: 900; font-size: 15px; color: var(--purple-l); text-transform: uppercase; letter-spacing: 1px; min-height: 1.2em; }
.quiz-qrow { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 8px; }
.quiz-q { font-family: var(--display); font-size: clamp(40px, 7vw, 64px); line-height: 1.1; text-shadow: 0 4px 0 rgba(0,0,0,.4); }
.quiz-q.word { font-family: var(--body); font-weight: 900; font-size: clamp(19px, 2.6vw, 25px); line-height: 1.35; text-shadow: none; text-align: left; max-width: 640px; }
.quiz-q.spell { font-size: clamp(30px, 4.6vw, 44px); }
.quiz-speak { width: 50px; height: 50px; border-radius: 14px; border: 3px solid var(--line); background: var(--blue); font-size: 22px; cursor: pointer; flex: none; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.quiz-visual { width: min(330px, 70vw); height: auto; display: block; margin: 0 auto 8px; }
.quiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 76px; padding: 10px 14px; border-radius: 16px; border: 4px solid var(--line); font-family: var(--display); font-size: clamp(26px, 4vw, 38px); color: #fff; cursor: pointer; box-shadow: inset 0 4px 0 rgba(255,255,255,.3), inset 0 -5px 0 rgba(0,0,0,.2), 0 6px 0 var(--line); text-shadow: 0 3px 0 rgba(0,0,0,.35); transition: transform .08s, opacity .2s, filter .2s; }
.choice:hover { transform: translateY(-2px); filter: brightness(1.08); }
.choice:active { transform: translateY(4px); box-shadow: inset 0 4px 0 rgba(255,255,255,.3), 0 2px 0 var(--line); }
.choice.spellc { font-family: var(--body); font-weight: 900; font-size: clamp(22px, 3.2vw, 30px); text-shadow: none; letter-spacing: .5px; }
.c-red { background: linear-gradient(180deg, #ff7a8a, #e8344a); }
.c-blue { background: linear-gradient(180deg, #6ab0ff, #2a6fe0); }
.c-yellow { background: linear-gradient(180deg, #ffd85a, #e8a800); color: #2a1800; text-shadow: none; }
.c-green { background: linear-gradient(180deg, #6ae05a, #2a9a2a); }
.cshape { position: absolute; left: 14px; font-size: 18px; opacity: .55; }
.ckey { position: absolute; right: 10px; top: 6px; font-family: var(--body); font-size: 12px; font-weight: 900; opacity: .55; }
body.touch-mode .ckey { display: none; }
.choice.right { background: linear-gradient(180deg, #8bff7a, #2fc83a) !important; color: #fff; animation: rightPop .45s; box-shadow: 0 0 0 4px #fff, 0 0 26px rgba(120,255,100,.9); z-index: 1; }
.choice.wrong { background: linear-gradient(180deg, #ff6a6a, #a01020) !important; animation: shake .4s; }
.choice.dim { opacity: .35; }
.quiz-feedback { margin-top: 10px; min-height: 0; }
.quiz-feedback.show { animation: popIn .3s cubic-bezier(.2,1.5,.4,1); }
.quiz-feedback.good .fb-big { font-family: var(--display); font-size: 34px; color: var(--green-l); text-shadow: 0 3px 0 rgba(0,0,0,.4); }
.quiz-feedback.bad .fb-big { font-family: var(--display); font-size: 28px; color: var(--orange-l); }
.fb-xp { font-weight: 900; font-size: 17px; color: var(--gold); }
.fb-explain { font-weight: 800; font-size: 18px; line-height: 1.4; margin: 6px auto 10px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.08); max-width: 620px; }
.fb-explain .big { font-size: 1.4em; color: var(--gold); letter-spacing: 1px; }
.fb-explain .tip { display: inline-block; margin-top: 6px; color: #bfe0ff; font-size: .92em; }
.quiz-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; min-height: 36px; }
.quiz-streak { font-family: var(--display); font-size: 20px; color: var(--orange-l); }
.quiz-streak.hot { animation: firePulse .6s ease-in-out infinite alternate; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1; margin: 0 .1em; font-size: .85em; }
.frac span:first-child { border-bottom: .09em solid currentColor; padding: 0 .12em .04em; }
.frac span:last-child { padding-top: .04em; }
.qbox { display: inline-grid; place-items: center; min-width: 1.2em; height: 1.2em; border: .08em dashed var(--gold); border-radius: .2em; color: var(--gold); padding: 0 .1em; }
.hl { color: var(--gold); text-decoration: underline; }

/* ---------------- world-space overlays ---------------- */
.float-text { position: absolute; left: 0; top: 0; font-family: var(--display); font-size: 22px; color: #fff; -webkit-text-stroke: 1.5px rgba(0,0,0,.7); paint-order: stroke fill; text-shadow: 0 3px 0 rgba(0,0,0,.45); white-space: nowrap; will-change: transform; }
.ft-big { font-size: 30px; }
.ft-huge { font-size: 44px; }
.ft-gold { color: var(--gold); }
.ft-green { color: var(--green-l); }
.ft-cyan { color: #7ff8ff; }
.ft-red { color: var(--red-l); }
.ft-purple { color: var(--purple-l); }
.bubble, .prompt { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .2s; will-change: transform; pointer-events: none; padding-bottom: 14px; }
.bubble.show, .prompt.show { opacity: 1; }
.bubble .anchor-box { position: relative; max-width: 250px; width: max-content; padding: 10px 14px; border-radius: 16px; border: 3px solid var(--line); background: #fff; color: #1a2030; font-weight: 800; font-size: 15.5px; line-height: 1.3; box-shadow: 0 5px 0 rgba(0,0,0,.25); }
.bubble .anchor-box::after { content: ''; position: absolute; left: 50%; bottom: -13px; margin-left: -10px; border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
.prompt .anchor-box { padding: 9px 16px; border-radius: 14px; border: 3px solid var(--line); background: linear-gradient(180deg, #a463ff, #6630c0); font-family: var(--display); font-size: 20px; white-space: nowrap; box-shadow: 0 5px 0 rgba(0,0,0,.3), 0 0 22px rgba(164,99,255,.7); animation: bob 1.2s ease-in-out infinite; text-align: center; }
.pkey { display: block; font-family: var(--body); font-weight: 900; font-size: 13px; opacity: .9; text-align: center; }

/* ---------------- touch controls ---------------- */
#touch { position: absolute; inset: 0; display: none; }
#touch.active { display: block; }
body:not(.touch-mode) #touch { display: none !important; }
.joy-base { position: absolute; width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%; background: rgba(255,255,255,.12); border: 3px solid rgba(255,255,255,.35); opacity: 0; transition: opacity .15s; pointer-events: none; left: 120px; top: calc(100% - 140px); }
.joy-base.active { opacity: 1; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.75); border: 3px solid rgba(0,0,0,.4); transform: translate(-50%, -50%); }
.tbtn { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; border: 4px solid rgba(11,15,28,.85); color: #fff; pointer-events: auto; touch-action: none; box-shadow: inset 0 4px 0 rgba(255,255,255,.35), 0 6px 0 rgba(0,0,0,.35); }
.tbtn .ticon { font-size: 30px; line-height: 1; }
.tbtn .tlabel { font-family: var(--display); font-size: 13px; margin-top: 2px; }
.tbtn.down { transform: translateY(4px) scale(.96); box-shadow: inset 0 3px 0 rgba(255,255,255,.3), 0 2px 0 rgba(0,0,0,.35); }
.tbtn-jump { width: 104px; height: 104px; right: calc(26px + var(--safe-r)); bottom: calc(30px + var(--safe-b)); background: radial-gradient(circle at 50% 35%, #8ff06b, #34931c); }
.tbtn-action { width: 86px; height: 86px; right: calc(146px + var(--safe-r)); bottom: calc(40px + var(--safe-b)); background: radial-gradient(circle at 50% 35%, #ffb46e, #d0600c); }
.tbtn-action.glow { background: radial-gradient(circle at 50% 35%, #d0a8ff, #6630c0); animation: glowPulse 1s ease-in-out infinite; width: 96px; height: 96px; }
body.touch-mode .bz-help { display: none; }

/* ---------------- animations ---------------- */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-10deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
@keyframes popIn { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.shake { animation: shake .4s; }
@keyframes glowPulse { 0%, 100% { box-shadow: inset 0 3px 0 rgba(255,255,255,.3), 0 6px 0 rgba(0,0,0,.35), 0 0 0 rgba(255,210,63,0); } 50% { box-shadow: inset 0 3px 0 rgba(255,255,255,.3), 0 6px 0 rgba(0,0,0,.35), 0 0 26px rgba(255,210,63,.85); } }
@keyframes firePulse { from { transform: scale(1); filter: brightness(1); } to { transform: scale(1.08); filter: brightness(1.25); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes starSpin { 0% { transform: scale(.3) rotate(-120deg); } 70% { transform: scale(1.25) rotate(10deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes rightPop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes goSplash { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 45% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------- responsive ---------------- */
@media (max-height: 560px) {
  .btn { font-size: 17px; padding: 8px 14px 10px; }
  .btn-huge { font-size: 30px; padding: 10px 44px 13px; }
  .btn-big { font-size: 21px; padding: 10px 22px 12px; }
  .pill { font-size: 18px; padding: 4px 12px 4px 6px; }
  .pill .ico { width: 22px; height: 22px; }
  .player-card { padding: 5px 12px 5px 5px; }
  .pc-face-wrap .face { width: 40px; height: 40px; }
  .pc-name { font-size: 19px; }
  .xpbar { width: 160px; height: 16px; }
  .menu-bottom { gap: 8px; bottom: 10px; }
  .lvl-node { padding: 6px; }
  .ln-num { font-size: 26px; }
  .w-blurb { display: none; }
  .quiz-panel { padding: 10px 14px; }
  .quiz-q { font-size: 40px; }
  .choice { min-height: 56px; font-size: 26px; }
  .quiz-visual { width: min(240px, 50vw); }
  .hud-hearts .heart-ico { width: 30px; height: 30px; }
  .hud-btn { width: 42px; height: 42px; }
  .tbtn-jump { width: 88px; height: 88px; }
  .tbtn-action { width: 74px; height: 74px; right: calc(124px + var(--safe-r)); }
  .scr-locker .locker-panel { top: 70px; }
  .big-panel { top: 70px; }
  .res-panel { padding: 10px 14px; }
  .rs-star, .rs-star .ico { font-size: 56px; width: 56px; height: 56px; }
  .rs-star { height: 60px; }
  .res-banner { font-size: 34px; }
  .bh-qtext { font-size: 30px; }
}
@media (max-width: 760px) {
  .menu-row .btn { font-size: 15px; padding: 8px 11px 10px; }
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
  .stats-cols { grid-template-columns: 1fr; }
  .scr-locker .locker-panel { width: auto; right: 16px; top: auto; height: 58vh; }
  .locker-hint { display: none; }
  .hud-name { display: none; }
  .lvl-node { width: 120px; }
  .ln-name { font-size: 12px; }
  .ln-link { flex-basis: 10px; }
  .daily-days { grid-template-columns: repeat(4, 1fr); }
  .xpbar { width: 130px; }
  .pc-name .rank { display: none; }
  .res-stars { gap: 8px; }
  .rs { width: 104px; }
}
@media (orientation: portrait) and (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  .w-levels { flex-wrap: wrap; gap: 8px; }
  .ln-link { display: none; }
  .lvl-node { width: 44%; max-width: none; }
  .quiz-choices { grid-template-columns: 1fr 1fr; }
  .hud-progress { display: none; }
}

/* Discovery Island: readable, roomy controls over the living voxel world. */
.explore-menu-card { display:flex; align-items:center; gap:16px; margin:18px auto 16px; width:min(560px,90vw); padding:15px 22px; border:2px solid #b8f3a4; border-radius:18px; color:#f5fff0; background:linear-gradient(120deg,#194e38e8,#173f49e8); box-shadow:0 6px 0 #0e242a,0 12px 30px #0004; cursor:pointer; text-align:left; }
.explore-menu-card:hover { background:linear-gradient(120deg,#25694c,#205464); }
.em-icon { font-size:40px; } .explore-menu-card small { letter-spacing:2px; color:#c0fda6; font-size:10px; font-weight:900; }
.explore-menu-card strong { display:block; font-family:var(--display); font-size:28px; }
.explore-menu-card em { font-size:13px; font-style:normal; } .explore-menu-card b { margin-left:auto; font-size:26px; }
.camera-controls { display:none; position:absolute; right:max(16px,env(safe-area-inset-right)); top:44%; pointer-events:auto; flex-direction:column; gap:6px; }
.playing:not(.quiz-open):not(.game-paused) .camera-controls { display:flex; }
.camera-controls button { width:44px; height:44px; color:white; background:#172839d9; border:2px solid #d5e7f588; border-radius:12px; font-size:24px; cursor:pointer; touch-action:none; }
.camera-controls button:hover { background:#346379; }
#explore-hud { position:absolute; inset:0; color:#fff; pointer-events:none; }
.explore-top { position:absolute; top:max(16px,env(safe-area-inset-top)); left:20px; right:20px; display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.island-card { border:1px solid #b9ffc47a; border-radius:16px; background:#102b32da; padding:13px 18px; box-shadow:0 6px 22px #0003; }
.island-card small { display:block; color:#b8f3a4; letter-spacing:2px; font-size:10px; font-weight:900; }
.island-card strong { display:block; font-family:var(--display); font-size:24px; margin:3px 0 6px; }
.island-card span { font-size:14px; font-weight:800; }
.explore-tools { display:flex; gap:8px; pointer-events:auto; }
.explore-objective { position:absolute; top:125px; left:20px; max-width:420px; padding:9px 14px; font-size:13px; font-weight:800; border-radius:12px; background:#14243bcc; }
.explore-prompt { position:absolute; left:0; right:0; bottom:210px; text-align:center; }
.explore-prompt>* { pointer-events:auto; } .explore-prompt>span { display:inline-block; background:#14243be0; border-radius:12px; padding:12px; }
.build-dock { position:absolute; bottom:max(22px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:max-content; max-width:94vw; background:#122332eb; border:1px solid #a2d7ad88; border-radius:18px; padding:13px; box-shadow:0 9px 25px #0005; pointer-events:auto; }
.build-actions { display:flex; align-items:center; justify-content:center; gap:10px; } .build-actions>span { font-size:12px; max-width:190px; }
.block-hotbar { display:flex; justify-content:center; gap:6px; margin-top:12px; }
.block-slot { display:flex; flex-direction:column; align-items:center; position:relative; gap:4px; width:64px; min-height:67px; border:2px solid #ffffff38; border-radius:10px; background:#213348; color:white; cursor:pointer; font:800 12px var(--body); }
.block-slot.selected { border-color:#b8f3a4; background:#35594f; box-shadow:0 0 0 2px #b8f3a444; }
.block-swatch { display:block; width:25px; height:25px; margin:7px 0 2px; background:var(--block-colour); border:2px solid #ffffff80; box-shadow:inset -5px -5px 0 #0003; }
.block-slot small { position:absolute; top:2px; right:5px; opacity:.6; font-size:9px; } .build-help { font-size:11px; text-align:center; margin-top:10px; color:#d8e5d5; }
.journal-panel { width:min(800px,94vw); max-height:88vh; overflow:auto; text-align:center; }
.journal-panel>small { color:#b8f3a4; letter-spacing:2px; font-weight:900; } .journal-panel h2 { font-size:29px; }
.journal-panel>p { max-width:580px; margin:12px auto; }
.journal-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:20px 0; text-align:left; }
.journal-entry { padding:14px; border-radius:14px; background:#ffffff0b; border-top:3px solid var(--station-colour); }
.journal-entry>span { font-size:26px; display:block; } .journal-entry strong { display:block; font-family:var(--display); font-size:19px; margin:6px 0; }
.journal-entry small { color:var(--station-colour); font-weight:800; } .journal-entry p { font-size:12px; line-height:1.5; }
.journal-goal { margin-bottom:18px; background:#453354; padding:14px; border-radius:12px; font-size:14px; line-height:1.7; }
.quiz-hint { margin-top:12px; } .quiz-hint-text { font-size:15px; color:#ffe6a8; padding:8px 0; line-height:1.4; } .quiz-hint-text:empty { display:none; }
.quiz-next { margin-top:12px; } .quiz-feedback .fb-explain { max-height:140px; overflow:auto; }
.game-paused #explore-hud, .quiz-open #explore-hud { visibility:hidden; }
.touch-mode .build-dock { bottom:max(20px,env(safe-area-inset-bottom)); max-width:calc(100vw - 280px); }
.touch-mode .block-slot { width:48px; } .touch-mode .build-actions>span { display:none; }
@media(max-width:700px) {
  .explore-top { left:10px; right:10px; } .island-card { padding:10px 12px; } .island-card strong { font-size:19px; }
  .explore-tools { gap:5px; } .explore-tools .btn { padding:8px; font-size:13px; }
  .explore-objective { top:110px; left:10px; font-size:11px; max-width:calc(100vw - 70px); }
  .build-actions { flex-wrap:wrap; gap:6px; } .build-actions .btn { font-size:13px; padding:7px 9px; }
  .block-hotbar { flex-wrap:wrap; } .block-slot { width:44px; } .build-help { max-width:270px; }
  .touch-mode .build-dock { max-width:calc(100vw - 170px); bottom:18px; padding:8px; }
  .touch-mode .block-slot { width:38px; min-height:55px; font-size:10px; } .block-swatch { width:20px; height:20px; }
  .journal-grid { grid-template-columns:repeat(2,1fr); } .journal-panel h2 { font-size:23px; }
  .explore-menu-card { margin:12px auto; padding:10px 15px; } .explore-menu-card strong { font-size:23px; }
  .camera-controls { right:10px; } .explore-prompt { bottom:235px; }
}
@media(max-height:600px) {
  .scr-main .menu-bottom { bottom:12px; } .explore-menu-card { margin:8px auto; padding:8px 15px; }
  .explore-menu-card strong { font-size:22px; } .explore-menu-card em { font-size:11px; }
  .scr-main .btn-huge { font-size:26px; padding:8px 36px; } .scr-main .tagline { font-size:16px; margin-bottom:8px; }
  .explore-objective { top:100px; } .island-card strong { font-size:18px; }
  .quiz-panel { max-height:94vh; overflow:auto; }
}
.island-map { position:absolute; top:76px; right:20px; width:132px; padding:10px; background:#122a33de; border:1px solid #b8f3a477; border-radius:16px; color:white; cursor:pointer; pointer-events:auto; }
.island-map small { font-size:9px; letter-spacing:1.5px; font-weight:900; } .island-map svg { width:100%; display:block; }
@media(max-width:700px) { .island-map { width:94px; top:76px; right:10px; padding:6px; } .island-map small { font-size:7px; } }
@media(max-height:600px) { .island-map { width:90px; top:65px; } }
/* Leave the bottom band free for the movement stick and action/jump buttons. */
.touch-mode .build-dock { bottom:150px; max-width:94vw; }
@media(max-width:700px) { .touch-mode .block-slot { width:44px; } .touch-mode .build-help { max-width:330px; } }
@media(max-height:600px) { .touch-mode .build-dock { bottom:150px; padding:8px; } .touch-mode .block-slot { min-height:48px; } .touch-mode .build-help { display:none; } }
.journal-panel, .quiz-panel { touch-action:pan-y; -webkit-overflow-scrolling:touch; }
/* A small, readable next step; the map holds the wider choices. */
.adventure-choice { display:block; margin:12px auto 20px; min-width:300px; }
.adventure-choice small { display:block; font:700 12px var(--body); margin-top:4px; letter-spacing:0; }
.explore-menu-card { border-width:3px; margin-top:12px; padding:18px 22px; }
.explore-objective { max-width:310px; padding:13px 15px; border:1px solid #ffebad77; background:#183132ef; }
.explore-objective strong { display:block; font-size:16px; color:#fff1b5; }
.explore-objective>span { display:block; max-width:275px; font-size:12px; line-height:1.5; margin-top:6px; }
.wayfinder { display:flex; align-items:center; gap:8px; font-size:11px; margin-top:8px; }
.wayfinder i { font:900 24px var(--body); color:#ffe69a; display:inline-block; font-style:normal; }
.guide-skip { pointer-events:auto; color:#ceeadb; border:0; background:none; text-decoration:underline; padding:9px 0 0; font:700 11px var(--body); cursor:pointer; }
.island-map>span { display:block; font-size:9px; padding-top:4px; }
.journal-entry { border-width:0; border-top:3px solid var(--station-colour); color:white; font-family:var(--body); cursor:pointer; text-align:left; }
.journal-entry:hover { background:#ffffff20; }
.journal-entry b { color:#e5ffc0; font-size:12px; }
.biome-collection { display:flex; gap:6px; flex-wrap:wrap; justify-content:center; }
.biome-collection span { padding:7px; border:1px solid #ffffff25; border-radius:8px; opacity:.5; font-size:11px; }
.biome-collection .found { opacity:1; border-color:#b8f3a4; background:#6eae4020; }
.journal-buttons { display:flex; flex-wrap:wrap; justify-content:center; gap:12px; }
.journal-buttons .btn { font-size:15px; }
.help-steps { display:grid; gap:12px; text-align:left; }
.help-steps p { margin:0; padding:15px; border-radius:12px; background:#ffffff0b; line-height:1.6; font-size:15px; }
.help-steps b { display:block; color:#c4ffa5; margin-bottom:5px; font-size:20px; }
.ln-next { color:#1a3921; font:900 12px var(--body); padding-top:7px; }
.lvl-node>small { display:block; font-size:10px; padding-top:7px; }
.quiz-pips { flex-wrap:wrap; } .quiz-pips small { flex-basis:100%; text-align:center; white-space:nowrap; font-size:11px; }
.earned-blocks { font-size:16px; font-weight:900; color:#ffe598; margin:8px 0; }
@media(max-width:700px) {
  .island-card { max-width:210px; } .island-card small { font-size:8px; letter-spacing:1px; }
  .island-card strong { font-size:17px; } .island-card span { font-size:11px; }
  .explore-top { gap:5px; } .explore-tools { flex-wrap:wrap; justify-content:flex-end; max-width:165px; }
  .explore-tools .btn { font-size:12px; padding:7px; }
  .explore-objective { top:120px; max-width:calc(100vw - 132px); padding:9px; }
  .explore-objective strong { font-size:13px; } .explore-objective>span { font-size:11px; }
  .wayfinder { font-size:10px; } .island-map { top:120px; }
  .adventure-choice { min-width:240px; margin:8px auto 14px; }
}
@media(max-height:600px) {
  .explore-objective { top:94px; max-width:230px; padding:8px; }
  .explore-objective>span { font-size:10px; } .explore-objective strong { font-size:12px; }
  .guide-skip { font-size:9px; } .island-map { top:78px; }
  .adventure-choice { margin:8px auto 12px; font-size:18px; padding:6px 20px; }
  .explore-menu-card { padding:8px 15px; }
}
.hud-goal { position:absolute; bottom:24px; left:50%; transform:translateX(-50%); width:max-content; max-width:70vw; padding:10px 16px; border-radius:12px; background:#17293ae6; color:#fff2c2; text-align:center; font-size:13px; font-weight:800; pointer-events:none; }
.touch-mode .hud-goal { bottom:150px; max-width:76vw; }
@media(max-height:600px) { .hud-goal { font-size:11px; padding:7px 10px; } }
#explore-hud.building .explore-objective { display:none; }
.explore-prompt .btn { max-width:92vw; white-space:normal; font-size:clamp(14px,2vw,20px); }
/* Show where movement starts before the first touch. The stick still follows the finger. */
.joy-base { width:112px; height:112px; margin:-56px 0 0 -56px; left:min(95px,20vw); top:calc(100% - 90px - var(--safe-b)); opacity:.55; background:#163a4599; }
.joy-base::after { content:'MOVE'; position:absolute; left:0; right:0; bottom:-20px; text-align:center; color:white; font:900 12px var(--body); text-shadow:0 2px 3px #123; }
.joy-base.active::after { opacity:0; }
.joy-knob { width:46px; height:46px; background:#e8fbf3bb; }
.journal-back { position:sticky; top:0; z-index:2; display:block; margin:0 0 12px auto; }
