/* Sky Raiders - UI styles. The HUD is laid over the playfield column (CSS vars --fx --fy --fw --fh are set by ui.onResize); --u scales type with the field width.
   Sections: base, HUD, banner + hint, touch buttons, stars, menu, mission map, hangar, cards (clear / fail / help / settings / finale), responsive */
:root { --sat: env(safe-area-inset-top, 0px); --sar: env(safe-area-inset-right, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --gold: #FFD23F; --heart: #FF4A6E; }
html, body { margin: 0; height: 100%; height: 100dvh; overflow: hidden; background: #0b3a5c; overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
body { font-family: var(--font-b); color: var(--paper); }
button { font-family: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#app, .sr { position: fixed; inset: 0; width: 100%; height: 100dvh; overflow: hidden; background: #0b3a5c; --fx: 0px; --fy: 0px; --fw: 100vw; --fh: 100vh; --u: 1; }
body.playing .sr .ar__cv { cursor: none; }
.btn { gap: .5em; white-space: nowrap; min-height: 2.6em; font-size: 1rem; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn--ghost { --bg: rgba(255, 255, 255, .1); --sh: rgba(0, 0, 0, .35); }
.btn--big { font-size: 1.35rem; }
.btn.warn { --bg: var(--orange); --sh: #A02A08; }
.top-l { display: flex; gap: .5rem; }
.ar__tools { margin-left: auto; }
.ar__tool.is-hidden { display: none; }
.ar__tool { text-decoration: none; color: #fff; }
.ar__tool svg { width: 20px; height: 20px; }
.ar__top { z-index: 45; }

/* ---------- HUD ---------- */
.hud { position: absolute; left: var(--fx); top: var(--fy); width: var(--fw); height: var(--fh); z-index: 12; pointer-events: none; font-size: calc(14px * var(--u)); }
.hud[hidden] { display: none; }
.hud-prog { position: absolute; left: 12px; right: 12px; top: calc(8px + var(--sat)); height: 5px; border-radius: 9px; background: rgba(15, 12, 34, .5); box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }
.hud-prog i { display: block; height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, var(--accent), #fff); box-shadow: 0 0 8px var(--accent); }
.hud-prog u { position: absolute; top: -3px; width: 3px; height: 11px; border-radius: 2px; background: #FFD23F; }
.hud-prog u.end { right: -1px; background: #FF5B2E; height: 13px; top: -4px; }
.hud-prog u[hidden] { display: none; }
.hud-prog span { position: absolute; left: 0; top: 12px; font-size: .72em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .8); text-shadow: 0 1px 3px rgba(0, 0, 0, .7); white-space: nowrap; }
.hud-top { position: absolute; left: 0; right: 0; top: calc(34px + var(--sat)); padding: 0 12px; display: flex; justify-content: space-between; align-items: flex-start; }
.hud-l { display: flex; flex-direction: column; gap: 5px; }
.hud-hp { display: flex; gap: 1px; padding: 4px 8px; border-radius: 12px; background: rgba(15, 12, 34, .55); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; align-self: flex-start; }
.hud-hp i { width: 1.45em; height: 1.45em; display: block; }
.hud-hp svg { width: 100%; height: 100%; stroke: rgba(15, 12, 34, .9); stroke-width: 1.8; }
.hud-hp i.on svg { fill: var(--heart); filter: drop-shadow(0 0 3px rgba(255, 74, 110, .6)); }
.hud-hp i.off svg { fill: rgba(255, 255, 255, .13); }
.hud-hp.hit { animation: hudhit .5s; }
@keyframes hudhit { 20% { transform: translateX(-5px) scale(1.1); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 100% { transform: none; } }
.hud-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hud-bombs { display: inline-flex; gap: 2px; padding: 3px 6px; border-radius: 10px; background: rgba(15, 12, 34, .55); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; }
.hud-bombs i { width: 1.25em; height: 1.25em; display: block; color: #FFD23F; }
.hud-bombs svg { width: 100%; height: 100%; stroke-width: 2; }
.hud-bombs i.off { opacity: .25; }
.hud-bombs i.on svg { fill: rgba(255, 91, 46, .55); filter: drop-shadow(0 0 3px rgba(255, 91, 46, .7)); }
.hud-gun { display: inline-flex; align-items: center; gap: 3px; padding: 4px 8px; border-radius: 10px; background: rgba(15, 12, 34, .55); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; font-size: .72em; font-weight: 800; letter-spacing: .06em; color: var(--mute); }
.hud-gun b { font-weight: 800; margin-right: 2px; }
.hud-gun i { width: .55em; height: 1.05em; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.hud-gun i.on { background: linear-gradient(#fff, var(--accent)); box-shadow: 0 0 6px var(--accent); }
.hud-gun em { font-style: normal; margin-left: 4px; padding: 1px 6px; border-radius: 6px; color: #0F0C22; background: #7fe7ff; }
.hud-gun em.w { background: #2FD6FF; } .hud-gun em.s { background: #B38CFF; }
.hud-c { position: absolute; right: calc(62px + var(--sar)); top: 0; text-align: right; line-height: 1; }
.hud-score { font-family: var(--font-d); font-size: 1.65em; text-shadow: 0 3px 0 rgba(0, 0, 0, .45), 0 0 14px rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums; }
.hud-mult { margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; }
.hud-mult[hidden] { display: none; }
.hud-mult b { font-family: var(--font-d); font-weight: 400; font-size: 1.2em; color: #FFD23F; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.hud-mult i { display: block; width: 3.4em; height: 5px; border-radius: 4px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.hud-mult u { display: block; height: 100%; background: #FFD23F; text-decoration: none; }
.hud-mult.pop b { animation: multpop .3s; }
@keyframes multpop { 30% { transform: scale(1.5); } }
.hud-boss { position: absolute; left: 14px; right: 14px; top: calc(112px + var(--sat)); text-align: center; }
.hud-boss[hidden] { display: none; }
.hud-boss span { display: block; font-family: var(--font-d); font-size: 1em; letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 3px 0 rgba(0, 0, 0, .55); margin-bottom: 3px; }
.hud-boss .bar { position: relative; height: .9em; border-radius: 99px; background: rgba(15, 12, 34, .75); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25) inset; overflow: hidden; }
.hud-boss .bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #FF5B2E, #FFD23F); border-radius: 99px; transition: width .2s; box-shadow: 0 0 12px rgba(255, 91, 46, .8); }
.hud-boss .bar s { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(15, 12, 34, .9); }
.hud-boss .bar s:nth-of-type(1) { left: 33%; } .hud-boss .bar s:nth-of-type(2) { left: 66%; }
.hud-boss.inv .bar { box-shadow: 0 0 0 2px #FFE35A inset, 0 0 18px rgba(255, 226, 90, .8); }
.hud-keys { position: absolute; left: 0; right: 0; bottom: calc(10px + var(--sab)); text-align: center; font-size: .76em; font-weight: 700; color: rgba(255, 255, 255, .6); text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.hud-keys kbd { font-size: .8em; padding: .2em .5em; box-shadow: 0 2px 0 #9992c2; }
.hud-keys .dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; margin: 0 .5em; vertical-align: middle; }
body.is-touch .hud-keys { display: none; }
/* hide the secondary tools while flying on phones so the playfield stays clear */
body.playing .ar__tool#bSound, body.playing .ar__tool#bFull { display: none; }
@media (min-width: 900px) and (hover: hover) { body.playing .ar__tool#bSound, body.playing .ar__tool#bFull { display: grid; } }
body.playing .ar__top .top-l { display: none; }
body.land .ar__top { padding-top: 12px; }

/* ---------- banner + hint ---------- */
.sr-ban { position: absolute; z-index: 20; left: var(--fx); width: var(--fw); top: calc(var(--fy) + 22%); text-align: center; pointer-events: none; opacity: 0; }
.sr-ban small { display: block; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; font-size: calc(13px * var(--u)); color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.sr-ban b { display: block; font-family: var(--font-d); font-weight: 400; font-size: calc(30px * var(--u)); line-height: 1.05; color: var(--bc); text-shadow: 0 5px 0 rgba(0, 0, 0, .45), 0 0 30px rgba(0, 0, 0, .35); padding: 0 10px; }
.sr-ban.show { animation: srban 2.4s var(--ease) forwards; }
@keyframes srban { 0% { opacity: 0; transform: translateY(22px) scale(.85); } 12% { opacity: 1; transform: translateY(0) scale(1.06); } 22% { transform: scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px); } }
.sr-hint { position: absolute; z-index: 30; left: calc(var(--fx) + var(--fw) / 2); bottom: calc(110px + var(--sab)); transform: translate(-50%, 10px); width: min(calc(var(--fw) - 28px), 420px); padding: .75em 1.1em; border-radius: 16px; text-align: center; font-weight: 800; font-size: calc(14px * var(--u)); line-height: 1.3; background: rgba(15, 12, 34, .86); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .18) inset, 0 10px 30px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .35s, transform .35s; }
.sr-hint.show { opacity: 1; transform: translate(-50%, 0); }
body:not(.is-touch) .sr-hint { bottom: calc(46px + var(--sab)); }

/* ---------- touch buttons (touch devices only) ---------- */
.tc { display: none; position: absolute; inset: 0; z-index: 15; pointer-events: none; }
body.is-touch.playing .tc { display: block; }
.tc-btn { position: absolute; pointer-events: auto; touch-action: none; border: 0; padding: 0; border-radius: 50%; width: 4.6em; height: 4.6em; display: grid; place-items: center; align-content: center; gap: 0; color: #fff; font-family: var(--font-d); text-transform: uppercase; font-size: .62em; letter-spacing: .04em; font-size: calc(11px * var(--u)); background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .4), rgba(255, 255, 255, .06) 55%), rgba(15, 12, 34, .5); box-shadow: 0 0 0 3px rgba(255, 255, 255, .28) inset, 0 8px 22px rgba(0, 0, 0, .35); transition: transform .08s; }
.tc-btn svg { width: 2.5em; height: 2.5em; stroke-width: 2.4; }
.tc-btn span { margin-top: -.3em; }
.tc-btn.on { transform: scale(.92); background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .7), rgba(255, 255, 255, .2) 55%), var(--accent); }
.tc-roll { left: calc(12px + var(--sal)); bottom: calc(14px + var(--sab)); --p: 100%; }
.tc-roll::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(var(--accent) var(--p), rgba(255, 255, 255, .15) 0); -webkit-mask: radial-gradient(circle, transparent calc(50% - 3px), #000 calc(50% - 2px)); mask: radial-gradient(circle, transparent calc(50% - 3px), #000 calc(50% - 2px)); }
.tc-roll.rdy { box-shadow: 0 0 0 3px var(--accent) inset, 0 0 18px var(--accent), 0 8px 22px rgba(0, 0, 0, .35); }
.tc-mega { right: calc(12px + var(--sar)); bottom: calc(14px + var(--sab)); }
.tc-mega.empty { opacity: .45; }
.tc-mega b { position: absolute; right: -2px; top: -2px; min-width: 1.7em; height: 1.7em; border-radius: 1em; display: grid; place-items: center; background: #FFD23F; color: #0F0C22; font-weight: 400; font-size: 1.05em; box-shadow: 0 2px 0 #B68A00; }
body.land.is-touch .tc-roll { left: calc(var(--fx) + 10px); } body.land.is-touch .tc-mega { right: auto; left: calc(var(--fx) + var(--fw) - 4.6em * var(--u) - 10px - 8px); }

/* ---------- stars ---------- */
.stars { display: inline-flex; gap: .12rem; }
.star { display: block; width: 1.5rem; height: 1.5rem; }
.star svg { width: 100%; height: 100%; fill: rgba(255, 255, 255, .14); stroke: rgba(15, 12, 34, .75); stroke-width: 1.6; }
.star.on svg { fill: var(--gold); filter: drop-shadow(0 0 5px rgba(255, 210, 63, .65)); }
.stars.mini .star { width: 1.05rem; height: 1.05rem; } .stars.mini .star svg { stroke-width: 1.2; }
.bigstars { display: flex; justify-content: center; gap: .5rem; margin: .4rem 0 .3rem; }
.bigstars .star { width: 4rem; height: 4rem; opacity: 0; animation: starin .55s var(--ease) forwards; animation-delay: var(--d, .3s); }
.bigstars .star:nth-child(2) { margin-top: -.8rem; }
.bigstars .star.on svg { filter: drop-shadow(0 0 12px rgba(255, 210, 63, .85)); }
@keyframes starin { 0% { opacity: 0; transform: scale(2.4) rotate(-40deg); } 60% { opacity: 1; transform: scale(.9) rotate(6deg); } 100% { opacity: 1; transform: none; } }

/* ---------- menu ---------- */
.ar__ov--menu { background: linear-gradient(90deg, rgba(5, 25, 48, .84) 0%, rgba(5, 25, 48, .5) 40%, rgba(5, 25, 48, 0) 68%); }
.menu h1 { font-size: clamp(2.8rem, 8.6vw, 6.2rem); background: linear-gradient(180deg, #fff 30%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .35)); }
.menu h1 em { color: transparent; -webkit-text-fill-color: transparent; background: linear-gradient(180deg, #FFE98A, #FF8A2E); -webkit-background-clip: text; background-clip: text; }
.mrow2 { margin-top: .8rem; }
@media (max-width: 760px) { .ar__ov--menu { background: linear-gradient(180deg, rgba(5, 25, 48, .78) 0%, rgba(5, 25, 48, .35) 55%, rgba(5, 25, 48, .6) 100%); place-items: start center; } .menu { margin: 0 auto; } }

/* ---------- mission map + hangar ---------- */
.ar__ov--map { background: linear-gradient(180deg, rgba(6, 18, 36, .74) 0%, rgba(6, 18, 36, .5) 50%, rgba(6, 18, 36, .82) 100%); padding: calc(.7rem + var(--sat)) calc(.9rem + var(--sar)) calc(.8rem + var(--sab)) calc(.9rem + var(--sal)); place-items: start center; }
.map, .hangar { width: min(720px, 100%); animation: arpop .35s var(--ease); display: grid; gap: .55rem; align-content: start; }
.map-top { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; }
.map-title small { display: block; font-weight: 800; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--wc, var(--accent)); }
.map-title h2 { margin: 0; font-family: var(--font-d); font-weight: 400; font-size: clamp(1.4rem, 5vw, 2.3rem); line-height: 1; text-transform: uppercase; text-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.map-tot { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border-radius: 1rem; background: rgba(15, 12, 34, .6); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; }
.map-tot svg { width: 1.3rem; height: 1.3rem; fill: var(--gold); stroke: #8a6400; stroke-width: 1.4; }
.map-tot b { font-family: var(--font-d); font-weight: 400; font-size: 1.25rem; } .map-tot small { color: var(--mute); font-weight: 800; }
.map-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; }
.wtab { border: 0; padding: .4rem .2rem; border-radius: .8rem; color: #fff; background: rgba(15, 12, 34, .55); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; display: grid; justify-items: center; row-gap: .1rem; line-height: 1.05; }
.wtab b { width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%; background: var(--wc); color: #0F0C22; font-family: var(--font-d); font-weight: 400; }
.wtab b svg { width: .9rem; height: .9rem; stroke: #0F0C22; }
.wtab span { font-weight: 800; font-size: .72rem; white-space: nowrap; }
.wtab small { font-weight: 800; font-size: .62rem; color: var(--mute); }
.wtab.on { background: rgba(255, 255, 255, .16); box-shadow: 0 0 0 2px var(--wc) inset, 0 0 18px -4px var(--wc); }
.wtab.lk { opacity: .55; }
.map-tag { margin: 0; font-size: .9rem; font-weight: 600; color: #DCE9FF; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.map-list { display: grid; gap: .45rem; }
.mcard { border-radius: 1rem; background: rgba(15, 12, 34, .62); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow: hidden; animation: arpop .3s var(--ease) both; animation-delay: calc(var(--d) * 45ms); }
.mcard.sel { box-shadow: 0 0 0 2px var(--wc) inset, 0 0 20px -6px var(--wc); background: rgba(24, 20, 56, .78); }
.mcard.lk { opacity: .6; }
.mcard.isboss .mnum { background: linear-gradient(135deg, #FF8A2E, #FF3D5A); color: #fff; }
.mhead { width: 100%; border: 0; background: none; color: inherit; text-align: left; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding: .55rem .8rem; min-height: 3.2rem; }
.mnum { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--wc); color: #0F0C22; font-family: var(--font-d); font-size: 1.1rem; }
.mnum svg { width: 1rem; height: 1rem; stroke: #fff; }
.mcard.lk .mnum { background: rgba(255, 255, 255, .14); }
.mmain b { display: block; font-family: var(--font-d); font-weight: 400; font-size: 1.02rem; text-transform: uppercase; letter-spacing: .01em; line-height: 1.1; }
.tag { display: inline-block; margin-top: .15rem; font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: .1rem .5rem; border-radius: 99px; }
.tag.boss { background: #FF3D5A; color: #fff; } .tag.mid { background: #FFB43F; color: #0F0C22; }
.mdet { padding: 0 .85rem .8rem; }
.mdet p { margin: 0 0 .5rem; font-size: .9rem; font-weight: 600; color: #DCD7FF; line-height: 1.35; }
.mgoals { display: grid; gap: .25rem; margin-bottom: .6rem; }
.mgoals span, .cgoals span { display: flex; align-items: center; gap: .15rem; font-size: .78rem; font-weight: 700; color: var(--mute); }
.mgoals span svg, .cgoals span svg { width: .85rem; height: .85rem; fill: rgba(255, 255, 255, .2); stroke: none; flex: none; }
.mgoals span.ok, .cgoals span.ok { color: #fff; } .mgoals span.ok svg, .cgoals span.ok svg { fill: var(--gold); }
.mgoals span svg:last-of-type, .cgoals span svg:last-of-type { margin-right: .35rem; }
.mfoot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.mmeta { display: grid; gap: .25rem; }
.mmeta small { font-size: .74rem; font-weight: 800; color: var(--mute); } .mmeta small b { color: #fff; font-family: var(--font-d); font-weight: 400; font-size: .95rem; }
.threat { display: inline-flex; gap: 3px; } .threat i { width: .7rem; height: .5rem; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.threat i.on { background: linear-gradient(90deg, #FFD23F, #FF5B2E); }
.need { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 800; color: var(--mute); } .need svg { width: .9rem; height: .9rem; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.pcard { display: grid; justify-items: center; gap: .15rem; padding: .6rem .5rem .7rem; border-radius: 1rem; text-align: center; background: rgba(15, 12, 34, .62); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; }
.pcard.sel { box-shadow: 0 0 0 2px var(--accent) inset, 0 0 20px -6px var(--accent); }
.pcard.lk { opacity: .7; } .pcard.lk .pprev { filter: brightness(.35) saturate(.4); }
.pprev { width: 150px; height: 140px; max-width: 100%; }
.pcard b { font-family: var(--font-d); font-weight: 400; font-size: 1.05rem; text-transform: uppercase; }
.pcard small { color: #CFC9F5; font-weight: 600; font-size: .78rem; min-height: 2.2em; }
.pstats { display: grid; gap: .2rem; margin: .3rem 0 .45rem; font-size: .72rem; font-weight: 800; color: var(--mute); text-align: left; }
.pstats span { display: flex; justify-content: space-between; gap: .6rem; }
.sbar { display: inline-flex; gap: 2px; } .sbar i { width: .55rem; height: .5rem; border-radius: 2px; background: rgba(255, 255, 255, .16); } .sbar i.on { background: var(--accent); }
.pin { font-family: var(--font-d); font-size: .8rem; color: var(--lime); letter-spacing: .06em; text-transform: uppercase; }

/* ---------- cards ---------- */
.card .kick { font-weight: 800; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: .2rem; }
.card h2 em { font-style: normal; color: var(--gold); }
.card.clear, .card.fail, .card.finale { width: min(520px, 100%); }
.card .big { font-size: clamp(2.6rem, 8vw, 4rem); }
.cgoals { display: grid; gap: .2rem; margin: -.4rem auto 1rem; width: fit-content; max-width: 100%; text-align: left; }
.unlock { margin: 0 auto .8rem; width: fit-content; max-width: 100%; display: flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border-radius: 12px; background: rgba(198, 255, 61, .14); box-shadow: 0 0 0 1.5px rgba(198, 255, 61, .45) inset; font-size: .85rem; font-weight: 700; animation: arpop .5s .6s both var(--ease); }
.unlock svg { width: 1.3rem; height: 1.3rem; stroke: var(--lime); flex: none; }
.help { text-align: left; } .help h2 { text-align: center; }
.hl { margin: 0 0 .8rem; padding-left: 1.1rem; font-size: .9rem; font-weight: 600; color: #E3DFFF; line-height: 1.4; display: grid; gap: .35rem; }
.hl b { color: #fff; }
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .4rem; margin-bottom: 1rem; }
.lg { display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.lg b { display: block; font-size: .85rem; } .lg small { display: block; font-size: .72rem; color: var(--mute); font-weight: 700; line-height: 1.2; }
.cic { width: 46px; height: 54px; flex: none; }
.settings { text-align: left; } .settings h2 { text-align: center; }
.settings .row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid rgba(255, 255, 255, .08); font-weight: 800; }
.settings .row input[type=range] { width: 11rem; max-width: 55%; accent-color: var(--accent); }
.seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, .3); }
.seg button { border: 0; padding: .45rem .75rem; border-radius: 9px; background: none; color: var(--mute); font-weight: 800; font-size: .8rem; min-height: 38px; }
.seg button.on { background: var(--accent); color: #0F0C22; }
.settings .acts { margin-top: 1rem; }
.pause .acts, .settings .acts, .help .acts { display: grid; gap: .6rem; }
.pause .row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.fin { background: rgba(5, 12, 30, .25); backdrop-filter: none; -webkit-backdrop-filter: none; }
.card.finale h2 { font-size: clamp(2.2rem, 7vw, 3.6rem); }

/* ---------- responsive ---------- */
@media (max-width: 760px) { .map-tabs { gap: .25rem; } .wtab span { font-size: .62rem; } .mmain b { font-size: .92rem; } }
@media (max-height: 560px) {
  .ar__ov--map { padding-top: calc(.4rem + var(--sat)); } .map-tag { display: none; } .map-title h2 { font-size: 1.3rem; }
  .hud-top { top: calc(28px + var(--sat)); } .hud-boss { top: calc(92px + var(--sat)); }
  .card .kick { display: none; } .bigstars .star { width: 3rem; height: 3rem; }
}
@media (prefers-reduced-motion: reduce) { .sr-ban.show { animation-duration: .01s; } .mcard { animation: none; } }
@media (max-width: 899px) { .map-top { padding-right: 104px; } }

/* two-column result cards on short landscape screens (phones turned sideways) */
@media (max-height: 520px) and (min-width: 560px) {
  .card.clear, .card.fail { width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1.1fr; gap: 0 18px; align-items: center; padding: 14px 18px; }
  .card.clear .stats, .card.fail .stats { margin: 0 0 8px; } .card .big { font-size: 2.6rem; } .bigstars { margin: 0; } .bigstars .star { width: 2.7rem; height: 2.7rem; }
  .card.clear .cgoals { margin: 0 0 8px; } .card .acts { gap: 6px; } .card .btn--big { font-size: 1.1rem; }
  .card h2 { font-size: 1.7rem; margin: 0; } .card .note { margin-top: 6px; }
  .menu h1 { font-size: 2.6rem; } .menu p.tag { font-size: .85rem; margin-bottom: 10px; }
  .menu__row .btn--big { font-size: 1.1rem; padding: .6em 1.2em; }
}
@media (max-height: 520px) { .menu h1 { font-size: 2.6rem; } .menu p.tag { font-size: .85rem; margin-bottom: 10px; } .menu__row .btn--big { font-size: 1.1rem; } .menu__best { display: none; } .ar__ov--menu { padding-top: calc(58px + var(--sat)); } }
@media (max-height: 520px) and (min-width: 700px) { .ar__ov--menu { place-items: center start; } }
/* on landscape screens the two round touch buttons sit at the screen edges, under the thumbs */
body.land .tc { position: fixed; inset: 0; }
body.land.is-touch .tc-roll { left: calc(18px + var(--sal)); bottom: calc(22px + var(--sab)); }
body.land.is-touch .tc-mega { left: auto; right: calc(18px + var(--sar)); bottom: calc(22px + var(--sab)); }
.ar__ov--center { z-index: 46; }

.medalchip { display: inline-block; margin: 0 0 .1rem; padding: .2em .9em; border-radius: 99px; font-family: var(--font-d); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: #0F0C22; }
.medalchip.m1 { background: linear-gradient(#f0b27a, #b9692f); } .medalchip.m2 { background: linear-gradient(#f4f6fb, #a9b3c8); } .medalchip.m3 { background: linear-gradient(#ffe68a, #ffb62e); }

.menu__key { flex-direction: column; align-items: flex-start; gap: 6px; } .menu__key span { font-size: .8rem; }
.menu__keys { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 460px; }
.hud-keys.cd .k1 { opacity: .35; }
