:root {
  --rose: #f43f5e;
  --cyan: #05D9E8;
  --green: #39FF88;
  --yellow: #FFE14D;
  --red: #ff3b5c;
  --bg: #0b0a1a;
  --text: #eaf6ff;
  --muted: #8fa6c0;
  --font: 'Rajdhani', system-ui, sans-serif;
  --font-head: 'Space Grotesk', var(--font);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
}

#game { position: fixed; inset: 0; }
#game canvas { display: block; touch-action: none; }

.hidden { display: none !important; }

/* ── HUD ── */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 0.7rem) 1.1rem 0;
  pointer-events: none;
}
.hud-label {
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 5px; display: block;
}
.hud-left { line-height: 1; }
.hull {
  width: 40vw; max-width: 200px; height: 12px;
  border-radius: 7px; background: rgba(255,255,255,0.08);
  overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
.hull-fill {
  width: 100%; height: 100%; border-radius: 7px;
  background: var(--green);
  transition: width 0.18s ease-out, background 0.25s linear;
}
.hull-fill.crit { animation: hullpulse 0.7s ease-in-out infinite; }
@keyframes hullpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.hud-right { text-align: right; line-height: 1; }
.score {
  font-family: var(--font-head); font-weight: 700;
  font-size: 2.1rem; letter-spacing: -0.02em;
}
.score-unit { font-size: 0.42em; color: var(--muted); margin-left: 0.15em; }
.depth-sm { color: var(--muted); font-weight: 700; font-size: 0.95rem; margin-top: 2px; }

/* ── Live-Multiplikator ── */
.mult {
  position: fixed; top: 22%; left: 50%; transform: translateX(-50%);
  z-index: 4; pointer-events: none;
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(2.4rem, 13vw, 4.5rem); letter-spacing: -0.02em;
  color: var(--cyan); text-shadow: 0 0 22px rgba(5,217,232,0.55);
  transition: opacity 0.25s, color 0.25s, text-shadow 0.25s;
}
.mult.idle { opacity: 0; }
.mult.hot { color: var(--yellow); text-shadow: 0 0 34px rgba(255,225,77,0.8); }

/* ── Boost-Zone (visuelle Daumen-Hilfe) ── */
.boost {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  z-index: 3; pointer-events: none;
  width: min(78vw, 460px); height: 24vh; max-height: 220px;
  border-radius: 30px 30px 0 0;
  background: radial-gradient(120% 130% at 50% 100%, rgba(244,63,94,0.16) 0%, rgba(244,63,94,0) 70%);
  border-top: 2px solid rgba(244,63,94,0.28);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: calc(env(safe-area-inset-bottom) + 1.3rem);
}
.boost span {
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.42);
}
.boost.low {
  background: radial-gradient(120% 130% at 50% 100%, rgba(255,59,92,0.34) 0%, rgba(255,59,92,0) 70%);
  border-top-color: rgba(255,59,92,0.7);
  animation: boostlow 0.6s ease-in-out infinite;
}
.boost.low span { color: rgba(255,200,210,0.85); }
@keyframes boostlow { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }

/* ── Flash-Overlay ── */
.flash {
  position: fixed; inset: 0; z-index: 7; pointer-events: none;
  background: #fff; opacity: 0;
}

/* ── Floating-Text ── */
.fx { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
.float {
  position: absolute; display: none;
  transform: translate(-50%, -50%);
  font-family: var(--font-head); font-weight: 700; white-space: nowrap;
  font-size: 1.6rem; color: #fff; text-shadow: 0 0 12px rgba(0,0,0,0.6);
}
.float.fx-score { font-size: 2.3rem; color: var(--green); text-shadow: 0 0 16px rgba(57,255,136,0.7); }
.float.fx-score-dim { font-size: 1.7rem; color: #ffb27a; }
.float.fx-mult { font-size: 1.7rem; color: var(--yellow); text-shadow: 0 0 16px rgba(255,225,77,0.7); }
.float.fx-dmg { font-size: 1.5rem; color: var(--red); text-shadow: 0 0 14px rgba(255,59,92,0.7); }
.float.fx-fuel { font-size: 1.5rem; color: var(--cyan); text-shadow: 0 0 14px rgba(5,217,232,0.7); }
.float.fx-hull { font-size: 1.5rem; color: var(--green); text-shadow: 0 0 14px rgba(57,255,136,0.7); }
.float.announce {
  font-size: clamp(2.2rem, 12vw, 4rem); letter-spacing: -0.01em;
}
.float.a-best { color: var(--yellow); text-shadow: 0 0 28px rgba(255,225,77,0.85); }
.float.a-clutch { color: var(--cyan); text-shadow: 0 0 30px rgba(5,217,232,0.9); }
.float.a-phase { color: #fff; text-shadow: 0 0 26px rgba(244,63,94,0.8); }

/* ── Mute ── */
.mute-btn {
  position: fixed; top: calc(env(safe-area-inset-top) + 0.6rem); right: 0.7rem; z-index: 9;
  width: 2.4rem; height: 2.4rem; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: #fff; font-size: 1rem; cursor: pointer;
  display: none;
}

/* ── Screens ── */
.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: radial-gradient(120% 90% at 50% 30%, rgba(60,12,40,0.4) 0%, rgba(6,6,15,0.86) 70%);
  backdrop-filter: blur(2px);
}
.card {
  width: 100%; max-width: 360px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
}
.logo {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(2.6rem, 15vw, 4.2rem); line-height: 0.9; letter-spacing: -0.02em;
  text-shadow: 0 0 30px rgba(244,63,94,0.45);
}
.logo span {
  display: inline-grid; place-items: center; width: 0.95em; height: 0.95em;
  margin-left: 0.14em; border-radius: 0.24em; transform: rotate(6deg);
  background: linear-gradient(160deg, var(--rose), #ff8aa3); color: #1a0410;
  box-shadow: 0 0 24px rgba(244,63,94,0.6);
}
.tagline { color: var(--muted); font-size: 1.02rem; font-weight: 600; }

.daily-toggle {
  margin-top: 0.3rem; padding: 0.55rem 1.1rem; border: 1.5px solid rgba(5,217,232,0.4);
  border-radius: 999px; background: rgba(5,217,232,0.06); color: var(--muted);
  font-family: var(--font); font-weight: 700; font-size: 0.92rem; cursor: pointer;
  letter-spacing: 0.02em;
}
.daily-toggle.on {
  color: #04222a; background: var(--cyan); border-color: var(--cyan);
  box-shadow: 0 0 22px rgba(5,217,232,0.5);
}

.tap-hint {
  margin-top: 0.6rem; color: var(--text); font-weight: 700; font-size: 1.05rem;
  opacity: 0.85; animation: blink 1.3s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:0.35} 50%{opacity:0.95} }

.go-title { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; color: var(--rose); }
.go-score { font-family: var(--font-head); font-weight: 700; font-size: clamp(3.4rem, 22vw, 5rem); line-height: 1; }
.go-unit { font-size: 0.4em; color: var(--muted); margin-left: 0.08em; }
.go-sub { color: var(--muted); font-size: 1.05rem; margin-top: -0.3rem; }
.go-best { color: var(--muted); font-size: 1.05rem; }
.go-best strong { color: #fff; }
.share-btn {
  margin-top: 0.5rem; padding: 0.8rem 1.6rem; border: none; border-radius: 999px;
  background: linear-gradient(160deg, var(--rose), #ff7a93); color: #2a0612;
  font-family: var(--font); font-weight: 900; font-size: 1.05rem; cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,0.3);
}
.share-btn:active { transform: translateY(2px); box-shadow: 0 3px 0 rgba(0,0,0,0.3); }

@media (prefers-reduced-motion: reduce) {
  .tap-hint, .hull-fill.crit, .boost.low { animation: none; }
}
