@font-face { font-family: 'Lilita One'; src: url('../fonts/LilitaOne-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('../fonts/Nunito-Variable.ttf') format('truetype'); font-weight: 200 1000; font-display: swap; }

:root {
  --night: #1B0F33; --panel: #26154A; --panel-2: #3D1F70; --line: #5B2E9E; --line-2: #8B5CD6;
  --deep: #2A1452; --orange: #F7892B; --orange-dk: #A84E12; --green: #8BEA5B; --gold: #FFC93C;
  --cream: #FFF4E0; --muted: #D9CCF0; --glass: rgba(22, 11, 44, 0.86);
  --sl: max(16px, env(safe-area-inset-left)); --sr: max(16px, env(safe-area-inset-right));
  --st: max(12px, env(safe-area-inset-top)); --sb: max(12px, env(safe-area-inset-bottom));
  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--cream);
  font-family: 'Nunito', system-ui, sans-serif; font-weight: 800; touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
canvas#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
b { font-family: var(--display); font-weight: 400; }
.ico-gold { color: var(--gold); } .ico-green { color: var(--green); } .ico-orange { color: var(--orange); }
.orange { color: var(--orange); } .green { color: var(--green); }
.muted { color: var(--muted); font-size: 13px; }
.tiny-label { font-size: 11px; font-weight: 900; letter-spacing: 1.2px; color: var(--muted); }
.spacer { width: 44px; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; display: none; z-index: 10; }
.screen.show { display: flex; }
.screen.solid { background: var(--night); }
.screen.dim { background: rgba(14, 7, 30, 0.78); align-items: center; justify-content: center; }
#loading { align-items: center; justify-content: center; background: var(--night); z-index: 50; text-align: center; }
#loading p { color: var(--muted); }

.logo-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(40px, 9vh, 60px); line-height: 0.95;
  color: var(--orange); text-shadow: 0 4px 0 var(--line), 0 6px 0 var(--deep); letter-spacing: 0.5px; }
.logo-ribbon { display: inline-block; background: var(--line); border: 3px solid var(--line-2); border-radius: 12px; padding: 2px 14px;
  font-family: var(--display); font-size: clamp(18px, 5vh, 26px); color: var(--green); letter-spacing: 1px; margin-top: 4px; }

.btn { border: 0; border-radius: 16px; font-family: var(--display); letter-spacing: 1px; min-height: 46px; padding: 0 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .06s; }
.btn:active { transform: translateY(3px); }
.btn svg { width: 24px; height: 24px; stroke-width: 2.8; }
.btn-primary { background: var(--orange); color: var(--deep); box-shadow: 0 5px 0 var(--orange-dk); font-size: 22px; min-height: 52px; }
.btn-primary:active { box-shadow: 0 2px 0 var(--orange-dk); }
.btn-big { font-size: 30px; min-height: 58px; width: 100%; }
.btn-secondary { white-space: nowrap; padding: 0 12px; background: var(--panel-2); border: 3px solid var(--line-2); box-shadow: 0 4px 0 #24104A; font-size: 17px; }
.btn-ghost { background: transparent; color: var(--muted); font-size: 16px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.round-btn { width: 46px; height: 46px; border-radius: 23px; background: var(--glass); border: 2px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.round-btn svg { width: 20px; height: 20px; stroke-width: 2.8; }
.round-btn.big { width: 50px; height: 50px; border-radius: 25px; }
.round-btn.square { width: 52px; height: 52px; border-radius: 16px; background: var(--panel-2); border: 3px solid var(--line-2); }
.pill { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 23px; background: var(--glass); border: 2px solid var(--line); }
.pill svg { width: 20px; height: 20px; }
.best-label { font-family: var(--display); font-size: 17px; color: var(--gold); letter-spacing: .5px; }
.chip { font-size: 10px; font-weight: 900; letter-spacing: 1.5px; color: var(--deep); background: var(--gold); padding: 2px 8px; border-radius: 6px; vertical-align: middle; }

/* ---------- menu ---------- */
#menu .menu-panel { width: min(400px, 48vw); height: 100%; background: var(--glass); display: flex; flex-direction: column; justify-content: center;
  gap: 12px; padding: var(--st) 32px var(--sb) calc(var(--sl) + 16px); }
#menu .menu-panel .logo-ribbon { align-self: flex-start; }
.menu-tag { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--muted); }
.corner-tr { position: absolute; top: var(--st); right: var(--sr); display: flex; gap: 10px; }
#sound-btn.off .wave { opacity: 0; }
.racers { position: absolute; right: var(--sr); bottom: var(--sb); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.racers .tiny-label { background: var(--glass); padding: 3px 10px; border-radius: 8px; color: var(--cream); }
.racer-row { display: flex; gap: 8px; }
.racer-row img { width: clamp(48px, 15vh, 66px); height: clamp(48px, 15vh, 66px); border-radius: 50%; object-fit: cover; object-position: 50% 30%;
  border: 3px solid var(--c); background: var(--night); }

/* ---------- costume ---------- */
.costume-wrap { display: flex; gap: 16px; width: 100%; height: 100%; padding: var(--st) var(--sr) var(--sb) var(--sl); }
.costume-hero { width: min(36%, 320px); flex-shrink: 0; border-radius: 22px; background: var(--panel); border: 3px solid var(--c, var(--green));
  overflow: hidden; display: flex; flex-direction: column; }
.costume-hero img { width: 100%; flex: 1; min-height: 0; object-fit: cover; object-position: 50% 20%; display: block; }
.costume-hero-info { padding: 8px 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.c-name-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.c-name { font-family: var(--display); font-size: clamp(26px, 8vh, 36px); line-height: 1; color: var(--c); }
.c-tag { font-size: 13px; font-style: italic; color: var(--muted); }
.c-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; }
.c-stat { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pips { display: flex; gap: 3px; } .pips i { width: 16px; height: 8px; border-radius: 4px; background: var(--panel-2); }
.pips i.on { background: var(--c); }
.costume-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.screen-head { display: flex; align-items: center; justify-content: space-between; }
.screen-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(22px, 7vh, 32px); color: var(--orange); text-shadow: 0 3px 0 var(--line); text-align: center; }
.screen-title.big { font-size: clamp(30px, 10vh, 44px); text-align: left; }
.c-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.c-tile { position: relative; height: clamp(70px, 23vh, 110px); padding: 0; border-radius: 16px; overflow: hidden; background: var(--panel);
  border: 3px solid var(--panel-2); }
.c-tile img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; opacity: .55; }
.c-tile span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0; background: var(--glass); font-family: var(--display); font-size: 14px; color: var(--c); }
.c-tile[aria-checked="true"] { border-color: var(--c); } .c-tile[aria-checked="true"] img { opacity: 1; }
.c-ability { border-radius: 16px; background: var(--panel); padding: 10px 14px; display: flex; flex-direction: column; gap: 5px; }
.c-ability-name { font-family: var(--display); font-size: 19px; color: var(--gold); letter-spacing: .5px; vertical-align: middle; }
.c-desc { font-size: 14px; line-height: 1.3; } .c-perk { font-size: 13px; color: var(--green); }
.c-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- how to ---------- */
.howto-wrap { display: flex; flex-direction: column; gap: 12px; width: 100%; height: 100%; padding: var(--st) calc(var(--sr) + 16px) var(--sb) calc(var(--sl) + 16px); }
.steps { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.step { background: var(--panel); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.step-top { display: flex; align-items: center; justify-content: space-between; }
.step .num { width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: var(--deep); font-family: var(--display); font-size: 17px; display: flex; align-items: center; justify-content: center; }
.step svg { width: 34px; height: 34px; color: var(--c); stroke-width: 2; }
.step h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(16px, 5vh, 20px); line-height: 1.05; color: var(--c); }
.step p { margin: 0; font-size: 13px; line-height: 1.35; color: #E6DCF5; }
.howto-foot { display: flex; gap: 12px; align-items: center; }
.controls-strip { flex: 1; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--panel); border-radius: 14px; padding: 8px 14px; min-height: 52px; font-size: 13px; }
.controls-strip > span { display: flex; align-items: center; gap: 8px; }
.ring-ico { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--cream); }
.dot-ico { width: 22px; height: 22px; border-radius: 50%; background: var(--green); }
.kb-only { display: none; }
@media (hover: hover) and (pointer: fine) { .kb-only { display: inline; } .touch-only { display: none; } }

/* ---------- settings / pause ---------- */
.modal { width: min(600px, 92vw); display: flex; gap: 20px; background: var(--panel); border: 3px solid var(--line-2); border-radius: 26px; padding: 20px; }
.modal-main { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.modal-title { margin: 0 0 2px; font-family: var(--display); font-weight: 400; font-size: 38px; line-height: 1; color: var(--orange); text-shadow: 0 3px 0 var(--line); }
.modal-side { width: 230px; display: flex; flex-direction: column; gap: 6px; background: var(--night); border-radius: 18px; padding: 14px; }
.toggle { display: flex; align-items: center; justify-content: space-between; min-height: 44px; border: 0; background: transparent; font-size: 15px; padding: 0 2px; text-align: left; }
.toggle i { width: 46px; height: 26px; border-radius: 13px; background: var(--panel-2); position: relative; flex-shrink: 0; transition: background .15s; }
.toggle i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--cream); transition: transform .15s; }
.toggle[aria-pressed="true"] i { background: var(--green); } .toggle[aria-pressed="true"] i::after { transform: translateX(20px); }
#settings.mode-settings #resume-btn, #settings.mode-settings #restart-btn, #settings.mode-settings #quit-btn, #settings.mode-settings #pause-sub { display: none; }
#settings.mode-pause #close-settings { display: none; }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0; z-index: 5; display: none; pointer-events: none; }
.hud.show { display: block; }
.hud button { pointer-events: auto; }
.hud-bag { position: absolute; left: var(--sl); top: var(--st); display: flex; gap: 10px; align-items: center; background: var(--glass);
  border: 2px solid var(--line); border-radius: 20px; padding: 6px 14px 6px 6px; }
.hud-bag img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; border: 3px solid var(--c); }
.hud-bag-info { display: flex; flex-direction: column; gap: 4px; }
.hud-line { display: flex; align-items: center; gap: 6px; } .hud-line svg { width: 16px; height: 16px; } .hud-line b { font-size: 16px; }
.bar { width: 150px; height: 10px; border-radius: 5px; background: var(--panel-2); overflow: hidden; }
.bar > div { height: 100%; width: 0; border-radius: 5px; background: var(--orange); transition: width .15s; }
.bar.full > div { background: #ff5d5d; }
.bar.thin { width: 170px; height: 6px; } .bar.thin > div { background: var(--gold); transition: none; }
.hud-clock { position: absolute; left: 50%; top: var(--st); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--glass); border: 2px solid var(--line); border-radius: 18px; padding: 6px 16px 8px; }
.hud-clock.witching { border-color: var(--orange); }
.clock-row { display: flex; align-items: center; gap: 8px; } .clock-row svg { width: 18px; height: 18px; }
#hud-time { font-family: var(--display); font-size: 26px; line-height: 1; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.hud-right { position: absolute; right: var(--sr); top: var(--st); display: flex; gap: 10px; align-items: flex-start; }
.standings { display: flex; flex-direction: column; gap: 4px; background: var(--glass); border: 2px solid var(--line); border-radius: 16px; padding: 6px 10px; }
.stand { display: flex; align-items: center; gap: 6px; height: 20px; }
.stand .pos { width: 12px; font-family: var(--display); font-size: 13px; color: var(--muted); }
.stand img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; border: 2px solid var(--c); }
.stand b { width: 28px; text-align: right; font-size: 14px; } .stand.me b { color: var(--green); }
.toast { position: absolute; left: 50%; bottom: calc(var(--sb) + 18px); transform: translate(-50%, 8px); opacity: 0; transition: opacity .2s, transform .2s;
  background: var(--orange); color: var(--deep); border-radius: 14px; padding: 6px 14px; box-shadow: 0 4px 0 var(--orange-dk); font-size: 14px; font-weight: 900; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.gold { background: var(--gold); box-shadow: 0 4px 0 #a8801a; } .toast.info { background: #9ad7ff; box-shadow: 0 4px 0 #4a87af; }
.banner { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-family: var(--display); font-size: clamp(30px, 11vh, 54px); color: var(--orange);
  text-shadow: 0 4px 0 var(--deep); opacity: 0; transform: scale(.8); transition: opacity .25s, transform .25s; }
.banner.show { opacity: 1; transform: scale(1); } .banner small { display: block; font-size: .42em; color: var(--cream); }
.countdown { position: absolute; left: 0; right: 0; top: 34%; text-align: center; font-family: var(--display); font-size: clamp(60px, 22vh, 110px); color: var(--cream); text-shadow: 0 6px 0 var(--line); }
.knock { position: absolute; display: none; flex-direction: column; align-items: center; gap: 2px; transform: translate(-50%, -100%); }
.knock.show { display: flex; }
.knock svg { width: 60px; height: 60px; } .knock .track { fill: var(--glass); stroke: var(--panel-2); stroke-width: 6; }
.knock .fill { stroke: var(--gold); stroke-width: 6; stroke-dasharray: 0 164; transform: rotate(-90deg); transform-origin: 32px 32px; }
.knock .hand { stroke: var(--cream); stroke-width: 2.2; }
.knock span { font-size: 11px; font-weight: 900; letter-spacing: 1px; background: var(--glass); padding: 2px 8px; border-radius: 6px; }
.indicator { position: absolute; display: none; align-items: center; gap: 6px; background: var(--glass); border-radius: 14px; padding: 6px 10px; transform: translate(-50%, -50%); }
.indicator.show { display: flex; }
.indicator .arrow { width: 18px; height: 18px; stroke-width: 2.8; }
.indicator.basket { border: 2px solid var(--green); color: var(--green); } .indicator.basket b { color: var(--cream); font-size: 15px; display: block; }
.indicator.basket .tiny-label { color: var(--green); } .indicator.ghost { border: 2px solid #E8E0FF; color: #E8E0FF; } .indicator.ghost .tiny-label { color: #E8E0FF; }
.popups { position: absolute; inset: 0; overflow: hidden; }
.popup { position: absolute; font-family: var(--display); font-size: 22px; transform: translate(-50%, -50%); text-shadow: 0 2px 0 var(--deep), 0 0 6px rgba(0,0,0,.6);
  animation: floatUp 1s ease-out forwards; white-space: nowrap; }
.popup.big { font-size: 30px; }
@keyframes floatUp { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -60px; } }
.touch-zone { position: absolute; inset: 0; pointer-events: auto; z-index: 0; }
.hud-right, .ability { z-index: 2; }
.stick { position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(22, 11, 44, 0.45); border: 3px solid rgba(255, 244, 224, 0.5);
  transform: translate(-50%, -50%); left: calc(var(--sl) + 76px); bottom: auto; top: calc(100% - var(--sb) - 76px); opacity: .55; transition: opacity .15s; }
.stick.active { opacity: 1; transition: none; }
.knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 244, 224, 0.88); transform: translate(-50%, -50%);
  box-shadow: 0 3px 0 rgba(22, 11, 44, 0.5); }
.ability { position: absolute; right: calc(var(--sr) + 20px); bottom: var(--sb); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hud.lefty .ability { right: auto; left: calc(var(--sl) + 20px); }
.hud.lefty .stick:not(.active) { left: calc(100% - var(--sr) - 76px); }
.ability-btn { position: relative; width: 96px; height: 96px; border: 0; background: transparent; padding: 0; pointer-events: auto; }
.ability-ring { position: absolute; inset: 0; width: 96px; height: 96px; }
.ability-ring .track { fill: var(--deep); stroke: var(--panel-2); stroke-width: 6; }
.ability-ring .fill { stroke: var(--c, var(--green)); stroke-width: 6; stroke-dasharray: 277 277; transform: rotate(-90deg); transform-origin: 48px 48px; }
.ability-btn.ready .ability-ring .track { fill: #3a1f66; }
.ability-btn.ready { animation: readyPulse 1.4s ease-in-out infinite; }
@keyframes readyPulse { 50% { transform: scale(1.05); } }
.ability-icon { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); color: var(--c, var(--green)); }
.ability-icon svg { width: 40px; height: 40px; stroke-width: 2.2; }
.ability-cd { position: absolute; left: 0; right: 0; bottom: 13px; font-family: var(--display); font-size: 15px; }
.pill-label { background: var(--glass); padding: 2px 8px; border-radius: 6px; color: var(--cream); }
.hud.flash::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 80px rgba(255, 60, 60, 0.55); animation: fade .5s forwards; }
@keyframes fade { to { opacity: 0; } }

/* ---------- results ---------- */
.results-wrap { display: flex; gap: 16px; width: 100%; height: 100%; padding: var(--st) calc(var(--sr) + 16px) var(--sb) calc(var(--sl) + 16px); }
.results-left { width: min(34%, 290px); flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.result-card { position: relative; flex: 1; min-height: 0; border-radius: 22px; background: var(--panel); border: 3px solid var(--c); overflow: hidden; display: flex; flex-direction: column; }
.result-card img { width: 100%; flex: 1; min-height: 0; object-fit: cover; object-position: 50% 15%; display: block; }
.place { position: absolute; top: 10px; left: 10px; font-family: var(--display); font-size: 18px; color: var(--deep); background: var(--gold); padding: 3px 12px; border-radius: 10px; }
.r-haul-row { padding: 8px 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.r-haul-row > div { display: flex; flex-direction: column; } #r-haul { font-size: clamp(32px, 11vh, 46px); line-height: 1; color: var(--c); }
.newbest { font-size: 12px; font-weight: 900; letter-spacing: 1px; color: var(--deep); background: var(--green); padding: 4px 10px; border-radius: 8px; margin-bottom: 6px; }
.newbest:empty { display: none; }
.results-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-top: clamp(0px, 8vh, 50px); }
.leaderboard { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border-radius: 18px; padding: 12px 14px; }
.lb { display: flex; align-items: center; gap: 10px; height: 26px; }
.lb .pos { width: 16px; font-family: var(--display); color: var(--muted); }
.lb img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; border: 2px solid var(--c); }
.lb .nm { width: 78px; font-size: 14px; font-weight: 900; }
.lb .track { flex: 1; height: 12px; border-radius: 6px; background: var(--panel-2); } .lb .track i { display: block; height: 100%; border-radius: 6px; background: var(--c); }
.lb b { width: 30px; text-align: right; font-size: 17px; }
.r-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.r-stats > div { background: var(--panel); border-radius: 14px; padding: 8px 12px; display: flex; flex-direction: column; }
.r-stats b { font-size: 22px; color: var(--gold); }
.r-buttons { display: flex; gap: 10px; margin-top: auto; } .grow { flex: 1; }

/* ---------- orientation ---------- */
.rotate { position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--night); text-align: center; padding: 24px; }
.rotate svg { width: 72px; height: 72px; color: var(--orange); animation: tilt 1.8s ease-in-out infinite; }
.rotate p { font-family: var(--display); font-size: 24px; margin: 0; }
@keyframes tilt { 50% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) { .rotate { display: flex; } }
.noscript { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }

/* short landscape phones */
@media (max-height: 360px) {
  .bar { width: 120px; } .hud-bag img { width: 38px; height: 38px; }
  .step p { font-size: 12px; } .step { padding: 10px; }
}

/* ---------- daily street + challenge ---------- */
.daily { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.daily b { color: var(--gold); font-size: 16px; } .daily .sep { opacity: .6; }
.challenge { background: var(--panel-2); border: 2px solid var(--gold); border-radius: 14px; padding: 8px 12px; font-size: 13px; line-height: 1.35; }
.challenge b { color: var(--gold); font-size: 18px; } .challenge small { display: block; color: var(--muted); font-size: 12px; }
.r-challenge { background: var(--panel); border: 2px solid var(--gold); border-radius: 14px; padding: 8px 14px; font-size: 14px; }
.r-challenge.won { border-color: var(--green); } .r-challenge b { font-size: 18px; color: var(--gold); } .r-challenge.won b { color: var(--green); }
.share-btn svg { width: 20px; height: 20px; }

/* ---------- moon arc in the clock ---------- */
.moon-arc { width: 180px; height: 26px; overflow: visible; }
.moon-arc .arc { stroke: var(--panel-2); stroke-width: 3; stroke-dasharray: 2 6; }
.moon-arc .arc-done { stroke: var(--gold); stroke-width: 3; stroke-dasharray: 0 400; opacity: .7; }
.moon-dot { fill: #ffe9b0; stroke: none; filter: drop-shadow(0 0 4px rgba(255, 220, 140, .9)); transition: fill .6s; }
.hud-clock.witching .moon-dot { fill: #ff6b4a; filter: drop-shadow(0 0 6px rgba(255, 90, 60, .95)); }
.hud-clock.witching .arc-done { stroke: #ff6b4a; }

/* ---------- power-up + streak chips ---------- */
.hud-chips { position: absolute; left: var(--sl); top: calc(var(--st) + 82px); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pu-chip { display: none; flex-direction: column; gap: 4px; background: var(--glass); border: 2px solid var(--pc, var(--green)); border-radius: 12px; padding: 5px 10px; }
.pu-chip.show { display: flex; }
.pu-chip span { font-family: var(--display); font-size: 14px; color: var(--pc, var(--green)); letter-spacing: .5px; }
.pu-bar { width: 120px; height: 5px; border-radius: 3px; background: var(--panel-2); overflow: hidden; } .pu-bar > div { height: 100%; background: var(--pc, var(--green)); }
.streak-chip { display: none; font-family: var(--display); font-size: 16px; color: var(--deep); background: var(--gold); border-radius: 10px; padding: 3px 10px; box-shadow: 0 3px 0 #a8801a; }
.streak-chip.show { display: block; animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(1.35); } to { transform: scale(1); } }
.toast.power { background: var(--green); box-shadow: 0 4px 0 #4e8f2e; }

/* ---------- jump scare ---------- */
.scare { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: clamp(90px, 38vh, 200px);
  color: #e8e0ff; text-shadow: 0 8px 0 #5b2e9e, 0 0 40px rgba(185, 138, 245, .9); background: radial-gradient(circle, rgba(91, 46, 158, .55), rgba(14, 7, 30, .85));
  opacity: 0; pointer-events: none; }
.scare.show { animation: boo .9s ease-out forwards; }
@keyframes boo { 0% { opacity: 0; transform: scale(.4); } 12% { opacity: 1; transform: scale(1.15); } 30% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05); } }
@media (max-height: 360px) { .hud-chips { top: calc(var(--st) + 72px); } }

/* keep the menu inside a short landscape phone when the challenge banner is showing */
#menu .menu-panel { overflow-y: auto; gap: 10px; }
#menu .menu-panel:has(.challenge:not([hidden])) .menu-tag { display: none; }
@media (max-height: 430px) {
  #menu .logo-title { font-size: clamp(34px, 10vh, 46px); }
  #menu .logo-ribbon { font-size: 18px; padding: 0 12px; margin-top: 2px; }
  #menu .btn-big { min-height: 52px; font-size: 26px; }
  #menu .btn-secondary { min-height: 42px; }
  .menu-tag { font-size: 13px; }
}
