/* Verstecktes Minigame "Stromkreis" (js/minigame.js).
   Eigene Datei statt eines Blocks in app.css: Das Spiel soll keine Zeile der App-Styles
   beruehren. Es nutzt nur die Farb-Token aus app.css (--surface, --accent, ...), dadurch passt
   es sich jedem Farbschema an, ohne hier eigene Fassungen zu brauchen.
   Auf der Landing Page (landing.css) gibt es diese Token nicht - dort greifen die Rueckfallwerte
   in var(..., x): das dunkle Noquu-Gelb der Landing Page. */

.sk-huelle {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s ease;
}
.sk-huelle.sk-offen { opacity: 1; }

.sk-karte {
  width: 100%; max-width: 440px; max-height: 100%; overflow: auto;
  background: var(--surface, #26272b); color: var(--text, #ececea);
  border: 1px solid var(--border, #313236); border-radius: var(--r-lg, 26px);
  padding: 18px 18px 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transform: translateY(12px) scale(0.97);
  transition: transform .3s var(--ease-spring-soft, ease), box-shadow .4s ease;
}
.sk-offen .sk-karte { transform: none; }
.sk-karte.sk-gewonnen { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--accent, #f2c230), 0 0 40px var(--accent-soft, rgba(242, 194, 48, 0.14)); }

.sk-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sk-titel { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.sk-unter { font-size: 13px; color: var(--text-muted, #a2a39f); margin-top: 2px; }
.sk-zu {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--surface-raised, #313236); color: var(--text-muted, #a2a39f); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sk-zu:hover { color: var(--text, #ececea); }
.sk-zu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.sk-werte {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 12px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.sk-werte span {
  padding: 5px 10px; border-radius: 999px;
  background: var(--surface-raised, #313236); color: var(--text-muted, #a2a39f);
}
.sk-werte span:first-child { background: var(--accent-soft, rgba(242, 194, 48, 0.14)); color: var(--accent, #f2c230); }

.sk-feld {
  --sk-n: 4;
  display: grid; grid-template-columns: repeat(var(--sk-n), 1fr); gap: 3px;
  padding: 6px; border-radius: var(--r-sm, 16px);
  background: var(--sunken, #1e1f22);
  aspect-ratio: 1 / 1;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.sk-zelle {
  position: relative; padding: 0; border: none; cursor: pointer;
  background: var(--surface, #26272b); border-radius: 8px;
  color: var(--text-muted, #a2a39f);
  -webkit-tap-highlight-color: transparent;
  transition: background .2s ease, color .2s ease;
}
.sk-zelle:hover { background: var(--surface-raised, #313236); }
.sk-zelle:focus-visible { outline: 2px solid var(--accent, #f2c230); outline-offset: 1px; }
.sk-zelle.sk-an { color: var(--accent, #f2c230); }
.sk-dreh {
  position: absolute; inset: 0; display: block;
  transition: transform .22s var(--ease-spring, ease);
}
.sk-dreh svg { width: 100%; height: 100%; display: block; overflow: visible; }
.sk-symbol { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sk-leitung line { stroke: currentColor; stroke-width: 13; stroke-linecap: butt; }
.sk-knoten { fill: currentColor; }

.sk-quelle { fill: var(--accent, #f2c230); }
.sk-blitz { fill: var(--accent-text, #1a1704); }

.sk-lampe { fill: var(--surface-raised, #313236); stroke: currentColor; stroke-width: 5; transition: fill .25s ease; }
.sk-wendel { fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; }
.sk-an .sk-lampe { fill: var(--accent, #f2c230); }
.sk-an .sk-wendel { stroke: var(--accent-text, #1a1704); }
.sk-an.sk-lampe-zelle .sk-symbol { filter: drop-shadow(0 0 6px var(--accent, #f2c230)); }

.sk-gewonnen .sk-zelle.sk-an { animation: sk-puls .9s ease 1; }
@keyframes sk-puls { 40% { background: var(--accent-soft, rgba(242, 194, 48, 0.14)); } }

.sk-meldung { min-height: 20px; margin: 12px 2px 0; font-size: 14px; font-weight: 700; color: var(--accent, #f2c230); }
.sk-meldung:empty { margin-top: 0; }

.sk-fuss { display: flex; gap: 8px; margin-top: 12px; }
.sk-knopf {
  flex: 1; padding: 12px 14px; border-radius: 999px; border: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700;
}
.sk-knopf[hidden] { display: none; }
.sk-zweit { background: var(--surface-raised, #313236); color: var(--text, #ececea); }
.sk-haupt { background: var(--accent, #f2c230); color: var(--accent-text, #1a1704); }

@media (prefers-reduced-motion: reduce) {
  .sk-huelle, .sk-karte, .sk-dreh { transition: none; }
  .sk-gewonnen .sk-zelle.sk-an { animation: none; }
}
