:root {
  --bg: #0a0a1f;
  --bg-2: #141433;
  --text: #ffffff;
  --soft: #5be8a8;
  --hard: #ff6b9d;
  --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:
    radial-gradient(120% 80% at 50% 0%, #1d1d45 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
}

#board {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  transition: filter 0.25s ease;
}
#board.dimmed { filter: blur(3px) brightness(0.55); }

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: calc(env(safe-area-inset-top) + 0.7rem) 1.1rem 0.6rem;
  pointer-events: none;
  z-index: 5;
}
.hud.hidden { display: none; }
.hud-block { display: flex; flex-direction: column; line-height: 1; }
.hud-mid { align-items: center; flex: 1; }
.hud-right { align-items: flex-end; }
.hud-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b8bb5;
  font-weight: 700;
}
.hud-value { font-size: 1.9rem; font-weight: 900; font-family: var(--font-head); }
.hud-sub {
  font-size: 0.95rem;
  font-weight: 700;
  color: #c9c9ec;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
}
.hud-sub.hidden { display: none; }

/* Soft-Mode Fortschrittsbalken (Zug X / 100) */
.progress {
  width: 60vw;
  max-width: 190px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.progress.hidden { display: none; }
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #5be8a8, #54a0ff);
  transition: width 0.25s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.progress.hot .progress-fill {
  background: linear-gradient(90deg, #ffc93c, #ff6b9d);
  box-shadow: 0 0 12px #ffb23c;
}

/* ---------- Juice-Overlay (DOM) ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 7; overflow: hidden; }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 6; opacity: 0; }
.fx-float, .fx-banner {
  position: absolute;
  font-family: var(--font-head);
  font-weight: 700;
  white-space: nowrap;
  will-change: transform, opacity;
}
.fx-float { transform: translate(-50%, -50%); }
.fx-banner { left: 50%; top: 40%; transform: translate(-50%, -50%); letter-spacing: 0.02em; }
.fx-idle { position: absolute; left: -9999px; top: -9999px; opacity: 0; }

.mute-btn {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 0.7rem);
  right: 0.9rem;
  z-index: 6;
  width: 2.6rem; height: 2.6rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---------- Screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.screen.hidden { display: none; }

.card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}

.logo {
  font-family: var(--font-head);
  font-size: clamp(3rem, 18vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.9;
}
.logo span {
  display: inline-grid;
  place-items: center;
  width: 0.95em; height: 0.95em;
  margin-left: 0.12em;
  border-radius: 0.26em;
  background: linear-gradient(160deg, var(--hard), #ff9f45);
  transform: rotate(6deg);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.22);
}
.tagline { color: #b9b9e0; font-size: 1rem; margin-bottom: 0.6rem; font-weight: 500; }

/* ---------- Daily-Toggle ---------- */
.daily-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #c9c9ec;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 0.4rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.daily-dot {
  width: 0.7rem; height: 0.7rem;
  border-radius: 50%;
  background: #555;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.daily-toggle.on { color: #fff; border-color: var(--soft); }
.daily-toggle.on .daily-dot { background: var(--soft); box-shadow: 0 0 10px var(--soft); }

/* ---------- Buttons (Jelly) ---------- */
.mode-btn {
  width: 100%;
  border: none;
  border-radius: 1.1rem;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  color: #1a0e2e;
  font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}
.mode-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.28); }
.mode-soft { background: linear-gradient(160deg, #7ef0bb, var(--soft)); }
.mode-hard { background: linear-gradient(160deg, #ff8fb4, var(--hard)); color: #2a0716; }
.mode-emoji { font-size: 1.6rem; }
.mode-name { font-size: 1.4rem; font-weight: 900; font-family: var(--font-head); }
.mode-desc { font-size: 0.82rem; font-weight: 600; opacity: 0.8; }

.text-btn {
  background: none;
  border: none;
  color: #9a9ac6;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.4rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Game Over ---------- */
.go-mode {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--hard);
}
.go-reason { color: #b9b9e0; font-weight: 600; }
.go-score {
  font-family: var(--font-head);
  font-size: clamp(3.4rem, 22vw, 5rem);
  font-weight: 700;
  line-height: 1;
  margin: 0.2rem 0;
}
.go-best { color: #c9c9ec; font-size: 1.05rem; margin-bottom: 0.7rem; }
.go-best strong { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  #board { transition: none; }
}
