:root {
  --bg-top: rgba(19,78,74,0.45);
  --card-from: #0e2f2c;
  --card-to: #153f3b;
  --border-teal: rgba(45,158,140,0.45);
  --border-teal-soft: rgba(45,158,140,0.18);
  --teal: #2d9e8c;
  --teal-light: #4fc3ac;
  --bronze: #c79a56;
  --bronze-dark: #8a6a34;
  --cream: #f3ead9;
  --muted: #8fada6;
  --emerald: #22c55e;
  --emerald-bg-from: #0e2a1c;
  --emerald-bg-to: #123a24;
  --rose: #f43f5e;
  --rose-bg-from: #2a0e14;
  --rose-bg-to: #3a1220;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(ellipse 140% 60% at 50% -10%, var(--bg-top), transparent 60%),
    linear-gradient(180deg, #04100e 0%, #0a201d 45%, #030b0a 100%);
  color: var(--cream);
  min-height: 100vh;
}

a { color: inherit; }

.card {
  background: linear-gradient(120deg, var(--card-from), var(--card-to));
  border: 1px solid var(--border-teal);
  border-radius: 16px;
  padding: 16px;
}

.gold-button {
  display: inline-block;
  background: linear-gradient(180deg, var(--bronze), var(--bronze-dark));
  color: #20160a;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 14px;
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.gold-button:disabled { opacity: 0.4; cursor: not-allowed; }

.outline-button {
  display: inline-block;
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--border-teal);
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bronze);
  font-weight: 800;
}

.muted { color: var(--muted); }

/* ============ Landingpage-spezifisch ============ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.site-header .brand-with-logo { display: flex; align-items: center; gap: 10px; }
.site-header .header-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-teal);
}
.site-header .brand { font-weight: 900; font-size: 18px; text-transform: uppercase; letter-spacing: 0.05em; }
.site-header nav a { margin-left: 20px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--cream); }

.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px 40px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 900;
  text-transform: uppercase;
  margin: 10px 0 16px;
  letter-spacing: 0.02em;
}
.hero p { color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 620px; margin: 0 auto 28px; }

.social-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 28px 0;
}
.social-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-teal);
  background: rgba(14,47,44,0.6);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  color: var(--cream);
}
.social-pill:hover { border-color: var(--bronze); }

section { max-width: 1000px; margin: 0 auto; padding: 40px 24px; }
section h2 {
  font-size: 22px;
  text-transform: uppercase;
  font-weight: 900;
  margin-bottom: 6px;
}
section .section-sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }

.steini-card {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.steini-card .steini-badge-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--bronze);
  flex-shrink: 0;
}
.steini-card .steini-text h3 { margin: 0 0 6px; font-size: 18px; color: var(--bronze); }
.steini-card .steini-text p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.steini-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.steini-gallery img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: top center;
  border-radius: 14px;
  border: 1px solid var(--border-teal);
  background: rgba(14,47,44,0.4);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.steini-gallery img:hover {
  transform: translateY(-3px);
  border-color: var(--bronze);
}

.game-cta {
  text-align: center;
  padding: 50px 24px 70px;
}
.game-cta h2 { font-size: 26px; }

footer {
  text-align: center;
  padding: 30px;
  color: var(--muted);
  font-size: 12px;
}

/* ============ Spiel-spezifisch ============ */

.game-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.game-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: min(820px, 92vh);
  border-radius: 32px;
  overflow: hidden;
  border: 4px solid #1b3d3a;
  box-shadow: 0 0 60px rgba(45,158,140,0.25);
  background: #04100e;
  display: flex;
  flex-direction: column;
}

.phase { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.phase-padded { padding: 22px; }
.phase-scroll { flex: 1; overflow-y: auto; }

input.text-input {
  width: 100%;
  background: var(--card-from);
  border: 1px solid var(--border-teal);
  border-radius: 12px;
  padding: 14px;
  color: var(--cream);
  font-size: 16px;
  text-align: center;
  margin-bottom: 14px;
}

.list-card {
  width: 100%;
  text-align: left;
  margin-bottom: 12px;
  cursor: pointer;
  display: block;
  color: inherit;
  font-family: inherit;
}
.list-card .title { font-weight: 800; font-size: 15px; color: var(--cream); }
.list-card .subtitle { color: var(--muted); font-size: 11px; margin-top: 6px; }

.back-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.back-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 20px; padding: 4px; }

.top-bar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.top-bar .counter { color: var(--muted); font-size: 11px; }
.top-bar .points-label { color: var(--cream); font-weight: 800; font-size: 15px; margin-top: 2px; }
.top-bar .secured-label { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.top-bar .secured-value { color: var(--bronze); font-weight: 800; font-size: 15px; }

.progress-bar { height: 5px; background: var(--card-from); border-radius: 3px; overflow: hidden; margin: 10px 0 14px; }
.progress-fill { height: 100%; background: var(--teal); }

.hard-badge {
  display: inline-block;
  background: rgba(244,63,94,0.12);
  border: 1px solid rgba(244,63,94,0.4);
  border-radius: 8px;
  padding: 3px 8px;
  margin-bottom: 8px;
  color: var(--rose);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.timer-badge {
  display: inline-block;
  background: rgba(45,158,140,0.15);
  border: 1px solid rgba(45,158,140,0.5);
  border-radius: 8px;
  padding: 4px 10px;
  margin-bottom: 8px;
  margin-left: 6px;
  color: var(--teal-light);
  font-size: 13px;
  font-weight: 800;
}
.timer-badge.timer-critical {
  background: rgba(244,63,94,0.15);
  border-color: rgba(244,63,94,0.6);
  color: var(--rose);
  animation: timerPulse 1s infinite;
}
@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.joker-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.joker-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(199,154,86,0.5);
  color: var(--bronze);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}
.joker-btn:disabled { border-color: var(--border-teal-soft); color: #3a4a48; cursor: not-allowed; }
.joker-cost-hint { color: var(--muted); font-size: 11px; margin-bottom: 12px; }

.question-box { margin-bottom: 14px; position: relative; }
.speaker-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(45,158,140,0.15);
  border: 1px solid var(--border-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
}
.question-text { color: var(--cream); font-weight: 800; font-size: 15px; line-height: 1.4; margin: 0; padding-right: 32px; }

.hint-box {
  background: rgba(199,154,86,0.12);
  border: 1px solid rgba(199,154,86,0.4);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  color: var(--cream);
  font-size: 13px;
}

.robot-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(45,158,140,0.12);
  border: 1px solid rgba(45,158,140,0.45);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: var(--cream);
  font-size: 13px;
  line-height: 1.4;
}
.robot-avatar {
  width: 40px;
  height: 40px;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
  border: 1px solid rgba(45,158,140,0.5);
  flex-shrink: 0;
  background: rgba(0,0,0,0.2);
}
.robot-text { flex: 1; }
.robot-badge {
  display: inline-block;
  font-weight: 800;
  color: var(--teal-light);
  margin-right: 4px;
}

/* ============ Zahnrädchen Live-Schalte ============ */
.robot-scene {
  align-items: center;
  justify-content: center;
}
.robot-stage {
  position: relative;
  width: 92%;
  max-width: 380px;
  margin: 6px auto 0;
  /* echtes Seitenverhältnis von zahnraedchen-full.png (Original 1024x1536) */
  aspect-ratio: 1024 / 1536;
}
.robot-figure {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Position exakt über dem Bauchmonitor auf dem Bild vermessen */
.robot-belly-screen {
  position: absolute;
  left: 33.5%;
  top: 41%;
  width: 33%;
  height: 16%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2% 3%;
  overflow: hidden;
}
.robot-belly-text {
  color: #8fffb0;
  font-family: "Courier New", monospace;
  font-size: 8.5px;
  line-height: 1.3;
  text-align: center;
  text-shadow: 0 0 4px rgba(143,255,176,0.7);
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
}
.robot-belly-text strong { font-size: 9.5px; }
.robot-belly-text::-webkit-scrollbar { width: 3px; }
.robot-belly-text::-webkit-scrollbar-thumb { background: rgba(143,255,176,0.5); }

.option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: linear-gradient(90deg, var(--card-from), var(--card-to));
  border: 1px solid var(--border-teal);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  margin-bottom: 8px;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
}
.option-btn.correct { border-color: var(--emerald); background: linear-gradient(90deg, var(--emerald-bg-from), var(--emerald-bg-to)); }
.option-btn.wrong { border-color: var(--rose); background: linear-gradient(90deg, var(--rose-bg-from), var(--rose-bg-to)); }
.option-btn.selected { border-color: var(--teal-light); }
.option-btn.dimmed { border-color: var(--border-teal-soft); }
.option-hidden {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border-teal-soft);
  border-radius: 12px; padding: 12px; margin-bottom: 8px; opacity: 0.3;
}
.letter-badge {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bronze); color: #20160a; font-weight: 900; font-size: 11px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.letter-badge.hidden-badge { background: #234b47; color: #5f8a83; }
.audience-pct { color: var(--bronze); font-weight: 800; font-size: 12px; margin-left: auto; }

.suspense-text { text-align: center; color: var(--bronze); font-weight: 800; font-size: 14px; margin-top: 10px; }
.confirm-row { display: flex; gap: 8px; margin-top: 10px; }
.confirm-row button { flex: 1; padding: 12px; border-radius: 12px; font-weight: 700; font-size: 13px; cursor: pointer; }
.confirm-change { border: 1px solid var(--border-teal); background: transparent; color: var(--cream); }
.confirm-final { border: none; background: linear-gradient(180deg, var(--bronze), var(--bronze-dark)); color: #20160a; font-weight: 800; }

.quit-btn {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(244,63,94,0.4);
  background: transparent;
  color: var(--rose);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.result-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; text-align: center; }
.result-points { font-size: 52px; font-weight: 900; color: var(--cream); margin: 10px 0 2px; }

.leaderboard-row {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(90deg, var(--card-from), var(--card-to));
  border: 1px solid var(--border-teal);
  border-radius: 10px; padding: 12px; margin-bottom: 8px;
}
.leaderboard-row .rank { color: var(--bronze); font-weight: 900; font-size: 14px; width: 22px; }
.leaderboard-row .name { color: var(--cream); font-weight: 700; font-size: 14px; }
.leaderboard-row .subj { color: var(--muted); font-size: 11px; }
.leaderboard-row .pts { color: var(--cream); font-weight: 800; font-size: 14px; margin-left: auto; }

/* ============ Hauptmenü mit Bild ============ */
/* Äußerer Container: füllt den gesamten Rahmen, zentriert das Bild */
.mainmenu-bg {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #04100e; /* gleiche Farbe wie game-frame, füllt evtl. Leerraum */
  overflow: hidden;
}
/* Innerer Container: hat EXAKT das Seitenverhältnis des Bildes.
   Dadurch stimmen die prozentual positionierten Banner-Zonen
   (BANNER_ZONES in game.js) immer exakt mit dem Bildinhalt überein,
   egal wie groß der Rahmen gerade ist. */
.mainmenu-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1051 / 1024; /* echtes Seitenverhältnis von main-menu-bg.png */
  max-height: 100%;
  background-image: url("../assets/main-menu-bg.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.mainmenu-welcome {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--cream);
  font-size: 13px;
  font-weight: 700;
  background: rgba(4,16,14,0.55);
  padding: 5px 14px;
  border-radius: 20px;
  white-space: nowrap;
  z-index: 2;
}
.banner-zone {
  position: absolute;
  background: transparent;
  border: none;
  cursor: pointer;
}
.banner-zone.debug { background: rgba(255,0,0,0.25); }
.replay-link {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(243,234,217,0.7);
  font-size: 11px;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

@media (max-width: 480px) {
  .game-frame { border-radius: 0; border-width: 0; height: 100vh; max-width: 100%; }
  .game-page { padding: 0; }
}
