/* =====================================================================
   Wer ist es? – Aufbau, Spielbrett, Fragen-Panel
   ===================================================================== */

:root {
  --accent: #00e5ff;
  --accent-2: #a855f7;
}

/* ============================== Screens ============================== */
.screen { display: none; }
.screen[data-aktiv='true'] { display: block; animation: einblenden 0.5s var(--ease-out) backwards; }

.seiten-kopfzeile { text-align: center; padding: clamp(1.2rem, 4vw, 2.6rem) 0 1.4rem; }
.seiten-titel { font-size: clamp(2rem, 6.5vw, 4rem); text-transform: uppercase; margin-top: 0.5rem; }
.seiten-unter { max-width: 54ch; margin: 1rem auto 0; color: var(--text-dim); }

.abschnitt-titel {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 2rem 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.abschnitt-titel::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

/* =========================== Theme-Auswahl =========================== */
.theme-gitter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.2rem;
}

.theme-karte {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-deep);
  transition: transform 0.35s var(--ease-out), border-color 0.35s, box-shadow 0.35s;
  font-family: inherit;
}
.theme-karte:hover { transform: translateY(-6px); border-color: var(--tf, var(--accent)); }
.theme-karte[aria-pressed='true'] {
  border-color: var(--tf, var(--accent));
  box-shadow: 0 0 40px -12px var(--tf, var(--accent)), var(--shadow-deep);
}
.theme-karte[aria-pressed='true']::after {
  content: '✓';
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--tf, var(--accent));
  color: #07061a;
  font-weight: 900;
  box-shadow: 0 0 18px var(--tf, var(--accent));
  animation: marker-pop 0.4s var(--ease-bounce);
}
@keyframes marker-pop {
  from { transform: scale(0); }
}

.theme-vorschau {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
}
.theme-vorschau img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  transition: transform 0.4s var(--ease-bounce);
}
.theme-karte:hover .theme-vorschau img:nth-child(1) { transform: translateY(-4px) rotate(-4deg); }
.theme-karte:hover .theme-vorschau img:nth-child(2) { transform: translateY(-6px) rotate(3deg); }
.theme-karte:hover .theme-vorschau img:nth-child(3) { transform: translateY(-4px) rotate(-2deg); }
.theme-karte:hover .theme-vorschau img:nth-child(4) { transform: translateY(-7px) rotate(5deg); }

.theme-text { padding: 1rem 1.2rem 1.3rem; }
.theme-text h3 { font-size: 1.3rem; text-transform: uppercase; }
.theme-text p { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--text-dim); }
.theme-text .anzahl {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

/* ============================ Modus-Wahl ============================= */
.modus-gitter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.2rem;
}
.modus-karte {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.3rem 1.4rem;
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.3s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
}
.modus-karte:hover { transform: translateY(-5px); border-color: var(--accent); }
.modus-karte[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 36px -12px var(--accent);
}
.modus-karte .symbol { font-size: 2rem; line-height: 1; }
.modus-karte h3 { font-size: 1.05rem; text-transform: uppercase; }
.modus-karte p { margin: 0.3rem 0 0; font-size: 0.87rem; color: var(--text-dim); }

.start-leiste { display: flex; justify-content: center; margin-top: 2rem; }

/* ========================== Geheim-Uebergabe ========================= */
.uebergabe {
  max-width: 560px;
  margin: 3rem auto;
  padding: clamp(1.6rem, 5vw, 3rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, rgba(30, 24, 78, 0.9), rgba(10, 8, 30, 0.96));
  box-shadow: var(--shadow-deep);
  text-align: center;
}
.uebergabe h2 { font-size: clamp(1.4rem, 4vw, 2rem); text-transform: uppercase; }
.uebergabe > p { color: var(--text-dim); margin: 0.8rem 0 0; }

.blickschutz {
  position: relative;
  margin: 1.8rem auto;
  width: min(240px, 70vw);
  aspect-ratio: 3 / 4;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #0a0824;
}
.blickschutz img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blickschutz-deckel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 0.4rem;
  background:
    repeating-linear-gradient(45deg, rgba(168, 85, 247, 0.18) 0 12px, transparent 12px 24px),
    linear-gradient(160deg, #211a5c, #0a0824);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 3rem;
  transition: opacity 0.45s var(--ease-out), transform 0.55s var(--ease-out);
}
.blickschutz[data-offen='true'] .blickschutz-deckel {
  opacity: 0;
  transform: translateY(-100%) rotateX(70deg);
  pointer-events: none;
}
.geheim-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* ============================= Spielbrett ============================ */
.brett-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  align-items: start;
}
@media (min-width: 1040px) {
  .brett-layout { grid-template-columns: minmax(0, 1fr) 330px; }
}

/* --- Spielerreiter (Modus A) --- */
.spieler-reiter {
  display: flex;
  gap: 0.4rem;
  padding: 4px;
  margin-bottom: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 6, 26, 0.7);
}
.spieler-reiter button {
  flex: 1;
  padding: 0.6em 1em;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s, background 0.35s, box-shadow 0.35s;
}
.spieler-reiter button[aria-pressed='true'] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07061a;
  box-shadow: 0 0 20px -4px var(--accent);
}

/* --- Kartenraster --- */
.karten-gitter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.6rem;
}
@media (min-width: 700px) {
  .karten-gitter { grid-template-columns: repeat(6, 1fr); gap: 0.7rem; }
}

.figur {
  perspective: 800px;
  aspect-ratio: 3 / 4;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.figur-innen {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.62s var(--ease-out);
}
.figur[data-aus='true'] .figur-innen { transform: rotateY(180deg); }
.figur:hover:not([data-aus='true']) .figur-innen { transform: translateY(-5px) scale(1.04); }
.figur:active .figur-innen { transform: scale(0.96); }

.figur-vorne,
.figur-hinten {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px -14px #000;
}

.figur-vorne {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.22));
  transition: border-color 0.3s, box-shadow 0.3s;
}
.figur:hover .figur-vorne {
  border-color: var(--accent);
  box-shadow: 0 0 26px -6px var(--accent);
}
.figur-vorne img {
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: cover;
  display: block;
  background: #0d0a28;
}
.figur-name {
  padding: 0.28rem 0.2rem;
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text);
  background: rgba(7, 6, 26, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.figur-hinten {
  transform: rotateY(180deg);
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(255, 46, 136, 0.12) 0 10px, transparent 10px 20px),
    linear-gradient(160deg, #1a1440, #0a0722);
  color: var(--neon-red);
  font-size: 1.9rem;
  opacity: 0.85;
}

/* Markierung der eigenen Geheimfigur */
.figur[data-geheim='true'] .figur-vorne {
  border-color: var(--neon-amber);
  box-shadow: 0 0 22px -4px var(--neon-amber);
}
.figur[data-geheim='true'] .figur-vorne::after {
  content: '★';
  position: absolute;
  top: 3px;
  right: 5px;
  color: var(--neon-amber);
  font-size: 0.8rem;
  text-shadow: 0 0 8px var(--neon-amber);
}

/* Treffer-/Fehl-Hervorhebung beim Raten */
.figur.richtig .figur-vorne { border-color: var(--neon-lime); box-shadow: 0 0 34px -4px var(--neon-lime); }
.figur.falsch .figur-vorne { border-color: var(--neon-red); box-shadow: 0 0 34px -4px var(--neon-red); }

/* ============================ Seitenpanel ============================ */
.panel {
  padding: 1rem 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.panel + .panel { margin-top: 0.9rem; }
.panel h3 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.7rem;
}

/* Eigene Geheimfigur im Panel */
.geheim-box { display: flex; align-items: center; gap: 0.8rem; }
.geheim-box img {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--neon-amber);
  box-shadow: 0 0 18px -6px var(--neon-amber);
  background: #0d0a28;
  transition: filter 0.35s;
}
.geheim-box[data-versteckt='true'] img { filter: blur(11px) saturate(0.4); }
.geheim-box[data-versteckt='true'] .geheim-box-name { filter: blur(6px); user-select: none; }
.geheim-box-name {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--neon-amber);
}
.geheim-box small { display: block; color: var(--text-faint); font-size: 0.72rem; }

/* Fragenliste */
.fragen-gruppe + .fragen-gruppe { margin-top: 0.8rem; }
.fragen-gruppe-titel {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.35rem;
}
.frage-knopf {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.3rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), border-color 0.25s, background 0.25s;
}
.frage-knopf:hover:not(:disabled) {
  transform: translateX(3px);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.frage-knopf:disabled { opacity: 0.32; cursor: not-allowed; text-decoration: line-through; }
.frage-knopf .gewinn {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.frage-knopf.top .gewinn { color: var(--neon-lime); }

/* Verlauf */
.verlauf { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.verlauf li {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.8rem;
  animation: einblenden 0.4s var(--ease-out) backwards;
}
.verlauf li:last-child { border-bottom: 0; }
.verlauf .wer {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.verlauf .antwort { margin-left: auto; font-weight: 700; flex-shrink: 0; }
.verlauf .antwort[data-ja='true'] { color: var(--neon-lime); }
.verlauf .antwort[data-ja='false'] { color: var(--neon-red); }
.verlauf-leer { color: var(--text-faint); font-size: 0.82rem; }

/* Computer-Zug */
.computer-zug {
  border-color: color-mix(in srgb, var(--accent-2) 45%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent-2) 16%, transparent), rgba(10, 8, 30, 0.7));
}
.computer-frage {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 0.9rem;
  min-height: 2.6em;
}
.computer-frage strong { color: var(--accent); }
.ja-nein { display: flex; gap: 0.6rem; }
.ja-nein .btn { flex: 1; }
.denk-punkte::after {
  content: '';
  animation: denken 1.2s steps(4) infinite;
}
@keyframes denken {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* Bewusst KEIN Flex-Layout: die Zeile besteht aus drei Textstuecken
   ("Der Computer haelt noch", der Zahl, "Figuren fuer moeglich"). Als
   Flex-Container wird jedes davon ein eigenes Element mit eigenem
   Zeilenumbruch – das ergab drei ungleich hohe Spalten statt eines
   Satzes. Als normaler Textblock liest es sich wie ein Satz und bricht
   sauber um. */
.rest-anzeige {
  margin-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.75;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.rest-anzeige b {
  font-size: 1.05rem;
  margin-inline: 0.12em;
  color: var(--accent);
}

/* Blickschutz beim Spielerwechsel */
.wechsel-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  background:
    repeating-linear-gradient(45deg, rgba(168, 85, 247, 0.12) 0 18px, transparent 18px 36px),
    rgba(4, 3, 14, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}
.wechsel-overlay[data-offen='true'] { opacity: 1; visibility: visible; }
.wechsel-overlay .symbol { font-size: 3.4rem; animation: schaukeln 1.8s ease-in-out infinite; }
@keyframes schaukeln {
  0%, 100% { transform: rotate(-9deg); }
  50% { transform: rotate(9deg); }
}
.wechsel-overlay h2 { margin: 1rem 0 0.5rem; font-size: clamp(1.4rem, 4vw, 2.2rem); text-transform: uppercase; }
.wechsel-overlay p { color: var(--text-dim); max-width: 40ch; margin: 0 auto 1.6rem; }

/* Werkzeugleiste ueber dem Brett */
.brett-werkzeuge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.brett-werkzeuge .btn { --btn-farbe: var(--accent); }

/* Endbildschirm */
.ende-figur {
  width: 150px;
  aspect-ratio: 3 / 4;
  margin: 1.2rem auto;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 0 40px -10px var(--accent);
  animation: marker-pop 0.6s var(--ease-bounce);
}
.ende-figur img { width: 100%; height: 100%; object-fit: cover; display: block; background: #0d0a28; }

/* Fusszeile mit Lizenzhinweisen */
.credits { font-size: 0.78rem; line-height: 1.7; }
.credits a { color: var(--text-dim); }

@media (max-width: 700px) {
  .panel { padding: 0.85rem 0.9rem 1rem; }
  .verlauf { max-height: 170px; }
}

/* -------------------------- Level-Filterleiste ------------------------ */
.level-leiste {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.8rem 0 1.8rem;
}
.level-taste {
  padding: 0.5em 1.2em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background 0.25s, transform 0.2s;
}
.level-taste:hover { color: var(--text); border-color: var(--line-strong); }
.level-taste[aria-pressed='true'] {
  color: #08061c;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  transform: translateY(-1px);
}

/* --------------------------- Live-Raum beitreten ----------------------- */
.raum-beitreten-feld {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin: 1.6rem 0 0;
  padding: 1.1rem 1.4rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.025);
}
.raum-beitreten-feld .symbol { font-size: 1.7rem; opacity: 0.75; }
.raum-beitreten-feld h3 { font-size: 0.95rem; text-transform: uppercase; color: var(--text-dim); }
.raum-beitreten-feld p { margin: 0.2rem 0 0; font-size: 0.84rem; color: var(--text-faint); max-width: 52ch; }
.raum-beitreten-feld > div { flex: 1; min-width: 220px; }
#online-beitreten-formular { display: flex; gap: 0.5rem; margin-left: auto; }
#online-code-eingabe {
  width: 120px;
  padding: 0.6em 0.8em;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(8, 6, 26, 0.72);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
}
#online-code-eingabe:focus-visible { outline: none; border-color: var(--accent); }

/* ------------------------- Warteraum / Online-Zug-Anzeige --------------- */
.warteraum-overlay .overlay-inhalt { max-width: 480px; }
.warteraum-code {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-shadow: 0 0 20px color-mix(in srgb, var(--accent) 50%, transparent);
  margin: 0.6rem 0;
}
.warteraum-link {
  display: block;
  padding: 0.6rem 0.9rem;
  margin: 0.6rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(8, 6, 26, 0.6);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  word-break: break-all;
  cursor: pointer;
}
.online-zug-banner {
  margin: 0 0 0.9rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-align: center;
}
.online-zug-banner[data-eigen='true'] { border-color: color-mix(in srgb, var(--neon-lime) 50%, transparent); color: var(--neon-lime); }
.online-zug-banner[data-eigen='false'] { border-color: color-mix(in srgb, var(--neon-amber) 50%, transparent); color: var(--neon-amber); }
