@font-face { font-family: 'Baloo'; src: url(../game/fonts/baloo-latin.woff2) format('woff2'); font-weight: 400 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Baloo'; src: url(../game/fonts/baloo-latin-ext.woff2) format('woff2'); font-weight: 400 800; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Baloo'; src: url(../game/fonts/baloo-arabic.woff2) format('woff2'); font-weight: 400 800; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'AmiriQuran'; src: url(../game/fonts/amiri-quran-arabic.woff2) format('woff2'); font-display: swap; }
/* KFGQPC Warsh font: required to draw the Warsh text's own marks correctly */
@font-face { font-family: 'WarshQuran'; src: url(../game/fonts/warsh-kfgqpc.woff2) format('woff2'); font-display: block; }

:root {
  --bg: #0b0a1f; --bg2: #1a1650; --ink: #f4f3ff; --muted: #b8b4e6; --card: #ffffff; --card-ink: #1c1940;
  --math: #f07a35; --arabic: #1fb3b0; --quran: #e9c46a; --stardust: #b37bff; --good: #46d36a; --bad: #ff6b6b;
  --r: 18px; --gap: clamp(8px, 1.6vmin, 16px);
  --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);
  --fs: clamp(14px, 2.2vmin + 6px, 22px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; overscroll-behavior: none; }
body { font: 500 var(--fs)/1.35 'Baloo', system-ui, sans-serif; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
img { -webkit-user-drag: none; user-select: none; }
.ar { font-family: 'Baloo', system-ui, sans-serif; direction: rtl; }
.quran { font-family: 'WarshQuran', 'AmiriQuran', serif; direction: rtl; line-height: 2.1; }
bdi { unicode-bidi: isolate; }

#sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: #0b0a1f center/cover no-repeat; transition: background-image .4s; }
#sky::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #0b0a1f99 0%, #0b0a1f22 30%, #0b0a1f33 70%, #0b0a1fcc 100%); }
#sky[data-bg="starmap"] { background-image: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/bg/starmap.webp); }
#sky[data-bg="math"] { background-image: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/bg/math.webp); }
#sky[data-bg="arabic"] { background-image: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/bg/arabic.webp); }
#sky[data-bg="base"] { background-image: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/bg/base.webp); background-position: center bottom; }
#sky[data-bg="souk"] { background-image: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/bg/souk.webp); }
#sky[data-bg="observatory"] { background-image: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/bg/observatory.webp); }
#sky[data-bg="home"] { background-image: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/bg/home.webp); }
#sky[data-bg="home"]::after { background: linear-gradient(180deg, transparent 50%, #0b0a1f99 100%); }
#sky[data-bg="observatory"]::after, #sky[data-bg="souk"]::after { background: #0b0a1f99; }
#app { position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 6px) calc(var(--safe-r) + 8px) calc(var(--safe-b) + 6px) calc(var(--safe-l) + 8px); }

/* ---------- generic ---------- */
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--gap); animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.grow { flex: 1; min-height: 0; }
.row { display: flex; align-items: center; gap: var(--gap); }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .8em; }
h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 800; }
h1 { font-size: clamp(30px, 7vmin, 64px); letter-spacing: .5px; }
h2 { font-size: clamp(20px, 4vmin, 34px); }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 52px; min-width: 52px; padding: .45em 1.1em;
  border-radius: 999px; font-weight: 800; color: #1c1940; background: linear-gradient(#fff, #d9dcff); box-shadow: 0 5px 0 #8f8ad6, 0 8px 18px #0006;
  transition: transform .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #8f8ad6, 0 4px 10px #0006; }
.btn.big { font-size: 1.25em; min-height: 64px; padding: .5em 1.6em; }
.btn.go { background: linear-gradient(#7cf29a, #2fbf5a); box-shadow: 0 5px 0 #1b7d3a, 0 8px 18px #0006; }
.btn.math { background: linear-gradient(#ffb27a, #f07a35); box-shadow: 0 5px 0 #a8461a, 0 8px 18px #0006; }
.btn.arabic { background: linear-gradient(#7fe7e3, #1fb3b0); box-shadow: 0 5px 0 #0f6f6c, 0 8px 18px #0006; }
.btn.gold { background: linear-gradient(#ffe7a3, #e9c46a); box-shadow: 0 5px 0 #9b7a2b, 0 8px 18px #0006; }
.btn.ghost { background: #ffffff1a; color: var(--ink); box-shadow: none; border: 2px solid #ffffff33; }
.btn[disabled] { opacity: .45; filter: grayscale(.6); pointer-events: none; }
.icon-btn { width: 52px; height: 52px; padding: 0; border-radius: 50%; font-size: 24px; background: #ffffff1a; border: 2px solid #ffffff2a; color: var(--ink); box-shadow: none; }

/* ---------- HUD ---------- */
.hud { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-height: 52px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; border-radius: 999px; background: #0008; border: 1px solid #ffffff22;
  font-weight: 800; font-size: .9em; white-space: nowrap; }
.chip img { width: 28px; height: 28px; border-radius: 7px; }
.chip .dot { width: 22px; height: 22px; border-radius: 50%; display: inline-block; margin-left: 3px; }
.hud .spacer { flex: 1; }
.o2 { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #0008; font-size: .8em; font-weight: 800; }
.o2 .bar { width: clamp(50px, 12vw, 120px); height: 10px; border-radius: 6px; background: #ffffff22; overflow: hidden; }
.o2 .bar i { display: block; height: 100%; background: linear-gradient(90deg, #6ee7ff, #b5f5ff); border-radius: 6px; transition: width 1s linear; }
.energy .bar i { background: linear-gradient(90deg, #ffd166, #ffef9f); }
@media (max-width: 560px) { .hud .label-hide { display: none; } .chip img { width: 24px; height: 24px; } }

/* ---------- title ---------- */
.title-art { position: relative; width: min(90vw, 560px); aspect-ratio: 2/1; }
.title-art img { position: absolute; bottom: 0; }
.title-art .astro { left: 8%; height: 92%; animation: float 3s ease-in-out infinite; }
.title-art .robot { right: 10%; height: 62%; bottom: 25%; animation: float 2.4s ease-in-out infinite reverse; }
@keyframes float { 50% { transform: translateY(-8px); } }
.logo { font-size: clamp(38px, 9vmin, 84px); background: linear-gradient(#fff, #ffd59e 60%, #f07a35); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #3a2b85); }
input.name { font: inherit; font-weight: 800; text-align: center; padding: .4em .8em; border-radius: 999px; border: 3px solid #ffffff44; background: #0006; color: #fff; width: min(80vw, 340px); }

/* ---------- star map ---------- */
.map { position: relative; flex: 1; min-height: 0; }
.planet { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.planet .ball { width: var(--s); height: var(--s); border-radius: 50%; position: relative; box-shadow: inset -14px -10px 0 #0003, 0 0 40px var(--glow); transition: transform .2s; }
.planet:active .ball { transform: scale(.94); }
.planet .name { font-weight: 800; background: #0009; padding: 2px 12px; border-radius: 999px; font-size: .9em; white-space: nowrap; }
.planet .stars { font-size: .75em; color: #ffe08a; }
.planet.locked .ball { filter: grayscale(1) brightness(.5); }
.planet.locked .name::before { content: '🔒 '; }
.ball.math { background: radial-gradient(circle at 35% 30%, #ffb27a, #e0582a 55%, #8f2d14); --glow: #f07a3566; }
.ball.math::after { content: ''; position: absolute; inset: 22% 18% auto auto; width: 22%; height: 22%; border-radius: 50%; background: #0002; box-shadow: -40% 120% 0 -2px #0002; }
.ball.arabic { background: radial-gradient(circle at 35% 30%, #a6fff5, #1fb3b0 55%, #0b5d6b); --glow: #1fb3b066; }
.ball.home { background: radial-gradient(circle at 35% 30%, #b9a58f, #7a6656 55%, #3d3029); --glow: #ffffff22; }
.ball.obs { background: radial-gradient(circle at 50% 100%, #2a3c78, #101a3e 70%); border-radius: 50% 50% 12% 12%; --glow: #e9c46a55; }
.ball.obs::after { content: '✦'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--quran); font-size: calc(var(--s) * .4); }
.ball.bonus { background: radial-gradient(circle at 35% 30%, #e2c4ff, #9a5cf0 55%, #4a2290); --glow: #b37bff55; }
.orbit { position: absolute; border: 2px dashed #ffffff18; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }

/* ---------- planet / level list ---------- */
.zone { background: #ffffff10; border: 1px solid #ffffff1c; border-radius: var(--r); padding: 10px 12px; }
.zone h3 { font-size: 1em; margin-bottom: 8px; color: var(--muted); }
.nodes { display: flex; flex-wrap: wrap; gap: 10px; }
.node { min-width: 0; flex: 1 1 210px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 16px; background: linear-gradient(#ffffff, #e3e5ff);
  color: var(--card-ink); font-weight: 800; text-align: left; box-shadow: 0 4px 0 #8f8ad6; min-height: 64px; }
.node .num { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 1.05em; }
.node .t { flex: 1; line-height: 1.15; } .node .t small { display: block; font-weight: 600; color: #5d58a0; font-size: .72em; }
.node .s { flex: none; color: #f4a300; letter-spacing: -2px; }
.node.locked { opacity: .5; filter: grayscale(.8); }
.node.boss { background: linear-gradient(#ffe6e0, #ffc4b5); }

/* ---------- level ---------- */
.level { flex: 1; min-height: 0; display: grid; gap: var(--gap);
  grid-template-columns: minmax(150px, 30%) 1fr; grid-template-rows: auto 1fr; grid-template-areas: "bubble bubble" "side field"; }
.level .bubble-wrap { grid-area: bubble; display: flex; align-items: center; gap: 8px; }
.level .side { grid-area: side; position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-height: 0; }
.level .field { grid-area: field; position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; }
.level .side img.astro { max-height: 70%; max-width: 100%; object-fit: contain; }
@media (orientation: portrait) {
  .level { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; grid-template-areas: "bubble" "field" "side"; }
  .level .side { flex-direction: row; justify-content: center; height: clamp(70px, 14vh, 130px); }
  .level .side img.astro { max-height: 100%; }
}
.helper-mini { height: clamp(56px, 11vmin, 96px); flex: none; animation: float 2.4s ease-in-out infinite; }
.bubble { position: relative; flex: 1; background: var(--card); color: var(--card-ink); border-radius: var(--r); padding: .5em 62px .5em .9em; box-shadow: 0 4px 0 #0004; min-height: 56px; }
.bubble::before { content: ''; position: absolute; left: -10px; top: 50%; margin-top: -10px; border: 10px solid transparent; border-right-color: var(--card); border-left: 0; }
.bubble .main { font-weight: 800; font-size: clamp(17px, 2.6vmin + 6px, 28px); line-height: 1.2; }
.bubble .sub { font-size: .78em; color: #5d58a0; line-height: 1.25; }
.bubble .speak { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; background: #efeefe; font-size: 22px; }
.bubble .q { font-weight: 800; color: #3a2b85; white-space: nowrap; }
.bubble .ar { display: block; }

.cliff { display: grid; grid-template-columns: repeat(var(--cols), var(--t)); grid-auto-rows: var(--t); gap: 0; touch-action: manipulation; }
.tile { position: relative; width: 100%; height: 100%; background: center/100% 100% no-repeat; display: grid; place-items: center; cursor: pointer; }
.tile.wide { grid-column: span 2; }
.tile .lbl { font-weight: 800; color: #1c1940; font-size: calc(var(--t) * .36); line-height: 1; padding: 0 6%; text-align: center; max-width: 100%; }
.tile.wide .lbl { font-size: calc(var(--t) * .34); }
.tile .lbl.ar { font-size: calc(var(--t) * .40); line-height: 1.6; }
.tile .lbl.long { font-size: calc(var(--t) * .26); }
.tile.gone { visibility: hidden; }
.tile.wobble { animation: wobble .35s; }
@keyframes wobble { 20% { transform: rotate(-7deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(2deg); } }
.tile.pop { animation: pop .38s ease-in forwards; z-index: 3; }
@keyframes pop { 30% { transform: scale(1.12); } 100% { transform: scale(0); opacity: 0; } }
.tile.hint { animation: glow 1s ease-in-out infinite; z-index: 2; }
@keyframes glow { 50% { filter: drop-shadow(0 0 10px #ffe66d) brightness(1.15); } }
.tile.shake { animation: shake .15s; }
@keyframes shake { 33% { transform: translate(-2px, 1px); } 66% { transform: translate(2px, -1px); } }

.ore { position: fixed; z-index: 50; width: 30px; height: 30px; pointer-events: none; transition: transform .7s cubic-bezier(.5, -0.4, .7, 1), opacity .7s; }
.spark { position: fixed; z-index: 49; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; }

/* catch */
.catch { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: var(--r); background: linear-gradient(#ffffff08, #ffffff14); border: 1px solid #ffffff1a; }
.faller { position: absolute; top: 0; left: 0; width: var(--t); height: var(--t); background: center/100% 100% no-repeat; display: grid; place-items: center; will-change: transform; cursor: pointer; }
.faller.wide { width: calc(var(--t) * 2); }
.faller .lbl { font-weight: 800; color: #1c1940; font-size: calc(var(--t) * .5); line-height: 1.5; }
.faller.wide .lbl { font-size: calc(var(--t) * .36); }
.catch .floor { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: linear-gradient(90deg, #1fb3b0, #7fe7e3, #1fb3b0); opacity: .5; }

/* order (ayah / sentence) */
.order { width: 100%; height: 100%; display: flex; flex-direction: column; gap: var(--gap); align-items: stretch; justify-content: center; }
.line { min-height: 2.6em; display: flex; flex-wrap: wrap; justify-content: flex-start; align-content: center; gap: 6px 10px; padding: 10px 14px;
  border-radius: var(--r); background: #ffffff10; border: 2px dashed #ffffff30; }
.bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.word { font-size: clamp(22px, 3.4vmin + 8px, 40px); padding: 2px 16px; border-radius: 14px; background: linear-gradient(#22306a, #17204b); border: 2px solid #e9c46a88; color: #fff8e1; min-height: 56px; }
.word.placed { background: transparent; border-color: transparent; padding: 0 2px; }
.word.used { visibility: hidden; }
.word.nudge { animation: glow 1s ease-in-out 2; }

/* results / modal */
.modal-bg { position: fixed; inset: 0; z-index: 60; background: #05041599; display: grid; place-items: center; padding: 16px; animation: fadein .2s; }
.modal { width: min(560px, 100%); max-height: 100%; overflow: auto; background: linear-gradient(#2b2470, #1a1650); border: 2px solid #ffffff2a; border-radius: 24px; padding: 18px; text-align: center;
  display: flex; flex-direction: column; gap: 12px; align-items: center; box-shadow: 0 20px 60px #000a; }
.bigstars { font-size: clamp(40px, 10vmin, 72px); letter-spacing: 6px; }
.bigstars .off { filter: grayscale(1) brightness(.4); }
.bigstars span { display: inline-block; animation: starin .45s backwards; }
@keyframes starin { from { transform: scale(0) rotate(-90deg); } }
.teach { width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.teach .visual { background: #fff; color: var(--card-ink); border-radius: 16px; padding: 12px; min-height: 80px; width: 100%; display: grid; place-items: center; font-weight: 800; font-size: 1.1em; }
.dots { display: grid; gap: 5px; } .dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--math); display: block; }
.pv { display: flex; gap: 6px; } .pv div { border: 2px solid #c9c6f3; border-radius: 10px; padding: 4px 8px; min-width: 52px; } .pv b { display: block; font-size: 1.4em; } .pv small { color: #6c67aa; font-size: .7em; }

#toasts { position: fixed; z-index: 80; left: 50%; top: calc(var(--safe-t) + 64px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #fff; color: var(--card-ink); font-weight: 800; padding: 8px 18px; border-radius: 999px; box-shadow: 0 6px 20px #0008; animation: toast 2.6s forwards; white-space: nowrap; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-10px) scale(.9); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- base ---------- */
.base { flex: 1; min-height: 0; display: grid; gap: var(--gap); grid-template-columns: 1.1fr 1fr; }
@media (orientation: portrait) { .base { grid-template-columns: 1fr; grid-template-rows: minmax(0, 42fr) minmax(0, 58fr); } }
.pad { position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 0; }
.pad .ground { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(36px, 8vmin, 64px); background: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/art/home-surface.webp) left bottom/auto 100% repeat-x; border-radius: 0 0 var(--r) var(--r); }
.pad .astro { position: absolute; left: 6%; bottom: clamp(30px, 7vmin, 58px); height: 34%; z-index: 2; }
.pad .robot { position: absolute; right: 8%; top: 12%; height: 22%; animation: float 2.4s ease-in-out infinite; }
.rocket .part { transition: opacity .4s, filter .4s; }
.rocket .part.missing { opacity: .18; filter: grayscale(1); }
.craft { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.craft .list { display: flex; flex-direction: column; gap: 8px; }
.part-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #ffffff12; border: 1px solid #ffffff1c; }
.part-row .pn { flex: 1; font-weight: 800; line-height: 1.1; } .part-row .pn small { display: block; color: var(--muted); font-weight: 600; font-size: .75em; }
.part-row.done { opacity: .7; }
.cost { display: inline-flex; gap: 6px; font-size: .8em; font-weight: 800; }
.cost span { display: inline-flex; align-items: center; gap: 2px; } .cost img { width: 20px; height: 20px; }
.cost .short { color: var(--bad); }

/* ---------- observatory ---------- */
.obs-sky { position: relative; flex: 1; min-height: 120px; border-radius: var(--r); background: radial-gradient(ellipse at 50% 120%, #22306a, #0b1030 70%); border: 1px solid #e9c46a33; overflow: hidden; }
.obs-sky svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.obs-sky .st { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #ffffff40; }
.obs-sky .st.on { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: #ffe7a3; box-shadow: 0 0 12px 3px #e9c46a99; }
.obs-sky .st.here::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid #fff; animation: ping 1.6s ease-in-out infinite; }
@keyframes ping { 50% { transform: scale(1.35); opacity: .5; } }
.obs-sky .cname { position: absolute; left: 12px; top: 8px; color: var(--quran); font-weight: 800; }
.ayah-card { background: linear-gradient(#1e2a5c, #151d45); border: 2px solid #e9c46a55; border-radius: var(--r); padding: 10px 16px; text-align: center; }
.ayah-card .quran { font-size: clamp(24px, 3.6vmin + 10px, 46px); color: #fff8e1; }
.ayah-num { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; border: 2px solid var(--quran); color: var(--quran); font-size: .55em; margin: 0 .3em; vertical-align: middle; font-family: 'Baloo'; }
.surah-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.surah { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: #ffffff10; border: 1px solid #e9c46a44; text-align: left; }
.surah .sn { flex: 1; } .surah .sn b { display: block; font-family: 'WarshQuran', 'AmiriQuran', serif; font-size: 1.3em; line-height: 1.6; color: #fff8e1; } .surah .sn small { color: var(--muted); }
.ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--quran) calc(var(--p) * 1%), #ffffff1a 0); display: grid; place-items: center; flex: none; }
.ring::after { content: attr(data-l); width: 36px; height: 36px; border-radius: 50%; background: #17204b; display: grid; place-items: center; font-size: .7em; font-weight: 800; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { padding: 6px 16px; border-radius: 16px; background: #ffffff12; border: 2px solid #e9c46a55; }
.choice.good { border-color: var(--good); background: #46d36a22; }

/* ---------- parent ---------- */
.ptable { width: 100%; border-collapse: collapse; font-size: .85em; }
.ptable td, .ptable th { padding: 6px 8px; border-bottom: 1px solid #ffffff1a; text-align: left; }
.card { background: #ffffff10; border: 1px solid #ffffff1c; border-radius: var(--r); padding: 12px 14px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ================= v2: Cuby, painted worlds, new games ================= */
:root { --zellij: url(../game/brand/zellij.webp); --gold: #e9c46a; }
.brand { position: fixed; right: calc(var(--safe-r) + 8px); bottom: calc(var(--safe-b) + 6px); z-index: 3; display: flex; align-items: center; padding: 4px 8px; border-radius: 999px;
  background: #0b0a1fcc; border: 1px solid #ffffff2a; opacity: .9; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: opacity .2s, transform .2s; }
.brand:hover { opacity: 1; transform: scale(1.04); }
.brand img { height: 20px; display: block; }
.by-da { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: #0b0a1fcc; border: 1px solid #ffffff33; color: var(--muted); font-weight: 700; text-decoration: none; }
.by-da img { height: 26px; display: block; } .by-da.big img { height: 40px; } .by-da.big { background: #fff; }
.about { text-align: center; } .about-ar p { margin: .25em 0; font-size: 1.05em; } .about-en { margin: 0; color: var(--muted); }
.about a { color: var(--gold); } .about .btn { text-decoration: none; color: #1c1940; }
.credits { width: 100%; text-align: left; background: #0b0a1f80; border-radius: 14px; padding: 8px 12px; font-size: .8em; }
.credits h3 { font-size: 1em; margin: 0 0 4px; } .credits ul { margin: 0; padding-left: 1.2em; } .credits li { margin: 2px 0; }
.hud-title { font-size: clamp(15px, 2.6vmin, 22px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; display: flex; flex-direction: column; line-height: 1.1; }
.hud-title small { font-size: .7em; color: var(--muted); font-weight: 600; }
@media (max-width: 560px) { .hud-title { display: none; } }
.chip.stardust img { border-radius: 50%; }

/* title */
.title-screen { gap: clamp(8px, 2vh, 16px); }
.logo { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.logo-ar { font-size: .42em; margin-top: .15em; background: linear-gradient(#fff, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: none; }
.title-art { position: relative; width: min(92vw, 620px); aspect-ratio: 2.1/1; }
.title-art .astro { left: 4%; height: 88%; bottom: 0; position: absolute; animation: float 3s ease-in-out infinite; }
.title-art .cuby-title { position: absolute; right: 26%; bottom: 0; height: 80%; animation: float 2.6s ease-in-out infinite reverse; }
.title-art .planet-deco { position: absolute; right: -2%; top: -4%; height: 46%; animation: spin 60s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cuby */
.cuby-mini { height: clamp(64px, 12vmin, 110px); flex: none; filter: drop-shadow(0 6px 10px #0008); transition: transform .2s; }
.cuby-modal { height: clamp(110px, 20vmin, 170px); filter: drop-shadow(0 8px 14px #0009); }
.cuby-base { position: absolute; right: 0; bottom: clamp(18px, 4vmin, 36px); height: 24%; filter: drop-shadow(0 6px 10px #0008); }
.story-en { font-size: 1.1em; font-weight: 800; margin: 0; } .story-ar { margin: 0; color: var(--muted); font-size: 1.05em; }
.teach-ar { color: var(--gold); font-size: 1.15em; }
.modal { background: linear-gradient(#2b2470f2, #1a1650f2); border-top: 6px solid transparent; border-image: var(--zellij) 30 / 6px round; }
.zellij-edge { position: relative; overflow: hidden; } .zellij-edge::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--zellij) center/48px; opacity: .9; }

/* base */
.pad .ground { display: none; }
.rocket-wrap { position: relative; height: 90%; aspect-ratio: 1060/2380; margin-bottom: clamp(18px, 4vmin, 36px); z-index: 1; }
.rocket-wrap img.rocket { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; max-height: none; }
.scaffold { position: absolute; left: -12%; right: -12%; height: 4px; background: repeating-linear-gradient(90deg, #ffd166 0 10px, #1c1940 10px 20px); border-radius: 2px; box-shadow: 0 0 12px #ffd16688; transition: bottom .8s ease; }
.pad .astro { left: 4%; bottom: clamp(18px, 4vmin, 36px); height: 30%; }
.pad .robot { display: none; }

/* star map with painted planets */
.planet img { display: block; filter: drop-shadow(0 10px 24px #000a); transition: transform .2s; animation: float 5s ease-in-out infinite; }
.planet:nth-child(odd) img { animation-duration: 6.5s; }
.planet:active img { transform: scale(.94); }
.planet .name { display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding: 3px 12px; }
.planet .name .ar { font-size: .8em; color: var(--gold); }

/* level chrome */
.progress { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.progress i { width: 10px; height: 10px; border-radius: 50%; background: #ffffff33; } .progress i.ok { background: var(--good); } .progress i.meh { background: #ffd166; } .progress i.now { background: #fff; box-shadow: 0 0 8px #fff; }
.combo { font-weight: 800; font-size: 1.2em; color: #ffd166; text-shadow: 0 2px 0 #a8461a, 0 0 12px #f07a35; }
.bubble .visual { margin-top: 6px; display: flex; justify-content: center; }
.bubble .visual .pv div { background: #f5f4ff; } .shape { max-width: 100%; height: auto; }
.explain { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; background: #fff; color: var(--card-ink); font-weight: 800; font-size: clamp(22px, 4vmin + 8px, 44px);
  padding: .3em .9em; border-radius: 18px; box-shadow: 0 10px 30px #000a, 0 0 0 4px var(--gold); animation: fadein .25s; white-space: nowrap; }
.pv div { background: #fff; color: var(--card-ink); text-align: center; } .pv small { line-height: 1.2; }
.calc { margin: 0; font: 800 1.3em/1.3 'Baloo', monospace; text-align: right; } .big-ar { font-size: 1.8em; line-height: 1.6; }

/* order / spell */
.order-wrap { width: 100%; height: 100%; display: flex; flex-direction: column; gap: var(--gap); justify-content: center; align-items: center; }
.line { width: min(100%, 760px); min-height: 72px; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-radius: var(--r); background: #0b0a1f99; border: 2px dashed #ffffff40; align-content: center; justify-content: center; }
.line.rtl { direction: rtl; }
.bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip-btn { min-height: 60px; min-width: 64px; padding: 4px 18px; border-radius: 16px; font-weight: 800; font-size: clamp(20px, 3vmin + 8px, 34px); background: linear-gradient(#fff, #e3e5ff); color: var(--card-ink); box-shadow: 0 5px 0 #8f8ad6; }
.chip-btn.ar { line-height: 1.6; }
.chip-btn.placed { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: none; border: 3px solid var(--good); }
.chip-btn .role { font-size: .45em; line-height: 1.2; }
.chip-btn.used, .letter-tile.used { visibility: hidden; }
.hint { animation: glow 1s ease-in-out infinite; }
.spell-line { min-width: min(80%, 420px); min-height: 1.6em; font-size: clamp(40px, 8vmin, 84px); text-align: center; background: #0b0a1f99; border: 2px dashed #ffffff40; border-radius: var(--r); padding: 0 .4em; line-height: 1.5; }
.spell-line.ok { border-color: var(--good); border-style: solid; color: #c9ffd8; }
.letter-tile { width: clamp(58px, 10vmin, 86px); height: clamp(58px, 10vmin, 86px); border-radius: 16px; font-size: clamp(30px, 6vmin, 52px); line-height: 1; background: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/art/panel-arabic.webp) center/100% 100%; color: var(--card-ink); font-weight: 800; }

/* workbench */
.bench-wrap { width: 100%; height: 100%; display: flex; gap: var(--gap); align-items: center; justify-content: center; flex-wrap: wrap; }
.bench-card { background: #fffdf5; color: var(--card-ink); border-radius: 20px; padding: 10px 18px; box-shadow: 0 10px 30px #0008, inset 0 0 0 4px #f1e3c4; }
.bench { display: grid; grid-template-columns: repeat(var(--n), clamp(40px, 7vmin, 64px)); font: 800 clamp(28px, 5.5vmin, 50px)/1.25 'Baloo', sans-serif; text-align: center; }
.bc { height: 1.3em; display: grid; place-items: center; }
.bc.carry { font-size: .5em; color: #e94f4f; height: 1.4em; } .bc.op { color: #f07a35; }
.bench .bar { grid-column: 1 / -1; height: 4px; background: #1c1940; border-radius: 2px; margin: 4px 0; }
.bc.res { border-radius: 10px; margin: 2px; background: #eceafd; } .bc.res.now { background: #fff3c4; box-shadow: 0 0 0 3px var(--gold); } .bc.res.ok { color: #1b8a3c; background: #dcf8e3; }
.bench-hint { min-height: 1.3em; text-align: center; color: #e94f4f; font-weight: 800; }
.keypad { display: grid; grid-template-columns: repeat(3, clamp(54px, 9vmin, 72px)); gap: 8px; }
.key { height: clamp(54px, 9vmin, 72px); border-radius: 16px; font-weight: 800; font-size: 1.4em; color: var(--card-ink); background: linear-gradient(#fff, #d9dcff); box-shadow: 0 5px 0 #8f8ad6; }
.key:active { transform: translateY(3px); box-shadow: 0 2px 0 #8f8ad6; } .key.zero { grid-column: 2; }

/* craft */
.craft-wrap { width: 100%; height: 100%; display: flex; flex-direction: column; gap: var(--gap); align-items: center; justify-content: center; }
.craft-table { background: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/art/metal-floor.webp) center/120px; padding: 12px; border-radius: 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 10px 30px #0008; }
.craft-row { display: grid; grid-template-columns: repeat(var(--b), clamp(26px, 5vmin, 42px)); gap: 5px; padding: 6px; border-radius: 12px; background: #0005; border: 2px dashed #ffffff55; }
.craft-row i { aspect-ratio: 1; border-radius: 8px; background: #ffffff18; }
.craft-row.next { border-color: var(--gold); animation: glow 1.2s ease-in-out infinite; }
.craft-row.full { border-style: solid; border-color: var(--good); } .craft-row.full i { background: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/art/mars-crack0.webp) center/cover; animation: pop-in .25s backwards; }
@keyframes pop-in { from { transform: scale(0); } }
.craft-total { font-weight: 800; font-size: 1.4em; background: #0009; padding: 2px 16px; border-radius: 999px; }
.choices-row { display: flex; gap: 12px; } .tile.pick { width: clamp(70px, 12vmin, 104px); height: clamp(70px, 12vmin, 104px); --t: clamp(70px, 12vmin, 104px); }

/* souk */
.souk-wrap { width: 100%; height: 100%; display: grid; gap: var(--gap); grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto; align-items: center; max-width: 900px; margin: auto; }
.stall { grid-row: span 2; background: #fff8ec; color: var(--card-ink); border-radius: 20px; padding: 12px; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: 0 10px 30px #0008, inset 0 6px 0 #e94f4f; min-width: 150px; }
.stall img { height: clamp(80px, 18vmin, 160px); } .item-name { font-size: 1.4em; font-weight: 800; } .price { font-size: 1.8em; font-weight: 800; color: #e94f4f; }
.tray-box { background: #0b0a1fcc; border-radius: 18px; padding: 10px 14px; border: 2px solid #ffffff22; align-self: stretch; display: flex; flex-direction: column; gap: 6px; }
.tray { min-height: 64px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.purse { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.souk-wrap > .btn { grid-column: 1 / -1; justify-self: center; }
@media (orientation: portrait) { .souk-wrap { grid-template-columns: 1fr; grid-template-rows: none; align-content: center; } .tray { min-height: 120px; } .stall { grid-row: auto; flex-direction: row; gap: 12px; } }
.money { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; color: #3b2a10; cursor: pointer; user-select: none; box-shadow: 0 4px 0 #0005; line-height: 1; }
.money small { font-size: .55em; }
.coin { width: 54px; height: 54px; border-radius: 50%; font-size: 1.1em; background: radial-gradient(circle at 35% 30%, #fff, #c9ccd6 45%, #8e93a3); border: 3px solid #a8adbb; }
.coin.c5, .coin.c10 { background: radial-gradient(circle at 50% 50%, #ffe9a3 0 42%, #c9ccd6 43%, #8e93a3); }
.note { width: 84px; height: 48px; border-radius: 8px; font-size: 1.15em; color: #fff; text-shadow: 0 1px 0 #0006; border: 2px solid #ffffff66; background-image: linear-gradient(135deg, #ffffff22 0 20%, transparent 20% 80%, #ffffff22 80%); }
.note.n20 { background-color: #7a5ab8; } .note.n50 { background-color: #2f9e5a; } .note.n100 { background-color: #c06a2b; } .note.n200 { background-color: #2f6fb5; }

/* place value */
.place-wrap { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--gap); }
.pv-cols { display: flex; gap: clamp(8px, 2vmin, 18px); }
.pv-col { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #0b0a1fb3; border-radius: 16px; padding: 8px; min-width: 70px; border: 2px solid transparent; }
.pv-col.hint { border-color: var(--gold); } .pv-col small { color: var(--muted); font-size: .7em; }
.pv-stack { height: clamp(110px, 24vmin, 200px); width: 54px; display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; overflow: hidden; }
.pv-stack i { display: block; width: 100%; height: 9%; border-radius: 3px; background: linear-gradient(#ffb27a, #f07a35); box-shadow: inset 0 -2px 0 #a8461a; }
.pv-stack.p1 i { background: linear-gradient(#7fe7e3, #1fb3b0); box-shadow: inset 0 -2px 0 #0f6f6c; } .pv-stack.p2 i { background: linear-gradient(#ffe7a3, #e9c46a); box-shadow: inset 0 -2px 0 #9b7a2b; width: 60%; }
.pv-stack.p3 i { background: linear-gradient(#fff, #c9c6f3); width: 30%; }
.pv-value { font-size: 2em; font-weight: 800; min-width: 3em; text-align: center; background: #fff; color: var(--card-ink); border-radius: 14px; padding: 0 .4em; }

/* sort */
.sort-wrap { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--gap); }
.sort-card { font-size: clamp(40px, 8vmin, 80px); font-weight: 800; color: var(--card-ink); background: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/art/panel-wide.webp) center/100% 100%; padding: .1em 1em; min-width: 5em; text-align: center; line-height: 1.7; }
.bins { display: flex; gap: clamp(16px, 6vw, 60px); }
.bin { width: clamp(120px, 24vmin, 190px); aspect-ratio: 1.2; border-radius: 20px 20px 34px 34px; background: linear-gradient(#5a6a9a, #2b3560); border: 4px solid #8f9bc9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 8px 0 #1a2140, 0 12px 24px #0008; }
.bin-icon { font-size: clamp(40px, 9vmin, 70px); line-height: 1; font-weight: 800; } .bin .ar { font-size: 1.05em; font-weight: 800; }

/* picture */
.pic-wrap { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--gap); }
.pic-word { font-size: clamp(48px, 10vmin, 96px); font-weight: 800; color: var(--card-ink); background: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/art/panel-wide.webp) center/100% 100%; padding: 0 .8em; line-height: 1.7; }
.pic-emoji { font-size: clamp(80px, 18vmin, 150px); line-height: 1.1; filter: drop-shadow(0 8px 12px #0008); }
.pic-opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.pic-opt { font-size: clamp(44px, 9vmin, 76px); width: clamp(84px, 15vmin, 128px); height: clamp(84px, 15vmin, 128px); border-radius: 22px; background: linear-gradient(#fff, #e3e5ff); box-shadow: 0 6px 0 #8f8ad6; line-height: 1; }
.pic-opt.word { width: auto; padding: 0 .5em; font-size: clamp(30px, 6vmin, 52px); font-weight: 800; color: var(--card-ink); line-height: 1.7; }
.pic-opt.good { box-shadow: 0 0 0 5px var(--good), 0 6px 0 #1b7d3a; }

/* rover */
.rover-layout { flex: 1; min-height: 0; display: grid; gap: var(--gap); grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; grid-template-areas: "msg msg" "board ctl"; align-items: center; justify-items: center; }
.rover-layout .bubble-wrap { grid-area: msg; width: 100%; } .rover-board { grid-area: board; } .rover-controls { grid-area: ctl; display: flex; flex-direction: column; gap: 10px; align-items: center; }
@media (orientation: portrait) { .rover-layout { grid-template-columns: 1fr; grid-template-areas: "msg" "board" "ctl"; } }
.rover-board { --c: min(15vmin, 96px); display: grid; grid-template-columns: repeat(5, var(--c)); grid-auto-rows: var(--c); gap: 3px; padding: 6px; border-radius: 16px; background: #0b0a1fb3; box-shadow: 0 10px 30px #0009; }
@media (orientation: portrait) { .rover-board { --c: min(16vw, 9.5vh); } .rover-pad { grid-template-columns: repeat(6, 1fr); width: min(100%, 420px); } .rover-pad .btn { grid-column: 1 / -1; min-height: 48px; } .rover-layout { overflow-y: auto; } }
.cell { position: relative; background: url(https://cdn.digitalarabians.xyz/games/astro-miner/v2/game/art/ground.webp) center/cover; border-radius: 8px; display: grid; place-items: center; }
.cell img { position: absolute; width: 86%; height: 86%; object-fit: contain; transition: transform .25s; } .cell img.goal { animation: glow 1.4s ease-in-out infinite; }
.program { display: grid; grid-template-columns: repeat(5, 40px); gap: 4px; }
.program .slot { height: 40px; border-radius: 10px; background: #ffffff14; border: 2px dashed #ffffff33; display: grid; place-items: center; font-weight: 800; font-size: 1.2em; }
.program .slot.on { background: #fff; color: var(--card-ink); border: 0; }
.rover-pad { display: grid; grid-template-columns: repeat(3, 60px); gap: 8px; justify-items: stretch; }
.rover-pad .btn { grid-column: 1 / -1; }
.rover-msg { flex: 1; }

/* quran extras */
.ayah-gap .gap { display: inline-block; min-width: 3em; border-bottom: 3px dashed var(--gold); margin: 0 .2em; }
.ayah-gap .gap.filled { border-bottom-color: var(--good); color: #c9ffd8; }

/* readability over the painted backgrounds: solid, blurred panels behind every text block */
.card, .zone, .part-row, .surah, .tray-box, .pv-col, .line, .spell-line { background: #14113ae6 !important; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-color: #ffffff2a; }
.part-row { background: #1d1950f2 !important; }
.chip, .o2, .icon-btn, .planet .name, .craft-total { background: #0b0a1fd9; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.btn.ghost { background: #14113ad9; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.muted, .part-row .pn small, .zone h3 { color: #d4d0ff; }
.hud-title, .hud-title small { text-shadow: 0 2px 6px #000; }
input.name { background: #0b0a1fd9; }
.cost span { background: #0b0a1fb3; padding: 1px 6px 1px 3px; border-radius: 999px; }

/* sound control: pause / resume / stop whatever is playing */
#audiobar { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--safe-b) + 10px); transform: translateX(-50%); display: flex; gap: 8px; padding: 6px; border-radius: 999px;
  background: #0b0a1fe6; border: 2px solid var(--gold); box-shadow: 0 8px 24px #000a; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fadein .2s; }
#audiobar[hidden] { display: none; }
#audiobar .icon-btn { width: 50px; height: 50px; font-size: 22px; background: #ffffff1f; }

/* the rocket: one layer per part, coloured when built, grey when missing; the next part to build pulses */
.rocket.ghost { filter: grayscale(1) brightness(.42); opacity: .92; }
.rocket.layer.built { filter: drop-shadow(0 0 1px #0006); }
.rocket.layer.ghost { opacity: 1; filter: grayscale(1) brightness(.42); }
.rocket.layer.next { animation: next-part 1.6s ease-in-out infinite; }
@keyframes next-part { 50% { filter: grayscale(1) brightness(.95) drop-shadow(0 0 10px #ffd166); } }
.rocket.layer.new { animation: part-in 1.1s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes part-in { 0% { opacity: 0; transform: scale(1.25) translateY(-6%); filter: brightness(3) drop-shadow(0 0 24px #fff); } 60% { opacity: 1; filter: brightness(1.6) drop-shadow(0 0 18px #ffd166); } 100% { transform: none; filter: none; } }
.scaffold { display: none; }

/* confetti, danger button, launch */
.confetti { position: fixed; top: 0; z-index: 90; pointer-events: none; border-radius: 2px; }
.btn.danger { background: linear-gradient(#ff9a8a, #e94f4f); color: #fff; box-shadow: 0 5px 0 #9b2a2a, 0 8px 18px #0006; }
.btn.launch { background: linear-gradient(#ffe7a3, #f2a62c); box-shadow: 0 5px 0 #a8461a, 0 0 24px #ffd166; animation: launch-pulse 1.4s ease-in-out infinite; }
@keyframes launch-pulse { 50% { transform: scale(1.04); box-shadow: 0 5px 0 #a8461a, 0 0 44px #ffd166; } }
.launch-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.launch-stage .skip { position: absolute; right: 8px; top: 8px; z-index: 6; }
.launch-rocket { position: absolute; left: 50%; bottom: 6%; height: 62%; transform: translateX(-50%); z-index: 3; }
.launch-rocket img { height: 100%; display: block; filter: drop-shadow(0 12px 20px #000a); }
.launch-rocket.shake { animation: rshake .09s linear infinite; }
@keyframes rshake { 50% { transform: translateX(calc(-50% + 3px)); } }
.launch-rocket.lift { animation: lift 2.2s cubic-bezier(.55,0,.9,.4) forwards; }
@keyframes lift { to { transform: translate(-50%, -130vh); } }
.launch-rocket.cruise { bottom: 30%; height: 34%; animation: cruise .12s linear infinite; }
@keyframes cruise { 50% { transform: translate(calc(-50% + 2px), -2px); } }
.launch-rocket.arrive { bottom: 8%; height: 40%; animation: arrive 1.8s cubic-bezier(.2,.8,.3,1) both; }
@keyframes arrive { from { transform: translate(-50%, -90vh); } to { transform: translate(-50%, 0); } }
.launch-rocket.landed { bottom: 8%; height: 40%; left: 22%; transition: left .8s ease; }
.flame { position: absolute; left: 50%; top: 92%; width: 34%; height: 40%; transform: translateX(-50%); opacity: 0; border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%;
  background: radial-gradient(ellipse at 50% 20%, #fff 0 15%, #ffe066 30%, #ff8a1f 55%, transparent 72%); filter: blur(1px); z-index: -1; }
.flame.on { opacity: 1; animation: flicker .08s linear infinite alternate; }
@keyframes flicker { to { transform: translateX(-50%) scaleY(1.15) scaleX(.92); } }
.smoke { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; opacity: 0; transition: opacity .6s; z-index: 2;
  background: radial-gradient(circle at 35% 90%, #ffffffcc 0 12%, transparent 30%), radial-gradient(circle at 65% 92%, #ffffffbb 0 14%, transparent 32%), radial-gradient(circle at 50% 100%, #ddddffcc 0 20%, transparent 45%); }
.smoke.on { opacity: 1; animation: puff 1.2s ease-in-out infinite alternate; }
@keyframes puff { to { transform: scale(1.15) translateY(-4%); } }
.countdown { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); z-index: 5; font-size: clamp(90px, 22vmin, 220px); font-weight: 800; color: #fff; text-shadow: 0 6px 0 #f07a35, 0 0 40px #ffd166; }
.countdown.pop { animation: cpop .9s ease-out; }
@keyframes cpop { from { transform: translateX(-50%) scale(2.2); opacity: 0; } 30% { opacity: 1; } to { transform: translateX(-50%) scale(1); } }
.warp { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .5s; }
.warp.on { opacity: 1; }
.warp i { position: absolute; top: -20%; width: 2px; height: 22%; background: linear-gradient(transparent, #fff); border-radius: 2px; animation: streak linear infinite; }
@keyframes streak { to { transform: translateY(140vh); } }
.fireworks { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.launch-cuby { position: absolute; right: 6%; bottom: 6%; height: 34%; z-index: 4; transition: transform .6s, opacity .6s; filter: drop-shadow(0 8px 14px #0009); }
.launch-cuby.out { transform: translateX(140%); opacity: 0; } .launch-cuby.in { transform: none; opacity: 1; }
.certificate { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; width: min(92%, 540px); padding: 18px 20px 16px; border-radius: 22px; text-align: center; color: #3b2a10;
  background: #fffaf0; border: 8px solid transparent; border-image: var(--zellij) 30 / 8px round; box-shadow: 0 20px 60px #000c; animation: cert-in .7s cubic-bezier(.2,1.4,.4,1); display: flex; flex-direction: column; gap: 6px; align-items: center; }
@keyframes cert-in { from { transform: translate(-50%, -50%) scale(.6) rotate(-4deg); opacity: 0; } }
.cert-top { font-weight: 800; letter-spacing: 1px; color: #b5651d; display: flex; flex-direction: column; } .cert-top .ar { font-size: 1.1em; }
.cert-name { font-size: clamp(30px, 7vmin, 52px); font-weight: 800; line-height: 1.1; color: #1c1940; }
.cert-sub { font-size: .85em; color: #6b5a3a; }
.cert-stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; font-weight: 800; font-size: 1.15em; }
.cert-stats span { background: #f3e7cc; border-radius: 12px; padding: 4px 10px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; } .cert-stats small { font-size: .55em; font-weight: 600; color: #6b5a3a; }
.cert-astro { height: clamp(70px, 14vmin, 120px); margin-top: -4px; }

/* the hidden attribute always wins over display rules (install button, craft choices, …) */
[hidden] { display: none !important; }
