/* =========================================================
   PIX – style.css
   Freundlich, klar, modern, kindgerecht (auch für Jugendliche).
   ========================================================= */

:root {
  --primary: #1c5d8c;        /* Wissensbuch-Blau */
  --primary-dark: #123f61;
  --accent: #2f8a8a;         /* Petrol/Teal */
  --accent-warm: #2f7fc2;    /* helles Buch-Blau (Akzent) */
  --success: #2f8a57;
  --warning: #2f7fc2;
  --risk: #b4472f;           /* Ziegelrot */
  --bg: #e3edf6;             /* helles Blaupapier */
  --paper: #f3f8fd;          /* Buchseite */
  --surface: #fbfdff;        /* Karten / Seiten */
  --text: #20303f;           /* dunkle Tinte (blaugrau) */
  --text-soft: #5a6e80;
  --line: #c7d8e6;           /* Seitenlinien */
  --shadow: 0 4px 14px rgba(24, 60, 96, 0.12);
  --shadow-lg: 0 14px 30px rgba(24, 60, 96, 0.20);
  --radius: 10px;
  --radius-sm: 8px;
  --serif: "Rockwell", "Roboto Slab", "Bookman Old Style", Georgia, "Times New Roman", serif;
}

/* ----- Dark Mode ----- */
:root[data-theme="dark"] {
  --primary: #6fb6e6;
  --primary-dark: #4f97c8;
  --accent: #57bcc7;
  --accent-warm: #5aa6e0;
  --success: #57c79a;
  --warning: #5aa6e0;
  --risk: #e07a5f;
  --bg: #131c27;             /* tiefes Nachtblau */
  --paper: #1a2533;
  --surface: #1c2836;        /* Seiten im Nachtmodus */
  --text: #e4eef7;
  --text-soft: #9fb2c5;
  --line: #314255;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 30px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Calibri", system-ui, -apple-system, Arial, sans-serif;
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
}

button { font-family: inherit; }

/* ---------- Layout ---------- */
.app-header {
  background: var(--primary);
  color: #fff;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow);
  border-bottom: 5px solid var(--accent-warm);
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-header .brand { display: flex; align-items: center; gap: 12px; }
.app-header .brand h1 { font-size: 1.2rem; margin: 0; }
.app-header .brand small { display: block; font-weight: 400; opacity: 0.9; font-size: 0.78rem; }
.brand-logo { width: 40px; height: 40px; flex: 0 0 auto; }
.brand-title {
  display: flex; flex-direction: column; line-height: 1.1;
  font-family: var(--serif);
}
.brand-title b {
  font-size: 1.35rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.brand-title small {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0.9; font-weight: 600;
}

.header-progress { flex: 1; max-width: 360px; min-width: 120px; }
.header-progress .bar-label { font-size: 0.75rem; margin-bottom: 4px; opacity: 0.95; }

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 18px 64px;
}

.view { animation: fade 0.35s ease; }
.hidden { display: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Progress bar ---------- */
.progress-track {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}
.app-header .progress-track { background: rgba(255,255,255,0.3); }
.progress-fill {
  height: 100%;
  background: var(--accent-warm);
  width: 0%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ---------- KIM speech bubble ---------- */
.kim-row { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.kim-avatar { width: 72px; height: 72px; flex: 0 0 auto; }
.kim-bubble {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px 12px 18px;
  box-shadow: var(--shadow);
  flex: 1;
}
.kim-bubble::before {
  content: "";
  position: absolute;
  left: -10px; top: 22px;
  border: 10px solid transparent;
  border-right-color: var(--surface);
}
.kim-bubble p { margin: 0; }

/* ---------- Start view ---------- */
.hero {
  text-align: center;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.hero::before {
  content: "";
  position: absolute; inset: 8px;
  border: 2px solid var(--accent-warm);
  border-radius: 6px;
  opacity: 0.4;
  pointer-events: none;
}
.hero > * { position: relative; }
.cover-kicker {
  font-family: "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.78rem; font-weight: 700; color: var(--accent-warm);
  margin: 0 0 4px;
}
.hero h2 { font-size: 2rem; margin: 8px 0; }
.hero .subtitle { color: var(--text-soft); font-size: 1.1rem; margin-bottom: 18px; }
.hero .kim-big { width: 120px; height: 120px; }

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-accent:hover { filter: brightness(0.95); }
.btn-ghost { background: transparent; color: var(--primary); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }

/* ---------- Chapter grid ---------- */
.section-title { margin: 4px 0 18px; }
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.chapter-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.chapter-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.chapter-card.locked { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.85); }
.chapter-card.locked:hover { transform: none; box-shadow: var(--shadow); border-color: var(--line); }
.chapter-card .num {
  font-size: 0.8rem; font-weight: 700; color: var(--primary);
  background: #e7f2fd; border-radius: 999px; padding: 2px 10px; align-self: flex-start;
}
.chapter-card h3 { margin: 2px 0; font-size: 1.05rem; }
.chapter-card .skill { font-size: 0.85rem; color: var(--text-soft); }
.chapter-card .status {
  margin-top: auto; font-size: 0.82rem; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.status.done { color: var(--success); }
.status.open { color: var(--primary); }
.status.locked { color: var(--text-soft); }
.badge-corner {
  position: absolute; top: 12px; right: 12px; font-size: 1.2rem;
}

/* ---------- Task view ---------- */
.task-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-top: 6px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.task-meta { color: var(--primary); font-weight: 700; font-size: 0.85rem; }
.task-card h2 { margin: 4px 0 4px; }
.task-instruction { color: var(--text-soft); margin-bottom: 18px; }

/* sort / classify shared cards */
.card-pool { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; min-height: 56px; }
.token {
  background: #f3f8fe;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  transition: transform 0.1s, box-shadow 0.1s;
}
.token:hover { box-shadow: var(--shadow); }
.token.dragging { opacity: 0.5; }
.token.placed { cursor: default; }
.token.correct { border-color: var(--success); background: #e8f8ef; }
.token.wrong { border-color: var(--risk); background: #fde9e7; }

.bins { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.bin {
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 110px;
  background: #fafdff;
  transition: border-color 0.15s, background 0.15s;
}
.bin.dragover { border-color: var(--primary); background: #eef6ff; }
.bin h4 { margin: 0 0 10px; text-align: center; font-size: 0.95rem; }
.bin .bin-items { display: flex; flex-wrap: wrap; gap: 8px; }

/* click (find AI) */
.scene-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.scene-item {
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 10px;
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.scene-item:hover { transform: translateY(-2px); border-color: var(--primary); }
.scene-item.found { border-color: var(--success); background: #e8f8ef; cursor: default; }
.scene-item.miss { border-color: var(--risk); background: #fde9e7; }

/* order (algorithm) */
.order-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.order-tab {
  border: 2px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 6px 14px; font-weight: 700; cursor: pointer;
}
.order-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.order-tab.solved { border-color: var(--success); }
.order-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.order-step {
  display: flex; align-items: center; gap: 12px;
  background: #f3f8fe; border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 14px; font-weight: 600;
}
.order-step .step-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 0.85rem; flex: 0 0 auto;
}
.order-step .step-text { flex: 1; }
.order-step .step-ctrl { display: flex; flex-direction: column; gap: 2px; }
.order-step .step-ctrl button {
  border: none; background: #e7f2fd; color: var(--primary); border-radius: 6px;
  width: 28px; height: 20px; cursor: pointer; font-weight: 700; line-height: 1;
}
.order-step .step-ctrl button:hover { background: var(--primary); color: #fff; }
.order-step.correct { border-color: var(--success); background: #e8f8ef; }
.order-step.wrong { border-color: var(--warning); background: #fff6e5; }

/* classify rows */
.classify-list { display: flex; flex-direction: column; gap: 12px; }
.classify-item {
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--surface);
}
.classify-item .statement { font-weight: 600; margin-bottom: 8px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  border: 2px solid var(--line); background: #f7fbff; border-radius: 999px;
  padding: 6px 14px; font-weight: 600; cursor: pointer; font-size: 0.9rem;
}
.choice:hover { border-color: var(--primary); }
.choice.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.classify-item.correct { border-color: var(--success); background: #e8f8ef; }
.classify-item.wrong { border-color: var(--risk); background: #fde9e7; }
.classify-item .row-feedback { font-size: 0.85rem; margin-top: 8px; color: var(--text-soft); }

/* prompt builder */
.builder-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.builder-field h4 { margin: 0 0 8px; font-size: 0.9rem; }
.option-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--line); background: #f7fbff; border-radius: 999px;
  padding: 6px 14px; font-weight: 600; cursor: pointer; font-size: 0.9rem;
}
.chip:hover { border-color: var(--primary); }
.chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.preview-box {
  background: #f3f8fe; border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 14px 0; font-size: 1.02rem;
}
.preview-box .label { font-size: 0.75rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.bad-prompt { color: var(--risk); font-weight: 700; }

/* generate / mark */
.generated-text { font-size: 1.05rem; line-height: 1.7; }

/* feedback box */
.feedback-box {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 18px;
  font-weight: 600;
  display: none;
}
.feedback-box.show { display: block; animation: fade 0.3s ease; }
.feedback-box.good { background: var(--surface); color: #1e7a45; border: 2px solid var(--success); border-left: 6px solid var(--success); }
.feedback-box.bad { background: var(--surface); color: #9a6207; border: 2px solid var(--warning); border-left: 6px solid var(--warning); }

/* memory sentence – Merkkasten (Faktenbox) */
.memory-sentence {
  margin-top: 22px;
  position: relative;
  background: var(--surface);
  border: 2px solid var(--accent-warm);
  border-left: 6px solid var(--accent-warm);
  border-radius: var(--radius-sm);
  padding: 18px 16px 14px;
  font-weight: 600;
  display: none;
}
.memory-sentence.show { display: block; }
.memory-sentence::before {
  content: "Merksatz";
  position: absolute;
  top: -11px; left: 14px;
  background: var(--accent-warm);
  color: #fff;
  font-family: var(--serif);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 2px 10px; border-radius: 4px;
}

/* rule book / steckbrief result */
.result-box {
  margin-top: 16px; background: var(--surface); border: 2px solid var(--accent);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius-sm); padding: 16px;
}
.result-box h4 { margin: 0 0 8px; }
.result-box ol, .result-box ul { margin: 0; padding-left: 20px; }
.steckbrief { font-size: 1.05rem; line-height: 1.6; }

/* ---------- Lernstand overlay ---------- */
.skill-popup {
  text-align: center; background: var(--surface); border-radius: var(--radius);
  padding: 30px 24px; box-shadow: var(--shadow-lg);
}
.skill-popup .badge { font-size: 3rem; }
.skill-popup h2 { margin: 8px 0; }
.skill-popup .new-skill { color: var(--accent); font-weight: 800; font-size: 1.2rem; }

/* ---------- Completion / certificate ---------- */
.certificate {
  text-align: center;
  background: var(--surface);
  border: 4px solid var(--accent-warm);
  border-radius: var(--radius);
  padding: 36px 26px;
  box-shadow: var(--shadow-lg);
}
.certificate h2 { font-size: 1.9rem; margin: 10px 0; }
.certificate .scout { color: var(--primary); font-weight: 800; font-size: 1.3rem; margin: 12px 0; }
.skill-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0; }
.skill-pill { background: #e7f2fd; color: var(--primary-dark); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 0.9rem; }

/* ---------- footer note ---------- */
.foot-note { text-align: center; color: var(--text-soft); font-size: 0.8rem; margin-top: 28px; }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .app-header { flex-wrap: wrap; }
  .header-progress { order: 3; max-width: 100%; width: 100%; }
  .hero h2 { font-size: 1.6rem; }
  .kim-avatar { width: 58px; height: 58px; }
}

/* =========================================================
   EYE-CANDY & JUICE – Animationen, Glow, Partikel
   ========================================================= */

/* ----- Papier-Hintergrund (ruhig, Buchoptik) ----- */
body {
  background: var(--bg);
  background-attachment: fixed;
}
:root[data-theme="dark"] body {
  background: var(--bg);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(40, 80, 120, 0.06) 0 1px, transparent 1.5px);
  background-size: 7px 7px;
}
.app-header, main { position: relative; z-index: 1; }

/* ----- View-Entrance ----- */
.view { animation: viewIn 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* ----- KIM lebt: idle-Wackeln + Reaktionen ----- */
.kim-avatar svg, .kim-big svg, .skill-popup svg, .certificate svg {
  animation: kimBob 3.2s ease-in-out infinite;
  transform-origin: bottom center;
  will-change: transform;
}
@keyframes kimBob {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50%      { transform: translateY(-6px) rotate(1.2deg); }
}
.kim-avatar.cheer svg, .kim-big.cheer svg { animation: kimCheer 0.7s ease; }
@keyframes kimCheer {
  0%   { transform: translateY(0) scale(1); }
  30%  { transform: translateY(-18px) scale(1.12) rotate(-6deg); }
  55%  { transform: translateY(0) scale(0.96) rotate(5deg); }
  75%  { transform: translateY(-8px) scale(1.05) rotate(-3deg); }
  100% { transform: translateY(0) scale(1); }
}
.kim-bubble { animation: bubblePop 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes bubblePop {
  from { opacity: 0; transform: scale(0.9) translateX(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ----- Buttons: Glanz-Sweep + Press-Juice + CTA-Puls ----- */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  transition: none;
}
.btn:hover::after { animation: sweep 0.7s ease; }
@keyframes sweep { to { left: 140%; } }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.hero .btn-primary, .daily-card .btn-accent { animation: ctaPulse 2.4s ease-in-out infinite; }
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(31,142,241,0.28); }
  50%      { box-shadow: 0 10px 28px rgba(31,142,241,0.5); }
}
.daily-card .btn-accent { animation-name: ctaPulseAccent; }
@keyframes ctaPulseAccent {
  0%, 100% { box-shadow: 0 6px 18px rgba(24,194,156,0.30); }
  50%      { box-shadow: 0 10px 30px rgba(24,194,156,0.55); }
}

/* Ripple beim Klick (per JS gesetzt) */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

/* ----- Kapitelkarten: gestaffeltes Pop-in + saftiger Hover ----- */
.chapter-card {
  opacity: 0;
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}
.chapter-card:hover { transform: translateY(-4px); }
.chapter-card:not(.locked)::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(31,142,241,0.0), rgba(24,194,156,0.12));
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.chapter-card:not(.locked):hover::before { opacity: 1; }
.chapter-card .num { transition: transform 0.2s; }
.chapter-card:hover .num { transform: scale(1.08); }
.badge-corner { animation: starSpin 3s ease-in-out infinite; transform-origin: center; }
.badge-corner.star-result { animation: none; }
@keyframes starSpin {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50%      { transform: rotate(8deg) scale(1.18); }
}
/* "Verfügbar"-Karte zieht den Blick */
.chapter-card .status.open { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* Locked-Karte schüttelt bei Klick (per JS) */
.shake { animation: shake 0.45s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-1deg); }
  40% { transform: translateX(7px) rotate(1deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ----- Progress-Bar: animierte Streifen + Glow ----- */
.progress-fill {
  background-image:
    linear-gradient(90deg, var(--accent-warm), #ffd56b),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.25) 0 10px, transparent 10px 20px);
  background-blend-mode: overlay;
  background-size: 100% 100%, 40px 40px;
  box-shadow: 0 0 12px rgba(255,176,32,0.7);
  animation: stripes 1s linear infinite;
}
@keyframes stripes { from { background-position: 0 0, 0 0; } to { background-position: 0 0, 40px 0; } }
.progress-fill.level-up { animation: stripes 1s linear infinite, barPulse 0.6s ease; }
@keyframes barPulse {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.8); }
  100% { filter: brightness(1); }
}

/* ----- Aufgabe: Token/Choice/Scene Juice ----- */
.token { transition: transform 0.12s, box-shadow 0.15s, background 0.2s, border-color 0.2s; }
.token:hover { transform: translateY(-2px) scale(1.05); box-shadow: var(--shadow-lg); }
.token:active { transform: scale(0.96) rotate(-2deg); }
.token.correct { animation: pop 0.4s ease; }
.token.wrong { animation: shake 0.45s; }
@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
.bin.dragover { animation: binGlow 0.8s ease-in-out infinite; }
@keyframes binGlow {
  0%,100% { box-shadow: 0 0 0 rgba(31,142,241,0); }
  50% { box-shadow: 0 0 18px rgba(31,142,241,0.5); }
}
.scene-item { transition: transform 0.14s, box-shadow 0.15s, border-color 0.15s, background 0.15s; }
.scene-item:hover { transform: translateY(-4px) scale(1.04); box-shadow: var(--shadow); }
.scene-item.found { animation: pop 0.4s ease; }
.scene-item.miss { animation: shake 0.45s; }
.choice, .chip { transition: transform 0.12s, background 0.2s, border-color 0.2s, box-shadow 0.15s; }
.choice:hover, .chip:hover { transform: translateY(-2px) scale(1.04); }
.choice.selected, .chip.selected { animation: pop 0.35s ease; }
.classify-item.correct { animation: pop 0.4s ease; }
.classify-item.wrong { animation: shake 0.45s; }
.order-step { transition: transform 0.15s, box-shadow 0.15s, background 0.2s; }
.order-step.correct { animation: pop 0.4s ease; }

/* ----- Feedback-Box + Merksatz Pop ----- */
.feedback-box.show { animation: popIn 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.feedback-box.good { box-shadow: 0 0 0 2px var(--success), 0 8px 24px rgba(40,180,99,0.3); }
.memory-sentence.show { animation: slideGlow 0.5s ease; }
@keyframes popIn {
  from { opacity: 0; transform: scale(0.85) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes slideGlow {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: none; }
}
.result-box { animation: popIn 0.5s cubic-bezier(0.22, 1, 0.36, 1); }

/* ----- Lernstand-Popup: Zoom-Bounce + Strahlen ----- */
.skill-popup { animation: zoomBounce 0.6s cubic-bezier(0.18, 1.5, 0.5, 1); position: relative; overflow: hidden; }
@keyframes zoomBounce {
  0% { opacity: 0; transform: scale(0.6); }
  60% { opacity: 1; transform: scale(1.06); }
  100% { transform: scale(1); }
}
.skill-popup::before {
  content: "";
  position: absolute;
  top: -40%; left: 50%;
  width: 220%; height: 220%;
  transform: translateX(-50%);
  background: repeating-conic-gradient(from 0deg, rgba(255,176,32,0.16) 0deg 12deg, transparent 12deg 24deg);
  animation: rays 14s linear infinite;
  z-index: 0;
  pointer-events: none;
}
.skill-popup > * { position: relative; z-index: 1; }
@keyframes rays { to { transform: translateX(-50%) rotate(360deg); } }
.skill-popup .badge { display: inline-block; animation: badgePulse 1.2s ease-in-out infinite; }
@keyframes badgePulse {
  0%,100% { transform: scale(1) rotate(0); }
  50% { transform: scale(1.3) rotate(10deg); filter: drop-shadow(0 0 12px rgba(255,176,32,0.9)); }
}
.skill-popup .new-skill {
  background: linear-gradient(90deg, var(--accent), var(--primary), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 3s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

/* ----- Zertifikat: glänzender Rahmen + Scout-Glow ----- */
.certificate { position: relative; overflow: hidden; animation: zoomBounce 0.7s cubic-bezier(0.18, 1.5, 0.5, 1); }
.certificate::before {
  content: "";
  position: absolute; inset: -50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(255,176,32,0.25) 60deg, transparent 120deg);
  animation: rays 10s linear infinite;
  pointer-events: none;
}
.certificate > * { position: relative; z-index: 1; }
.certificate .scout {
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent-warm), var(--primary));
  background-size: 300% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 4s linear infinite;
  text-shadow: none;
}
.skill-pill { animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards; }

/* ----- Partikel-/Konfetti-Layer ----- */
#fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}
.confetti {
  position: absolute;
  width: 10px; height: 14px;
  will-change: transform, opacity;
  animation: confettiFall var(--dur, 1.6s) cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translate3d(0,0,0) rotate(0); }
  100% { opacity: 0; transform: translate3d(var(--dx,0), var(--dy,520px), 0) rotate(var(--rot,720deg)); }
}
.spark {
  position: absolute;
  font-size: 22px;
  will-change: transform, opacity;
  animation: sparkBurst 0.9s ease-out forwards;
}
@keyframes sparkBurst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.4); }
  60% { opacity: 1; transform: translate(calc(-50% + var(--sx,0)), calc(-50% + var(--sy,0))) scale(1.2); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--sx,0)), calc(-50% + var(--sy,0))) scale(0.8); }
}
.xp-pop {
  position: absolute;
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--accent-warm);
  text-shadow: 0 2px 6px rgba(0,0,0,0.25);
  will-change: transform, opacity;
  animation: xpFloat 1.2s ease-out forwards;
  white-space: nowrap;
}
@keyframes xpFloat {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -10px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -90px) scale(1); }
}

/* Kurzer Vollbild-Glanz bei Erfolg */
#fx-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(circle at center, rgba(255,255,255,0.55), transparent 60%);
  opacity: 0;
}
#fx-flash.go { animation: flash 0.5s ease; }
@keyframes flash { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   DARK MODE – Toggle-Button & Anpassungen
   ========================================================= */

/* Umschalt-Button im Header */
.theme-toggle {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { transform: scale(1.1) rotate(-12deg); background: rgba(255, 255, 255, 0.3); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle .theme-icon { display: inline-block; transition: transform 0.4s ease; }
:root[data-theme="dark"] .theme-toggle .theme-icon { transform: rotate(360deg); }

/* Flächen, die feste helle Farben nutzen, im Dark Mode abdunkeln */
:root[data-theme="dark"] .token,
:root[data-theme="dark"] .preview-box,
:root[data-theme="dark"] .order-step {
  background: #3a3322;
}
:root[data-theme="dark"] .bin { background-color: rgba(255, 255, 255, 0.03); }
:root[data-theme="dark"] .scene-item { background: var(--surface); }
:root[data-theme="dark"] .choice,
:root[data-theme="dark"] .chip { background: #3a3322; }
:root[data-theme="dark"] .classify-item { background: var(--surface); }
:root[data-theme="dark"] .chapter-card .num,
:root[data-theme="dark"] .skill-pill { background: rgba(74, 168, 255, 0.18); color: var(--primary); }
:root[data-theme="dark"] .order-step .step-ctrl button { background: rgba(74, 168, 255, 0.18); }

/* farbige Status-/Ergebnisflächen abdunkeln */
:root[data-theme="dark"] .token.correct,
:root[data-theme="dark"] .scene-item.found,
:root[data-theme="dark"] .classify-item.correct,
:root[data-theme="dark"] .order-step.correct { background: rgba(61, 220, 132, 0.16); }
:root[data-theme="dark"] .token.wrong,
:root[data-theme="dark"] .scene-item.miss,
:root[data-theme="dark"] .classify-item.wrong { background: rgba(255, 107, 94, 0.16); }
:root[data-theme="dark"] .order-step.wrong { background: rgba(245, 176, 65, 0.16); }
:root[data-theme="dark"] .result-box { background: rgba(47, 214, 174, 0.12); }
:root[data-theme="dark"] .feedback-box.good { background: rgba(61, 220, 132, 0.14); color: #8af0b5; }
:root[data-theme="dark"] .feedback-box.bad { background: rgba(245, 176, 65, 0.14); color: #ffd591; }
:root[data-theme="dark"] .memory-sentence {
  background: linear-gradient(135deg, rgba(255, 194, 77, 0.16), rgba(255, 176, 32, 0.1));
  color: var(--text);
}

/* Brand-Logo/KIM-Augen bleiben gut sichtbar; Masthead bleibt im Dunkeln dunkel */
:root[data-theme="dark"] .app-header { background: #15324a; }
:root[data-theme="dark"] .kim-bubble { background: var(--surface); }
:root[data-theme="dark"] .kim-bubble::before { border-right-color: var(--surface); }

/* Flash dezenter im Dunkeln */
:root[data-theme="dark"] #fx-flash {
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3), transparent 60%);
}

/* ============================================================
   STERNE · STATS · TAGESZIEL · TAP-TO-MOVE · A11Y
   ============================================================ */

/* --- Sterne-Bewertung --- */
.star-result { display: inline-flex; gap: 2px; align-items: center; line-height: 1; }
.star-result .star { font-size: 1.05rem; }
.star-result .star.on { color: #ffb020; text-shadow: 0 1px 2px rgba(230, 149, 0, 0.4); }
.star-result .star.off { color: rgba(0, 0, 0, 0.18); }
:root[data-theme="dark"] .star-result .star.off { color: rgba(255, 255, 255, 0.18); }
.star-result.big .star { font-size: 2rem; }
.star-result.big { margin: 6px 0 2px; animation: starPop 0.5s ease-out; }
.badge-corner.star-result { background: none; box-shadow: none; padding: 0; }
@keyframes starPop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
.bonus-xp { color: #e69500; font-weight: 700; white-space: nowrap; }

/* --- Stats-Leiste auf dem Startbildschirm --- */
.stats-bar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin: 14px auto 4px; max-width: 600px;
}
.stats-bar .stat {
  background: var(--surface, #fff);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 10px 14px; min-width: 78px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.stats-bar .stat-num { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.stats-bar .stat-lbl { font-size: 0.72rem; color: var(--muted, #667); text-transform: uppercase; letter-spacing: 0.04em; }
.stats-bar .stat.stage { background: linear-gradient(135deg, var(--accent, #18c29c), var(--primary, #1f8ef1)); }
.stats-bar .stat.stage .stat-num { color: #fff; font-size: 0.95rem; }
.stats-bar .stat.stage .stat-lbl { color: rgba(255, 255, 255, 0.85); }
:root[data-theme="dark"] .stats-bar .stat { background: var(--surface); border-color: rgba(255, 255, 255, 0.08); }

/* --- Tagesziel-Karte --- */
.daily-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(255, 176, 32, 0.14), rgba(24, 194, 156, 0.12));
  border: 1.5px solid rgba(255, 176, 32, 0.4);
  border-radius: 16px; padding: 14px 18px; margin: 4px 0 18px;
}
.daily-card .daily-icon { font-size: 2rem; line-height: 1; }
.daily-card .daily-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.daily-card .daily-info strong { color: var(--text); }
.daily-card .daily-info span { font-size: 0.9rem; color: var(--muted, #556); }
.daily-card .daily-check { font-size: 1.6rem; color: var(--accent, #18c29c); font-weight: 800; }
.daily-card.done { border-color: rgba(24, 194, 156, 0.45); opacity: 0.92; }
:root[data-theme="dark"] .daily-card .daily-info span { color: #aab6c8; }

/* --- Tap-to-Move Hinweis + ausgewähltes Token --- */
.tap-hint { font-size: 0.85rem; color: var(--muted, #667); margin: 4px 0 10px; }
.token.selected {
  outline: 3px solid var(--accent, #18c29c);
  outline-offset: 2px;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 16px rgba(24, 194, 156, 0.35);
}

/* --- Fokus-Sichtbarkeit (Tastatur/A11y) --- */
.token:focus-visible,
.bin:focus-visible,
.card-pool:focus-visible,
.scene-item:focus-visible,
.choice:focus-visible {
  outline: 3px solid var(--primary, #1f8ef1);
  outline-offset: 2px;
}
.bin[role="button"] { cursor: pointer; }

/* --- Footer + Eltern-/Lehrkräftebereich --- */
.app-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  padding: 18px 16px 26px; margin-top: 12px;
  font-size: 0.85rem; color: var(--muted, #667);
}
.footer-link {
  background: none; border: none; cursor: pointer;
  color: var(--primary, #1f8ef1); font: inherit; font-weight: 700;
  padding: 4px 8px; border-radius: 8px;
}
.footer-link:hover { background: rgba(31, 142, 241, 0.1); }
.footer-sep { opacity: 0.5; }

.parent-block {
  background: var(--surface, #fff);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px; padding: 18px 20px; margin: 0 auto 16px; max-width: 760px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.parent-block h3 { margin: 0 0 8px; color: var(--primary, #1f8ef1); }
.parent-block.privacy { border-color: rgba(24, 194, 156, 0.4); background: linear-gradient(135deg, rgba(24, 194, 156, 0.08), transparent); }
.parent-claim { font-weight: 600; }
.parent-goals { display: flex; flex-direction: column; gap: 10px; }
.pg-item { border-left: 3px solid var(--primary, #1f8ef1); padding: 4px 0 4px 12px; }
.pg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pg-done { color: var(--accent, #18c29c); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.pg-goal { margin: 4px 0 2px; }
.pg-talk { margin: 0; font-size: 0.88rem; color: var(--muted, #667); font-style: italic; }
:root[data-theme="dark"] .parent-block { background: var(--surface); border-color: rgba(255, 255, 255, 0.08); }
:root[data-theme="dark"] .pg-talk,
:root[data-theme="dark"] .app-footer { color: #aab6c8; }

/* ============================================================
   AUFHÜBSCHEN: MISSIONS-ICONS · AKZENTFARBEN · TYPO · TEASER
   ============================================================ */

/* --- Verspielte, kräftige Headlines --- */
.hero h2,
.section-title,
.skill-popup h2,
.certificate h2 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}
.hero h2 {
  font-size: 2.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}
.section-title {
  font-size: 1.55rem;
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--accent-warm);
  color: var(--primary-dark);
}
.section-title::before {
  content: "📖"; font-size: 1.3rem;
}

/* --- Hero: schwebende KIM + Teaser --- */
.kim-big.floaty svg { animation: kimBob 3.2s ease-in-out infinite, heroGlow 4s ease-in-out infinite; }
@keyframes heroGlow {
  0%,100% { filter: drop-shadow(0 8px 16px rgba(31,142,241,0.25)); }
  50%     { filter: drop-shadow(0 14px 26px rgba(24,194,156,0.4)); }
}
.teaser {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  margin: 18px auto 4px; max-width: 560px;
}
.teaser-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-bottom: 3px solid var(--accent-warm);
  border-radius: 10px; padding: 10px 14px; min-width: 110px;
  transition: transform 0.18s ease;
}
.teaser-item:hover { transform: translateY(-4px) scale(1.03); }
.teaser-icon { font-size: 1.9rem; line-height: 1; }
.teaser-txt { font-size: 0.86rem; font-weight: 700; color: var(--text); }
:root[data-theme="dark"] .teaser-item { border-color: rgba(74,168,255,0.25); }

/* --- Kapitelkarten: Akzentleiste + Themen-Icon --- */
.chapter-card {
  --card-accent: var(--primary, #1f8ef1);
  overflow: hidden;
  padding-top: 20px;
}
.card-accent-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--card-accent), color-mix(in srgb, var(--card-accent) 50%, #ffffff));
  z-index: 2;
}
.chapter-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; align-self: flex-start;
  background: color-mix(in srgb, var(--card-accent) 16%, #ffffff);
  border: 1.5px solid color-mix(in srgb, var(--card-accent) 35%, #ffffff);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--card-accent) 22%, transparent);
  transition: transform 0.2s ease;
}
.chapter-card:hover .chapter-icon { transform: scale(1.1) rotate(-4deg); }
.chapter-card .num {
  color: var(--card-accent);
  background: color-mix(in srgb, var(--card-accent) 14%, #ffffff);
}
.chapter-card .status.open { color: var(--card-accent); }
.chapter-card:hover { border-color: var(--card-accent); }

/* Verfügbare Karte hervorheben: leuchtender Rahmen + sanfter Puls */
.chapter-card.open-card {
  border-color: var(--card-accent);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--card-accent) 28%, transparent);
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards, openGlow 2.2s ease-in-out 0.6s infinite;
}
@keyframes openGlow {
  0%,100% { box-shadow: 0 6px 18px color-mix(in srgb, var(--card-accent) 22%, transparent); }
  50%     { box-shadow: 0 10px 30px color-mix(in srgb, var(--card-accent) 48%, transparent); }
}
.chapter-card.open-card .status.open::after {
  content: " →"; transition: transform 0.2s;
}
/* Abgeschlossene Karte: dezenter Akzent-Tint */
.chapter-card.done-card {
  background: linear-gradient(160deg, color-mix(in srgb, var(--card-accent) 7%, var(--surface)), var(--surface));
}
.chapter-card.done-card .chapter-icon {
  background: color-mix(in srgb, var(--success, #18c29c) 16%, #ffffff);
  border-color: color-mix(in srgb, var(--success, #18c29c) 35%, #ffffff);
}

/* Akzent-Overlay-Hover an Karten-Akzent koppeln */
.chapter-card:not(.locked)::before {
  background: linear-gradient(135deg, transparent, color-mix(in srgb, var(--card-accent) 14%, transparent));
}

:root[data-theme="dark"] .chapter-icon {
  background: color-mix(in srgb, var(--card-accent) 28%, var(--surface));
  border-color: color-mix(in srgb, var(--card-accent) 45%, var(--surface));
}
:root[data-theme="dark"] .chapter-card .num {
  background: color-mix(in srgb, var(--card-accent) 28%, var(--surface));
}

/* --- Header-Fortschritt etwas kräftiger --- */
.progress-track { height: 14px; }
.progress-fill {
  background: linear-gradient(90deg, var(--accent-warm, #ffb020), #ff8c42);
  position: relative;
}

/* --- dezente Papierstruktur (Buchoptik) --- */
body::before {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(40, 80, 120, 0.06) 0 1px, transparent 1.5px);
  background-size: 7px 7px;
}

/* Reduced motion respektieren */
@media (prefers-reduced-motion: reduce) {
  .hero h2 { animation: none; }
  .kim-big.floaty svg { animation: none; }
  .chapter-card.open-card { animation: cardIn 0.5s ease forwards; }
}

/* ============================================================
   SPIEL-HAUPTMENÜ (Startbildschirm)
   ============================================================ */
.game-menu {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.2fr);
  align-items: center;
  gap: 28px;
  background:
    radial-gradient(1100px 500px at 15% -20%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 60%),
    radial-gradient(900px 480px at 110% 120%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 55%),
    linear-gradient(160deg, var(--surface), var(--paper));
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 30px 38px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.game-menu::before {
  content: "";
  position: absolute; inset: 10px;
  border: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: 12px;
  pointer-events: none;
}
.game-menu > * { position: relative; z-index: 1; }

/* Linke Seite: Roboterkopf */
.menu-left { display: flex; justify-content: center; align-items: center; }
.menu-left .kim-big { width: clamp(120px, 18vw, 165px); height: auto; }
.menu-left .kim-big svg { width: 100%; height: auto; filter: drop-shadow(0 12px 22px color-mix(in srgb, var(--primary) 40%, transparent)); }

/* Rechte Seite: Logo + Menü */
.menu-right { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.menu-logo {
  width: min(240px, 62%);
  height: auto;
  align-self: center;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.18));
  animation: menuLogoIn 0.6s cubic-bezier(0.18, 1.3, 0.5, 1) both;
}
@keyframes menuLogoIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}
.menu-tagline {
  margin: -2px 0 6px;
  text-align: center;
  font-family: "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
}

/* Vertikales Menü */
.menu-nav { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 12px 18px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.14s ease, box-shadow 0.16s ease, border-color 0.16s, background 0.2s, color 0.2s;
}
.menu-item .menu-ico {
  width: 30px; flex: 0 0 auto; text-align: center;
  font-size: 1.15rem;
}
.menu-item .menu-txt { flex: 1; }
/* Glanz-Sweep beim Hover */
.menu-item::after {
  content: "";
  position: absolute; top: 0; left: -130%;
  width: 55%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg);
}
.menu-item:hover::after { animation: sweep 0.7s ease; }
.menu-item:hover {
  transform: translateX(6px);
  border-color: var(--primary);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 26%, transparent);
}
.menu-item:active { transform: translateX(6px) scale(0.99); }
.menu-item:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
/* Pfeil-Indikator wie im Spielmenü */
.menu-item::before {
  content: "›";
  position: absolute; right: 16px;
  font-size: 1.4rem; font-weight: 800;
  color: var(--primary);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.16s, transform 0.16s;
}
.menu-item:hover::before { opacity: 1; transform: none; }

.menu-item--primary {
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  border-color: var(--primary-dark);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 40%, transparent);
  animation: menuPrimaryPulse 2.6s ease-in-out infinite;
}
.menu-item--primary .menu-ico { font-size: 1rem; }
.menu-item--primary::before { color: #fff; }
.menu-item--primary:hover { border-color: #fff; }
@keyframes menuPrimaryPulse {
  0%,100% { box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 35%, transparent); }
  50%     { box-shadow: 0 12px 30px color-mix(in srgb, var(--primary) 60%, transparent); }
}
.menu-item--danger { color: var(--risk); }
.menu-item--danger .menu-ico, .menu-item--danger::before { color: var(--risk); }
.menu-item--danger:hover { border-color: var(--risk); box-shadow: 0 8px 20px color-mix(in srgb, var(--risk) 26%, transparent); }

/* Stats/Teaser im Menü etwas kompakter */
.menu-right .stats-bar,
.menu-right .teaser { margin: 4px 0 2px; }

@media (max-width: 680px) {
  .game-menu {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 28px 22px;
  }
  .menu-left .kim-big { width: clamp(120px, 40vw, 160px); }
  .menu-logo { width: min(240px, 80%); }
}

@media (prefers-reduced-motion: reduce) {
  .menu-item--primary { animation: none; }
  .menu-logo { animation: none; }
}





