/* ============================================
   Fachschaft Zahnmedizin Ulm — Design Tokens
   Palette:
     --paper:    #FAFAF7  background
     --surface:  #FFFFFF  panels
     --line:     #E3E0D8  hairline borders
     --ink:      #1B1B18  primary text
     --ink-soft: #6B6862  secondary text
     --teal:     #1F5C52  primary accent (instrument teal)
     --teal-deep:#12403A  accent hover/dark
     --rose:     #B76E79  sparing secondary accent
   Type:
     Headings — Space Grotesk (geometric, precise)
     Body     — Inter (neutral, highly readable)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --paper: #FAFAF7;
  --surface: #FFFFFF;
  --line: #E3E0D8;
  --ink: #1B1B18;
  --ink-soft: #6B6862;
  --teal: #1F5C52;
  --teal-deep: #12403A;
  --rose: #B76E79;
  --radius-sm: 3px;
  --maxw: 1120px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:hover { text-decoration: none; color: var(--teal-deep); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  transition: outline-offset 0.15s var(--ease);
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Header / Nav ---------- */
header.site-header {
  border-bottom: 1px solid transparent;
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}
header.site-header.scrolled {
  background: rgba(250, 250, 247, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--line);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
}
.wordmark .tag {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
}

nav.primary-nav {
  display: flex;
  gap: 28px;
}
nav.primary-nav a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.25s var(--ease);
}
nav.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
nav.primary-nav a:hover,
nav.primary-nav a.active {
  color: var(--ink);
  text-decoration: none;
}
nav.primary-nav a:hover::after,
nav.primary-nav a.active::after {
  transform: scaleX(1);
}

.nav-toggle { display: none; }
nav.primary-nav a, .wordmark, .wordmark .tag { white-space: nowrap; }
.wordmark { margin-right: 24px; }

/* Menü klappt ein, sobald die Reiter nicht mehr in eine Zeile passen */
@media (max-width: 1180px) {
  nav.primary-nav {
    position: fixed;
    inset: 72px 0 0 0;
    background: var(--paper);
    flex-direction: column;
    padding: 24px 32px;
    gap: 20px;
    transform: translateY(-110%);
    transition: transform 0.25s ease;
  }
  nav.primary-nav.open { transform: translateY(0); }
  .nav-toggle {
    display: block;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font: inherit;
    cursor: pointer;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease),
              color 0.25s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--teal);
  color: #fff;
}
.btn-primary:hover { background: var(--teal-deep); text-decoration: none; }
.btn-outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 72px;
  position: relative;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-eyebrow {
  color: var(--teal);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.08;
  max-width: 14ch;
}
.hero p.lead {
  margin-top: 20px;
  text-wrap: pretty;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 1.08rem;
}
.hero-actions {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.chart-art {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center 15%;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.hero-caption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 12px;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}
.hero-credit {
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-soft);
  opacity: 0.7;
  margin-top: 4px;
}

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 40px; }
}

/* ---------- Section basics ---------- */
section { padding: 64px 0; }
section.tight { padding: 40px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 32px;
}
.section-head h2 { font-size: 1.6rem; }
.section-head .index {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* Divider list (replaces card-shadow pattern) */
.divider-list { border-top: 1px solid var(--line); }
.divider-list > * {
  border-bottom: 1px solid var(--line);
  padding: 28px 4px;
  margin: 0 -4px;
  border-radius: var(--radius-sm);
  transition: background-color 0.25s var(--ease);
}
.divider-list > *:hover { background: rgba(31, 92, 82, 0.045); }

.trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.trio > div {
  padding: 28px 28px;
  border-right: 1px solid var(--line);
}
.trio > div:first-child { padding-left: 0; }
.trio > div:last-child { padding-right: 0; border-right: none; }
.trio .fdi {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  color: var(--teal);
  border: 1px solid var(--teal);
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.trio h3 { font-size: 1.15rem; margin-bottom: 8px; }
.trio p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

@media (max-width: 760px) {
  .trio { grid-template-columns: 1fr; }
  .trio > div { border-right: none; border-bottom: 1px solid var(--line); padding: 24px 0; }
}

/* ---------- Event / news items ---------- */
.event-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 20px;
  align-items: start;
}
.event-date {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.95rem;
}
.event-item h3 { font-size: 1.1rem; margin-bottom: 6px; }
.event-item p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }
.pill {
  align-self: start;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal-deep);
  background: #EAF2F0;
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .event-item { grid-template-columns: 1fr; }
  .pill { justify-self: start; }
}

/* ---------- Contact / Gremien ---------- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.person {
  background: var(--surface);
  padding: 26px;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}
.person:hover { background: #FCFBF8; transform: translateY(-2px); }
.person .role {
  color: var(--teal);
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 6px;
}
.person h3 { font-size: 1.1rem; margin-bottom: 4px; }
.person a { color: var(--ink-soft); font-size: 0.9rem; }
@media (max-width: 700px) {
  .people-grid { grid-template-columns: 1fr; }
}

/* ---------- Forms ---------- */
.form-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 36px;
}
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.field input[type="text"],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font: inherit;
  background: var(--paper);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal);
}
.file-drop {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 28px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
  cursor: pointer;
  background: var(--paper);
}
.file-drop.drag { border-color: var(--teal); color: var(--teal); }
.form-msg { font-size: 0.9rem; margin-top: 14px; }
.form-msg.ok { color: var(--teal-deep); }
.form-msg.err { color: #A13A3A; }

/* ---------- Altfragen list ---------- */
.filter-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-row select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font: inherit;
  background: var(--surface);
}
.file-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-sm);
  transition: background-color 0.25s var(--ease);
}
.file-row:hover { background: rgba(31, 92, 82, 0.045); }
.file-row .fach-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal-deep);
  min-width: 0;
  overflow-wrap: break-word;
  hyphens: auto;
}
.file-row .fname { font-weight: 500; }
.file-row .meta { color: var(--ink-soft); font-size: 0.85rem; }
.file-item { border-bottom: 1px solid var(--line); }
.comment-toggle {
  font-size: 0.85rem;
  white-space: nowrap;
}
.comment-panel {
  padding: 4px 8px 24px 8px;
  animation: gate-in 0.35s var(--ease);
}
.comment-thread { margin-top: 12px; }
.comment-item {
  border-left: 2px solid var(--line);
  padding: 10px 0 10px 16px;
  margin-top: 10px;
}
.comment-item .comment-meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.comment-item .comment-meta .autor { font-weight: 600; color: var(--ink); }
.comment-item .comment-text { font-size: 0.92rem; line-height: 1.5; white-space: pre-wrap; }
.comment-actions-row { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.comment-votes { display: flex; align-items: center; gap: 6px; }
.vote-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 24px;
  height: 22px;
  line-height: 1;
  font-size: 0.75rem;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vote-btn:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.vote-btn:disabled { cursor: default; opacity: 0.55; }
.vote-btn.vote-up.voted { color: var(--teal); border-color: var(--teal); background: rgba(31,92,82,0.08); }
.vote-btn.vote-down.voted { color: #A13A3A; border-color: #A13A3A; background: rgba(161,58,58,0.08); }
.vote-score { font-size: 0.85rem; font-weight: 600; color: var(--ink); min-width: 1.2em; text-align: center; }
.comment-reply-btn {
  background: none;
  border: none;
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 4px;
}
.comment-replies { margin-left: 8px; }
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  max-width: 480px;
}
.comment-form input, .comment-form textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}
.comment-form textarea { resize: vertical; min-height: 60px; }
.comment-form-actions { display: flex; align-items: center; gap: 12px; }
.comment-empty { color: var(--ink-soft); font-size: 0.88rem; font-style: italic; }
.empty-state {
  padding: 48px 0;
  text-align: center;
  color: var(--ink-soft);
}
@media (max-width: 700px) {
  .file-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Password gate (pre-launch) ---------- */
#fs-gate {
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  clip-path: circle(150% at var(--gx, 50%) var(--gy, 50%));
  transition: clip-path 1.3s cubic-bezier(0.65, 0, 0.35, 1);
}
#fs-gate.fs-gate-unlocking {
  clip-path: circle(0% at var(--gx, 50%) var(--gy, 50%));
}
.fs-gate-aurora {
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  filter: blur(70px);
  opacity: 0.5;
}
.fs-gate-aurora span {
  position: absolute;
  border-radius: 50%;
}
.fs-gate-aurora span:nth-child(1) {
  width: 340px; height: 340px;
  background: var(--teal);
  top: 8%; left: 12%;
  animation: aurora-1 19s ease-in-out infinite;
}
.fs-gate-aurora span:nth-child(2) {
  width: 300px; height: 300px;
  background: var(--rose);
  bottom: 10%; right: 12%;
  animation: aurora-2 23s ease-in-out infinite;
}
.fs-gate-aurora span:nth-child(3) {
  width: 260px; height: 260px;
  background: #C9A24B;
  top: 38%; right: 28%;
  animation: aurora-3 27s ease-in-out infinite;
}
@keyframes aurora-1 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(70px, 45px) scale(1.18); }
}
@keyframes aurora-2 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-55px, -35px) scale(1.12); }
}
@keyframes aurora-3 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(35px, -55px) scale(0.88); }
}
.fs-gate-box {
  position: relative;
  z-index: 1;
  max-width: 360px;
  width: 100%;
  text-align: center;
  transition: transform 1.3s cubic-bezier(0.65, 0, 0.35, 1);
}
#fs-gate.fs-gate-unlocking .fs-gate-box {
  transform: scale(0.8);
}
.fs-gate-title {
  opacity: 0;
  animation: gate-in 0.8s cubic-bezier(0.16,1,0.3,1) 0.15s forwards;
}
.fs-gate-box > p {
  opacity: 0;
  animation: gate-in 0.8s cubic-bezier(0.16,1,0.3,1) 0.32s forwards;
}
#fs-gate-form {
  opacity: 0;
  animation: gate-in 0.8s cubic-bezier(0.16,1,0.3,1) 0.48s forwards;
}
@keyframes gate-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .fs-gate-aurora span { animation: none; }
  .fs-gate-title, .fs-gate-box > p, #fs-gate-form {
    animation: none;
    opacity: 1;
  }
}

/* ---------- Reveal of the page behind the gate ---------- */
#page-content {
  transition: transform 1.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.3s ease;
}
#page-content.pre-reveal {
  transform: scale(1.06);
  opacity: 0.8;
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  #page-content, #page-content.pre-reveal {
    transform: none;
    opacity: 1;
    transition: none;
  }
}
.fs-gate-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 8px;
}
.fs-gate-title span { color: var(--teal); }
.fs-gate-box p {
  color: var(--ink-soft);
  margin-bottom: 24px;
  font-size: 0.95rem;
}
#fs-gate-form {
  display: flex;
  gap: 10px;
}
#fs-gate-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}
#fs-gate-input:focus { border-color: var(--teal); outline: none; }
.fs-gate-error {
  margin-top: 12px;
  color: #A13A3A;
  font-size: 0.88rem;
  min-height: 1.2em;
}
footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 40px;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.footer-row a { color: var(--ink-soft); }
.easter-egg {
  color: var(--rose);
  opacity: 0.55;
  text-decoration: none;
  font-weight: 700;
  padding: 0 2px;
}
.easter-egg:hover,
.easter-egg:focus {
  opacity: 1;
  text-decoration: none;
}

/* ---------- Bestenliste (alle Spiele) ---------- */
.leaderboard .lb-rank { width: auto; min-width: 38px; }
.lb-list.lb-expanded { max-height: 420px; overflow-y: auto; }
.lb-row.lb-me { background: rgba(31, 92, 82, 0.08); border-radius: var(--radius-sm); }
.lb-row.lb-me .lb-name { font-weight: 700; }
.lb-gap { text-align: center; color: var(--ink-soft); padding: 4px 0; }
.lb-mine-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.92rem;
  text-align: left;
}
.lb-toggle {
  margin-top: 12px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font: inherit;
  font-size: 0.88rem;
  color: var(--teal-deep);
  cursor: pointer;
}
.lb-toggle:hover { background: rgba(31, 92, 82, 0.045); }
.lb-total { margin-top: 10px; font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Prof-Köpfe in den Spielen ---------- */
.prof-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- Altfragen: Buttons & Vorschau ---------- */
.file-actions { display: flex; gap: 8px; }
@media (max-width: 700px) {
  .file-actions { margin-top: 6px; }
}
.vorschau-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(18, 28, 26, 0.55);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.vorschau-modal.offen { display: flex; }
.vorschau-box {
  background: var(--paper);
  border-radius: var(--radius-sm);
  width: min(1000px, 100%);
  height: min(90vh, 1200px);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.vorschau-kopf {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.vorschau-titel {
  flex: 1; min-width: 0; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vorschau-inhalt { position: relative; flex: 1; background: #e9e7e1; }
.vorschau-inhalt iframe { width: 100%; height: 100%; border: 0; display: block; }
.vorschau-laden {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center; color: var(--ink-soft);
}
.vorschau-modal.laedt .vorschau-laden { display: flex; }
.vorschau-modal.laedt iframe { visibility: hidden; }

/* ============================================
   Dunkelmodus
   ============================================ */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111614;
  --surface: #19201E;
  --line: #2B3532;
  --ink: #E9E7E2;
  --ink-soft: #A29F98;
  --teal: #3E9C8A;
  --teal-deep: #7CCBBB;
  --rose: #C98591;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  margin-left: 16px;
  flex-shrink: 0;
  transition: border-color 0.2s, background-color 0.2s;
}
.theme-toggle:hover { border-color: var(--teal); }
/* Reihenfolge im Header: Logo … Navigation, Schalter (Desktop) bzw. Logo … Schalter, Menü (Handy) */
.nav-row nav.primary-nav { order: 1; margin-left: auto; }
.nav-row .theme-toggle { order: 2; }
.nav-row .nav-toggle { order: 3; }
@media (max-width: 1180px) {
  .nav-row .theme-toggle { margin-left: auto; margin-right: 10px; }
}

[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
[data-theme="dark"] header.site-header.scrolled { background: rgba(17, 22, 20, 0.78); }
[data-theme="dark"] .btn-primary { background: #2E8070; }
[data-theme="dark"] .btn-primary:hover { background: #3A9483; }
[data-theme="dark"] .pill { background: rgba(124, 203, 187, 0.12); }
[data-theme="dark"] .person:hover { background: #1D2523; }
[data-theme="dark"] .divider-list > *:hover,
[data-theme="dark"] .file-row:hover,
[data-theme="dark"] .lb-toggle:hover { background: rgba(124, 203, 187, 0.06); }
[data-theme="dark"] .lb-row.lb-me { background: rgba(124, 203, 187, 0.12); }
[data-theme="dark"] .form-msg.err,
[data-theme="dark"] .fs-gate-error { color: #E58A8A; }
[data-theme="dark"] .vote-btn.vote-down.voted { color: #E58A8A; border-color: #E58A8A; background: rgba(229, 138, 138, 0.1); }
[data-theme="dark"] .vote-btn.vote-up.voted { background: rgba(124, 203, 187, 0.1); }
[data-theme="dark"] .vorschau-inhalt { background: #0C100F; }
[data-theme="dark"] .vorschau-modal { background: rgba(0, 0, 0, 0.65); }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea { background: var(--surface); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .chart-art { filter: brightness(0.92); }
[data-theme="dark"] .fs-gate-aurora { opacity: 0.55; }

/* Spiele */
[data-theme="dark"] .hole { background: radial-gradient(circle at 50% 40%, #2A3330, #1C2321); border-color: #33403C; }
[data-theme="dark"] #game-area.game-area { background: linear-gradient(#1C2422, #151B19); }
[data-theme="dark"] .wk-start-overlay { background: rgba(17, 22, 20, 0.88); }
[data-theme="dark"] .game-card:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }

/* Kalender */
[data-theme="dark"] .cal-day.weekend { background: rgba(255, 255, 255, 0.02); }
[data-theme="dark"] .cal-day:hover { background: rgba(124, 203, 187, 0.06); }
[data-theme="dark"] .cal-day[data-load="1"] { background: rgba(201, 162, 75, 0.10); }
[data-theme="dark"] .cal-day[data-load="2"] { background: rgba(201, 162, 75, 0.18); }
[data-theme="dark"] .cal-day[data-load="3"] { background: rgba(201, 133, 145, 0.22); }
[data-theme="dark"] .cal-day.today .cal-num { background: #2E8070; }
[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Semesterfarben im Kalender: im Dunkeln etwas heller, damit sie lesbar bleiben */
:root[data-theme="dark"] {
  --sem1: #3E9C8A; --sem2: #6FB3A6; --sem3: #C9A24B; --sem4: #B8964A;
  --sem5: #C98591; --sem6: #B06A76; --sem7: #5B8CC2; --sem8: #86A6CC;
  --sem9: #8C7DC6; --sem10: #ADA1DA;
}

/* Startseite: zufälliges Bild/Video immer komplett im Originalformat zeigen */
.chart-art.hero-frei { aspect-ratio: auto; height: auto; object-fit: contain; max-height: 72vh; width: auto; }
.chart-art.hero-hoch { max-width: min(100%, 320px); }
.chart-art.hero-quer { max-width: 100%; }

/* Lernmaterial */
.file-row.lm-row { grid-template-columns: 170px minmax(0, 1fr) auto auto; }
.lm-beschreibung { margin-top: 4px; }
.lm-endung { font-family: 'Space Grotesk', sans-serif; text-transform: uppercase; font-size: 0.75rem; letter-spacing: .05em; }
.lm-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--ink-soft); margin: 4px 0 18px; cursor: pointer; }
.lm-check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--teal-deep); }
.lm-hinweis { margin-top: 20px; }
@media (max-width: 700px) { .file-row.lm-row { grid-template-columns: 1fr; gap: 4px; } .lm-endung { display: none; } }
