/* ============ AI Quest styles ============ */
:root {
  --bg1: #ffd6ec; --bg2: #e9d5ff; --bg3: #c7f0ff;
  --ink: #3b1f4a; --muted: #7a5a8c; --card: rgba(255, 255, 255, 0.78); --card-solid: #fff;
  --line: rgba(124, 58, 237, 0.14); --accent: #ec4899; --accent2: #8b5cf6; --good: #10b981; --bad: #f43f5e; --gold: #f59e0b;
  --shadow: 0 10px 30px rgba(91, 33, 182, 0.14), 0 2px 6px rgba(91, 33, 182, 0.08);
  --r: 22px;
  --font-h: "Fredoka", "Baloo 2", system-ui, sans-serif;
  --font-b: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --dock-h: 78px;
  color-scheme: light;
}
body.theme-sunset { --bg1: #ffd1b3; --bg2: #ffb3c6; --bg3: #ffe5a3; --accent: #f97316; --accent2: #e11d48; }
body.theme-ocean { --bg1: #b9f3ff; --bg2: #c7d2fe; --bg3: #a7f3d0; --accent: #0ea5e9; --accent2: #6366f1; }
body.theme-matcha { --bg1: #dcfce7; --bg2: #fef9c3; --bg3: #e0f2fe; --accent: #16a34a; --accent2: #65a30d; }
body.theme-galaxy {
  --bg1: #1e1b4b; --bg2: #3b0764; --bg3: #0c4a6e; --ink: #f5f3ff; --muted: #c4b5fd;
  --card: rgba(30, 27, 75, 0.72); --card-solid: #241f5c; --line: rgba(196, 181, 253, 0.22); --accent: #f472b6; --accent2: #a78bfa;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-b); color: var(--ink); min-height: 100vh;
  background: linear-gradient(160deg, var(--bg1), var(--bg2) 55%, var(--bg3));
  background-attachment: fixed; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--dock-h) + 24px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-h); margin: 0; line-height: 1.15; }
a { color: inherit; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; background: rgba(139, 92, 246, 0.12); padding: 0.08em 0.35em; border-radius: 6px; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }
.small { font-size: 0.85rem; color: var(--muted); }
small { color: var(--muted); font-weight: 700; }

/* ---------- animated sky ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(40px); opacity: 0.55; animation: drift 18s ease-in-out infinite alternate; }
.b1 { width: 340px; height: 340px; background: var(--accent); top: -80px; left: -90px; }
.b2 { width: 300px; height: 300px; background: var(--accent2); bottom: 10%; right: -100px; animation-delay: -6s; }
.b3 { width: 240px; height: 240px; background: #38bdf8; top: 40%; left: 30%; opacity: 0.3; animation-delay: -12s; }
.spark { position: absolute; color: #fff; font-size: 18px; text-shadow: 0 0 10px #fff; animation: twinkle 3s ease-in-out infinite; }
.s1 { top: 12%; left: 82%; } .s2 { top: 30%; left: 8%; animation-delay: -1s; } .s3 { top: 66%; left: 90%; animation-delay: -2s; }
.s4 { top: 84%; left: 18%; animation-delay: -0.5s; } .s5 { top: 48%; left: 55%; animation-delay: -1.6s; }
@keyframes drift { to { transform: translate(60px, 80px) scale(1.15); } }
@keyframes twinkle { 0%, 100% { opacity: 0.15; transform: scale(0.7); } 50% { opacity: 1; transform: scale(1.2); } }

/* ---------- layout ---------- */
.view { max-width: 760px; margin: 0 auto; padding: 14px 16px 24px; outline: none; }
.card { background: var(--card); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.pop-in { animation: popIn 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.slide-in { animation: slideIn 0.35s ease both; }
@keyframes popIn { from { opacity: 0; transform: scale(0.92) translateY(10px); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } }

/* ---------- HUD ---------- */
.hud {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px max(16px, calc((100vw - 760px) / 2 + 16px)); padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--card-solid) 70%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hud-pet { width: 46px; height: 46px; border: 0; padding: 2px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); cursor: pointer; flex: none; }
.hud-pet .pet-svg { width: 100%; height: 100%; background: var(--card-solid); border-radius: 50%; }
.hud-level { flex: 1; min-width: 0; }
.hud-row { display: flex; align-items: center; gap: 6px; }
.lvl-badge { font-family: var(--font-h); font-weight: 700; font-size: 0.8rem; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); padding: 2px 9px; border-radius: 999px; }
.hud-title { font-family: var(--font-h); font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xpbar { position: relative; height: 14px; margin-top: 4px; border-radius: 999px; background: rgba(139, 92, 246, 0.15); overflow: hidden; }
.xpbar span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #facc15, var(--accent), var(--accent2)); background-size: 200% 100%; animation: shimmer 3s linear infinite; transition: width 0.6s cubic-bezier(0.2, 1.2, 0.4, 1); }
.xpbar em { position: absolute; inset: 0; font-style: normal; font-size: 0.62rem; font-weight: 800; display: grid; place-items: center; color: var(--ink); mix-blend-mode: normal; text-shadow: 0 0 4px var(--card-solid); }
.xpbar.big { height: 22px; margin: 8px 0 4px; } .xpbar.big em { font-size: 0.75rem; white-space: nowrap; overflow: hidden; }
@keyframes shimmer { to { background-position: -200% 0; } }
.hud-chips { display: flex; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; font-weight: 800; font-size: 0.85rem; background: var(--card-solid); border: 1px solid var(--line); white-space: nowrap; }
.chip.dim { opacity: 0.55; }
.chip-gear { cursor: pointer; padding: 5px 8px; }
.chip-gem.bump, .bump { animation: bump 0.45s ease; }
@keyframes bump { 40% { transform: scale(1.3) rotate(-6deg); } }
.chip-soft { background: rgba(255, 255, 255, 0.55); }
body.theme-galaxy .chip-soft { background: rgba(255, 255, 255, 0.08); }
.chip-glass { background: rgba(255, 255, 255, 0.25); border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.chip-timer { cursor: pointer; background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; border-color: #fcd34d; }

/* ---------- dock ---------- */
.dock {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  display: flex; align-items: flex-end; gap: 4px; padding: 8px 10px; width: min(520px, calc(100vw - 24px));
  justify-content: space-between; border-radius: 28px; background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.dock-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; padding: 4px 0; border-radius: 16px; transition: transform 0.15s; }
.dock-btn:active { transform: scale(0.9); }
.dock-ico { font-size: 1.45rem; line-height: 1; transition: transform 0.25s; }
.dock-lbl { font-size: 0.7rem; font-weight: 800; color: var(--muted); }
.dock-btn.active .dock-ico { transform: translateY(-3px) scale(1.15); }
.dock-btn.active .dock-lbl { color: var(--accent); }
.dock-play { flex: 1.2; }
.dock-play .dock-ico {
  width: 58px; height: 58px; margin-top: -30px; display: grid; place-items: center; border-radius: 50%; font-size: 1.5rem; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 50%, transparent);
  border: 4px solid var(--card-solid); animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 8px 30px color-mix(in srgb, var(--accent) 80%, transparent), 0 0 0 8px color-mix(in srgb, var(--accent) 18%, transparent); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--font-h); font-weight: 600; font-size: 1rem; padding: 11px 18px; border-radius: 16px; transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.95) translateY(2px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-main { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 5px 0 color-mix(in srgb, var(--accent2) 70%, #000), 0 10px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-ghost { background: var(--card-solid); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 12px; }
.btn-wide { width: 100%; margin-top: 12px; }
.btn-danger { background: #fee2e2; color: #b91c1c; border: 2px solid #fecaca; }
.btn-next { color: #fff; background: linear-gradient(135deg, var(--accent2), var(--accent)); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent2) 70%, #000); }

/* ---------- hero ---------- */
.hero { text-align: center; position: relative; padding-top: 22px; }
.hero-pet { width: 130px; height: 136px; margin: 0 auto; cursor: pointer; }
.bubble {
  position: relative; display: inline-block; max-width: 520px; margin: 8px auto 10px; padding: 10px 16px; border-radius: 18px;
  background: var(--card-solid); border: 2px solid var(--line); font-weight: 700; box-shadow: 0 4px 0 var(--line);
}
.hero .bubble::before { content: ""; position: absolute; top: -9px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top: 0; border-bottom-color: var(--card-solid); }
.hero-title { font-size: clamp(1.7rem, 6vw, 2.4rem); background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 10px 0 14px; }
.btn-play {
  display: flex; flex-direction: column; width: 100%; max-width: 420px; margin: 0 auto; padding: 16px; font-size: 1.35rem; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 7px 0 color-mix(in srgb, var(--accent2) 65%, #000), 0 16px 30px color-mix(in srgb, var(--accent) 35%, transparent);
  animation: breathe 2.6s ease-in-out infinite;
}
.btn-play small { color: rgba(255, 255, 255, 0.88); font-family: var(--font-b); font-size: 0.85rem; }
@keyframes breathe { 50% { transform: scale(1.03); } }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ---------- worlds & map ---------- */
.world { margin: 26px 0 8px; }
.world-banner {
  display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r); color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.world-banner::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.35), transparent 40%); }
.world-emoji { font-size: 3rem; animation: float 3.5s ease-in-out infinite; flex: none; }
.world-kicker { font-size: 0.75rem; font-weight: 800; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.06em; }
.world-info h2 { font-size: 1.5rem; }
.world-info p { margin: 4px 0 8px; font-size: 0.9rem; opacity: 0.95; }
.world-prog { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.35); overflow: hidden; }
.world-prog span { display: block; height: 100%; background: #fff; border-radius: 999px; }
.world-meta { font-size: 0.78rem; font-weight: 800; margin-top: 6px; }
@keyframes float { 50% { transform: translateY(-8px) rotate(4deg); } }
.path { position: relative; margin: 0 auto; max-width: 560px; }
.path-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.path-bg { fill: none; stroke: rgba(255, 255, 255, 0.7); stroke-width: 18; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.path-dash { fill: none; stroke: var(--c1); stroke-width: 4; stroke-dasharray: 2 12; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0.7; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -14; } }
.node {
  position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; display: grid; place-items: center; text-decoration: none;
  background: var(--card-solid); border: 4px solid #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12), var(--shadow); transition: transform 0.15s; z-index: 1;
}
.node:hover { transform: scale(1.08); }
.node:active { transform: scale(0.94); }
.node-emoji { font-size: 1.7rem; line-height: 1; }
.node-num { position: absolute; bottom: -6px; right: -6px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; font-size: 0.72rem; font-weight: 800; display: grid; place-items: center; background: var(--c1); color: #fff; border: 2px solid #fff; }
.node-stars { position: absolute; top: -16px; font-size: 0.85rem; color: var(--gold); letter-spacing: -1px; text-shadow: 0 1px 0 #fff, 0 0 4px rgba(255, 255, 255, 0.8); white-space: nowrap; }
.node-label { position: absolute; top: 50%; left: calc(100% + 10px); transform: translateY(-50%); width: max-content; max-width: 150px; font-size: 0.74rem; font-weight: 800; line-height: 1.2; padding: 4px 8px; border-radius: 10px; background: color-mix(in srgb, var(--card-solid) 80%, transparent); color: var(--ink); pointer-events: none; }
.node[style*="left:7"] .node-label, .node[style*="left:8"] .node-label, .node[style*="left:6"] .node-label { left: auto; right: calc(100% + 10px); text-align: right; }
.node.done { background: linear-gradient(135deg, var(--c1), var(--c2)); }
.node.done .node-emoji { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.15)); }
.node.future { opacity: 0.65; filter: saturate(0.4); }
.node.future .node-label { opacity: 0.8; }
.node.open { border-color: var(--c2); }
.node-ring { position: absolute; inset: -8px; border-radius: 50%; background: conic-gradient(var(--c1) calc(var(--p, 0) * 1%), transparent 0); -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%); mask: radial-gradient(circle, transparent 60%, #000 61%); z-index: -1; }
.node.current { width: 78px; height: 78px; margin: -39px 0 0 -39px; border-color: var(--c1); animation: glow 1.8s ease-in-out infinite; z-index: 2; }
.node.current .node-emoji { font-size: 2.1rem; }
@keyframes glow { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--c1) 25%, transparent), 0 0 30px var(--c1); } }
.node-pet { position: absolute; width: 46px; height: 48px; top: -26px; left: -34px; animation: hop 1.2s ease-in-out infinite; z-index: 3; }
@keyframes hop { 50% { transform: translateY(-8px); } }
.node.boss { width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 28px; border-width: 5px; border-color: var(--c2); }
.node.boss .node-emoji { font-size: 2.3rem; }
.node.boss::after { content: "BOSS"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; color: #fff; background: linear-gradient(135deg, #f43f5e, #f97316); padding: 2px 8px; border-radius: 999px; }
.node.boss.done::after { content: "CLEARED"; background: linear-gradient(135deg, #f59e0b, #eab308); }
.node.boss .node-stars { top: -30px; }

/* ---------- level page ---------- */
.level-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.level-arrows { display: flex; gap: 6px; }
.level-head {
  position: relative; overflow: hidden; color: #fff; border-radius: var(--r); padding: 20px; text-align: center;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: var(--shadow); margin-bottom: 14px;
}
.level-head::before { content: ""; position: absolute; width: 260px; height: 260px; right: -80px; top: -120px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.lh-kicker { font-weight: 800; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.95; }
.tag { background: #fff; color: var(--c1); padding: 1px 7px; border-radius: 6px; }
.lh-emoji { font-size: 3.6rem; margin: 6px 0; animation: float 3s ease-in-out infinite; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.18)); }
.level-head h1 { font-size: clamp(1.5rem, 5vw, 2rem); }
.level-head code { background: rgba(255, 255, 255, 0.25); color: #fff; }
.lh-goal { margin: 8px auto 12px; max-width: 520px; font-weight: 700; opacity: 0.95; }
.lh-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.stars { color: #fde047; letter-spacing: 1px; }
.lh-prog { position: relative; height: 22px; margin-top: 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.lh-prog span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #fff, #fde68a); border-radius: 999px; transition: width 0.5s; }
.lh-prog em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 0.78rem; color: var(--c1); mix-blend-mode: normal; }
.preview-note { margin-top: 12px; background: rgba(0, 0, 0, 0.15); padding: 8px 12px; border-radius: 12px; font-weight: 700; font-size: 0.88rem; }

.stages { display: flex; align-items: center; gap: 0; margin: 0 0 14px; scroll-margin-top: 90px; }
.stage-link { flex: 1; height: 4px; min-width: 6px; background: var(--line); border-radius: 2px; margin-bottom: 20px; }
.stage-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; cursor: pointer; padding: 0; flex: none; }
.stage-ico {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; font-size: 1.4rem; background: var(--card-solid);
  border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line); transition: transform 0.2s;
}
.stage-lbl { font-size: 0.72rem; font-weight: 800; color: var(--muted); }
.stage-btn.done .stage-ico { background: linear-gradient(135deg, #34d399, #10b981); color: #fff; border-color: #a7f3d0; font-weight: 800; }
.stage-btn.active .stage-ico { transform: scale(1.15) translateY(-3px); border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 20%, transparent), 0 4px 0 var(--accent); }
.stage-btn.active .stage-lbl { color: var(--accent); }

.stage-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.stage-title h2 { font-size: 1.4rem; }
.hint { color: var(--muted); font-weight: 700; margin: 4px 0 12px; }
.sub { font-size: 1.05rem; margin: 18px 0 10px; }
.sub small { font-family: var(--font-b); font-size: 0.78rem; }
.stage-nav { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }

/* pet says */
.pet-says { display: flex; gap: 10px; align-items: flex-start; }
.mini-pet { width: 64px; height: 68px; flex: none; }
.mini-pet.big { width: 120px; height: 126px; margin: 10px auto; }
.pet-says .bubble { margin: 4px 0 0; flex: 1; font-weight: 600; line-height: 1.45; }
.pet-says .bubble::before { content: ""; position: absolute; left: -9px; top: 18px; border: 8px solid transparent; border-left: 0; border-right-color: var(--card-solid); }

/* loot */
.loot { display: grid; gap: 10px; }
.loot-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; text-decoration: none; background: var(--card-solid);
  border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); transition: transform 0.12s;
}
.loot-card:hover { transform: translateY(-2px); }
.loot-card:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.loot-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 1.4rem; border-radius: 14px; background: #fef3c7; }
.type-video .loot-icon { background: #fee2e2; } .type-tutorial .loot-icon { background: #dbeafe; } .type-course .loot-icon { background: #ede9fe; }
.type-docs .loot-icon { background: #dcfce7; } .type-tool .loot-icon { background: #fef3c7; }
.loot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.loot-kind { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.loot-label { font-weight: 800; line-height: 1.3; }
.loot-go { font-weight: 800; font-size: 1.1rem; color: var(--accent); }
.loot-card.opened { border-color: #a7f3d0; }
.loot-card.opened .loot-go { color: var(--good); }

/* crystals */
.crystals { display: grid; gap: 10px; }
.crystal {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 18px; cursor: pointer; line-height: 1.45;
  background: linear-gradient(135deg, color-mix(in srgb, var(--card-solid) 92%, #a5f3fc), var(--card-solid)); border: 2px dashed color-mix(in srgb, var(--accent2) 35%, transparent);
  transition: transform 0.15s, background 0.3s;
}
.crystal:active { transform: scale(0.97); }
.crystal-gem { font-size: 1.5rem; line-height: 1; transition: transform 0.4s; }
.crystal.got { border-style: solid; border-color: #c4b5fd; background: linear-gradient(135deg, #f5f3ff, #fdf2f8); }
body.theme-galaxy .crystal.got { background: linear-gradient(135deg, #3b2a7a, #4a2560); }
.crystal.got .crystal-gem { animation: spinGem 0.6s ease; }
@keyframes spinGem { 50% { transform: scale(1.5) rotate(180deg); } }

/* missions */
.missions { display: grid; gap: 10px; counter-reset: m; }
.mission {
  display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 18px; cursor: pointer; line-height: 1.4;
  background: var(--card-solid); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); transition: transform 0.12s, background 0.25s; position: relative;
}
.mission:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.m-num { width: 34px; height: 34px; flex: none; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-h); font-weight: 700; background: color-mix(in srgb, var(--accent2) 14%, transparent); color: var(--accent2); }
.m-text { flex: 1; font-weight: 700; }
.m-stamp { font-weight: 800; font-size: 0.78rem; color: var(--muted); background: rgba(139, 92, 246, 0.1); padding: 3px 8px; border-radius: 999px; }
.mission.done { background: linear-gradient(135deg, #ecfdf5, #f0fdfa); border-color: #6ee7b7; box-shadow: 0 4px 0 #a7f3d0; }
body.theme-galaxy .mission.done { background: linear-gradient(135deg, #064e3b, #134e4a); }
.mission.done .m-num { background: var(--good); color: #fff; }
.mission.done .m-text { opacity: 0.75; }
.mission.done .m-stamp { background: var(--good); color: #fff; font-size: 1rem; animation: stamp 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes stamp { from { transform: scale(2.4) rotate(-20deg); opacity: 0; } }
.mission.bonus { margin-top: 12px; border: 2px dashed var(--gold); background: linear-gradient(135deg, #fffbeb, #fef3c7); box-shadow: 0 4px 0 #fde68a; }
body.theme-galaxy .mission.bonus { background: linear-gradient(135deg, #4a3410, #3a2a0a); }
.mission.bonus .m-num { background: var(--gold); color: #fff; }
.mission.bonus.done { border-style: solid; }

/* chest */
.chest { margin-top: 14px; border-radius: 18px; border: 2px solid #fcd34d; background: #fffbeb; overflow: hidden; }
body.theme-galaxy .chest { background: #2a2050; }
.chest summary { cursor: pointer; padding: 12px 14px; font-family: var(--font-h); font-weight: 600; list-style: none; }
.chest summary::-webkit-details-marker { display: none; }
.chest summary::after { content: " ▾"; }
.chest[open] summary::after { content: " ▴"; }
.code-wrap { position: relative; }
.chest pre { margin: 0; padding: 44px 16px 16px; background: #1e1b3a; color: #f5f3ff; overflow-x: auto; font-size: 0.82rem; line-height: 1.5; }
.chest pre code { background: none; padding: 0; font-size: inherit; }
.btn-copy { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, 0.16); color: #fff; border: 1px solid rgba(255, 255, 255, 0.3); }

/* boss */
.boss-card { text-align: center; padding: 18px; border-radius: 20px; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%); }
.boss-emoji { font-size: 5rem; animation: wobble 2.4s ease-in-out infinite; display: inline-block; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.2)); }
.boss-card.beaten .boss-emoji { animation: none; }
.boss-name { font-family: var(--font-h); font-size: 1.4rem; font-weight: 700; }
.boss-hp { margin: 4px 0; letter-spacing: 2px; }
.boss-sub { font-size: 0.85rem; color: var(--muted); font-weight: 700; margin-bottom: 14px; }
.btn-big { font-size: 1.25rem; padding: 14px 28px; color: #fff; border-radius: 20px; background: linear-gradient(135deg, #f43f5e, #f97316); box-shadow: 0 6px 0 #9f1239, 0 12px 24px rgba(244, 63, 94, 0.3); }
.boss-result { margin-top: 14px; font-weight: 800; }
@keyframes wobble { 25% { transform: rotate(-8deg) scale(1.05); } 75% { transform: rotate(8deg) scale(0.97); } }

/* logbook */
.logbook { margin-top: 18px; padding: 14px; border-radius: 20px; background: color-mix(in srgb, var(--accent) 8%, var(--card-solid)); border: 2px solid var(--line); }
.logbook .sub { margin-top: 0; }
.moods { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.mood { font-size: 1.7rem; width: 52px; height: 52px; border-radius: 16px; border: 2px solid var(--line); background: var(--card-solid); cursor: pointer; transition: transform 0.15s; }
.mood:active { transform: scale(0.88); }
.mood.sel { border-color: var(--accent); transform: scale(1.12); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea, input[type="text"], input:not([type]), input[type="date"] {
  width: 100%; font: inherit; font-weight: 600; color: var(--ink); background: var(--card-solid); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; resize: vertical;
}
textarea:focus, input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.log-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* check */
.ask-card { margin-top: 16px; padding: 14px 16px; border-radius: 20px; background: linear-gradient(135deg, #e0f2fe, #f5f3ff); border: 2px solid #bae6fd; }
body.theme-galaxy .ask-card { background: linear-gradient(135deg, #0c4a6e, #312e81); border-color: #1e3a8a; }
.ask-kicker { font-weight: 800; font-size: 0.8rem; text-transform: uppercase; color: #0369a1; letter-spacing: 0.05em; }
body.theme-galaxy .ask-kicker { color: #7dd3fc; }
.ask-q { font-family: var(--font-h); font-weight: 600; font-size: 1.1rem; margin-top: 4px; }
.btn-finish { width: 100%; margin-top: 16px; padding: 16px; font-size: 1.3rem; flex-direction: column; color: #fff; border-radius: 20px; background: linear-gradient(135deg, #9ca3af, #6b7280); }
.btn-finish small { color: rgba(255, 255, 255, 0.9); font-family: var(--font-b); font-size: 0.8rem; }
.btn-finish.ready { background: linear-gradient(135deg, #10b981, #06b6d4); box-shadow: 0 6px 0 #047857, 0 14px 28px rgba(16, 185, 129, 0.35); animation: breathe 1.6s ease-in-out infinite; }
.done-banner { margin-top: 16px; padding: 16px; border-radius: 20px; text-align: center; font-family: var(--font-h); font-size: 1.2rem; font-weight: 700; background: linear-gradient(135deg, #fef3c7, #fce7f3); display: flex; flex-direction: column; gap: 10px; align-items: center; }
body.theme-galaxy .done-banner { background: linear-gradient(135deg, #4a3410, #4a1d3a); }
.done-banner .stars { color: var(--gold); font-size: 1.6rem; }

/* ---------- overlay / modals ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(40, 10, 60, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 0.2s ease; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: min(440px, 100%); background: var(--card-solid); border-radius: 26px; padding: 22px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3); text-align: center; animation: popIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); max-height: calc(100vh - 32px); overflow-y: auto; }
.overlay.wide .modal { width: min(560px, 100%); }
.modal h2 { font-size: 1.6rem; margin-bottom: 8px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.modal-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(139, 92, 246, 0.12); cursor: pointer; font-weight: 800; z-index: 2; }
.settings { text-align: left; }
.field { display: block; font-weight: 800; font-size: 0.85rem; margin: 10px 0; text-align: left; }
.field input { margin-top: 4px; }
.switch { display: flex; gap: 8px; align-items: center; font-weight: 800; margin: 10px 0; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }
.how { padding-left: 18px; line-height: 1.6; }
.danger { color: var(--bad); }
.sync-text { font-size: 0.72rem; font-family: ui-monospace, monospace; word-break: break-all; }

/* celebrate */
.celebrate { overflow: hidden; }
.cele-stars { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.cstar { font-size: 3.4rem; color: #e5e7eb; animation: starIn 0.5s cubic-bezier(0.2, 1.8, 0.4, 1) both; }
.cstar.on { color: var(--gold); text-shadow: 0 0 18px rgba(245, 158, 11, 0.6); }
@keyframes starIn { from { transform: scale(0) rotate(-120deg); opacity: 0; } }
.cele-pet { width: 150px; height: 158px; margin: 6px auto; }
.cele-pet .pet-svg { animation: dance 0.8s ease-in-out infinite; }
.cele-pet.evolve { animation: evolve 1.2s ease both; }
@keyframes evolve { 0% { filter: brightness(4) blur(4px); transform: scale(0.4); } 60% { filter: brightness(2); transform: scale(1.15); } }
@keyframes dance { 25% { transform: rotate(-6deg) translateY(-6px); } 75% { transform: rotate(6deg) translateY(-6px); } }
.cele-loot { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cele-loot span { font-weight: 800; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.lvl-burst { font-family: var(--font-h); font-weight: 700; font-size: 2.4rem; background: linear-gradient(90deg, #f59e0b, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: popIn 0.6s cubic-bezier(0.2, 1.8, 0.4, 1); }

/* battle */
.battle { text-align: left; }
.arena { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 12px; border-radius: 20px; margin-bottom: 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent2) 22%, transparent), color-mix(in srgb, var(--accent) 12%, transparent)); }
.arena-boss { flex: 1; text-align: center; }
.arena-emoji { font-size: 4rem; display: inline-block; animation: wobble 2s ease-in-out infinite; }
.arena-boss.hit .arena-emoji { animation: hit 0.5s ease; }
@keyframes hit { 20% { transform: translateX(-12px) rotate(-14deg); filter: brightness(2) hue-rotate(-40deg); } 40% { transform: translateX(12px) rotate(10deg); } 70% { transform: scale(0.9); } }
.arena-name { font-family: var(--font-h); font-weight: 700; }
.hpbar { height: 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.12); overflow: hidden; margin-top: 4px; }
.hpbar span { display: block; height: 100%; background: linear-gradient(90deg, #f43f5e, #fb923c); transition: width 0.5s ease; }
.arena-me { text-align: center; }
.arena-me .mini-pet { margin: 0 auto; }
.hearts { font-size: 0.95rem; letter-spacing: 1px; }
.q-count { font-size: 0.8rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.q-text { font-family: var(--font-h); font-size: 1.25rem; font-weight: 600; margin: 6px 0 12px; }
.q-opts { display: grid; gap: 8px; }
.q-opt { display: flex; gap: 10px; align-items: center; text-align: left; padding: 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--card-solid); cursor: pointer; font-weight: 700; box-shadow: 0 4px 0 var(--line); transition: transform 0.1s; }
.q-opt:not(:disabled):hover { border-color: var(--accent2); }
.q-opt:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.q-key { width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 0.8rem; background: color-mix(in srgb, var(--accent2) 15%, transparent); color: var(--accent2); }
.q-opt.right { border-color: var(--good); background: #ecfdf5; box-shadow: 0 4px 0 #6ee7b7; animation: bump 0.4s ease; }
.q-opt.right .q-key { background: var(--good); color: #fff; }
.q-opt.wrong { border-color: var(--bad); background: #fff1f2; box-shadow: 0 4px 0 #fda4af; }
.q-opt.wrong .q-key { background: var(--bad); color: #fff; }
body.theme-galaxy .q-opt.right { background: #064e3b; } body.theme-galaxy .q-opt.wrong { background: #4c0519; }
.q-opt.fade { opacity: 0.5; }
.q-opt:disabled { cursor: default; }
.q-why { margin-top: 12px; padding: 12px 14px; border-radius: 16px; font-weight: 700; line-height: 1.45; animation: slideIn 0.3s ease; }
.q-why.ok { background: #ecfdf5; border: 2px solid #a7f3d0; } .q-why.no { background: #fff7ed; border: 2px solid #fed7aa; }
body.theme-galaxy .q-why.ok { background: #064e3b; } body.theme-galaxy .q-why.no { background: #431407; }
.shake { animation: shake 0.4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.battle-end { text-align: center; }
.end-emoji { font-size: 5rem; }
.end-emoji.boom { animation: boom 0.7s cubic-bezier(0.2, 1.8, 0.4, 1); }
@keyframes boom { from { transform: scale(0.2) rotate(-90deg); } }

/* hatch */
.hatch { text-align: center; }
.egg { font-size: 7rem; border: 0; background: none; cursor: pointer; margin: 10px auto; display: block; animation: wobble 2s ease-in-out infinite; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.15)); }
.egg.wobble { animation: eggShake 0.5s ease; }
@keyframes eggShake { 25% { transform: rotate(-18deg) scale(1.08); } 50% { transform: rotate(14deg); } 75% { transform: rotate(-8deg); } }
.egg-cracks { font-size: 1.6rem; min-height: 2rem; letter-spacing: 6px; }

/* ---------- pet page ---------- */
.pet-home { text-align: center; }
.pet-big { width: 200px; height: 210px; margin: 0 auto; cursor: pointer; }
.pet-name { font-size: 2rem; display: flex; gap: 8px; justify-content: center; align-items: center; }
.evo-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.evo { padding: 8px 4px; border-radius: 16px; background: rgba(139, 92, 246, 0.06); filter: grayscale(1) opacity(0.5); }
.evo.on { filter: none; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.evo-pet { width: 56px; height: 60px; margin: 0 auto; }
.evo small { font-size: 0.7rem; }
.shop-head { display: flex; justify-content: space-between; align-items: center; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tab { flex: 1; padding: 9px 10px; border-radius: 14px; border: 2px solid var(--line); background: var(--card-solid); cursor: pointer; font-weight: 800; white-space: nowrap; }
.tab.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.shop-item { padding: 10px 6px; border-radius: 18px; border: 2px solid var(--line); background: var(--card-solid); cursor: pointer; box-shadow: 0 4px 0 var(--line); transition: transform 0.12s; }
.shop-item:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.shop-item.eq { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent), 0 4px 0 var(--accent); }
.shop-prev { width: 70px; height: 74px; margin: 0 auto; display: grid; place-items: center; }
.shop-name { font-weight: 800; font-size: 0.85rem; }
.shop-price { font-size: 0.75rem; font-weight: 800; color: var(--muted); }
.shop-item:not(.owned) .shop-price { color: var(--accent2); }
.theme-swatch { width: 60px; height: 60px; border-radius: 16px; border: 3px solid #fff; box-shadow: var(--shadow); }
.theme-swatch.theme-candy { background: linear-gradient(135deg, #ffd6ec, #e9d5ff, #c7f0ff); }
.theme-swatch.theme-sunset { background: linear-gradient(135deg, #ffd1b3, #ffb3c6, #ffe5a3); }
.theme-swatch.theme-ocean { background: linear-gradient(135deg, #b9f3ff, #c7d2fe, #a7f3d0); }
.theme-swatch.theme-matcha { background: linear-gradient(135deg, #dcfce7, #fef9c3, #e0f2fe); }
.theme-swatch.theme-galaxy { background: radial-gradient(circle at 30% 30%, #fff 1px, transparent 2px), linear-gradient(135deg, #1e1b4b, #3b0764, #0c4a6e); }

/* pet svg animations */
.pet-svg { width: 100%; height: 100%; overflow: visible; display: block; }
.pet-body { transform-origin: 100px 190px; animation: squish 2.6s ease-in-out infinite; }
@keyframes squish { 50% { transform: scale(1.04, 0.96) translateY(3px); } }
.pet-eyes { transform-origin: 100px 94px; animation: blink 4.5s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
.pet-bulb { animation: bulb 1.6s ease-in-out infinite; }
@keyframes bulb { 50% { fill: #fff7ae; } }
.pet-wings { transform-origin: 100px 120px; animation: flap 0.9s ease-in-out infinite; }
@keyframes flap { 50% { transform: scaleX(1.08) translateY(-3px); } }
.pet-aura { transform-origin: 100px 112px; animation: spin 10s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pet-svg.jump { animation: jump 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes jump { 40% { transform: translateY(-26px) rotate(-6deg); } }

/* ---------- trophies ---------- */
.level-card { display: flex; gap: 16px; align-items: center; }
.level-card > div:last-child { flex: 1; }
.lvl-big { width: 86px; height: 86px; flex: none; border-radius: 26px; display: grid; place-items: center; font-family: var(--font-h); font-weight: 700; font-size: 1.5rem; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: var(--shadow); transform: rotate(-6deg); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 6px; text-align: center; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.tile-e { font-size: 1.5rem; } .tile-v { font-family: var(--font-h); font-weight: 700; font-size: 1.25rem; } .tile-l { font-size: 0.72rem; font-weight: 800; color: var(--muted); }
.cups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.cup { text-align: center; padding: 12px 6px; border-radius: 18px; background: rgba(139, 92, 246, 0.06); filter: grayscale(0.8); opacity: 0.7; }
.cup.won { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; filter: none; opacity: 1; }
.cup.won small { color: #fff; }
.cup-e { font-size: 2rem; } .cup-n { font-weight: 800; font-size: 0.78rem; line-height: 1.2; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 12px; }
.badge { text-align: center; padding: 12px 6px; border-radius: 18px; background: rgba(139, 92, 246, 0.06); border: 2px dashed var(--line); }
.badge.got { background: linear-gradient(135deg, #fef3c7, #fce7f3); border: 2px solid #fcd34d; }
body.theme-galaxy .badge.got { background: linear-gradient(135deg, #4a3410, #4a1d3a); }
.badge-e { font-size: 2rem; } .badge.got .badge-e { animation: float 3s ease-in-out infinite; }
.badge-n { font-weight: 800; font-size: 0.82rem; }
.badge small { font-size: 0.68rem; }

/* ---------- diary ---------- */
.log-entry { display: flex; gap: 12px; align-items: flex-start; }
.log-mood { font-size: 2.2rem; }
.log-body { flex: 1; min-width: 0; }
.log-body p { margin: 4px 0 0; white-space: pre-wrap; }
.log-kicker { font-size: 0.78rem; font-weight: 800; color: var(--muted); }
.empty { text-align: center; }

/* ---------- timer, toasts, floaters ---------- */
.timer {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock-h) + 26px + env(safe-area-inset-bottom)); z-index: 31;
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-radius: 999px; background: #1e1b3a; color: #fff; box-shadow: var(--shadow); font-weight: 800;
}
.t-time { font-family: var(--font-h); font-size: 1.15rem; min-width: 52px; text-align: center; }
.t-lbl { font-size: 0.8rem; opacity: 0.8; }
.timer button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; cursor: pointer; }
.toasts { position: fixed; top: calc(76px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--card-solid); border: 2px solid var(--line); box-shadow: var(--shadow); font-weight: 700; animation: toastIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
.toast.out { animation: toastOut 0.4s ease forwards; }
.toast-i { font-size: 1.5rem; }
@keyframes toastIn { from { transform: translateY(-20px) scale(0.9); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-20px); opacity: 0; } }
.floater { position: fixed; z-index: 70; transform: translate(-50%, -50%); pointer-events: none; font-family: var(--font-h); font-weight: 700; font-size: 1.05rem; color: #fff; background: linear-gradient(135deg, #f59e0b, var(--accent)); padding: 4px 12px; border-radius: 999px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2); animation: floatUp 1.2s ease forwards; white-space: nowrap; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(0.6); } 20% { opacity: 1; transform: translate(-50%, -90%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .hud { gap: 8px; }
  .hud-title { display: none; }
  .chip { padding: 4px 8px; font-size: 0.8rem; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .cups { grid-template-columns: repeat(2, 1fr); }
  .stage-ico { width: 46px; height: 46px; font-size: 1.2rem; }
  .stage-lbl { font-size: 0.66rem; }
  .node-label { max-width: 110px; font-size: 0.68rem; }
  .world-emoji { font-size: 2.4rem; }
  .stage-nav .btn { font-size: 0.9rem; padding: 10px 12px; }
  .level-card { flex-direction: column; text-align: center; }
}
@media (min-width: 900px) {
  .view { padding-top: 22px; }
  .loot, .crystals { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
