:root{
  --bg: #880d1e;

  /* Glas / Pillen */
  --surface: rgba(255,248,245,.12);
  --border: rgba(255,255,255,.18);

  /* Karten: warmes Papier */
  --card-bg: #fff7f3;
  --card-border: rgba(0,0,0,.06);

  --shadow: 0 12px 30px rgba(0,0,0,.28);

  /* Text */
  --text-main: #2b1b1b;
  --text-muted: #6b4b4b;
}

/* =========================
   Reset / Global Safety
   ========================= */
*,
*::before,
*::after{
  box-sizing: border-box;
}

html, body{ height: 100%; }

/* Bootstrap überschreiben */
body{
  background: var(--bg) !important;
  overflow: hidden;
  overflow-x: hidden; /* verhindert 100vw-Overflow */
  font-family: "Source Serif 4", serif;
}

/* =========================
   Typography
   ========================= */
h1, h2, h3, h4, .chapter-wrap h2{
  font-family: "Playfair Display", serif;
  letter-spacing: .02em;
}

/* Kapitel */
.chapter-wrap h2{
  font-weight: 600;
  color: var(--text-main);
}

.chapter-wrap .text-muted{
  color: var(--text-muted) !important;
  font-size: .95rem;
}

/* Frage */
.question-wrap .fs-4{
  font-family: "Source Serif 4", serif;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

/* =========================
   Layout
   ========================= */
.layout{
  min-height: 100svh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 100vw;
}

.section{
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  max-width: 100vw;
}

.section.top{
  transform: rotate(180deg);
  transform-origin: center;
}

.section.middle{
  flex: 0 0 auto;
  height: 5vh;
  min-height: 64px;
  overflow: visible;
  max-width: 100vw;
}

/* =========================
   Middle Bar (3 Pillen)
   ========================= */
.middle-bar{
  width: 100%;
  max-width: min(900px, 100vw);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: .25rem .75rem;
}

.pill{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .4rem .65rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: 100%;
}

.pill-center{ gap: .6rem; }
.pill-mirror{ transform: rotate(180deg); }

/* Buttons */
.pill .btn{
  width: 48px;
  height: 48px;
  border-radius: 50% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  padding: 0;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0,0,0,.20);
  flex: 0 0 auto;
}

/* Disabled sichtbar aber nicht klickbar */
.btn.disabled,
.btn:disabled{
  opacity: .35 !important;
  pointer-events: none;
}

/* Fullscreen Button */
.pill .btn.fullscreen-toggle{
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.18);
}
.pill .btn.fullscreen-toggle:hover{
  background: rgba(0,0,0,.65);
}

/* =========================
   Dropdown (immer ~3 Zeichen breit)
   ========================= */
.question-select{
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  letter-spacing: .02em;

  height: 48px;

  width: 4.6ch;
  min-width: 4.6ch;
  max-width: 4.6ch;

  border-radius: 999px !important;
  padding-left: .35rem;
  padding-right: .35rem;

  /* ✅ Zentrierung in der Pille */
  text-align: center;
  text-align-last: center;

  overflow: hidden;
  white-space: nowrap;

  background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,0,0,.08);
  color: #2b1b1b;
}

.question-select option,
.question-select optgroup{
  font-family: "Roboto", sans-serif;
  font-weight: 700;

  /* ✅ Options in der Liste ebenfalls zentrieren */
  text-align: center;
}

/* =========================
  Content Shell
  ========================= */
.content-shell{
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  max-width: 100vw;
}

.content-wrap{
  width: 100%;
  height: 100%;
  max-width: min(900px, 100vw);
  padding: 1rem;
}

/* Content als einfache Flex-Column (ersetzt das alte 7-Zeilen-Grid) */
.content-stack{
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  min-height: 0;
}

.content-stack .chapter-wrap{
  display: flex;
  align-items: center;
  justify-content: center;
}

.content-stack .question-wrap{
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
}

/* Cards */
.content-wrap .card{
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 30px rgba(0,0,0,.20);
  max-width: 100%;
}

.question-wrap .card-body{
  overflow-y: auto;
}

/* Untere Section als Anker (nur die, die du willst) */
.section.footer-row{
  position: relative;
}

/* Footer relativ zur footer-row, nicht zum Viewport */
.subtitle-footer-fixed{
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(1.5 * 1em * 1.2);

  font-family: "Roboto", sans-serif;
  font-weight: 300;
  line-height: 1.2;
  pointer-events: auto;
}

/* Footer Text Styling */
.footer-text,
.footer-link {
  font-family: "Roboto", sans-serif !important;
  font-weight: 100 !important; /* Thin */
}

/* Chapter Pages: Hide Dropdowns */
.chapter-page .pill:first-child,
.chapter-page .pill:last-child {
  visibility: hidden;
}

/* =========================
   ULTRA SLIM Mobile
   ========================= */
@media (max-width: 576px){

  /* niemals breiter als Viewport */
  html, body, .layout, .section, .content-shell, .content-wrap{
    max-width: 100vw !important;
  }

  /* kein seitlicher Platz */
  .container,
  .container-fluid,
  .content-shell,
  .content-wrap{
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
  }

  /* Cards full width */
  .content-wrap .card{
    width: 100%;
    border-radius: 10px;
  }

  /* ✅ CHAPTER: viel viel kleiner */
  .chapter-wrap .card-body{
    padding: .25rem .40rem !important;
  }
  .chapter-wrap h2{
    font-size: .70rem;
    font-weight: 500;
    line-height: 1.1;
    margin: 0;
  }
  .chapter-wrap .text-muted{
    font-size: .58rem !important;
    line-height: 1.1;
    margin: .10rem 0 0 0 !important;
  }

  /* ✅ FRAGEN: kompakt, keine Scrollbar */
  .question-wrap,
  .question-wrap .card,
  .question-wrap .card-body{
    min-height: 0;
    max-height: 100%;
  }

  .question-wrap .card-body{
    padding: .25rem .35rem !important;
    overflow-y: hidden !important;
  }

  .question-wrap .fs-4{
    font-size: clamp(.60rem, 2.9vw, .82rem) !important;
    line-height: 1.12 !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    margin: 0 !important;
  }

  /* Middle-Bar kleiner */
  .section.middle{
    height: auto;
    min-height: 44px;
  }

  .middle-bar{
    max-width: 100% !important;
    padding: .15rem .35rem;
    gap: .25rem;
    justify-content: space-between;
  }

  .pill{
    padding: .18rem .28rem;
    box-shadow: 0 8px 18px rgba(0,0,0,.22);
  }

  .pill-center{ gap: .25rem; }

  .pill .btn{
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
  }

  .question-select{
    height: 34px;
    font-size: .88rem;

    width: 4.6ch;
    min-width: 4.6ch;
    max-width: 4.6ch;

    padding-left: .25rem;
    padding-right: .25rem;

    /* ✅ auch mobil zentriert */
    text-align: center;
    text-align-last: center;
  }
}
