/* ═══════════════════════════════════════════════════════════
   LEAP CHARGE – Style Sheet
   Theme: Leapmotor CI × Tischtennis × E-Mobility
   CI: Schwarz/Weiß + Grün-Akzent | Montserrat lokal
   Mobile-first, single-page prototype
═══════════════════════════════════════════════════════════ */

/* ── Local Fonts ────────────────────────────────────────── */
@font-face {
  font-family: 'Montserrat';
  src: url('../assets/brand/Montserrat-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../assets/brand/Montserrat-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../assets/brand/Montserrat-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../assets/brand/Montserrat-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

/* ── Variables ─────────────────────────────────────────── */
:root {
  /* Leapmotor CI Farben */
  --leap-black:      #000000;
  --leap-ink:        #0A0A0A;
  --leap-white:      #FFFFFF;
  --leap-green:      #67C23A;
  --leap-green-dark: #529B2E;
  --leap-green-deep: #0F500F;
  --leap-green-soft: #95D475;
  --leap-grey:       #B3B3B3;
  --leap-grey-dark:  #303133;

  /* Funktionale Farben */
  --error:           #FF4D51;

  /* Legacy aliases für JS-Kompatibilität (CSS-Vars in app.js) */
  --orange:         var(--leap-green);
  --orange-light:   var(--leap-green-soft);
  --orange-glow:    rgba(103,194,58,0.35);
  --blue:           var(--leap-grey);
  --blue-glow:      rgba(179,179,179,0.25);
  --green:          var(--leap-green);
  --green-glow:     rgba(103,194,58,0.4);
  --dark:           var(--leap-black);
  --dark-mid:       #111111;
  --dark-card:      rgba(255,255,255,0.05);
  --dark-border:    rgba(255,255,255,0.10);
  --white:          var(--leap-white);
  --muted:          var(--leap-grey);

  /* Typography */
  --font-display: 'Montserrat', -apple-system, sans-serif;
  --font-body:    'Montserrat', -apple-system, sans-serif;

  /* Layout */
  --radius:       16px;
  --radius-sm:    10px;
  --transition:   0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  height: 100%;
  background: var(--leap-black);
  color: var(--leap-white);
  font-family: var(--font-body);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
button { border: none; background: none; cursor: pointer; font-family: inherit; }

/* ── App wrapper ────────────────────────────────────────── */
#app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════
   SCREEN SYSTEM
══════════════════════════════════════════════════════════ */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateX(60px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s var(--transition);
  overflow: hidden;
}
.screen.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}
.screen.exit-left {
  opacity: 0;
  transform: translateX(-60px);
}

/* ── Backgrounds ────────────────────────────────────────── */
.screen-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.bg-start {
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(103,194,58,0.18) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(103,194,58,0.06) 0%, transparent 60%),
    linear-gradient(160deg, #000000 0%, #0A0A0A 60%, #050505 100%);
}
.bg-rules {
  background:
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(103,194,58,0.10) 0%, transparent 60%),
    linear-gradient(150deg, #000000 0%, #0A0A0A 100%);
}
.bg-game {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(103,194,58,0.10) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(103,194,58,0.06) 0%, transparent 55%),
    linear-gradient(180deg, #000000 0%, #050505 100%);
}
.bg-end {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(103,194,58,0.14) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(103,194,58,0.06) 0%, transparent 55%),
    linear-gradient(150deg, #000000 0%, #0A1505 100%);
}

/* Scanline texture */
.scan-line {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.06) 3px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════
   SHARED COMPONENTS
══════════════════════════════════════════════════════════ */

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}
.btn:active::after { background: rgba(255,255,255,0.12); }

.btn-primary {
  background: var(--leap-green);
  color: #000;
  box-shadow: 0 4px 20px rgba(103,194,58,0.35);
}
.btn-primary:active {
  background: var(--leap-green-dark);
  transform: scale(0.97);
}
.glow-btn {
  animation: btn-pulse 2.5s ease-in-out infinite;
}
@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(103,194,58,0.35); }
  50%       { box-shadow: 0 4px 40px rgba(103,194,58,0.6), 0 0 60px rgba(103,194,58,0.2); }
}

.btn-outline {
  background: transparent;
  color: var(--leap-grey);
  border: 1px solid var(--dark-border);
  font-size: 14px;
}
.btn-outline:active { background: var(--dark-card); }

.btn-icon { font-size: 18px; }
.btn-back {
  color: var(--leap-grey);
  font-size: 14px;
  padding: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 1px;
}

/* ── Nav bar ────────────────────────────────────────────── */
.nav-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}
.nav-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--leap-grey);
  text-transform: uppercase;
}
.nav-filler { width: 48px; }

/* ══════════════════════════════════════════════════════════
   SCREEN 1 · START (Umbau 3)
══════════════════════════════════════════════════════════ */
#screen-start {
  justify-content: space-between;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* Logo groß + zentriert oben */
.start-logo-wrap {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 32px 20px 12px;
  padding-top: max(32px, env(safe-area-inset-top));
}
.start-logo-img {
  height: 96px;
  max-width: 82%;
  width: auto;
  display: block;
  filter: invert(1) brightness(2);
}

/* Legacy brand-bar hidden */
.brand-bar  { display: none; }
.brand-name { display: none; }

/* Start hero */
.start-hero {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  gap: 18px;
}

/* Title */
.game-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 10vw, 64px);
  font-weight: 900;
  text-align: center;
  line-height: 1.0;
  letter-spacing: 4px;
  text-transform: uppercase;
}
.title-leap {
  display: block;
  color: var(--leap-white);
  font-size: 0.65em;
  letter-spacing: 6px;
}
.title-rally,
.title-charge {
  display: block;
  color: var(--leap-green);
  filter: drop-shadow(0 0 20px rgba(103,194,58,0.5));
}

/* Spielziel-Zeile */
.game-goal-line {
  font-size: 14px;
  font-weight: 600;
  color: var(--leap-grey);
  text-align: center;
  line-height: 1.5;
  max-width: 300px;
}

/* 2 Gewinn-Wege: Win-Cards */
.win-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}
.win-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--dark-border);
  background: var(--dark-card);
}
.win-card-instant {
  border-color: rgba(103,194,58,0.45);
  background: rgba(103,194,58,0.07);
}
.win-card-highscore {
  border-color: rgba(255,200,0,0.30);
  background: rgba(255,200,0,0.04);
}
.win-card-icon {
  font-size: 28px;
  min-width: 36px;
  text-align: center;
  filter: drop-shadow(0 0 8px rgba(103,194,58,0.5));
}
.win-card-highscore .win-card-icon {
  filter: drop-shadow(0 0 8px rgba(255,200,0,0.5));
}
.win-card-body { flex: 1; }
.win-card-title {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--leap-green);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.win-card-highscore .win-card-title { color: #FFB800; }
.win-card-desc {
  font-size: 12px;
  color: var(--leap-grey);
  line-height: 1.4;
  font-weight: 400;
}

/* Dezenter Daten-Hinweis */
.start-data-hint {
  font-size: 11px;
  color: rgba(179,179,179,0.65);
  text-align: center;
  letter-spacing: 0.5px;
}

/* Start CTA */
.start-cta {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 24px 4px;
}
.start-cta .btn { width: 100%; max-width: 320px; font-size: 18px; padding: 20px; }
.start-cta-headline {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--leap-green);
  text-shadow: 0 0 12px rgba(103,194,58,0.6);
  text-align: center;
  margin: 0;
  animation: pulseGlow 2s ease-in-out infinite alternate;
}
@keyframes pulseGlow {
  from { text-shadow: 0 0 8px rgba(103,194,58,0.4); }
  to   { text-shadow: 0 0 18px rgba(103,194,58,0.9), 0 0 4px rgba(149,212,117,0.5); }
}
.start-hint {
  font-size: 12px;
  color: var(--leap-grey);
  text-align: center;
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════════════════
   SCREEN 2 · RULES
══════════════════════════════════════════════════════════ */
#screen-rules {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.rules-body {
  position: relative;
  z-index: 5;
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.rules-trophy {
  font-size: 48px;
  animation: trophy-glow 2s ease-in-out infinite;
  filter: drop-shadow(0 0 16px rgba(255,200,0,0.5));
}
@keyframes trophy-glow {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50%       { transform: scale(1.1) rotate(3deg); }
}
.rules-headline {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  text-align: center;
  line-height: 1.2;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.rules-challenge-name {
  font-family: var(--font-display);
  text-align: center;
  text-transform: uppercase;
  line-height: 1.05;
  margin: 4px 0 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rules-challenge-name .title-leap {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--leap-white);
}
.rules-challenge-name .title-charge {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--leap-green);
  text-shadow: 0 0 18px rgba(103,194,58,0.5);
}
.text-orange { color: var(--leap-green); }
.rules-intro {
  font-size: 14px;
  color: var(--leap-grey);
  text-align: center;
  line-height: 1.6;
}

.rules-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rule-step {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 16px;
}
.step-icon {
  font-size: 28px;
  min-width: 44px;
  text-align: center;
}
.step-content strong {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--leap-green);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.step-content p {
  font-size: 13px;
  color: var(--leap-grey);
  line-height: 1.4;
  font-weight: 400;
}

.rules-cta {
  position: relative;
  z-index: 10;
  padding: 16px 24px;
}
.rules-cta .btn { width: 100%; font-size: 16px; }

/* ══════════════════════════════════════════════════════════
   SCREEN 3 · GAMEPLAY
══════════════════════════════════════════════════════════ */
#screen-game {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

/* ── Lives HUD ───────────────────────────────────────────── */
.hud-lives-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.lives-display {
  display: flex;
  gap: 4px;
  align-items: center;
}
.life-heart {
  font-size: 18px;
  transition: transform 0.2s, opacity 0.3s;
  filter: drop-shadow(0 0 4px rgba(255,80,80,0.6));
}
.life-heart.life-empty {
  opacity: 0.3;
  filter: none;
  transform: scale(0.85);
}

/* Remove old timer ring references; keep for compatibility if needed */
.hud-timer-wrap { display: none; }

/* HUD */
.level-badge {
  position: relative;
  z-index: 11;
  align-self: center;
  margin: 40px auto 0;  /* leave room for the larger centered Leapmotor top-bar logo */
  padding: 3px 14px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #000;
  background: var(--leap-green);
  box-shadow: 0 2px 12px rgba(103,194,58,0.4);
  transition: background .3s, box-shadow .3s, transform .2s;
  text-transform: uppercase;
}
.level-badge.level-1 { background: var(--leap-green);      box-shadow: 0 2px 12px rgba(103,194,58,0.4); }
.level-badge.level-2 { background: var(--leap-green-soft); box-shadow: 0 2px 12px rgba(149,212,117,0.4); color: #000; }
.level-badge.level-3 { background: var(--leap-white);      box-shadow: 0 2px 12px rgba(255,255,255,0.3); color: #000; }
.level-badge.level-4 { background: var(--leap-green);      box-shadow: 0 2px 16px rgba(103,194,58,0.6); transform: scale(1.06); }
/* Level 5+ — orange/rot, maximaler Glow (verhindert visuelle Bugs bei langen Runden) */
.level-badge.level-5 { background: #FF8C00; color: #fff; box-shadow: 0 2px 18px rgba(255,140,0,0.7);   transform: scale(1.08); }
.level-badge.level-6 { background: #E53935; color: #fff; box-shadow: 0 2px 20px rgba(229,57,53,0.75);  transform: scale(1.10); }
.level-badge.level-7 { background: #C62828; color: #fff; box-shadow: 0 2px 22px rgba(198,40,40,0.8),  0 0 8px rgba(255,80,0,0.5); transform: scale(1.12); }
.level-badge.level-8,
.level-badge.level-9,
.level-badge.level-10 { background: linear-gradient(135deg,#E53935,#FF8C00); color:#fff; box-shadow: 0 2px 24px rgba(229,57,53,0.85), 0 0 12px rgba(255,140,0,0.5); transform: scale(1.14); animation: levelPulse 1s ease-in-out infinite alternate; }
@keyframes levelPulse {
  from { box-shadow: 0 2px 24px rgba(229,57,53,0.85), 0 0 12px rgba(255,140,0,0.5); }
  to   { box-shadow: 0 2px 32px rgba(229,57,53,1.0),  0 0 20px rgba(255,140,0,0.8); }
}

.game-hud {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-top: max(12px, env(safe-area-inset-top));
}
.hud-block {
  min-width: 70px;
}
.hud-block.right { text-align: right; }
.hud-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  color: var(--leap-white);
}
.hud-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--leap-grey);
  margin-top: 2px;
  text-transform: uppercase;
}
.combo-val {
  color: var(--leap-green);
  transition: color 0.3s, transform 0.15s;
}
.combo-val.x2 { color: var(--leap-green-soft); }
.combo-val.x3 { color: var(--leap-white); }
.combo-val.x4 { color: var(--leap-green); filter: drop-shadow(0 0 6px var(--leap-green)); }
.combo-val.x5 { color: var(--leap-green); filter: drop-shadow(0 0 10px var(--leap-green)); }

/* Timer ring – hidden (replaced by lives system) */
.hud-timer-wrap {
  display: none;
}
.timer-ring, .timer-ring-bg, .timer-ring-fill, .hud-timer { display: none; }
.timer-urgent .timer-ring-fill { stroke: var(--error); }
.timer-urgent .hud-timer { display: none; }

/* Game arena */
.game-arena {
  position: relative;
  z-index: 5;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  cursor: none;
}

/* Game floor */
.game-floor {
  position: relative;
  z-index: 5;
  padding: 0 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Car track */
.car-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: var(--dark-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--dark-border);
  overflow: hidden;
}
.car-progress {
  position: absolute;
  left: 8px;
  display: flex;
  align-items: center;
  transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}
.car-emoji {
  display: flex;
  align-items: center;
  filter: drop-shadow(0 2px 8px rgba(103,194,58,0.4));
  transition: filter 0.3s;
}
/* SVG silhouette visibility toggle */
.car-svg { display: block; }
.car-svg-boost { display: none; }
.car-emoji.boost-mode .car-svg-normal { display: none; }
.car-emoji.boost-mode .car-svg-boost  { display: block; }
.car-exhaust {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-left: 2px;
  opacity: 0;
  transition: opacity 0.3s;
}
.car-exhaust span {
  font-size: 8px;
  color: var(--leap-green);
  animation: exhaust-drift 0.4s ease-in-out infinite;
  opacity: 0.7;
}
.car-exhaust span:nth-child(2) { animation-delay: 0.1s; }
.car-exhaust span:nth-child(3) { animation-delay: 0.2s; }
.car-exhaust.active { opacity: 1; }
@keyframes exhaust-drift {
  0%, 100% { transform: translateX(0) scale(1); opacity: 0.7; }
  50%       { transform: translateX(-3px) scale(0.8); opacity: 0.3; }
}

/* Ghost car – competitor on the track */
.ghost-car {
  position: absolute;
  top: 50%;
  left: 65%;
  transform: translateY(-50%);
  opacity: 0.35;
  filter: grayscale(1) brightness(0.6);
  transition: left 0.4s ease, opacity 0.3s, transform 0.3s, filter 0.3s;
  z-index: 1;
  pointer-events: none;
}
.ghost-car.ghost-overtaken {
  opacity: 0;
  filter: grayscale(1) brightness(0.2);
  transform: translateY(-50%) scale(0.6);
  animation: ghost-shake 0.35s ease-in-out, ghost-fadeout 0.5s ease-in 0.3s forwards;
  pointer-events: none;
}
@keyframes ghost-fadeout {
  0%   { opacity: 0.10; }
  100% { opacity: 0; }
}
.ghost-car.ghost-reset {
  opacity: 0.35;
  filter: grayscale(1) brightness(0.6);
  transform: translateY(-50%);
  left: 25% !important;
}
@keyframes ghost-shake {
  0%, 100% { transform: translateY(-50%) translateX(0) scale(0.75); }
  30%       { transform: translateY(-50%) translateX(5px) scale(0.8); }
  70%       { transform: translateY(-50%) translateX(-4px) scale(0.7); }
}

/* Car-progress boost state */
.car-progress.boosting .car-emoji {
  animation: boost-pulse 0.25s ease-in-out infinite !important;
  filter: drop-shadow(0 0 10px var(--leap-green)) drop-shadow(0 0 24px rgba(103,194,58,0.6)) !important;
}
.car-progress.boosting .car-exhaust {
  opacity: 1 !important;
}
.car-progress.boosting .car-exhaust span {
  color: var(--leap-green);
  animation: boost-spark 0.12s step-end infinite;
}
@keyframes boost-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.18); }
}
@keyframes boost-spark {
  0%, 100% { opacity: 1; transform: translateX(-5px) scale(1.3); }
  50%       { opacity: 0; transform: translateX(-10px) scale(0.7); }
}

/* Car-target-hit brief bounce */
.car-progress.car-target-hit .car-emoji {
  animation: target-bounce 0.35s ease-in-out;
}
@keyframes target-bounce {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.35) rotate(12deg); }
}

.track-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  margin: 0 8px;
  border-radius: 2px;
}
.track-flag {
  font-size: 22px;
  filter: drop-shadow(0 0 6px rgba(103,194,58,0.5));
}

/* Battery section */
.battery-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.battery-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--leap-grey);
  text-transform: uppercase;
}
.battery-pct {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--leap-green);
  transition: color 0.5s;
}
.battery-pct.full { color: var(--leap-green-soft); }

.battery-track {
  position: relative;
  height: 18px;
  background: rgba(255,255,255,0.05);
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--leap-grey-dark);
}
.battery-fill {
  height: 100%;
  width: 0%;
  border-radius: 9px;
  background: linear-gradient(90deg, var(--leap-green-deep), var(--leap-green));
  transition: width 0.3s ease-out, background 0.5s;
  position: relative;
}
.battery-fill::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 8px;
  right: 8px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.3);
}
.battery-fill.full {
  background: linear-gradient(90deg, var(--leap-green), var(--leap-green-soft));
  box-shadow: 0 0 16px rgba(103,194,58,0.5);
  animation: battery-charged 0.6s ease-out;
}
@keyframes battery-charged {
  0%   { box-shadow: 0 0 50px rgba(103,194,58,0.9), 0 0 100px rgba(103,194,58,0.5); }
  100% { box-shadow: 0 0 16px rgba(103,194,58,0.4); }
}
.battery-spark-line {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 3px;
  background: rgba(255,255,255,0.9);
  border-radius: 2px;
  opacity: 0;
  transition: left 0.3s ease-out;
  filter: blur(1px);
  animation: spark-flick 0.15s step-end infinite;
}
.battery-spark-line.active { opacity: 1; }
@keyframes spark-flick {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   SOFORT-GEWINN OVERLAY (Umbau 2)
═══════════════════════════════════════════════════════════ */
.iwo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
  backdrop-filter: blur(6px);
}
.iwo-backdrop.hidden { display: none; }

.iwo-box {
  position: relative;
  background: linear-gradient(145deg, #060F06 0%, #0A1A0A 100%);
  border: 2px solid var(--leap-green);
  border-radius: var(--radius);
  padding: 28px 22px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  overflow: hidden;
  animation: iwo-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes iwo-enter {
  from { transform: scale(0.8) translateY(30px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.iwo-glow {
  position: absolute;
  inset: -30%;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(103,194,58,0.18) 0%, transparent 70%);
  pointer-events: none;
  animation: iw-pulse 1.5s ease infinite;
}
.iwo-icon {
  font-size: 52px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 20px rgba(103,194,58,0.8));
  animation: iwo-flash 0.8s ease infinite alternate;
}
@keyframes iwo-flash {
  from { filter: drop-shadow(0 0 12px rgba(103,194,58,0.6)); }
  to   { filter: drop-shadow(0 0 32px rgba(103,194,58,1.0)); }
}
.iwo-headline {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--leap-green);
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 0 24px rgba(103,194,58,0.6);
  margin-bottom: 10px;
}
.iwo-sub {
  font-size: 14px;
  color: var(--leap-white);
  margin-bottom: 10px;
  line-height: 1.5;
}
.iwo-sub strong { color: var(--leap-green); }
.iwo-warning {
  font-size: 13px;
  color: var(--leap-grey);
  margin-bottom: 20px;
  line-height: 1.5;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.iwo-warning strong { color: #FFB800; }
.iwo-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

/* Both buttons equal size — no color hierarchy */
.iwo-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font-display);
  text-align: center;
  transition: transform 0.1s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.iwo-btn:active { transform: scale(0.97); }
.iwo-btn-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.iwo-btn-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  opacity: 0.85;
  font-family: var(--font-body);
}

/* Claim now: white fill — clear, primary action */
.iwo-btn-claim {
  background: #FFFFFF;
  color: #000000;
  border-color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(255,255,255,0.25);
}
.iwo-btn-claim .iwo-btn-sub { opacity: 0.6; }

/* Keep playing: white outline — equal weight, different treatment */
.iwo-btn-play {
  background: rgba(255,255,255,0.08);
  color: #FFFFFF;
  border-color: rgba(255,255,255,0.7);
  box-shadow: 0 4px 16px rgba(255,255,255,0.08);
}

/* ── IN-GAME OPT-IN (Sofort-Gewinn form on screen-game) ───── */
.game-optin-section {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 45;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 16px max(24px, env(safe-area-inset-bottom));
}
.game-optin-section.hidden { display: none; }

.game-optin-inner {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
}
.game-optin-header {
  text-align: center;
  padding-bottom: 4px;
}
.game-optin-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 16px rgba(103,194,58,0.7));
}
.game-optin-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: var(--leap-green);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.game-optin-sub {
  font-size: 13px;
  color: var(--leap-grey);
  line-height: 1.5;
}
/* Code revealed after submit */
.game-iw-code-wrap {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(103,194,58,0.14) 0%, rgba(15,80,15,0.18) 100%);
  border: 2px solid var(--leap-green);
  border-radius: var(--radius);
  animation: iw-pulse 1.4s ease infinite;
}
.game-iw-code-wrap.hidden { display: none; }
.game-iw-continue {
  width: 100%;
  font-size: 16px;
  padding: 18px;
}
.game-iw-continue.hidden { display: none; }

/* Bonus level badge modifier */
.level-badge.bonus {
  background: linear-gradient(90deg, var(--leap-green), var(--leap-green-soft));
  animation: bonus-badge-pulse 0.7s ease-in-out infinite alternate;
}
@keyframes bonus-badge-pulse {
  from { box-shadow: 0 2px 12px rgba(103,194,58,0.4); }
  to   { box-shadow: 0 2px 24px rgba(103,194,58,0.8), 0 0 40px rgba(103,194,58,0.3); }
}

/* Boost overlay */
.boost-overlay {
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(103,194,58,0.10);
  border: 1.5px solid var(--leap-green);
  border-radius: 12px;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(103,194,58,0.25);
}
.boost-overlay.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.boost-overlay .boost-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--leap-green);
  letter-spacing: 2px;
  text-transform: uppercase;
  filter: drop-shadow(0 0 6px var(--leap-green));
}
.boost-overlay .boost-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--leap-grey);
  letter-spacing: 1px;
}

/* ══════════════════════════════════════════════════════════
   SCREEN 4 · END / LEADERBOARD
══════════════════════════════════════════════════════════ */
.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

#screen-end {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overflow-x: hidden;
}

/* ══ NEW END-SCREEN LAYOUT ══ */

.end-topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 20px 12px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(103,194,58,0.2);
}

.end-topbar .end-logo {
  height: 52px;
  width: auto;
  filter: invert(1) brightness(2);
  opacity: 0.95;
}

.end-hero {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 24px 16px;
  text-align: center;
}

.end-hero-lock {
  font-size: 48px;
  line-height: 1;
  filter: drop-shadow(0 0 14px rgba(103,194,58,0.5));
  animation: lock-pulse 2s ease-in-out infinite;
}

@keyframes lock-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 14px rgba(103,194,58,0.5)); }
  50%       { transform: scale(1.08); filter: drop-shadow(0 0 22px rgba(103,194,58,0.8)); }
}

.end-hero-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--leap-white);
  margin: 0;
}

.end-hero-sub {
  font-size: 13px;
  color: var(--leap-grey);
  line-height: 1.5;
  max-width: 320px;
  margin: 0;
}

/* CTA Card (the form wrapper) */
.end-cta-card {
  position: relative;
  z-index: 5;
  margin: 0 12px 16px;
  padding: 20px 16px;
  background: var(--dark-card);
  border: 1.5px solid rgba(103,194,58,0.4);
  border-radius: var(--radius);
  box-shadow: 0 0 24px rgba(103,194,58,0.1);
}

.end-cta-card.hidden { display: none; }

/* Big green submit button inside end-cta-card */
.end-cta-submit {
  margin-top: 12px;
  width: 100%;
  font-size: 16px;
  letter-spacing: 1.5px;
  padding: 20px 24px;
  background: var(--leap-green);
  color: #000;
  font-weight: 900;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 32px rgba(103,194,58,0.6), 0 0 0 2px rgba(103,194,58,0.3);
  transition: box-shadow 0.2s, transform 0.1s;
  animation: cta-pulse 2s ease-in-out infinite;
}
@keyframes cta-pulse {
  0%,100% { box-shadow: 0 6px 32px rgba(103,194,58,0.6), 0 0 0 2px rgba(103,194,58,0.3); }
  50%      { box-shadow: 0 6px 48px rgba(103,194,58,0.9), 0 0 0 4px rgba(103,194,58,0.5); }
}
.end-cta-submit:active { transform: scale(0.97); animation: none; }
.end-cta-submit:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; animation: none; }

/* Reveal section */
.end-reveal {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 0 8px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.end-reveal.hidden {
  display: none;
}

.end-reveal.reveal-active {
  opacity: 1;
  transform: translateY(0);
}

.result-card {
  margin: 0 12px;
}

/* ══ LEGACY end-header (keep as dead code, won't render) ══ */
.end-header {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 20px 12px;
  padding-top: max(24px, env(safe-area-inset-top));
}
/* End screen logo */
.end-logo {
  height: 52px;
  width: auto;
  filter: invert(1) brightness(2);
  opacity: 0.95;
  margin-bottom: 8px;
}

.end-trophy-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
}
.end-trophy {
  font-size: 56px;
  position: relative;
  z-index: 2;
  animation: trophy-enter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes trophy-enter {
  0%   { transform: scale(0) rotate(-20deg); }
  100% { transform: scale(1) rotate(0); }
}
.trophy-ring-outer, .trophy-ring-inner {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid;
  animation: ring-expand 1.5s ease-out forwards;
}
.trophy-ring-outer {
  inset: -8px;
  border-color: rgba(103,194,58,0.4);
  animation-delay: 0.3s;
}
.trophy-ring-inner {
  inset: 4px;
  border-color: rgba(103,194,58,0.2);
  animation-delay: 0.5s;
}
@keyframes ring-expand {
  0%   { transform: scale(0); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: scale(1); opacity: 0.6; }
}
.end-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 4px;
  text-align: center;
  text-transform: uppercase;
  color: var(--leap-white);
  filter: drop-shadow(0 0 12px rgba(103,194,58,0.4));
}
.end-sub {
  font-size: 14px;
  color: var(--leap-grey);
  text-align: center;
  font-weight: 400;
}

/* Result card */
.result-card {
  position: relative;
  z-index: 5;
  margin: 0 16px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--dark-border);
}
.result-row:last-child { border-bottom: none; }
.result-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--leap-grey);
  letter-spacing: 0.5px;
}
.result-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--leap-white);
}
.result-val.accent { color: var(--leap-green); }
.big-row {
  background: rgba(103,194,58,0.06);
  border-top: 1px solid rgba(103,194,58,0.2);
}
.big-row .result-label {
  color: var(--leap-white);
  font-weight: 700;
  font-size: 14px;
}
.score-big {
  font-size: 28px;
  color: var(--leap-green);
}

/* Leaderboard */
.leaderboard {
  position: relative;
  z-index: 5;
  margin: 12px 16px 0;
}
.lb-heading {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--leap-grey);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.lb-entries {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lb-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.3s;
}
.lb-entry.you {
  border-color: var(--leap-green);
  background: rgba(103,194,58,0.08);
}
.lb-rank {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  min-width: 28px;
  color: var(--leap-grey);
}
.lb-rank.top1 { color: #FFD700; }
.lb-rank.top2 { color: #C0C0C0; }
.lb-rank.top3 { color: #CD7F32; }
.lb-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
}
.lb-name .you-badge {
  display: inline-block;
  background: var(--leap-green);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 1px;
  margin-left: 6px;
  vertical-align: middle;
}
.lb-score {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--leap-white);
}
.lb-energy {
  font-size: 11px;
  color: var(--leap-grey);
  min-width: 36px;
  text-align: right;
}

/* End CTA */
.end-cta {
  position: relative;
  z-index: 5;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.end-cta .btn-primary { width: 100%; }
.end-cta .btn-outline  { width: 100%; font-size: 14px; }

.btn-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--dark-card);
  color: var(--leap-grey);
  border: 1px solid var(--dark-border);
  transition: var(--transition);
}
.btn-home:active {
  background: rgba(255,255,255,0.09);
  color: var(--leap-white);
}

/* ══════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  backdrop-filter: blur(8px);
  transition: opacity 0.25s;
}
.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.modal-box {
  background: #111111;
  border: 1px solid var(--leap-grey-dark);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-in {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.modal-icon { font-size: 40px; }
.modal-box h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.share-text-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--leap-grey-dark);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--leap-grey);
  line-height: 1.6;
  text-align: center;
  width: 100%;
  white-space: pre-line;
}
.modal-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}
.modal-actions .btn { flex: 1; font-size: 14px; padding: 14px; }

/* Countdown */
/* ══════════════════════════════════════════════════════
   COUNTDOWN — MK64-style race-start
══════════════════════════════════════════════════════ */
.countdown-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px 48px 24px;
}
.countdown-number {
  font-family: var(--font-display);
  font-size: 112px;
  font-weight: 900;
  color: var(--leap-green);
  animation: cd-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  line-height: 1;
}
/* GO! variant: larger */
.countdown-number.countdown-go {
  font-size: 128px;
  animation: cd-go-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes cd-pop {
  0%   { transform: scale(0.3) rotate(-4deg); opacity: 0; }
  60%  { transform: scale(1.10) rotate(0deg); opacity: 1; }
  100% { transform: scale(1.00); opacity: 1; }
}
@keyframes cd-go-pop {
  0%   { transform: scale(0.2) rotate(-6deg); opacity: 0; }
  60%  { transform: scale(1.18) rotate(0deg); opacity: 1; }
  100% { transform: scale(1.00); opacity: 1; }
}

.countdown-text {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 6px;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
}
/* Traffic-light dots row */
.countdown-lights {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.countdown-light {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(80,80,80,0.5);
  border: 1.5px solid rgba(255,255,255,0.15);
  transition: background 0.15s, box-shadow 0.15s;
}
.countdown-light.active-red    { background: #FF4D51; box-shadow: 0 0 10px #FF4D51; }
.countdown-light.active-amber  { background: #FFB800; box-shadow: 0 0 10px #FFB800; }
.countdown-light.active-green  { background: #67C23A; box-shadow: 0 0 10px #67C23A; }

/* ══════════════════════════════════════════════════════════
   UTILITY
══════════════════════════════════════════════════════════ */
.hidden { display: none !important; }

#screen-end { overflow-y: auto; -webkit-overflow-scrolling: touch; }
#screen-game { overflow: hidden; }

button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--leap-green); outline-offset: 2px; }

/* ══════════════════════════════════════════════════════════
   INSTANT WIN BANNER
══════════════════════════════════════════════════════════ */
.instant-win-banner {
  position: relative;
  margin: 0 16px 20px;
  padding: 20px 16px;
  background: linear-gradient(135deg, rgba(103,194,58,0.14) 0%, rgba(15,80,15,0.18) 100%);
  border: 2px solid var(--leap-green);
  border-radius: var(--radius);
  text-align: center;
  overflow: hidden;
}
.instant-win-banner.win-active {
  animation: iw-pulse 1.4s ease infinite;
}
@keyframes iw-pulse {
  0%,100% { box-shadow: 0 0 24px rgba(103,194,58,0.3); }
  50%      { box-shadow: 0 0 48px rgba(103,194,58,0.55), 0 0 80px rgba(103,194,58,0.2); }
}
.iw-glow-ring {
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(103,194,58,0.10) 0%, transparent 70%);
  pointer-events: none;
}
.iw-icon   { font-size: 42px; margin-bottom: 6px; }
.iw-headline {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--leap-green);
  text-shadow: 0 0 20px rgba(103,194,58,0.5);
  margin-bottom: 6px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.iw-sub { font-size: 13px; color: var(--leap-grey); margin-bottom: 8px; }
.iw-code-wrap { margin-top: 14px; }
.iw-code-label {
  display: block;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--leap-grey);
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 700;
}
.iw-code {
  display: block;
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--leap-green);
  text-shadow: 0 0 30px rgba(103,194,58,0.6), 0 0 60px rgba(103,194,58,0.3);
  animation: iw-code-glow 1.2s ease infinite alternate;
}
@keyframes iw-code-glow {
  from { text-shadow: 0 0 20px rgba(103,194,58,0.5); }
  to   { text-shadow: 0 0 50px rgba(103,194,58,0.8), 0 0 90px rgba(103,194,58,0.3); }
}
.iw-hint { font-size: 12px; color: var(--leap-grey); margin-top: 8px; }

/* ══════════════════════════════════════════════════════════
   OPT-IN FORM
══════════════════════════════════════════════════════════ */
.optin-section {
  margin: 0 16px 20px;
  padding: 20px 16px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
}
.optin-heading {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--leap-white);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.optin-sub {
  font-size: 13px;
  color: var(--leap-grey);
  margin-bottom: 16px;
  line-height: 1.5;
}
.optin-form { display: flex; flex-direction: column; gap: 14px; }

.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row-half { flex-direction: row; gap: 10px; }
.form-row-half .form-col { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.form-row-check { flex-direction: row; align-items: flex-start; gap: 8px; }

.form-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--leap-grey);
}
.form-input,
.form-select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--leap-grey-dark);
  border-radius: var(--radius-sm);
  color: var(--leap-white);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s;
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--leap-green);
  box-shadow: 0 0 0 2px rgba(103,194,58,0.2);
}
.form-input.error,
.form-select.error { border-color: var(--error); }
.form-select option { background: #111111; color: var(--leap-white); }

/* Consent block */
.consent-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--leap-grey-dark);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.consent-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--leap-grey);
}
.consent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.consent-label { font-size: 13px; flex: 1; line-height: 1.4; }
.radio-group { display: flex; gap: 12px; flex-shrink: 0; }
.radio-opt {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  cursor: pointer;
  color: var(--leap-white);
}
.radio-opt input[type=radio] {
  width: 18px; height: 18px;
  accent-color: var(--leap-green);
  cursor: pointer;
}
.radio-opt.error-radio { color: var(--error); }

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.5;
}
.check-label input[type=checkbox] {
  width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px;
  accent-color: var(--leap-green);
  cursor: pointer;
}
.form-link { color: var(--leap-green); text-decoration: underline; }

.optin-error {
  background: rgba(255,77,81,0.10);
  border: 1px solid rgba(255,77,81,0.35);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: #FF8080;
  line-height: 1.5;
}

.optin-submit {
  margin-top: 4px;
  width: 100%;
}
.optin-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-height: 667px) {
  .start-hero { gap: 10px; }
  .game-title { font-size: 32px; }
  .start-logo-img { height: 72px; }
  .win-cards { gap: 7px; }
  .win-card { padding: 10px 12px; }
  .win-card-icon { font-size: 22px; }
  .rules-trophy { font-size: 36px; }
  .rules-steps { gap: 8px; }
  .rule-step { padding: 12px; }
  .lives-display .life-heart { font-size: 15px; }
}
@media (min-height: 800px) {
  .game-title { font-size: 54px; }
  .start-logo-img { height: 116px; }
}

/* ══════════════════════════════════════════════════════════
   SOUND TOGGLE BUTTON
══════════════════════════════════════════════════════════ */
.sound-toggle-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 30;
  background: rgba(0, 0, 0, 0.65);
  border: 1.5px solid var(--leap-green);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--leap-white);
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  box-shadow: 0 2px 10px rgba(103, 194, 58, 0.3);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.sound-toggle-btn:active {
  transform: scale(0.92);
}
.sound-toggle-btn.sound-off {
  border-color: var(--leap-grey);
  box-shadow: none;
  opacity: 0.7;
}
/* In-game position: top-LEFT, clear of the right-side COMBO HUD block */
.sound-toggle-ingame {
  top: 8px;
  left: 10px;
  right: auto;
  width: 38px;
  height: 38px;
  font-size: 17px;
}

/* Vehicle power-up preview bar — slim strip above logo, slides in/out */
.vehicle-preview-bar {
  /* Horizontal strip: image left, text right — full width, drops from top */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 35;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: rgba(0,0,0,0.93);
  border-bottom: 2.5px solid #67C23A;
  box-shadow: 0 4px 24px rgba(103,194,58,0.45);
  animation: vpb-drop 0.22s ease-out;
}
.vehicle-preview-bar.hidden { display: none; }
@keyframes vpb-drop {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.vpb-img {
  height: 64px;
  width:  96px;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
  flex-shrink: 0;
}
.vpb-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #FFFFFF;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(103,194,58,0.5);
  flex: 1;
}

/* Top bar with centered Leapmotor logo */
.game-topbar {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 12;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}
.game-topbar-logo {
  height: 28px;
  width: auto;
  filter: invert(1) brightness(2);
  opacity: 0.9;
}

/* ═══════════════════════════════════════════════════════════
   ATTRACT MODE (Screensaver)
═══════════════════════════════════════════════════════════ */
.attract-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.90);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.attract-inner {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 44px 24px;
  text-align: center;
}
.attract-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 50% 55%, rgba(103, 194, 58, 0.12) 0%, transparent 70%);
  animation: attract-glow-pulse 3s ease-in-out infinite;
}
@keyframes attract-glow-pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}
.attract-logo {
  height: 64px;
  width: auto;
  filter: invert(1) brightness(2);
  animation: attract-logo-pulse 2.2s ease-in-out infinite;
  position: relative;
  z-index: 1;
}
@keyframes attract-logo-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.07);
              filter: invert(1) brightness(2.5) drop-shadow(0 0 18px rgba(103, 194, 58, 0.8)); }
}
.attract-cars {
  width: 100%;
  height: 80px;
  position: relative;
  overflow: hidden;
  background: #000;
}
.attract-car {
  position: absolute;
  height: 64px;
  top: 50%;
  transform: translateY(-50%);
  object-fit: contain;
  animation: attract-drive linear infinite;
  mix-blend-mode: screen;
  filter: brightness(1.1) drop-shadow(0 0 12px rgba(103, 194, 58, 0.5));
  transform: translateY(-50%) scaleX(-1); /* Autos fahren nach links, also gespiegelt */
}
.attract-car-1 { animation-duration: 6s;    animation-delay:  0s;   }
.attract-car-2 { animation-duration: 8.5s;  animation-delay: -2.5s; }
.attract-car-3 { animation-duration: 7.2s;  animation-delay: -4.8s; }
.attract-car-4 { animation-duration: 10s;   animation-delay: -1.3s; }
@keyframes attract-drive {
  from { left: 110%; }
  to   { left: -28%; }
}
.attract-headline {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #67C23A;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  animation: attract-headline-glow 1.8s ease-in-out infinite;
}
@keyframes attract-headline-glow {
  0%, 100% { text-shadow: 0 0 20px rgba(103, 194, 58, 0.7); }
  50%       { text-shadow: 0 0 40px rgba(103, 194, 58, 1), 0 0 80px rgba(103, 194, 58, 0.4); }
}
.attract-sub {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 4px;
  text-transform: uppercase;
  animation: attract-sub-blink 1.2s ease-in-out infinite;
  position: relative;
  z-index: 1;
}
@keyframes attract-sub-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* ═══════════════════════════════════════════════════════════
   SHARE ACTIONS (End-Screen)
═══════════════════════════════════════════════════════════ */
.share-actions-wrap {
  padding: 4px 0 16px;
}
.share-actions-wrap.hidden { display: none; }
.share-actions-btns {
  display: flex;
  gap: 10px;
}
.share-btn-wa {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  background: #25D366;
  color: #000;
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-decoration: none;
  text-transform: uppercase;
  min-height: 50px;
  transition: background 0.2s;
}
.share-btn-wa:active { background: #1ebe5b; }
.share-btn-native {
  flex: 1;
  padding: 14px 10px;
  background: rgba(103, 194, 58, 0.10);
  border: 1px solid rgba(103, 194, 58, 0.40);
  border-radius: 14px;
  color: #67C23A;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  min-height: 50px;
  transition: background 0.2s;
}
.share-btn-native:active { background: rgba(103, 194, 58, 0.20); }

/* ── LOW-FX TOGGLE (Start Screen) ─────────────────────── */
.lowfx-toggle {
  margin-top: 12px;
  text-align: center;
}
.lowfx-toggle .toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
}
.lowfx-toggle input[type="checkbox"] {
  accent-color: #67C23A;
  width: 16px;
  height: 16px;
}

/* ── Edit-Event Modal ── */
.edit-event-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 20px;
}
.edit-event-modal {
  background: #1a1a2e; border: 1px solid rgba(103,194,58,0.35);
  border-radius: 16px; padding: 28px 24px; width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 14px;
}
.edit-event-modal h3 { margin: 0; color: #fff; font-size: 18px; }
.edit-event-modal label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 1px;
}
.edit-event-modal .form-input {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; color: #fff; padding: 10px 12px; font-size: 15px; width: 100%;
}
.edit-event-actions { display: flex; gap: 10px; }
.edit-event-actions .btn-action { flex: 1; }
.btn-secondary { background: rgba(255,255,255,0.08) !important; }

/* ══════════════════════════════════════════════════════════
   iPad / Tablet LANDSCAPE MODE
   Letterbox: game bleibt Portrait, zentriert mit schwarzen Rändern
   ══════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════
   iPad / Tablet LANDSCAPE: QR-Panel links | Spiel | QR-Panel rechts
══════════════════════════════════════════════════════ */
.landscape-qr-panel {
  display: none;
}

@media (orientation: landscape) and (min-width: 600px) {
  body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: #000;
    overflow: hidden;
  }
  #app {
    /* Exakte Breite: verfügbarer Platz minus beide Panels, max Portrait-Ratio */
    flex: 0 0 auto;
    width: min(92dvh, calc(100dvw - 2 * clamp(150px, 17vw, 210px)));
    height: 100dvh;
    position: relative;
    order: 2;
  }
  /* QR-Seitenstreifen: flex:1 damit sie den übrigen Platz gleich aufteilen */
  .landscape-qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex: 1;
    padding: 20px 14px;
    background: linear-gradient(180deg,
      rgba(103,194,58,0.07) 0%,
      rgba(103,194,58,0.02) 100%);
  }
  .landscape-qr-panel.left {
    order: 1;
    border-right: 1px solid rgba(103,194,58,0.14);
  }
  .landscape-qr-panel.right {
    order: 3;
    border-left: 1px solid rgba(103,194,58,0.14);
  }
  .landscape-qr-panel .lqr-logo {
    height: 22px;
    filter: brightness(0) invert(1);
    opacity: 0.6;
  }
  .landscape-qr-panel .lqr-img {
    width: clamp(120px, 22dvh, 180px);
    height: clamp(120px, 22dvh, 180px);
    border-radius: 12px;
    animation: lqr-glow 3s ease-in-out infinite;
  }
  @keyframes lqr-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(103,194,58,0.20); }
    50%       { box-shadow: 0 0 45px rgba(103,194,58,0.50); }
  }
  .landscape-qr-panel .lqr-cta {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(10px, 1.4dvh, 13px);
    font-weight: 900;
    letter-spacing: 2px;
    color: #67C23A;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.6;
  }
  .landscape-qr-panel .lqr-sub {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(9px, 1.2dvh, 11px);
    font-weight: 700;
    color: rgba(255,255,255,0.45);
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1.5;
  }
  .landscape-qr-panel .lqr-arrow {
    font-size: clamp(22px, 4dvh, 36px);
    animation: lqr-bounce-l 1.3s ease-in-out infinite;
  }
  .landscape-qr-panel.right .lqr-arrow {
    animation: lqr-bounce-r 1.3s ease-in-out infinite;
  }
  @keyframes lqr-bounce-l {
    0%, 100% { transform: translateX(0);   opacity: 0.6; }
    50%       { transform: translateX(7px); opacity: 1; }
  }
  @keyframes lqr-bounce-r {
    0%, 100% { transform: translateX(0);    opacity: 0.6; }
    50%       { transform: translateX(-7px); opacity: 1; }
  }
}
