:root {
  --nacht: #0b1430;
  --nacht2: #142250;
  --schnee: #f4f7ff;
  --gold: #ffcf4a;
  --rot: #c8323c;
  --gruen: #2f8f5b;
  --text: #1d2433;
  --papier: #fffdf8;
  --rand: #e3ddd0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--schnee);
  background: radial-gradient(ellipse at top, var(--nacht2), var(--nacht) 70%) fixed;
  min-height: 100vh;
}

a { color: var(--gold); }

#schnee { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

.huelle { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }

header.kopf { text-align: center; padding: 20px 0 10px; }
header.kopf h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin: 0; letter-spacing: 0.02em; }
header.kopf .unter { font-size: clamp(1rem, 2.6vw, 1.3rem); color: #c9d4ff; margin-top: 6px; }
.wellen { font-size: 2rem; display: inline-block; animation: funk 2.4s ease-in-out infinite; }
@keyframes funk { 0%, 100% { opacity: 0.4; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.08); } }

.leiste { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0; }
.knopf {
  display: inline-block; padding: 9px 16px; border-radius: 999px; text-decoration: none;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--schnee); font-size: 0.95rem; cursor: pointer;
}
.knopf:hover { background: rgba(255, 255, 255, 0.18); }
.knopf.an { background: var(--gold); color: #222; border-color: var(--gold); }

.hinweis {
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 14px;
  padding: 14px 18px; margin: 10px auto 22px; max-width: 760px; text-align: center; line-height: 1.5;
}

.raster { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; perspective: 1200px; }
@media (max-width: 760px) { .raster { grid-template-columns: repeat(4, 1fr); gap: 10px; } }
@media (max-width: 440px) { .raster { grid-template-columns: repeat(3, 1fr); } }

.tuer {
  position: relative; aspect-ratio: 1 / 1.15; border-radius: 10px; cursor: pointer; border: none; padding: 0;
  background: transparent; transform-style: preserve-3d; font: inherit; color: inherit;
}
.tuer .innen, .tuer .vorne {
  position: absolute; inset: 0; border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 8px;
}
.tuer .innen { background: var(--papier); color: var(--text); font-size: 0.8rem; line-height: 1.25; }
.tuer .innen strong { font-size: 1.4rem; color: var(--rot); }
.tuer .vorne {
  backface-visibility: hidden; transform-origin: left center; transition: transform 0.7s ease;
  background: linear-gradient(145deg, #b22a35, #7d1622); border: 2px dashed rgba(255, 215, 120, 0.7);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.tuer:nth-child(3n) .vorne { background: linear-gradient(145deg, #2f8f5b, #1b5a38); }
.tuer:nth-child(4n) .vorne { background: linear-gradient(145deg, #2b4ea2, #172f6b); }
.tuer:nth-child(5n) .vorne { background: linear-gradient(145deg, #a6762a, #6e4b14); }
.tuer .zahl { font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 800; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.4); }
.tuer .schloss { font-size: 0.85rem; opacity: 0.85; margin-top: 4px; }
.tuer.offen .vorne { transform: rotateY(-105deg); }
.tuer.zu { cursor: not-allowed; }
.tuer.zu .vorne { filter: saturate(0.6) brightness(0.85); }
.tuer:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.tuer.wackeln { animation: wackeln 0.4s; }
/* Bonus-Türchen 25 und 26: breit und golden, in eigener Reihe unter den 24 */
.tuer.bonus { grid-column: span 3; aspect-ratio: auto; min-height: 110px; }
@media (max-width: 760px) { .tuer.bonus { grid-column: span 2; } }
@media (max-width: 440px) { .tuer.bonus { grid-column: span 3; } }
.raster .tuer.bonus .vorne { background: linear-gradient(145deg, #e0b03a, #9a6b12); flex-direction: row; gap: 14px; }
.tuer .bonus-text { color: #fff; font-weight: 700; font-size: 1.05rem; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
@keyframes wackeln { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }

#meldung {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #fff; color: #222;
  padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 24px rgba(0,0,0,.4); opacity: 0;
  transition: opacity .3s; z-index: 10; pointer-events: none; max-width: 90vw; text-align: center;
}
#meldung.zeigen { opacity: 1; }

footer { text-align: center; color: #9fb0e6; font-size: 0.85rem; margin-top: 40px; line-height: 1.6; }
footer .spoilerwarnung { color: #ffe08a; margin: 0 auto 16px; max-width: 620px; }
.knopf.spenden { background: rgba(255, 207, 74, 0.15); border-color: var(--gold); color: var(--gold); font-weight: 600; }
.knopf.spenden:hover { background: var(--gold); color: #222; }

.werbung { max-width: 820px; margin: 34px auto 0; text-align: center; line-height: 1.55; }
.werbung h2 { font-size: clamp(1.3rem, 3.6vw, 1.8rem); color: var(--gold); margin: 0 0 8px; }
.werbung p { color: #dbe3ff; margin: 0 auto 18px; max-width: 700px; }
.punkte { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.punkte li { background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 12px; padding: 10px 12px; font-size: 0.95rem; }

/* Tagesseite */
.blatt {
  background: var(--papier); color: var(--text); border-radius: 16px; padding: 28px clamp(16px, 4vw, 40px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); line-height: 1.6;
}
.blatt h1 { color: var(--rot); margin-top: 0; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.blatt h2 { border-bottom: 2px solid var(--rand); padding-bottom: 4px; margin-top: 1.6em; }
.blatt a { color: #1b5fb5; }
.blatt table { border-collapse: collapse; width: 100%; font-size: 0.92rem; display: block; overflow-x: auto; }
.blatt th, .blatt td { border: 1px solid var(--rand); padding: 6px 8px; text-align: left; vertical-align: top; }
.blatt th { background: #f4efe4; }
.blatt code { background: #f1ede4; padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.blatt pre code { background: none; padding: 0; }
.blatt img { max-width: 100%; }
.blatt blockquote { border-left: 4px solid var(--gold); margin: 1em 0; padding: 4px 14px; background: #fff7dd; }

.steckbild { margin: 0 0 20px; text-align: center; }
.steckbild img { width: 100%; border: 1px solid var(--rand); border-radius: 10px; background: #fafafa; cursor: zoom-in; }
.steckbild figcaption { font-size: 0.85rem; color: #666; margin-top: 4px; }

.code-kasten { margin: 22px 0; border: 1px solid var(--rand); border-radius: 12px; overflow: hidden; }
.code-kopf {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center;
  background: #1d2433; color: #fff; padding: 8px 12px; font-family: ui-monospace, monospace; font-size: 0.9rem;
}
.code-kopf button, .code-kopf a {
  background: var(--gold); color: #222; border: none; border-radius: 6px; padding: 5px 10px; cursor: pointer;
  font-size: 0.85rem; text-decoration: none;
}
.code-kasten pre { margin: 0; max-height: 520px; overflow: auto; background: #0f1524; }
.code-kasten pre code { display: block; padding: 14px; font-size: 0.85rem; color: #e6e6e6; }

.navi { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.gesperrt { text-align: center; padding: 40px 10px; }
.gesperrt .gross { font-size: 3rem; }
