html, body { height: 100%; }
body { overflow-x: hidden; }
.screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 64px 16px 24px; gap: 14px; }
.screen[hidden] { display: none; }
.topbar { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; z-index: 5; }
.btn.small { padding: 8px 16px; font-size: 0.9rem; }
.ar-logo { font-size: clamp(2rem, 9vw, 3.4rem); margin: 8px 0 0; text-align: center; }
.muted { color: var(--muted); text-align: center; max-width: 520px; margin: 0; }
.sec { font-family: var(--display); font-size: 1rem; letter-spacing: 0.1em; color: var(--muted); margin: 18px 0 0; }
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; width: min(560px, 100%); }
.lv { position: relative; aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--line); background: rgba(14, 16, 40, 0.8); color: #fff; font-family: var(--display); font-size: 1.1rem; cursor: pointer; }
.lv small { position: absolute; left: 0; right: 0; bottom: 4px; font-size: 0.6rem; letter-spacing: 1px; color: var(--yellow); }
.lv.done { border-color: rgba(34, 243, 255, 0.6); box-shadow: 0 0 10px rgba(34, 243, 255, 0.25); }
.lv.next { border-color: var(--pink); box-shadow: var(--glow-pink); animation: pulse 1.4s infinite alternate; }
.lv:disabled { opacity: 0.3; cursor: default; }
@keyframes pulse { to { transform: scale(1.06); } }

#game { padding: 0; gap: 0; height: 100vh; height: 100dvh; justify-content: flex-start; }
.hud { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; }
.hud-mid { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.hud-mid b { font-family: var(--display); color: var(--cyan); text-shadow: var(--glow-cyan); }
.hud-mid span { color: var(--muted); font-size: 0.9rem; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); color: #fff; font-size: 1.2rem; cursor: pointer; }
.hearts { font-size: 1.4rem; letter-spacing: 2px; min-width: 90px; text-align: right; }
.hearts .lost { filter: grayscale(1); opacity: 0.25; }
#board { flex: 1; width: 100%; min-height: 0; display: block; touch-action: manipulation; cursor: pointer; }
.tip { margin: 0; padding: 0 16px; min-height: 1.3em; color: var(--muted); text-align: center; font-size: 0.92rem; }
.bottom { display: flex; gap: 8px; padding: 10px 14px 16px; }
.bottom b { color: var(--yellow); }
.stars { font-size: 2.6rem; letter-spacing: 6px; }
.stars .off { filter: grayscale(1); opacity: 0.25; }
.xp { color: var(--lime); font-weight: 800; font-family: var(--display); margin: 0; }
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 6, 15, 0.7); z-index: 10; }
.overlay[hidden] { display: none; }
.menu-card { width: min(420px, 100%); padding: 24px 20px; border-radius: 22px; text-align: center; background: var(--panel); border: 1px solid rgba(34, 243, 255, 0.35); box-shadow: 0 0 40px rgba(34, 243, 255, 0.15); display: flex; flex-direction: column; gap: 12px; animation: pop 0.25s ease-out; }
.menu-card h2 { margin: 0; font-size: 2rem; }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }
