/* style.css — Frutiger Aero UI: glossy glass, aqua gradients, lime accents, soft glow.
   Rule of thumb for study: every panel is `.glass` + one modifier; colors live in :root. */
:root {
  --aqua: #19c3e6; --aqua2: #7be8ff; --lime: #b8ff3f; --deep: #0b4f8a; --ink: #0a3b66; --glow: #9dffd8;
  --glass: linear-gradient(180deg, rgba(255,255,255,.62) 0%, rgba(255,255,255,.2) 48%, rgba(255,255,255,.07) 50%, rgba(160,235,255,.28) 100%);
  --edge: rgba(255,255,255,.8); --shadow: 0 10px 34px rgba(0,70,130,.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #bff3ff; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  font-family: 'Segoe UI', 'Trebuchet MS', 'Helvetica Neue', system-ui, sans-serif; color: var(--ink); }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: none; }
button, .btn, .pill, #dialwrap, #timedial, #stick, #btns { pointer-events: auto; }

.glass { background: var(--glass); border: 1px solid var(--edge); border-radius: 18px; box-shadow: inset 0 1px 0 #fff, inset 0 -8px 18px rgba(25,195,230,.18), var(--shadow);
  backdrop-filter: blur(12px) saturate(1.5); -webkit-backdrop-filter: blur(12px) saturate(1.5); }
.glow-text { text-shadow: 0 0 10px rgba(255,255,255,.9), 0 1px 0 rgba(255,255,255,.8); }

/* ---- overlays: loading + title ---- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; transition: opacity .9s ease; padding: 16px; }
.overlay.hide { opacity: 0; pointer-events: none !important; }
.overlay.hide * { pointer-events: none !important; }
#loading { background: radial-gradient(120% 90% at 50% 20%, #e8fdff 0%, #9fe7ff 45%, #3fb6ea 100%); z-index: 50; pointer-events: auto; }
#title { z-index: 40; justify-content: space-between; padding-top: 5vh; padding-bottom: 4vh; background: radial-gradient(90% 80% at 50% 30%, rgba(255,255,255,.1), rgba(10,90,160,.25) 100%); pointer-events: auto; }
.logo { font-size: clamp(30px, 8vw, 78px); font-weight: 800; letter-spacing: .06em; line-height: 1; color: #fff; text-shadow: 0 0 22px rgba(125,255,235,.95), 0 3px 0 rgba(10,100,170,.55), 0 10px 40px rgba(0,80,150,.5); margin: 0; }
.logo small { display: block; font-size: .32em; letter-spacing: .5em; margin-top: .6em; color: #eaffff; font-weight: 600; }
.tag { margin: 18px 0 26px; font-size: clamp(14px, 2.4vw, 19px); color: #fff; text-shadow: 0 1px 8px rgba(0,80,150,.6); max-width: 560px; }
.bar { width: min(380px, 80vw); height: 16px; border-radius: 99px; overflow: hidden; margin-top: 22px; }
.bar > i { display: block; height: 100%; width: 0%; background: linear-gradient(180deg, #d9ff8a, #7be83a 55%, #4fc01f); box-shadow: 0 0 14px rgba(160,255,80,.9); transition: width .2s; border-radius: 99px; }
.btn { appearance: none; border: 1px solid #fff; cursor: pointer; font: inherit; font-weight: 700; letter-spacing: .12em; color: #fff; text-shadow: 0 1px 2px rgba(0,60,100,.6);
  background: linear-gradient(180deg, #8bf0ff 0%, #20c4ea 49%, #0aa4d8 51%, #52e0ff 100%); border-radius: 99px; padding: 15px 44px; font-size: 18px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.9), inset 0 -6px 14px rgba(0,100,170,.35), 0 8px 26px rgba(0,120,190,.5), 0 0 24px rgba(125,255,235,.6); transition: transform .12s, filter .12s; }
.btn:hover { transform: translateY(-1px) scale(1.03); filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(.98); }
.pills { display: flex; gap: 8px; margin: 0 0 18px; flex-wrap: wrap; justify-content: center; }
.pill { cursor: pointer; border: 1px solid rgba(255,255,255,.9); background: rgba(255,255,255,.28); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .08em; padding: 7px 16px; border-radius: 99px; text-shadow: 0 1px 2px rgba(0,60,100,.5); backdrop-filter: blur(6px); }
.pill.on { background: linear-gradient(180deg, #e6ff9a, #9be83a); color: #1b4a05; text-shadow: none; box-shadow: 0 0 14px rgba(180,255,70,.8); }
.help { margin-top: 22px; padding: 14px 20px; max-width: 620px; font-size: 13px; line-height: 1.7; color: var(--ink); text-align: left; }
.help b { display: inline-block; min-width: 54px; color: #086a9e; }
.help .t { display: none; }
.touch .help .k { display: none; } .touch .help .t { display: block; }
.fine { margin-top: 14px; font-size: 12px; color: #eaffff; opacity: .9; text-shadow: 0 1px 4px rgba(0,60,100,.7); }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0; transition: opacity .5s; }
.h-off #hud, .h-off #touch { opacity: 0; pointer-events: none !important; }
.h-sub #hud > :not(#subs) { opacity: 0; }
#vignette { position: fixed; inset: 0; background: radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(255,255,255,.12) 78%, rgba(120,225,255,.28) 100%); mix-blend-mode: screen; pointer-events: none; }
#objective { position: absolute; left: 16px; top: 14px; padding: 10px 16px; max-width: min(340px, 56vw); font-weight: 700; font-size: 14px; }
#objective small { display: block; font-weight: 600; opacity: .75; letter-spacing: .08em; font-size: 11px; }
#objective .dots { display: flex; gap: 6px; margin-top: 7px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: rgba(10,80,140,.25); border: 1px solid #fff; box-shadow: inset 0 1px 2px rgba(0,0,0,.2); transition: all .6s; }
.dot.on { background: radial-gradient(circle at 35% 30%, #fff, var(--c, #9dffd8) 55%); box-shadow: 0 0 12px var(--c, #9dffd8); }
#compass { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: min(420px, 52vw); height: 38px; border-radius: 99px; overflow: hidden; }
#compass .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.55); }
#compass .mk { position: absolute; top: 4px; transform: translateX(-50%); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4);
  background: radial-gradient(circle at 35% 30%, #fff 0%, var(--c) 60%); box-shadow: 0 0 10px var(--c); border: 1px solid #fff; }
#compass .mk i { position: absolute; bottom: -1px; font-style: normal; font-size: 8px; opacity: .85; color: var(--ink); text-shadow: none; display: none; }
#compass .mk.edge { opacity: .8; }
#toasts { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { padding: 10px 16px; font-weight: 700; font-size: 14px; max-width: 300px; animation: tin .5s cubic-bezier(.2,1.4,.4,1), tout .7s ease 4.6s forwards; border-left: 5px solid var(--c, var(--aqua)); }
.toast small { display: block; font-weight: 600; font-size: 11px; opacity: .7; letter-spacing: .1em; }
@keyframes tin { from { transform: translateX(40px) scale(.9); opacity: 0; } }
@keyframes tout { to { opacity: 0; transform: translateY(-8px); } }
#hint { position: absolute; left: 50%; bottom: 34%; transform: translateX(-50%); padding: 10px 22px; font-weight: 700; font-size: 15px; text-align: center; opacity: 0; transition: opacity .6s; max-width: 86vw; }
#hint.on { opacity: 1; }
#subs { position: absolute; left: 50%; bottom: 190px; transform: translateX(-50%); width: min(720px, 92vw); padding: 14px 22px 16px; opacity: 0; transition: opacity .35s; }
#subs.on { opacity: 1; }
#subs .who { display: inline-block; font-weight: 800; font-size: 12px; letter-spacing: .14em; padding: 3px 12px; border-radius: 99px; color: #fff; background: var(--c, var(--aqua)); text-shadow: 0 1px 2px rgba(0,0,0,.35); box-shadow: 0 0 12px var(--c); margin-bottom: 7px; }
#subs .txt { font-size: clamp(15px, 2.4vw, 19px); line-height: 1.5; font-weight: 600; min-height: 3em; }
#subs .nx { position: absolute; right: 16px; bottom: 8px; font-size: 11px; opacity: .6; letter-spacing: .1em; }

/* dial widget */
#dialwrap { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: 158px; height: 158px; border-radius: 50%; opacity: 0; transform-origin: 50% 100%; transition: opacity 1s, transform 1s; cursor: grab; touch-action: none; }
#dialwrap.on { opacity: 1; }
#dialwrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
#timedial { position: absolute; left: calc(50% + 100px); bottom: 12px; width: 70px; height: 70px; border-radius: 50%; opacity: 0; transition: opacity 1s; cursor: grab; touch-action: none; }
#timedial.on { opacity: 1; }
#timedial svg { width: 100%; height: 100%; display: block; }
#dialinfo { position: absolute; left: 50%; bottom: 168px; transform: translateX(-50%); text-align: center; font-weight: 800; letter-spacing: .16em; font-size: 12px; color: #fff; text-shadow: 0 0 10px var(--glow), 0 1px 3px rgba(0,60,100,.7); opacity: 0; transition: opacity .8s; white-space: nowrap; }
#dialinfo.on { opacity: 1; }
#dialinfo small { display: block; letter-spacing: .06em; font-weight: 600; font-size: 12px; opacity: .95; }

/* touch controls */
#touch { position: fixed; inset: 0; display: none; }
.touch #touch { display: block; }
#stick { position: absolute; left: 22px; bottom: 28px; width: 132px; height: 132px; border-radius: 50%; touch-action: none; }
#stick i { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #fff, #7be8ff 55%, #19b0d8); box-shadow: 0 6px 16px rgba(0,100,160,.45), inset 0 -4px 8px rgba(0,100,170,.3); }
#btns { position: absolute; right: 18px; bottom: 26px; width: 170px; height: 170px; }
#btns .b { position: absolute; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 11px; letter-spacing: .08em; color: #fff; text-shadow: 0 1px 2px rgba(0,60,100,.6); touch-action: none;
  background: linear-gradient(180deg, #8bf0ff 0%, #20c4ea 49%, #0aa4d8 51%, #52e0ff 100%); border: 1px solid #fff; box-shadow: inset 0 2px 0 rgba(255,255,255,.9), 0 6px 18px rgba(0,120,190,.5); }
#btns .b.press { filter: brightness(1.25); transform: scale(.94); }
#bJump { right: 0; bottom: 36px; } #bBoost { right: 80px; bottom: 0; background: linear-gradient(180deg, #e6ff9a, #9be83a 50%, #6cc81c 52%, #c6ff6a); color: #1b4a05; text-shadow: none; } #bBoard { right: 86px; bottom: 90px; width: 62px; height: 62px; }

/* warp + fx */
#glitch { position: fixed; inset: 0; pointer-events: none; opacity: 0; mix-blend-mode: screen;
  background: repeating-linear-gradient(0deg, rgba(120,255,235,.18) 0 2px, transparent 2px 5px), linear-gradient(90deg, rgba(255,40,120,.18), transparent 30%, transparent 70%, rgba(40,160,255,.22)); }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#finale { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; opacity: 0; pointer-events: none; transition: opacity 2s; }
#finale.on { opacity: 1; }
#finale .logo { font-size: clamp(28px, 7vw, 64px); }
#finale p { color: #fff; font-weight: 600; text-shadow: 0 1px 10px rgba(0,80,150,.8); max-width: 520px; }

/* debug */
#debug { position: fixed; left: 8px; top: 8px; z-index: 60; width: 250px; padding: 10px 12px; font: 11px/1.5 ui-monospace, Menlo, monospace; color: #063; background: rgba(255,255,255,.78); border: 1px solid #fff; border-radius: 10px; pointer-events: auto; max-height: 94vh; overflow: auto; }
#debug b { color: #086a9e; } #debug input[type=range] { width: 100%; } #debug button { font: inherit; margin: 2px 2px 0 0; cursor: pointer; }
#debug pre { margin: 4px 0; white-space: pre-wrap; }
@media (max-width: 640px) { #dialwrap { width: 150px; height: 150px; bottom: 6px; } #timedial { left: calc(50% + 88px); width: 70px; height: 70px; } #dialinfo { bottom: 160px; font-size: 10px; } #subs { bottom: 150px; } .touch #dialwrap { bottom: 140px; } .touch #timedial { bottom: 144px; } .touch #dialinfo { bottom: 292px; } .touch #subs { bottom: 300px; } }

#title .tt, #title .tb { display: flex; flex-direction: column; align-items: center; }
#title .tag { margin: 10px 0 0; }
#title .help { margin-top: 14px; }
body.titling #hud { opacity: 0; }
@media (max-height: 560px) { #title .help { display: none; } #title .tag { display: none; } .logo { font-size: clamp(26px, 7vh, 56px); } }
