/* Higher or Lower — spielspezifische Stile. Basis aus game-base.css;
   Auswahl-Chips im selben Look wie GeoFill / Capture the Map. */

:root {
  --gold: #ffc83d;
  --gold-text: #ffc83d;   /* Gold als Schriftfarbe (im Hellen dunkler, sonst unlesbar) */
  --hoch: #2bd9a4;
  --tief: #ff6b6b;
}
:root[data-theme="light"] { --gold-text: #a86f00; }

.hol {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 0 56px;
}

/* ---------- Start ---------- */
.hol-titel {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 2.9rem);
  margin: 10px 0 8px;
}
.hol-unter { margin: 0 0 26px; color: var(--ink-muted); max-width: 56ch; }

.optionen { display: flex; flex-direction: column; gap: 18px; margin-bottom: 26px; }
.gruppe {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 14px 16px 16px;
  margin: 0;
}
.gruppe legend { padding: 0 6px; font-family: var(--font-display); font-weight: 600; color: var(--ink-muted); }
.wahl-reihe { display: flex; flex-wrap: wrap; gap: 8px; }
.wahl { cursor: pointer; }
.wahl input { position: absolute; opacity: 0; pointer-events: none; }
.wahl span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-weight: 600;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.wahl span b { font-weight: 400; }
.wahl em { font-style: normal; color: var(--ink-muted); font-weight: 400; }
.wahl input:checked + span { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--bg)); }
.wahl input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 45%, transparent); }

.btn-gross { font-size: 1.1rem; padding: 14px 28px; }
.btn-leise { background: var(--bg-panel); color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: 0.45; cursor: default; filter: none; }

.quelle { margin: 30px 0 0; color: var(--ink-muted); font-size: 0.8rem; max-width: 70ch; opacity: 0.85; }

/* ---------- Start & Ende: links Inhalt, rechts persönliche Bestenliste ---------- */
.hol.hol-breit { max-width: 1060px; }
.start-raster { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 30px; align-items: start; }
.start-links .gruppe { margin-bottom: 22px; }

/* Erklärung zur Kategorie */
.erklaerung {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 10%, var(--bg)), var(--bg) 70%);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  display: flex; flex-direction: column; gap: 14px;
}
.er-kopf { display: flex; gap: 14px; align-items: flex-start; }
.er-icon {
  flex: none; width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.7rem;
  background: color-mix(in srgb, var(--gold) 18%, var(--bg-panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent);
}
.er-name { margin: 2px 0 4px; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.er-text { margin: 0; color: var(--ink-muted); line-height: 1.45; }
.er-skala { display: grid; grid-template-columns: minmax(0, 1fr) minmax(40px, 1.1fr) minmax(0, 1fr); align-items: center; gap: 10px; }
.er-ende { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.er-max { text-align: right; align-items: flex-end; }
.er-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); font-weight: 700; }
.er-ende > span:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 7px; }
.er-max > span:last-child { justify-content: flex-end; }
.er-ende img { width: 22px; height: 16px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
.er-ende b { font-weight: 700; }
.er-ende em { font-style: normal; color: var(--gold-text); font-weight: 700; font-variant-numeric: tabular-nums; width: 100%; }
.er-balken { height: 8px; border-radius: 99px; position: relative;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 15%, var(--bg-panel)), var(--gold)); }
.er-balken::before, .er-balken::after {
  content: ""; position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--bg); border: 2px solid var(--gold);
}
.er-balken::before { left: 0; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.er-balken::after { left: 100%; box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 60%, transparent); }
.er-balken i {                                     /* kleiner Lichtpunkt, der über die Skala wandert */
  position: absolute; top: 50%; left: 0; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%); opacity: 0.85;
  box-shadow: 0 0 8px 2px color-mix(in srgb, var(--gold) 80%, transparent);
  animation: er-wandern 3.2s ease-in-out infinite;
}
@keyframes er-wandern { 0%, 100% { left: 6%; } 50% { left: 94%; } }
.er-tipp { margin: 0; display: flex; gap: 8px; align-items: baseline; font-size: 0.95rem; line-height: 1.45; }
.er-tipp b { font-weight: 400; }
.er-anzahl { margin: -6px 0 0; font-size: 0.8rem; color: var(--ink-muted); }

/* Persönliche Bestenliste */
.bestenliste {
  position: sticky; top: 18px;
  margin-top: 14px;
  padding: 18px 18px 14px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line));
  background:
    radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 70%),
    var(--bg-panel);
}
.pb-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pb-titel { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.pb-kat { font-size: 0.85rem; font-weight: 700; color: var(--gold-text); white-space: nowrap; }
.pb-hinweis { margin: 0 0 10px; color: var(--ink-muted); font-size: 0.9rem; }
.pb-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pb-eintrag {
  display: grid; grid-template-columns: 34px 46px minmax(0, 1fr); align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line);
}
.pb-eintrag.top { border-color: color-mix(in srgb, var(--gold) 25%, var(--line)); }
.pb-rang { font-weight: 800; color: var(--ink-muted); text-align: center; font-size: 1.05rem; }
.pb-eintrag.top .pb-rang { font-size: 1.25rem; }
.pb-wert { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--gold-text); font-variant-numeric: tabular-nums; }
.pb-info { display: flex; flex-direction: column; gap: 1px; font-size: 0.8rem; color: var(--ink-muted); min-width: 0; }
.pb-datum { color: var(--ink); font-weight: 600; }
.pb-aus { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pb-aus img { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
.pb-neu {
  margin-left: 4px; padding: 0 6px; border-radius: 99px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--gold); color: #2a1f00;
}
.pb-eintrag.neu { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 22px color-mix(in srgb, var(--gold) 30%, transparent); animation: pb-auf 0.6s ease-out; }
@keyframes pb-auf { from { transform: scale(0.96); opacity: 0.3; } to { transform: none; opacity: 1; } }
.pb-leer { border-style: dashed; background: transparent; }
.pb-leer .pb-wert { color: var(--ink-muted); opacity: 0.5; }
.pb-leer .pb-rang { opacity: 0.45; filter: grayscale(1); }
.pb-fuss { margin: 12px 0 0; font-size: 0.75rem; color: var(--ink-muted); text-align: center; }

/* Wechsel der Kategorie: kurz einblenden */
.wechsel { animation: hol-wechsel 0.35s ease-out; }
@keyframes hol-wechsel { from { opacity: 0.25; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Spiel ---------- */
.hol-spiel { padding-top: 10px; }
.spiel-leiste {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--ink-muted);
  flex-wrap: wrap;
}
.s-kategorie { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--ink); flex: 1; }
.s-best {
  padding: 3px 12px; border-radius: 999px; border: 1px dashed var(--line);
  font-size: 0.9rem; font-variant-numeric: tabular-nums; transition: all 0.25s ease;
}
.s-best.rekord {
  border: 1px solid var(--gold); color: #2a1f00; background: var(--gold); font-weight: 700;
  box-shadow: 0 0 16px color-mix(in srgb, var(--gold) 50%, transparent); animation: pb-auf 0.4s ease-out;
}
.s-punkte {
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--ink);
  font-weight: 700;
}
.s-punkte strong { color: var(--gold); font-variant-numeric: tabular-nums; }

.duell {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 14px;
}
.karte-land {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 26px 18px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-panel);
  min-height: 330px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.kl-flagge {
  width: min(70%, 190px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.3);
  margin-bottom: 8px;
}
.kl-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3.6vw, 1.9rem);
  line-height: 1.15;
  margin: 0;
}
.kl-wert {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4.2vw, 2.2rem);
  color: var(--gold);
  margin: 6px 0 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kl-einheit { margin: 0; color: var(--ink-muted); font-size: 0.92rem; max-width: 24ch; }

.kl-frage { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; width: 100%; }
.kl-text { margin: 0; color: var(--ink-muted); }
.knoepfe { display: flex; flex-direction: column; gap: 10px; width: min(100%, 240px); }
.btn-hoeher, .btn-tiefer {
  font-size: 1.08rem;
  padding: 13px 20px;
  color: #10291f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-hoeher { background: var(--hoch); }
.btn-tiefer { background: var(--tief); color: #3a1010; }
.btn-hoeher:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--hoch) 55%, transparent); }
.btn-tiefer:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tief) 55%, transparent); }

.karte-land.richtig { border-color: var(--hoch); box-shadow: 0 0 0 1px var(--hoch), 0 0 28px color-mix(in srgb, var(--hoch) 30%, transparent); }
.karte-land.falsch  { border-color: var(--tief); box-shadow: 0 0 0 1px var(--tief), 0 0 28px color-mix(in srgb, var(--tief) 30%, transparent); }
.karte-land.richtig .kl-wert { color: var(--hoch); }
.karte-land.falsch .kl-wert { color: var(--tief); }

.vs {
  align-self: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 2px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-transform: uppercase;
  box-shadow: 0 0 18px color-mix(in srgb, var(--gold) 25%, transparent);
}

/* Kette: das rechte Land rückt nach links, ein neues kommt von rechts */
.duell.rutsch #links  { animation: vonRechts 0.38s ease-out; }
.duell.rutsch #rechts { animation: reinkommen 0.42s ease-out; }
.duell.start .karte-land { animation: reinkommen 0.35s ease-out; }
@keyframes vonRechts { from { transform: translateX(46%); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes reinkommen { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.spiel-fuss {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  min-height: 48px;
}
.meldung { margin: 0; font-weight: 700; font-size: 1.05rem; }
.meldung.ja { color: var(--hoch); }
.meldung.nein { color: var(--tief); }
.spiel-fuss .btn { margin-left: auto; }
.tasten-tipp { margin: 10px 0 0; color: var(--ink-muted); font-size: 0.8rem; }

/* ---------- Ende ---------- */
.ende { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-top: 16px; min-width: 0; }
.e-kategorie { margin: 0; color: var(--ink-muted); font-weight: 600; }
.e-titel { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 5vw, 2.4rem); }
.e-text { margin: 0; font-size: 1.25rem; }
.e-text strong { color: var(--gold); font-size: 1.5rem; }
.e-rekord.gold { background: var(--gold); color: #2a1f00; border-color: var(--gold); box-shadow: 0 0 18px color-mix(in srgb, var(--gold) 40%, transparent); }
.e-zwischen { margin: 14px 0 0; width: 100%; max-width: 640px; text-align: left; font-family: var(--font-display); font-weight: 600; color: var(--ink-muted); font-size: 1rem; }
.e-rekord {
  margin: 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 16%, var(--bg-panel));
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  font-weight: 700;
}
.e-liste {
  list-style: none;
  margin: 8px 0 14px;
  padding: 0;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.e-liste li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.e-liste li.frueher { display: none; }
.e-liste.alle li.frueher { display: flex; }
.e-liste li.e-mehr { order: -1; justify-content: center; background: none; border: none; padding: 0; }
.e-liste li.e-mehr .btn { font-size: 0.85rem; padding: 6px 14px; }
.e-liste img { width: 24px; height: 18px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); vertical-align: -3px; }
.el-paar { flex: 1; line-height: 1.5; }
.el-pfeil { color: var(--gold); margin: 0 6px; font-size: 0.85rem; }
.el-werte { color: var(--ink-muted); font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }
.el-urteil { font-weight: 800; width: 1.2em; text-align: center; }
.e-liste li.ok .el-urteil { color: var(--hoch); }
.e-liste li.no .el-urteil { color: var(--tief); }
.aktionen { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- Schmale Fenster: Bestenliste unter den Inhalt ---------- */
@media (max-width: 860px) {
  .start-raster { grid-template-columns: 1fr; gap: 8px; }
  .bestenliste { position: static; margin-top: 18px; }
}

/* ---------- Handy: Karten untereinander ---------- */
@media (max-width: 640px) {
  .duell { grid-template-columns: 1fr; gap: 0; }
  .vs { width: 44px; height: 44px; font-size: 1rem; margin: -12px auto; position: relative; z-index: 1; }
  .karte-land { min-height: 0; padding: 18px 14px; }
  .kl-flagge { width: min(46%, 140px); }
  .knoepfe { flex-direction: row; width: 100%; }
  .knoepfe .btn { flex: 1; }
  .duell.rutsch #links { animation: reinkommen 0.38s ease-out; }
  .e-liste li { flex-wrap: wrap; }
  .el-werte { width: 100%; text-align: left; order: 3; }
  .tasten-tipp { display: none; }
  /* Spanne: Tiefst- und Höchstwert nebeneinander, Balken darunter über die ganze Breite */
  .er-skala { grid-template-columns: 1fr 1fr; grid-template-areas: "min max" "balken balken"; row-gap: 12px; }
  .er-min { grid-area: min; } .er-max { grid-area: max; } .er-balken { grid-area: balken; margin: 0 6px; }
  .er-icon { width: 44px; height: 44px; font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .duell .karte-land { animation: none !important; }
  .wahl span, .karte-land { transition: none; }
  .er-balken i, .wechsel, .pb-eintrag.neu, .s-best.rekord { animation: none; }
}
