/* Spielfeld-Styles: Verlauf, Eingabe, Ergebnis, Buchstabenstatus, Design-Overrides */
/* DESIGN-VERBESSERUNGEN ANFANG */

/* Typografie-Hierarchie */
.start-section-titel {
  font-size: 1.15rem;
  letter-spacing: .3px;
}

/* Mehr Luft zwischen Abschnitten */
#start-screen {
  gap: 20px;
  padding: 28px 0;
}

/* Karten: mehr Rundung und Luft */
.start-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  gap: 12px;
}

/* Titelzeile in Karten ohne Rahmen */
.start-section-titel {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 2px;
}

/* Primäre Buttons größer und einladender */
.btn-primary {
  padding: 16px;
  border-radius: 8px;
  font-size: 1.05rem;
  letter-spacing: .2px;
}

/* Sekundäre Buttons weicher */
.btn-secondary {
  padding: 13px;
  border-radius: 8px;
}

/* Hover-Effekte weicher */
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  transition: all .2s ease;
}

.btn-secondary:hover {
  background: var(--border);
  transform: translateY(-1px);
  transition: all .2s ease;
}

/* Mobile: mehr Luft */
@media(max-width: 560px) {
  #start-screen {
    gap: 16px;
    padding: 20px 0;
  }
  .start-section {
    padding: 14px 16px;
  }
  .btn-primary {
    padding: 15px;
  }
}

/* Details/Summary in Anleitung schöner */
details {
  border-radius: 10px !important;
  transition: box-shadow .2s ease;
}
details[open] {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
details summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details summary::after {
  content: '▸';
  font-size: .85rem;
  color: var(--text-muted);
  transition: transform .2s ease;
}
details[open] summary::after {
  transform: rotate(90deg);
}

/* Themes stärker integrieren */
[data-design="fuchsbau"] .btn-primary {
  background: #8B5E3C;
}
[data-design="fuchsbau"] .btn-primary:hover {
  background: #6B4422;
}
[data-design="fuchsbau"] .start-section {
  border-color: #c4a882;
}
[data-design="fuchsbau"] .start-section-titel {
  border-color: #c4a882;
}

[data-design="natur-tag"] .btn-primary {
  background: #3a8a3a;
}
[data-design="natur-tag"] .btn-primary:hover {
  background: #2a6a2a;
}
[data-design="natur-tag"] .start-section {
  border-color: #8bc48b;
}
[data-design="natur-tag"] .start-section-titel {
  border-color: #8bc48b;
}

[data-design="natur-nacht"] .btn-primary {
  background: #4a6fa5;
}
[data-design="natur-nacht"] .btn-primary:hover {
  background: #3a5a8a;
}
[data-design="natur-nacht"] .start-section {
  border-color: #2a3050;
  background: #141828;
}

/* Reduzierte Bewegung respektieren */
@media(prefers-reduced-motion: reduce) {
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
  }
  details summary::after {
    transition: none;
  }
}

/* Mini-Fuchs Startseite Animationen */
@keyframes warten {
  0%,100%{transform:translateY(0) rotate(0deg)}
  50%{transform:translateY(-2px) rotate(1deg)}
}
@keyframes schwanz {
  0%,100%{transform:rotate(0deg)}
  50%{transform:rotate(15deg)}
}
@keyframes schwanz-wedeln {
  0%,100%{transform:rotate(0deg)}
  50%{transform:rotate(15deg)}
}

/* Fuchs als Overlay im Hintergrundbild */
#fuchs-overlay {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  display: none;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
}
#fuchs-overlay svg {
  display: block;
}

/* Uhr-Overlay für Design-Hintergründe */
#uhr-overlay {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  display: none;
}

/* Standard: Fuchs rechts neben dem Eingabefeld */
[data-design="standard"] #fuchs-container {
  display: flex !important;
}

/* =============================================
   DESIGN-KARTEN
   ============================================= */
.design-karten-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.design-karte {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color .2s, transform .15s;
}
.design-karte:hover {
  transform: translateY(-2px);
}
.design-karte.aktiv {
  border-color: var(--accent);
}
.design-karte.aktiv .design-karte-haken {
  display: flex;
}
.design-karte input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.design-karte-vorschau {
  height: 64px;
  display: flex;
  align-items: flex-end;
  padding: 6px 8px;
  position: relative;
}
.design-karte-haken {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: .7rem;
  font-weight: 700;
}
.design-karte-label {
  padding: 8px 10px;
  background: rgba(0,0,0,.08);
}
.design-karte-name {
  font-size: .88rem;
  font-weight: 700;
  display: block;
}
.design-karte-desc {
  font-size: .75rem;
  opacity: .75;
  display: block;
  margin-top: 2px;
}

/* Vorschau-Farben pro Design */
.design-karte[data-design="standard"] .design-karte-vorschau {
  background: linear-gradient(135deg, #f5f2ee 60%, #2c5f8a 100%);
}
.design-karte[data-design="standard"] .design-karte-label {
  background: #f5f2ee;
  color: #1c1a17;
}
.design-karte[data-design="fuchsbau"] .design-karte-vorschau {
  background: linear-gradient(180deg, #c8a070 0%, #8B5E3C 60%, #6a3e20 100%);
}
.design-karte[data-design="fuchsbau"] .design-karte-vorschau::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; width: 4px; height: 40%;
  background: #5a3520;
  border-radius: 0 0 4px 4px;
  opacity: .6;
}
.design-karte[data-design="fuchsbau"] .design-karte-vorschau::after {
  content: '';
  position: absolute;
  top: 0; left: 40%; width: 3px; height: 30%;
  background: #5a3520;
  border-radius: 0 0 4px 4px;
  opacity: .5;
}
.design-karte[data-design="fuchsbau"] .design-karte-label {
  background: #f2e8d5;
  color: #3a1a00;
}
.design-karte[data-design="natur-tag"] .design-karte-vorschau {
  background: linear-gradient(180deg, #87CEEB 0%, #87CEEB 55%, #5a9e30 55%, #5a9e30 100%);
}
.design-karte[data-design="natur-tag"] .design-karte-vorschau::before {
  content: '';
  position: absolute;
  bottom: 0; left: 20%;
  width: 12px; height: 32px;
  background: radial-gradient(ellipse at 50% 100%, #228B22 60%, transparent 100%);
  border-radius: 50% 50% 0 0;
}
.design-karte[data-design="natur-tag"] .design-karte-label {
  background: #e8f4e8;
  color: #1a3a1a;
}
.design-karte[data-design="natur-nacht"] .design-karte-vorschau {
  background: #080c20;
}
.design-karte[data-design="natur-nacht"] .design-karte-vorschau::before {
  content: '';
  position: absolute;
  top: 8px; right: 16px;
  width: 14px; height: 14px;
  background: #FFF8DC;
  border-radius: 50%;
  box-shadow: -3px 0 0 2px #080c20;
}
.design-karte[data-design="natur-nacht"] .design-karte-label {
  background: #141828;
  color: #e8eaf6;
}

/* Hell/Dunkel Umschalter */
.hell-dunkel-schalter {
  display: flex;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.hell-dunkel-option {
  flex: 1;
  padding: 10px;
  cursor: pointer;
  text-align: center;
  font-size: .9rem;
  font-weight: 700;
  background: var(--surface);
  color: var(--text-muted);
  transition: background .15s, color .15s;
  position: relative;
}
.hell-dunkel-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.hell-dunkel-option.aktiv {
  background: var(--accent);
  color: #fff;
}

/* =============================================
   FUCHS-ILLUSTRATIONEN in Abschnitts-Titeln
   ============================================= */
.start-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  border-radius: 6px 6px 0 0;
  margin: -4px -4px 4px;
  padding: 4px 4px 8px;
  transition: background .15s;
}
.start-section-header:hover {
  background: var(--key-bg);
}
.start-section-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  flex: 1;
  letter-spacing: .3px;
}
.section-fuchs {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}

/* =============================================
   AKKORDEON — Chevron, Textfarbe, Trenner
   ============================================= */

/* Alle Toggle-Buttons: immer lesbarer dunkler Text */
.start-section h2 {
  margin: 0;
}
.start-section h2 button[aria-expanded] {
  color: var(--text) !important;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 2px 0;
}
.start-section h2 button[aria-expanded]:hover {
  color: var(--accent) !important;
}

/* Chevron-Pfeil — dreht sich beim Aufklappen */
.start-section h2 button[aria-expanded]::after {
  content: '▾';
  font-size: .9rem;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--accent);
  flex-shrink: 0;
  display: inline-block;
  transition: transform .2s ease;
  margin-left: 8px;
}
.start-section h2 button[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

/* Bare h2 direkt in .start-section (ohne .start-section-header) */
.start-section > h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Inhalt-Bereiche: kleiner Abstand nach oben wenn aufgeklappt */
.start-section > div[id$="-inhalt"] {
  padding-top: 6px;
}

/* =============================================
.fuchs-titel-box {
  background: #E8621A;
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.fuchs-titel-box h1,
.fuchs-titel-box .fuchs-titel-text {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #3a1a00;
  margin: 0;
  flex: 1;
}
.fuchs-tatze {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  flex-shrink: 0;
  display: block;
  opacity: 0.85;
}
/* Im Dunkelmodus etwas heller */
[data-theme="dark"] .fuchs-titel-box {
  background: #c04f10;
}
[data-theme="dark"] .fuchs-titel-box h1,
[data-theme="dark"] .fuchs-titel-box .fuchs-titel-text {
  color: #ffe0c0;
}
/* Natur Nacht: Mondblau statt Orange */
[data-design="natur-nacht"] .fuchs-titel-box {
  background: #1e2a50;
}
[data-design="natur-nacht"] .fuchs-titel-box h1,
[data-design="natur-nacht"] .fuchs-titel-box .fuchs-titel-text {
  color: #c8d8f8;
}
/* Natur Tag: Waldgrün */
[data-design="natur-tag"] .fuchs-titel-box {
  background: #3a8a3a;
}
[data-design="natur-tag"] .fuchs-titel-box h1,
[data-design="natur-tag"] .fuchs-titel-box .fuchs-titel-text {
  color: #e8f8e8;
}

/* =============================================
   SPIELEN-BEREICH ganz oben auf Startseite
   ============================================= */
#start-spiel-bereich {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
#start-spiel-titel {
  color: var(--text);
}

/* =============================================
   STATISTIK-SCREEN Überschriften
   ============================================= */
#statistik-screen h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

/* =============================================
   WILLKOMMENS-BOX auf Startseite
   ============================================= */
.willkommen-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid #E8621A;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: .95rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.willkommen-box strong {
  color: var(--text);
}
[data-design="natur-tag"] .willkommen-box { border-left-color: #3a8a3a; }
[data-design="natur-nacht"] .willkommen-box { border-left-color: #4a6fa5; }

/* =============================================
   SPIELFELD — dezenter Hintergrund
   ============================================= */
#game-screen {
  background: var(--surface);
  border-radius: 12px;
  padding: 0 16px 16px;
  border: 1px solid var(--border);
  margin-top: 8px;
}
[data-design="fuchsbau"] #game-screen {
  background: var(--design-surface, #fdf5e6);
  border-color: var(--design-border, #c4a882);
}
[data-design="natur-tag"] #game-screen {
  background: linear-gradient(to bottom, #f0faf0 68%, #c8f098 88%, #90cc50 100%);
  border-color: var(--design-border, #8bc48b);
}
[data-design="natur-nacht"] #game-screen {
  background-color: #141828;
  background-image:
    radial-gradient(circle at 9% 6%, rgba(255,251,224,0.85) 1px, transparent 1px),
    radial-gradient(circle at 22% 4%, rgba(255,255,255,0.75) 1.5px, transparent 1.5px),
    radial-gradient(circle at 38% 8%, rgba(255,251,224,0.8) 1px, transparent 1px),
    radial-gradient(circle at 54% 3%, rgba(255,255,255,0.9) 1.5px, transparent 1.5px),
    radial-gradient(circle at 68% 7%, rgba(255,251,224,0.75) 1px, transparent 1px),
    radial-gradient(circle at 82% 5%, rgba(255,255,255,0.8) 1px, transparent 1px),
    radial-gradient(circle at 95% 9%, rgba(255,251,224,0.7) 1.5px, transparent 1.5px),
    radial-gradient(circle at 15% 14%, rgba(255,255,255,0.65) 1px, transparent 1px),
    radial-gradient(circle at 32% 12%, rgba(255,251,224,0.7) 1px, transparent 1px),
    radial-gradient(circle at 48% 16%, rgba(255,255,255,0.75) 1.5px, transparent 1.5px),
    radial-gradient(circle at 64% 11%, rgba(255,251,224,0.65) 1px, transparent 1px),
    radial-gradient(circle at 78% 15%, rgba(255,255,255,0.7) 1px, transparent 1px),
    radial-gradient(circle at 4% 18%, rgba(255,251,224,0.6) 1px, transparent 1px),
    radial-gradient(circle at 91% 17%, rgba(255,255,255,0.65) 1px, transparent 1px);
  border-color: #2a3050;
}

/* GRAFISCHE QWERTZ-TASTATUR */
#grafik-tastatur {
  flex-direction: column;
  gap: 5px;
  padding: 8px 0 4px;
  width: 100%;
}
/* CSS Grid erzwingt exakte Spaltenbreiten unabhängig vom Inhalt */
.tastatur-reihe {
  display: grid;
  gap: 4px;
  width: 100%;
}
/* Ohne Umlaute: Reihe 1 = 10 Tasten, Reihe 2 = 9 Tasten (eingerückt), Reihe 3 = ENTER + 7 + ⌫.
   minmax(0,1fr) erzwingt Schrumpfen unter Content-Breite */
.tastatur-reihe:nth-child(1) {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}
.tastatur-reihe:nth-child(2) {
  grid-template-columns: repeat(9, minmax(0, 1fr));
  padding: 0 5%;
}
.tastatur-reihe:nth-child(3) {
  grid-template-columns: minmax(0, 1.5fr) repeat(7, minmax(0, 1fr)) minmax(0, 1.5fr);
}
/* Grafische Tastatur sitzt im Eingabebereich direkt unter dem Eingabefeld */
#eingabe-bereich #grafik-tastatur {
  max-width: 500px;
  padding-top: 0;
}
.taste {
  -webkit-appearance: none;
  appearance: none;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}
.taste:active { transform: scale(0.9); }
.taste-action { font-size: 0.75rem; }
.taste-enter {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}
.taste[data-status="correct"] {
  background: #4a9e50;
  color: #fff;
  border-color: #3a8e40;
}
.taste[data-status="present"] {
  background: #c88020;
  color: #fff;
  border-color: #b87010;
}
.taste[data-status="absent"] {
  background: #606060;
  color: #fff;
  border-color: #505050;
}
@media(max-width: 400px) {
  .taste { height: 36px; font-size: 0.75rem; }
}

/* FARBLEGENDE */
#farblegende {
  display: none;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 0 4px;
  font-size: .8rem;
  color: var(--text-muted);
}
[data-design="standard"] #farblegende,
[data-design="fuchsbau"] #farblegende,
[data-design="natur-tag"] #farblegende,
[data-design="natur-nacht"] #farblegende {
  display: flex;
}
.farb-eintrag {
  display: flex;
  align-items: center;
  gap: 5px;
}
.farb-box {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}
.farb-correct  { background: #4a9e50; }
.farb-present  { background: #c88020; }
.farb-absent   { background: #606060; }
.farb-unused   { background: var(--key-bg); border: 1px solid var(--border); }

/* FUCHSFALLEN — Tastaturfarben */
.taste[data-status="falle"] {
  background: #1565c0;
  color: #fff;
  border-color: #0d47a1;
}
.taste[data-status="niete"] {
  background: #c62828;
  color: #fff;
  border-color: #b71c1c;
}

/* FUCHSFALLEN — Layout-Äquivalente zum Hauptspiel */
#ff-fortschritt-punkte { display: flex; gap: 8px; justify-content: center; padding: 8px 0 4px; }
#ff-verlauf { padding: 8px 0; min-height: 32px; }
#ff-verlauf-liste { list-style: none; display: flex; flex-direction: column; gap: 4px; }
#ff-eingabe-bereich { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* FUCHSFALLEN — Screen */
#fuchsfallen-screen {
  background: var(--surface);
  border-radius: 12px;
  padding: 0 16px 16px;
  border: 1px solid var(--border);
  margin-top: 8px;
}

/* FUCHSFALLEN — grafische Tastatur (immer sichtbar) */
#ff-grafik-tastatur {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 0 4px;
  width: 100%;
}

/* FUCHSFALLEN — Farblegende */
#ff-farblegende {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 0 4px;
  font-size: .8rem;
  color: var(--text-muted);
}
.ff-farb-falle { background: #1565c0; }
.ff-farb-niete { background: #c62828; }

