/* Gemeinsames Gerüst. Farben und Look kommen aus rock.css und cozy.css. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  line-height: 1.45;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow-x: hidden;
}

[hidden] { display: none !important; }
html[data-theme="rock"] .nur-cozy { display: none !important; }
html[data-theme="cozy"] .nur-rock { display: none !important; }

.kulisse {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; display: block;
}
.kopf, main, .fuss { position: relative; max-width: 1100px; margin-inline: auto; padding-inline: 14px; }

.kopf { text-align: center; padding-top: 10px; }
.werkzeuge { display: flex; justify-content: space-between; align-items: center; }
.kopf h1 { margin: 6px 0 2px; font-size: clamp(2rem, 8vw, 4.4rem); line-height: 1; }
.kopf h1 em { font-style: normal; }
.unterzeile { margin: 8px 0 4px; font-size: clamp(.85rem, 2.4vw, 1.1rem); }
.countdown { margin: 4px 0 14px; font-weight: 700; min-height: 1.4em; }

.vorschau-leiste {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: center;
  margin-bottom: 8px; padding: 8px 12px; background: #111; color: #fff; border: 2px dashed #ffe600;
  font-family: system-ui, sans-serif; font-size: .9rem;
}
.vorschau-leiste a { color: #ffe600; }
.vorschau-leiste input { margin-left: 6px; font: inherit; }

.schalter {
  display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; min-height: 40px;
  font: inherit; font-weight: 700; cursor: pointer; color: var(--knopf-text);
  background: var(--knopf); border: 3px solid var(--rand); border-radius: var(--radius);
}
.schalter span { opacity: .5; }
html[data-theme="rock"] .schalter-rock, html[data-theme="cozy"] .schalter-cozy { opacity: 1; text-decoration: underline; }
.schalter .schalter-pfeil { opacity: 1; }

.meldung { padding: 10px 14px; background: var(--flaeche); color: var(--flaeche-text); border: 3px solid var(--rand); text-align: center; }

.tuerchen-raster {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(46%, 158px), 1fr));
}
.tuerchen-raster li:first-child { grid-column: 1 / -1; }
.tuerchen-raster li:last-child { grid-column: 1 / -1; }

.tuer {
  position: relative; width: 100%; height: 100%; min-height: 136px; padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: inherit; color: var(--flaeche-text); text-align: center; cursor: pointer; overflow: hidden;
  transition: transform .15s ease;
}
.tuer:not(:disabled):hover { transform: translateY(-3px) rotate(-1deg); }
.tuer:focus-visible, .knopf:focus-visible, .schalter:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
.tuer:disabled { cursor: default; }
.tuer-nummer { font-size: 2.4rem; font-weight: 900; line-height: 1; }
.tuer-band { font-size: .92rem; font-weight: 700; line-height: 1.15; }
.tuer-datum { font-size: .76rem; opacity: .8; }
.tuer-stempel { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }

.fuss { text-align: center; padding-block: 26px 30px; }
.link-knopf { background: none; border: 0; color: var(--kopf-text); font: inherit; text-decoration: underline; cursor: pointer; padding: 10px; }

.katzen-link { display: block; line-height: 0; transition: transform .2s ease; }
.katzen-link:hover { transform: rotate(-8deg) scale(1.08); }

.knopf {
  font: inherit; font-weight: 800; padding: 10px 18px; min-height: 44px; cursor: pointer;
  color: var(--knopf-text); background: var(--knopf); border: 3px solid var(--rand); border-radius: var(--radius);
}
.knopf:disabled { opacity: .55; cursor: default; }

/* Türchen-Dialog */
.buehne {
  width: min(680px, 94vw); max-height: 92dvh; padding: 0; overflow: hidden;
  color: var(--flaeche-text); background: var(--flaeche);
  border: 5px solid var(--rand); border-radius: var(--radius);
}
.buehne[open] { display: flex; flex-direction: column; }
.buehne::backdrop { background: rgb(0 0 0 / .78); }
.dialog-innen { position: relative; padding: 18px; overflow-y: auto; }
.dialog-tag { margin: 0; font-weight: 800; }
.dialog-innen h2 { margin: 2px 40px 12px 0; font-size: clamp(1.4rem, 5vw, 2.2rem); line-height: 1.1; }
.schliessen {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; font-size: 1.8rem; line-height: 1;
  color: var(--knopf-text); background: var(--knopf); border: 3px solid var(--rand); border-radius: 50%; cursor: pointer;
}
.inhalte { display: flex; flex-direction: column; gap: 14px; }
.inhalt p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.inhalt img, .inhalt video { display: block; width: 100%; max-height: 66dvh; object-fit: contain; background: #000; border-radius: 6px; }
.inhalt audio { display: block; width: 100%; }
.inhalt .inhalt-von { margin-top: 6px; font-size: .88rem; font-weight: 700; }
.inhalt-leer { margin: 12px 0; text-align: center; font-size: 1.1rem; }
.antwort { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.antwort label { font-weight: 700; }
textarea, input { font: inherit; }
.antwort textarea {
  width: 100%; padding: 8px; font-size: 16px; color: #111; background: #fff; border: 2px solid var(--rand); border-radius: 6px;
}
.zeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hinweis { font-size: .9rem; }
.zugabe { display: block; margin: 16px auto 0; font-size: 1.2rem; }
.baum svg { display: block; width: 130px; margin: 0 auto 8px; }

/* Öffnen: Vorhang (Rock) und Deckel (Cozy) */
.vorhang, .deckel { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.vorhang-links, .vorhang-rechts { position: absolute; top: 0; bottom: 0; width: 51%; transition: transform .9s cubic-bezier(.6, .05, .3, 1); }
.vorhang-links { left: 0; }
.vorhang-rechts { right: 0; }
.buehne.auf .vorhang-links { transform: translateX(-102%); }
.buehne.auf .vorhang-rechts { transform: translateX(102%); }
.deckel { transition: transform .8s cubic-bezier(.5, -.2, .4, 1), opacity .8s ease; transform-origin: top center; }
.buehne.auf .deckel { transform: translateY(-104%) rotate(-5deg); opacity: 0; }

/* Konfetti */
.konfetti { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.konfetti span { position: absolute; top: -14px; width: 9px; height: 14px; animation: konfetti-fall linear forwards; }
@keyframes konfetti-fall {
  to { transform: translateY(105vh) rotate(720deg); }
}

/* Einfache Seiten (Login, Upload) */
.seite-mitte { display: grid; place-items: center; min-height: 100dvh; padding: 16px; }
.karte {
  position: relative; width: min(460px, 100%); padding: 22px;
  color: var(--flaeche-text); background: var(--flaeche); border: 5px solid var(--rand); border-radius: var(--radius);
}
.karte h1 { margin: 0 0 14px; font-size: 2.2rem; line-height: 1.05; }
.karte h1 em { font-style: normal; }
.karte form { display: flex; flex-direction: column; gap: 6px; }
.karte label { font-weight: 700; margin-top: 8px; }
.karte input[type="text"], .karte input:not([type]), .karte input[type="password"] {
  width: 100%; padding: 10px; font-size: 16px; color: #111; background: #fff; border: 2px solid var(--rand); border-radius: 6px;
}
.karte .knopf { margin-top: 14px; }
.fehler { margin: 10px 0 0; font-weight: 700; color: var(--fehler); }

/* Upload */
.fortschritt { width: 100%; height: 18px; margin-top: 12px; accent-color: var(--fokus); }
.gruss-text { white-space: pre-wrap; font-size: 1.05rem; }
.datei-knopf { display: block; text-align: center; margin-top: 14px; }
.datei-knopf input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.datei-knopf:focus-within { outline: 3px solid var(--fokus); outline-offset: 2px; }

/* Schnee */
.schnee { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.schnee span {
  position: absolute; top: -10px; border-radius: 50%; background: #fff; opacity: .85;
  animation: schneefall linear infinite;
}
@keyframes schneefall {
  to { transform: translate3d(30px, 105vh, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
