/* ============================================================
   Connected! – styles.css  (v4 – Touch-First Redesign)
   ------------------------------------------------------------
   Grundregel für Touch: alles, was der Finger trifft, ist
   mindestens 48px groß. Zahlenkarten haben eine feste äußere
   Trefferbox (.numcard); nur der Inhalt (.numcard-inner)
   schwebt – so bleibt die Trefferfläche unter dem Finger stabil.
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Farben */
  --bg-0: #070a18;
  --bg-1: #0d1230;
  --border: rgba(255,255,255,0.14);

  --accent: #a06bff;
  --accent-2: #ffc94d;
  --accent-3: #2fe3b0;
  --danger: #ff5c72;

  --text: #eef2ff;
  --text-dim: #8b94bd;

  /* Maße */
  --hud-h: 60px;
  --safe-top: 0px;
  --tap: 48px;            /* minimale Touch-Zielgröße */

  --font-d: "Baloo 2", "Nunito", system-ui, sans-serif;
  --font-b: "Nunito", system-ui, sans-serif;

  /* Herzsilhouette als Maske für die Partikel */
  --heart-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 92'%3E%3Cpath d='M50 88C25 68 5 50 5 32 5 16 17 6 30 6c9 0 16 5 20 12 4-7 11-12 20-12 13 0 25 10 25 26 0 18-20 36-45 56z' fill='%23000'/%3E%3C/svg%3E");
}

@supports (padding-top: env(safe-area-inset-top)) {
  :root { --safe-top: env(safe-area-inset-top); }
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-b);
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: none;
  overscroll-behavior: none;   /* kein Pull-to-Refresh beim Wischen */
}

/* ── HINTERGRUND: AURORA + STERNE ─────────────────────────── */
.aurora {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, #1b1f4d 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 70%);
}
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.4;
  will-change: transform;
}
.blob-1 { width: 55vmax; height: 55vmax; left: -18vmax; top: -18vmax;
          background: #7b3fff; animation: drift1 26s ease-in-out infinite; }
.blob-2 { width: 45vmax; height: 45vmax; right: -16vmax; top: 18%;
          background: #0f7fa8; animation: drift2 31s ease-in-out infinite; }
.blob-3 { width: 50vmax; height: 50vmax; left: 8%; bottom: -26vmax;
          background: #b4318a; animation: drift3 37s ease-in-out infinite; }

@keyframes drift1 { 0%,100%{transform:translate(0,0) scale(1)}    50%{transform:translate(12vmax,8vmax) scale(1.15)} }
@keyframes drift2 { 0%,100%{transform:translate(0,0) scale(1.1)}  50%{transform:translate(-10vmax,12vmax) scale(0.9)} }
@keyframes drift3 { 0%,100%{transform:translate(0,0) scale(0.95)} 50%{transform:translate(9vmax,-10vmax) scale(1.2)} }

.stars { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.star {
  position: absolute; border-radius: 50%; background: #fff; opacity: 0;
  animation: twinkle var(--dur,3s) ease-in-out infinite var(--del,0s);
}
@keyframes twinkle { 0%,100%{opacity:0} 50%{opacity:var(--bright,0.5)} }

/* Bewegungsreduktion respektieren */
@media (prefers-reduced-motion: reduce) {
  .blob, .star, .logo-icon, .result-emoji, .numcard-inner { animation: none !important; }
}

/* ── SCREENS ──────────────────────────────────────────────── */
.screen {
  position: fixed; inset: 0; z-index: 2;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: calc(var(--safe-top) + 8px) 0 env(safe-area-inset-bottom);
}
.screen.active { opacity: 1; pointer-events: auto; z-index: 10; }

/* ── KARTEN-FLÄCHEN (Start / Ergebnis) ────────────────────── */
.start-card, .result-card {
  position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: clamp(20px, 5vw, 34px) clamp(18px, 5.5vw, 36px);
  width: min(440px, 92vw);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.14);
  display: flex; flex-direction: column;
  gap: clamp(14px, 3vw, 20px);
}

/* ── LOGO ─────────────────────────────────────────────────── */
.logo { text-align: center; }
.logo-icon {
  font-size: clamp(2.4rem, 8vw, 3.2rem); display: block; line-height: 1;
  filter: drop-shadow(0 6px 18px rgba(160,107,255,0.5));
  animation: float 3.4s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-9px)} }
.logo-title {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(2rem, 7vw, 2.8rem); line-height: 1.1; margin-top: 4px;
  background: linear-gradient(100deg, var(--accent-2) 10%, #ff8ad4 55%, var(--accent) 95%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.logo-sub {
  color: var(--text-dim); font-size: clamp(0.8rem, 2.8vw, 0.92rem);
  font-weight: 700; margin-top: 2px;
}

/* Kleine Statistik unter dem Logo */
.start-stats {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 14px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(160,107,255,0.18), rgba(160,107,255,0.06));
  border: 1px solid rgba(160,107,255,0.35);
  color: var(--text-dim); font-size: 0.85rem; font-weight: 700; text-align: center;
}
.start-stats[hidden] { display: none; }
.start-stats b { color: var(--text); font-weight: 900; font-variant-numeric: tabular-nums; }

/* ── FORMULARE ────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 8px; }
.field-group label {
  font-size: 0.7rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 1.6px; color: var(--text-dim);
}
#player-name, #player-class {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid var(--border); border-radius: 14px;
  padding: 0 16px; height: var(--tap);
  font-family: var(--font-b); font-size: 1rem; font-weight: 800;
  color: var(--text); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#player-name:focus, #player-class:focus {
  border-color: var(--accent); background: rgba(160,107,255,0.12);
  box-shadow: 0 0 0 4px rgba(160,107,255,0.2);
}
#player-name::placeholder, #player-class::placeholder { color: var(--text-dim); font-weight: 600; }
#player-name.invalid, #player-class.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255,92,114,0.18); }
.field-error { color: var(--danger); font-size: 0.75rem; font-weight: 800; }
.field-error[hidden] { display: none; }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn-primary, .btn-secondary {
  border-radius: 15px; cursor: pointer;
  font-family: var(--font-d); font-weight: 800;
  touch-action: manipulation;
  min-height: 54px; padding: 0 26px;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}
.btn-primary {
  border: none; color: #fff; font-size: 1.15rem; letter-spacing: 0.4px;
  background: linear-gradient(135deg, #b47bff, #6d2bff);
  box-shadow: 0 8px 24px rgba(109,43,255,0.45), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-primary:active { transform: scale(0.96); box-shadow: 0 3px 12px rgba(109,43,255,0.4); }
.btn-secondary {
  background: rgba(255,255,255,0.08); border: 1.5px solid var(--border);
  color: var(--text); font-size: 1.05rem;
}
.btn-secondary:active { transform: scale(0.96); background: rgba(255,255,255,0.14); }

.hint {
  text-align: center; color: var(--text-dim);
  font-size: 0.76rem; font-weight: 700; line-height: 1.5;
}

/* ══ HUD ══════════════════════════════════════════════════ */
.hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  height: calc(var(--hud-h) + var(--safe-top));
  padding: var(--safe-top) 10px 0 10px;
  background: linear-gradient(180deg, rgba(7,10,24,0.95), rgba(7,10,24,0.72));
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.hud-quit {
  flex: none;
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 1rem; font-weight: 900;
  cursor: pointer; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s, background 0.2s, color 0.2s;
}
.hud-quit:active { transform: scale(0.9); background: rgba(255,92,114,0.2); color: var(--danger); }

.hud-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 0; flex: 1 1 auto;
}
.hud-item[hidden] { display: none; }
.hud-item-name { max-width: 28%; }
.hud-item-time { flex: none; min-width: 46px; }
.hud-label {
  font-size: 0.52rem; text-transform: uppercase; letter-spacing: 1.3px;
  color: var(--text-dim); font-weight: 900; white-space: nowrap;
}
.hud-value {
  font-family: var(--font-d); font-weight: 800; font-size: 1.15rem; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  transition: transform 0.18s ease, color 0.18s ease;
}
.hud-score.bump { transform: scale(1.35); color: var(--accent-2); }
@keyframes pulse { from{transform:scale(1)} to{transform:scale(1.16)} }

/* Zeitbalken am unteren Rand des HUD */
.timebar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(255,255,255,0.08);
}
.timebar-fill {
  height: 100%; width: 100%; transform-origin: left center;
  background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
  transition: transform 0.15s linear, background 0.4s ease;
}
.timebar-fill.low { background: linear-gradient(90deg, #ff8b3d, var(--danger)); }
#hud-total.low { color: var(--danger); animation: pulse 0.5s ease infinite alternate; }
/* Abzug für ein falsches Paar steigt rot auf */
.float-points.minus { color: var(--danger); text-shadow: 0 0 18px rgba(255,92,114,0.7); }

/* Spielzeit blinkt kurz grün (Rundenbonus) oder rot (Überspringen) */
#hud-total.gain { animation: timeGain 0.7s ease; }
#hud-total.loss { animation: timeLoss 0.7s ease; }
@keyframes timeGain { 0%,100% { transform: scale(1); } 30% { transform: scale(1.45); color: var(--accent-3); } }
@keyframes timeLoss { 0%,100% { transform: scale(1); } 30% { transform: scale(1.45); color: var(--danger); } }

/* ══ SPIELFELD ════════════════════════════════════════════ */
#game-field {
  position: absolute;
  top: calc(var(--hud-h) + var(--safe-top)); left: 0; right: 0; bottom: 0;
  overflow: hidden;
}

/* ── AUFGABEN-BANNER ──────────────────────────────────────── */
#mode-banner {
  position: absolute; top: 10px; left: 50%;
  transform: translateX(-50%); z-index: 4; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: opacity 0.25s ease, transform 0.25s ease;
  width: max-content; max-width: 94%;
}
#mode-banner.swap { opacity: 0; transform: translateX(-50%) translateY(-10px); }

.mode-name {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(1rem, 3.6vw, 1.35rem);
  color: rgba(255,255,255,0.6); letter-spacing: 0.5px;
  text-transform: uppercase;
}
.target-wrap {
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(160deg, rgba(160,107,255,0.28), rgba(160,107,255,0.10));
  border: 1.5px solid rgba(160,107,255,0.5);
  border-radius: 18px; padding: 3px 22px 6px;
  min-width: 96px;
  box-shadow: 0 8px 28px rgba(123,47,255,0.28), inset 0 1px 0 rgba(255,255,255,0.18);
}
.target-label {
  font-size: 0.53rem; text-transform: uppercase; letter-spacing: 1.6px;
  color: rgba(255,255,255,0.5); font-weight: 900;
}
.target-number {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(1.9rem, 6.5vw, 2.7rem); line-height: 1.1;
  color: var(--accent-2);
  text-shadow: 0 0 26px rgba(255,201,77,0.55);
}
.pairs-left {
  font-size: 0.68rem; font-weight: 800; color: var(--text-dim); letter-spacing: 0.4px;
}
/* Modi ohne Zielzahl zeigen hier einen kurzen Hinweis statt einer Zahl */
.target-number.is-text {
  font-size: clamp(0.95rem, 3.4vw, 1.25rem);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 4px 0 2px;
}

/* ── BRÜCHE ───────────────────────────────────────────────── */
.frac {
  display: inline-flex; flex-direction: column; align-items: center;
  vertical-align: middle; line-height: 1;
}
.fnum { border-bottom: 2.5px solid currentColor; padding: 0 4px 2px; font-size: 0.8em; }
.fden { padding: 2px 4px 0; font-size: 0.8em; }
/* Prozentzeichen etwas kleiner als die Zahl */
.pct { font-size: 0.72em; margin-left: 1px; opacity: 0.85; }

/* ══ ZAHLENKARTEN ═════════════════════════════════════════
   .numcard       = stabile Trefferbox (bewegt sich nicht!)
   .numcard-inner = das, was sichtbar schwebt
   Die Trennung ist wichtig: sonst wandert das Touch-Ziel
   unter dem Finger weg.
========================================================== */
.numcard {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: var(--tap); min-height: var(--tap);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; z-index: 5;
}
.numcard-inner {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-width: var(--tap); min-height: var(--tap);
  padding: 8px clamp(14px, 4vw, 20px);
  border-radius: 16px;
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(1.35rem, 5vw, 1.9rem);
  color: #fff; white-space: nowrap;
  background:
    linear-gradient(155deg,
      hsla(var(--h, 260), var(--s, 92%), 66%, 0.55),
      hsla(var(--h, 260), var(--s, 92%), 42%, 0.30));
  border: 1.5px solid hsla(var(--h, 260), var(--s, 92%), 78%, 0.7);
  box-shadow:
    0 6px 22px hsla(var(--h, 260), var(--s, 92%), 30%, 0.55),
    0 0 0 1px hsla(var(--h, 260), var(--s, 92%), 50%, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  text-shadow: 0 2px 8px hsla(var(--h, 260), var(--s, 92%), 15%, 0.6);
  animation: floatNum var(--fd, 4s) ease-in-out infinite var(--fdel, 0s);
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}
.numcard-text { position: relative; z-index: 1; }

/* Formkarten (Herz, Wolke): das SVG liefert die Silhouette,
   die Box selbst ist unsichtbar. */
.shape-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; overflow: visible;
}
.shape-heart .numcard-inner,
.shape-cloud .numcard-inner {
  background: none; border: none; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
/* Schweben über "translate" statt "transform": so bleibt
   transform frei für die Zustands-Skalierung unten. */
@keyframes floatNum {
  0%,100% { translate: 0 0; }
  50%     { translate: 0 var(--fa, -8px); }
}

/* ── KARTENZUSTÄNDE ───────────────────────────────────────
   Skalierung und Animation gelten für jede Form. Die Farbe
   sitzt bei Boxkarten im Hintergrund, bei Herz und Wolke im
   SVG-Pfad – deshalb sind beide Fälle getrennt notiert.
========================================================== */
.numcard.armed    .numcard-inner { transform: scale(1.1); }
.numcard.selected .numcard-inner { transform: scale(1.12); }
.numcard.error    .numcard-inner { animation: shake 0.42s ease; color: #ffd9de; }
.numcard.pop      .numcard-inner { animation: popOut 0.42s ease forwards; }

/* Boxkarten (Standard, Ziegel) */
.shape-card.armed .numcard-inner, .shape-brick.armed .numcard-inner, .shape-bubble.armed .numcard-inner, .shape-square.armed .numcard-inner {
  background: linear-gradient(155deg, rgba(255,201,77,0.45), rgba(255,201,77,0.20));
  border-color: rgba(255,201,77,0.95);
  box-shadow: 0 0 0 3px rgba(255,201,77,0.35), 0 0 30px rgba(255,201,77,0.45);
}
.shape-card.selected .numcard-inner, .shape-brick.selected .numcard-inner, .shape-bubble.selected .numcard-inner, .shape-square.selected .numcard-inner {
  background: linear-gradient(155deg, rgba(255,255,255,0.32), rgba(255,255,255,0.16));
  border-color: rgba(255,255,255,0.95);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.4), 0 0 26px rgba(255,255,255,0.3);
}
.shape-card.error .numcard-inner, .shape-brick.error .numcard-inner, .shape-bubble.error .numcard-inner, .shape-square.error .numcard-inner {
  background: linear-gradient(155deg, rgba(255,60,80,0.45), rgba(255,60,80,0.22));
  border-color: rgba(255,92,114,0.9);
}

/* Formkarten (Herz, Wolke) */
.shape-heart .shape-bg path, .shape-cloud .shape-bg path {
  fill: hsla(var(--h, 340), var(--s, 85%), 58%, 0.9);
  stroke: hsla(var(--h, 340), var(--s, 85%), 82%, 0.95);
  stroke-width: 3; stroke-linejoin: round;
  transition: fill 0.14s, stroke 0.14s;
}
.shape-heart.armed .shape-bg path, .shape-cloud.armed .shape-bg path {
  fill: rgba(255,201,77,0.92); stroke: #fff3cf;
}
.shape-heart.selected .shape-bg path, .shape-cloud.selected .shape-bg path {
  fill: rgba(255,255,255,0.75); stroke: #ffffff;
}
.shape-heart.error .shape-bg path, .shape-cloud.error .shape-bg path {
  fill: rgba(255,60,80,0.85); stroke: #ffb3bf;
}

@keyframes shake {
  0%,100% { transform: translateX(0) scale(1.04) }
  20%     { transform: translateX(8px) scale(1.06) }
  45%     { transform: translateX(-8px) scale(1.06) }
  70%     { transform: translateX(5px) scale(1.04) }
}
@keyframes popOut {
  0%   { transform: scale(1.12); opacity: 1 }
  45%  { transform: scale(1.5);  opacity: 0.7 }
  100% { transform: scale(0.15); opacity: 0 }
}

/* ══ WELTEN JE MODUS ══════════════════════════════════════
   Die Klasse sitzt auf <body> und färbt Hintergrund, Banner
   und Karten um. Nur im Spiel aktiv – Menü und Ergebnis
   bleiben im Grundlook.
========================================================== */

/* ── VERLIEBTE ZAHLEN: rosa, Herzen ───────────────────────── */
.theme-love .aurora {
  background:
    radial-gradient(120% 90% at 50% -10%, #4a1030 0%, transparent 62%),
    linear-gradient(180deg, #2a0a22 0%, #16040f 72%);
}
.theme-love .blob-1 { background: #ff3d8b; }
.theme-love .blob-2 { background: #b81e6a; }
.theme-love .blob-3 { background: #ff7ab8; opacity: 0.34; }

.theme-love .mode-name { color: rgba(255,200,225,0.8); }
.theme-love .target-wrap {
  background: linear-gradient(160deg, rgba(255,61,139,0.3), rgba(255,61,139,0.12));
  border-color: rgba(255,122,184,0.6);
  box-shadow: 0 8px 28px rgba(255,61,139,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}
.theme-love .target-number { color: #ffd9e8; text-shadow: 0 0 26px rgba(255,122,184,0.8); }
.theme-love .round-flash {
  background: radial-gradient(circle at 50% 40%, rgba(255,110,175,0.3), transparent 62%);
}
/* Herz: Text sitzt im breiten oberen Teil, nicht in der Spitze */
.shape-heart .numcard-inner {
  min-width: 78px; min-height: 74px;
  padding: 0 10px 16px;
  font-size: clamp(1.2rem, 4.4vw, 1.65rem);
  text-shadow: 0 2px 10px rgba(120,0,50,0.75);
}
/* Sehr schmale Handys: wegen der kartenfreien Randstreifen
   (Zurück-Geste) fehlt Breite – die Herzen werden etwas kleiner. */
@media (max-width: 360px) {
  .shape-heart .numcard-inner { min-width: 68px; min-height: 64px; padding-bottom: 14px; }
}
.shape-heart .shape-bg { filter: drop-shadow(0 6px 16px rgba(255,40,110,0.45)); }

/* ── ADDITION: Sonnenuntergang, runde Seifenblasen ────────── */
.theme-sun .aurora {
  background:
    radial-gradient(130% 80% at 50% 110%, #c2521f 0%, transparent 60%),
    linear-gradient(180deg, #24103a 0%, #4f1a3f 45%, #7a2e22 100%);
}
.theme-sun .blob-1 { background: #ff8a3d; opacity: 0.38; }
.theme-sun .blob-2 { background: #ffb443; opacity: 0.3; }
.theme-sun .blob-3 { background: #d9486b; opacity: 0.34; }
.theme-sun .stars { opacity: 0.5; }

.theme-sun .mode-name { color: rgba(255,226,190,0.8); }
.theme-sun .target-wrap {
  background: linear-gradient(160deg, rgba(255,150,60,0.32), rgba(255,150,60,0.12));
  border-color: rgba(255,180,90,0.6);
  box-shadow: 0 8px 28px rgba(255,120,40,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}
.theme-sun .target-number { color: #ffe3a8; text-shadow: 0 0 26px rgba(255,170,70,0.8); }
.theme-sun .round-flash {
  background: radial-gradient(circle at 50% 40%, rgba(255,170,70,0.28), transparent 62%);
}
/* Blase: kreisrund (bei langen Zahlen eine Kapsel) mit Glanzpunkt */
.shape-bubble .numcard-inner {
  min-width: 66px; min-height: 66px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid hsla(var(--h, 30), var(--s, 90%), 80%, 0.75);
  background:
    radial-gradient(circle at 30% 26%, rgba(255,255,255,0.7) 0 7%, rgba(255,255,255,0) 20%),
    radial-gradient(circle at 50% 50%,
      hsla(var(--h, 30), var(--s, 90%), 55%, 0.35) 0%,
      hsla(var(--h, 30), var(--s, 90%), 50%, 0.55) 70%,
      hsla(var(--h, 30), var(--s, 90%), 75%, 0.8) 100%);
  box-shadow:
    0 8px 22px hsla(var(--h, 30), var(--s, 90%), 25%, 0.5),
    inset 0 -6px 14px hsla(var(--h, 30), var(--s, 90%), 30%, 0.35),
    inset 0 2px 6px rgba(255,255,255,0.35);
  text-shadow: 0 2px 8px hsla(var(--h, 30), 90%, 18%, 0.7);
}

/* ── QUADRATZAHLEN: grüne Quadrate ────────────────────────── */
.theme-garden .aurora {
  background:
    radial-gradient(120% 90% at 50% -10%, #145a3a 0%, transparent 60%),
    linear-gradient(180deg, #0b2a1f 0%, #061811 72%);
}
.theme-garden .blob-1 { background: #1fae63; opacity: 0.36; }
.theme-garden .blob-2 { background: #0f7a5a; opacity: 0.4; }
.theme-garden .blob-3 { background: #7ccf4a; opacity: 0.26; }
.theme-garden .stars { opacity: 0.45; }

.theme-garden .mode-name { color: rgba(200,255,215,0.8); }
.theme-garden .target-wrap {
  background: linear-gradient(160deg, rgba(60,200,120,0.3), rgba(60,200,120,0.12));
  border-color: rgba(110,230,150,0.55);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(20,140,70,0.3), inset 0 1px 0 rgba(255,255,255,0.18);
}
.theme-garden .target-number { color: #d6ffe0; text-shadow: 0 0 22px rgba(90,230,140,0.7); }
.theme-garden .round-flash {
  background: radial-gradient(circle at 50% 40%, rgba(90,230,140,0.25), transparent 62%);
}
/* Quadrat: gleich breit wie hoch, auch bei dreistelligen Zahlen */
.shape-square .numcard-inner {
  min-width: 64px; min-height: 64px;
  aspect-ratio: 1 / 1;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: clamp(1.25rem, 4.6vw, 1.7rem);
  border: 2px solid hsla(var(--h, 140), var(--s, 65%), 72%, 0.8);
  background:
    linear-gradient(155deg,
      hsla(var(--h, 140), var(--s, 65%), 48%, 0.85),
      hsla(var(--h, 140), var(--s, 65%), 30%, 0.85));
  box-shadow:
    0 6px 20px hsla(var(--h, 140), var(--s, 65%), 15%, 0.6),
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 0 0 3px hsla(var(--h, 140), var(--s, 65%), 40%, 0.5);
  text-shadow: 0 2px 6px rgba(0,40,15,0.7);
}

/* ── MULTIPLIKATION: Pflasterstein und Ziegel ─────────────── */
.theme-brick .aurora {
  background:
    radial-gradient(120% 90% at 50% -10%, #3a3129 0%, transparent 60%),
    linear-gradient(180deg, #221e1b 0%, #14100e 72%);
}
.theme-brick .blob-1 { background: #7a4030; opacity: 0.5; }
.theme-brick .blob-2 { background: #4a4a4f; opacity: 0.45; }
.theme-brick .blob-3 { background: #93503a; opacity: 0.32; }
.theme-brick .stars { opacity: 0.25; }

.theme-brick .mode-name { color: rgba(232,214,200,0.7); }
.theme-brick .target-wrap {
  background: linear-gradient(160deg, rgba(150,90,66,0.35), rgba(90,80,74,0.18));
  border-color: rgba(180,130,105,0.55);
  box-shadow: 0 8px 26px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.14);
}
.theme-brick .target-number { color: #e9c9ae; text-shadow: 0 0 20px rgba(190,120,80,0.55); }
.theme-brick .round-flash {
  background: radial-gradient(circle at 50% 40%, rgba(200,130,90,0.2), transparent 62%);
}
/* Ziegel: kantig, mit Mörtelfuge und rauer Oberfläche */
.shape-brick .numcard-inner {
  border-radius: 5px;
  border-width: 2px;
  border-color: hsla(var(--h, 20), var(--s, 50%), 30%, 0.9);
  background:
    repeating-linear-gradient(0deg,
      transparent 0 13px,
      hsla(var(--h, 20), var(--s, 50%), 12%, 0.5) 13px 15px),
    linear-gradient(155deg,
      hsla(var(--h, 20), var(--s, 50%), 52%, 0.95),
      hsla(var(--h, 20), var(--s, 50%), 34%, 0.95));
  box-shadow:
    0 5px 0 hsla(var(--h, 20), var(--s, 50%), 18%, 0.9),
    0 10px 20px rgba(0,0,0,0.55),
    inset 0 1px 0 hsla(var(--h, 20), var(--s, 50%), 70%, 0.5);
  text-shadow: 0 2px 3px rgba(0,0,0,0.75);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}

/* ── GLEICHHEIT: Himmel und Wolken ────────────────────────── */
.theme-sky .aurora {
  background:
    radial-gradient(120% 95% at 50% -5%, #6fb7f0 0%, transparent 58%),
    linear-gradient(180deg, #2d74b8 0%, #123a63 60%, #0b2440 100%);
}
.theme-sky .blob-1 { background: #cfe9ff; opacity: 0.3; }
.theme-sky .blob-2 { background: #7fc4f5; opacity: 0.32; }
.theme-sky .blob-3 { background: #ffffff; opacity: 0.16; }
.theme-sky .stars { opacity: 0; }        /* am Taghimmel keine Sterne */

.theme-sky .mode-name { color: rgba(255,255,255,0.85); }
.theme-sky .target-wrap {
  background: linear-gradient(160deg, rgba(255,255,255,0.35), rgba(255,255,255,0.15));
  border-color: rgba(255,255,255,0.7);
  box-shadow: 0 8px 28px rgba(20,70,120,0.35), inset 0 1px 0 rgba(255,255,255,0.5);
}
.theme-sky .target-label { color: rgba(255,255,255,0.75); }
.theme-sky .target-number { color: #ffffff; text-shadow: 0 0 22px rgba(255,255,255,0.7); }
.theme-sky .pairs-left { color: rgba(255,255,255,0.72); }
.theme-sky .round-flash {
  background: radial-gradient(circle at 50% 40%, rgba(255,255,255,0.32), transparent 62%);
}
/* Wolke: heller Körper, dunkler Text */
.shape-cloud .numcard-inner {
  min-width: 86px; min-height: 62px;
  padding: 0 14px 4px;
  color: #14456e;
  font-size: clamp(1.15rem, 4.2vw, 1.6rem);
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}
.shape-cloud .shape-bg path {
  fill: rgba(255,255,255,0.94);
  stroke: hsla(var(--h, 205), var(--s, 80%), 78%, 0.9);
  stroke-width: 2;
}
.shape-cloud .shape-bg { filter: drop-shadow(0 6px 14px rgba(20,60,110,0.35)); }
.shape-cloud.armed .numcard-inner,
.shape-cloud.selected .numcard-inner { color: #7a4a00; }
.shape-cloud.error .numcard-inner { color: #7a0016; }

/* ── CANVAS (fängt alle Zeigereingaben) ───────────────────── */
#line-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 6; pointer-events: auto;
  cursor: crosshair; touch-action: none;
}

/* ── COMBO-POPUP ──────────────────────────────────────────── */
.combo-popup {
  position: absolute; top: 24%; left: 50%; z-index: 30;
  transform: translateX(-50%) scale(0.6);
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  color: var(--accent-2); text-shadow: 0 0 24px rgba(255,201,77,0.85);
  pointer-events: none; opacity: 0; white-space: nowrap;
}
.combo-popup.warn { color: var(--danger); text-shadow: 0 0 24px rgba(255,92,114,0.85); }
.combo-popup.show {
  opacity: 1; transform: translateX(-50%) scale(1);
  transition: opacity 0.12s, transform 0.12s cubic-bezier(.2,1.6,.4,1);
}
.combo-popup.hide {
  opacity: 0; transform: translateX(-50%) translateY(-34px) scale(1.2);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

/* Kurzer Farbblitz beim Rundenwechsel */
.round-flash {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(47,227,176,0.22), transparent 62%);
  opacity: 0; transition: opacity 0.5s ease;
}
.round-flash.on { opacity: 1; transition: opacity 0.12s ease; }

/* ── AUFGABEN-FENSTER (beim Wechsel des Aufgabentyps) ─────── */
/* ── ÜBERSPRINGEN ─────────────────────────────────────────
   Unten mittig über dem Canvas. Die Kartenplatzierung lässt
   darüber Platz (bottomReserve), damit kein Fingertipp auf
   eine Karte versehentlich den Knopf trifft. */
.btn-skip {
  position: absolute; left: 50%; bottom: 10px; z-index: 8;
  transform: translateX(-50%);
  min-height: 44px; padding: 0 18px;
  display: flex; align-items: center; gap: 8px;
  border-radius: 999px;
  background: rgba(10,14,33,0.72);
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-b); font-size: 0.9rem; font-weight: 800;
  white-space: nowrap;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  cursor: pointer; touch-action: manipulation;
  transition: transform 0.12s, background 0.2s, color 0.2s;
}
.btn-skip:active { transform: translateX(-50%) scale(0.95); background: rgba(255,92,114,0.2); color: var(--danger); }
.skip-cost {
  font-size: 0.75rem; color: var(--danger);
  padding: 2px 7px; border-radius: 999px; background: rgba(255,92,114,0.14);
}
#screen-game.tutorial .btn-skip { display: none; }

/* Punkte steigen dort auf, wo das Paar war */
.float-points {
  position: absolute; z-index: 26; pointer-events: none;
  transform: translate(-50%, -50%);
  font-family: var(--font-d); font-weight: 800; font-size: 1.5rem;
  color: var(--accent-2); text-shadow: 0 2px 10px rgba(0,0,0,0.6), 0 0 18px rgba(255,201,77,0.7);
  white-space: nowrap;
  animation: floatUp 1s ease-out forwards;
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, -30%) scale(0.7); }
  15%  { opacity: 1; transform: translate(-50%, -60%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -170%) scale(1); }
}

.mode-intro {
  position: absolute; inset: 0; z-index: 35;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,8,20,0.45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  pointer-events: none; opacity: 0;
  transition: opacity 0.15s ease;
}
.mode-intro.show { opacity: 1; pointer-events: auto; transition-duration: 0.08s; }
.intro-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transform: scale(0.85); transition: transform 0.15s ease;
}
.mode-intro.show .intro-card { transform: scale(1); transition: transform 0.12s cubic-bezier(.2,1.6,.4,1); }
.intro-name {
  font-family: var(--font-d); font-weight: 800; font-size: 1.7rem;
  text-transform: uppercase; letter-spacing: 1px; color: #fff;
  text-shadow: 0 2px 18px rgba(0,0,0,0.6);
}
.intro-card .target-wrap { padding: 6px 34px 10px; min-width: 150px; }
.intro-card .target-label { font-size: 0.65rem; }
.intro-card .target-number { font-size: 4rem; }
.intro-card .target-number.is-text { font-size: 1.5rem; padding: 6px 0 2px; }

/* ── TUTORIAL ─────────────────────────────────────────────── */
.hud-item-tut { display: none; }
#screen-game.tutorial .hud-item,
#screen-game.tutorial .timebar { display: none; }
#screen-game.tutorial .hud-item-tut { display: flex; }

.tut-panel {
  position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(5,8,20,0.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.tut-panel[hidden] { display: none; }
.tut-card {
  width: min(360px, 100%); max-height: 100%; overflow-y: auto;
  background: linear-gradient(160deg, rgba(40,44,90,0.92), rgba(20,22,52,0.92));
  border: 1px solid var(--border); border-radius: 22px;
  padding: 22px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.14);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
  animation: tutIn 0.28s cubic-bezier(.2,1.4,.4,1);
}
@keyframes tutIn { from { transform: scale(0.85); opacity: 0; } }
.tut-emoji { font-size: 2.6rem; line-height: 1; }
.tut-title { font-family: var(--font-d); font-weight: 800; font-size: 1.5rem; line-height: 1.15; }
.tut-text { color: #c9cff0; font-size: 0.95rem; line-height: 1.45; }
.tut-text[hidden], .tut-example[hidden] { display: none; }
.tut-example {
  width: 100%;
  font-family: var(--font-d); font-weight: 800; font-size: 1.3rem; line-height: 1.5;
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 12px;
}
.tut-card .btn-primary { width: 100%; margin-top: 4px; }

.tut-coach {
  position: absolute; left: 50%; bottom: 18px; z-index: 7;
  transform: translateX(-50%) translateY(8px);
  max-width: 90%; width: max-content;
  padding: 10px 18px; border-radius: 16px;
  background: rgba(13,18,48,0.85); border: 1px solid var(--border);
  font-size: 0.95rem; font-weight: 800; text-align: center; line-height: 1.35;
  pointer-events: none; opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.tut-coach.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.tut-coach.warn { border-color: rgba(255,92,114,0.6); color: #ffd9de; }

/* ══ ERGEBNIS ═════════════════════════════════════════════ */
.result-card { text-align: center; align-items: center; }
.result-emoji {
  font-size: clamp(3rem, 11vw, 4rem); line-height: 1;
  animation: float 2.4s ease-in-out infinite;
  filter: drop-shadow(0 8px 22px rgba(255,201,77,0.4));
}
.result-title { font-family: var(--font-d); font-weight: 800; font-size: clamp(1.5rem, 5.5vw, 2rem); }
.result-player { color: var(--text-dim); font-size: 0.95rem; font-weight: 800; margin-top: -8px; }

.result-stars { display: flex; gap: 6px; font-size: clamp(1.6rem, 6vw, 2rem); line-height: 1; }
.result-stars span { opacity: 0.22; transform: scale(0.8); color: var(--text-dim); }
.result-stars span.on {
  opacity: 1; transform: scale(1); color: var(--accent-2);
  filter: drop-shadow(0 0 12px rgba(255,201,77,0.8));
  animation: starPop 0.45s cubic-bezier(.2,1.7,.4,1) backwards;
}
@keyframes starPop { from { transform: scale(0.1) rotate(-40deg); opacity: 0 } }

.result-score-box {
  background: linear-gradient(160deg, rgba(160,107,255,0.24), rgba(160,107,255,0.08));
  border: 1.5px solid rgba(160,107,255,0.4);
  border-radius: 18px; padding: 10px clamp(24px, 8vw, 40px);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.result-score-label {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--text-dim); font-weight: 900;
}
.result-score-value {
  font-family: var(--font-d); font-weight: 800; font-size: clamp(2.2rem, 8vw, 3rem); line-height: 1.1;
  background: linear-gradient(120deg, var(--accent-2), #ff8ad4);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.result-cell {
  min-width: 0;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: 13px; padding: 9px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.result-cell b {
  font-family: var(--font-d); font-weight: 800; font-size: 1.25rem; line-height: 1;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.result-cell span {
  font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-dim); font-weight: 900;
  max-width: 100%; line-height: 1.2; text-align: center; overflow-wrap: anywhere;
}
.result-cell.good b { color: var(--accent-3); }
.result-cell.bad  b { color: var(--danger); }

.result-actions { display: flex; gap: 10px; width: 100%; }
.result-actions button { flex: 1; padding: 0 12px; }

.save-status { font-size: 0.78rem; font-weight: 800; color: var(--text-dim); min-height: 1.2em; margin: -6px 0; }
.save-status.ok  { color: var(--accent-3); }
.save-status.bad { color: var(--danger); }

/* ══ LEADERBOARD ══════════════════════════════════════════ */
.board-card { height: min(720px, calc(100dvh - 24px)); }
.board-title { font-family: var(--font-d); font-weight: 800; font-size: clamp(1.5rem, 5.5vw, 2rem); }

.board-filter {
  width: 100%; height: var(--tap);
  padding: 0 40px 0 16px;
  font-family: var(--font-b); font-size: 1rem; font-weight: 800; color: var(--text);
  background: rgba(255,255,255,0.07) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b94bd' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 16px center / 12px 8px;
  border: 1.5px solid var(--border); border-radius: 14px;
  appearance: none; -webkit-appearance: none;
  outline: none; cursor: pointer; touch-action: manipulation;
}
.board-filter:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(160,107,255,0.2); }
.board-filter option { background: #1b1f4d; color: var(--text); }

/* Spalten: Platz | Name | Klasse | Punkte | Zeit */
.board-head, .board-row {
  /* rem statt em: Kopf und Zeilen haben verschiedene Schriftgrößen */
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) 3.4rem 4rem 3rem;
  align-items: center; gap: 6px; width: 100%;
}
.board-head {
  padding: 0 12px; margin-bottom: -8px; text-align: left;
  font-size: 0.58rem; font-weight: 900; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim);
}
.board-head span:nth-child(n+3), .board-row span:nth-child(n+3) { text-align: right; }

.board-list {
  list-style: none; width: 100%;
  flex: 1 1 auto; min-height: 120px;
  overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  display: flex; flex-direction: column; gap: 6px;
  padding: 3px;            /* Platz für den Rahmen der eigenen Zeile */
}
.board-row {
  flex: none;
  padding: 9px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid transparent;
  font-size: 0.92rem; font-weight: 800; text-align: left;
}
.board-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row span:first-child { font-family: var(--font-d); color: var(--text-dim); }
.board-row span:nth-child(3) { color: var(--text-dim); }
.board-row span:nth-child(4) { font-family: var(--font-d); font-size: 1.05rem; color: var(--accent-2); }
.board-row span:nth-child(5) { color: var(--text-dim); font-size: 0.82rem; }
/* Eigener Eintrag: umrahmt */
.board-row.me {
  border: 2px solid var(--accent-2);
  background: linear-gradient(150deg, rgba(255,201,77,0.18), rgba(255,201,77,0.06));
  box-shadow: 0 0 0 1px rgba(255,201,77,0.25), 0 6px 20px rgba(255,201,77,0.18);
}
.board-empty {
  padding: 24px 8px; text-align: center;
  color: var(--text-dim); font-size: 0.9rem; font-weight: 800;
}

/* ── PARTIKEL ─────────────────────────────────────────────── */
.particle {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 25;
  animation: pfall var(--dur, 0.7s) ease-out forwards;
}
/* Im Verliebte-Zahlen-Modus regnet es Herzchen statt Punkte */
.particle-heart {
  border-radius: 0;
  -webkit-mask: var(--heart-mask) center/contain no-repeat;
  mask: var(--heart-mask) center/contain no-repeat;
}
@keyframes pfall {
  0%   { transform: translate(0,0) scale(1); opacity: 1 }
  100% { transform: translate(var(--tx,0), var(--ty,60px)) scale(0); opacity: 0 }
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 600px) {
  :root { --hud-h: 56px; }
  .numcard-inner { font-size: clamp(1.25rem, 6vw, 1.7rem); padding: 8px 15px; }
  .blob { filter: blur(60px); opacity: 0.34; }
}

@media (max-width: 400px) {
  :root { --hud-h: 52px; --tap: 46px; }
  .hud-item-name { display: none; }        /* Platz für Punkte/Combo/Zeit */
  .hud-label { font-size: 0.48rem; }
  .hud-value { font-size: 1.02rem; }
  .result-grid { gap: 6px; }
  .result-cell b { font-size: 1.1rem; }
}

/* Laptop/Tablet: Spielfeld auf Handygröße begrenzen. Auf einem
   großen Bildschirm wären die Wege zwischen den Karten sonst
   viel länger als am Handy – ein Nachteil im Wettbewerb.
   Karten bekommen dieselbe Größe wie auf dem Handy. */
@media (min-width: 601px) and (min-height: 501px) {
  #screen-game {
    inset: 0; margin: auto;
    width: 420px; height: min(820px, calc(100dvh - 24px));
    padding: 0;
    border: 1px solid var(--border); border-radius: 26px;
    background: rgba(7,10,24,0.35);
    box-shadow: 0 24px 60px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.10);
  }
  #screen-game .hud { --safe-top: 0px; border-radius: 26px 26px 0 0; }
  #screen-game #game-field { top: var(--hud-h); }
  #screen-game .numcard-inner { font-size: 1.5rem; padding: 8px 15px; }
}

/* Querformat auf dem Handy: Banner kompakter, sonst frisst er das Feld */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --hud-h: 46px; }
  #mode-banner { flex-direction: row; align-items: center; gap: 10px; top: 6px; }
  .target-wrap { flex-direction: row; align-items: baseline; gap: 8px; padding: 2px 14px 4px; min-width: 0; }
  .target-number { font-size: 1.6rem; }
  .mode-name { font-size: 0.95rem; }
  .start-card, .result-card { padding: 16px 22px; gap: 10px; }
  .logo-icon { display: none; }
}

/* ── TON AN/AUS ───────────────────────────────────────────── */
.sound-toggle { font-size: 1rem; }
.sound-toggle.off { opacity: 0.55; }
.start-sound {
  position: absolute; top: 12px; right: 12px; z-index: 2;   /* über dem schwebenden Logo */
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
}
.start-sound:active { transform: scale(0.92); }

/* Ton-Menü */
.sound-menu {
  position: fixed; z-index: 100; width: 260px;
  padding: 6px; border-radius: 16px;
  background: rgba(20,24,58,0.97); border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; gap: 2px;
}
.sound-menu[hidden] { display: none; }
.sound-menu button {
  display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 8px;
  align-items: center; text-align: left;
  padding: 9px 10px; border-radius: 11px; border: 1.5px solid transparent;
  background: transparent; color: var(--text); font-family: var(--font-b); cursor: pointer;
  touch-action: manipulation;
}
.sound-menu button span { grid-row: 1 / 3; font-size: 1.2rem; text-align: center; }
.sound-menu button b { font-size: 0.95rem; font-weight: 800; }
.sound-menu button small { font-size: 0.72rem; color: var(--text-dim); font-weight: 700; }
.sound-menu button:hover { background: rgba(255,255,255,0.06); }
.sound-menu button[aria-checked="true"] {
  border-color: var(--accent);
  background: linear-gradient(150deg, rgba(160,107,255,0.30), rgba(160,107,255,0.12));
}
