/* Skizzenbuch-Optik: warmes Papier, Tusche-Rahmen, kräftige Farben. */
:root {
  --paper: #f5ecd9;
  --paper-2: #fffaf0;
  --sheet: #fffdf6;
  --ink: #1d1b16;
  --ink-soft: #5f574a;
  --line: #1d1b16;
  --pink: #ff5c8a;
  --yellow: #ffd23f;
  --teal: #2ec4b6;
  --violet: #7b61ff;
  --red: #e63946;
  --green: #3fbf6f;
  --radius: 16px;
  --shadow: 4px 4px 0 var(--ink);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(29, 27, 22, 0.09) 1px, transparent 1.2px);
  background-size: 18px 18px;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.4;
}

button, input { font: inherit; color: inherit; }

h1, h2 { margin: 0; line-height: 1.15; text-wrap: balance; }
h2 { font-size: 1.15rem; font-weight: 900; }
p, li { text-wrap: pretty; }

/* Tastatur: deutlich sichtbarer Ring, der zur Tusche-Optik passt */
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.input:focus-visible { outline: none; }

/* ---- Rahmen ---- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: var(--paper-2);
  border-bottom: 2.5px solid var(--ink);
}
.logo { font-weight: 900; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.topbar-actions .btn { white-space: nowrap; }
.code-chip {
  font-weight: 900; letter-spacing: 0.15em; padding: 3px 10px; border-radius: 999px;
  background: var(--yellow); border: 2px solid var(--ink);
}
@media (max-width: 480px) {
  .topbar:has(.topbar-actions) .logo-text { display: none; }
}

.app {
  max-width: 680px; margin: 0 auto;
  padding: 16px 16px max(40px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
body.is-screen .app { max-width: 1600px; }

.offline {
  position: sticky; top: 54px; z-index: 19; text-align: center; padding: 6px;
  background: var(--red); color: white; font-weight: 800;
}

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--ink); color: var(--paper-2); font-weight: 800; text-align: center;
  transition: transform 0.25s, opacity 0.25s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---- Bausteine ---- */

.card {
  background: var(--paper-2); border: 2.5px solid var(--ink);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; flex-wrap: wrap; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.label { margin: 0; font-weight: 800; color: var(--ink-soft); }
.kicker { margin: 0; font-weight: 800; font-size: 0.95rem; color: var(--ink-soft); }
.headline { font-size: 1.8rem; font-weight: 900; text-align: center; }
.section-h { margin: 8px 0 10px; }

.btn {
  border: 2.5px solid var(--ink); border-radius: 12px; padding: 12px 18px; cursor: pointer;
  font-weight: 900; font-size: 1.05rem; background: var(--paper-2);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.06s, box-shadow 0.06s;
}
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--pink); color: white; }
.btn.ghost { box-shadow: none; border-width: 2px; background: transparent; }
.btn.small { min-height: 36px; padding: 5px 11px; font-size: 0.85rem; border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); }
.btn.ghost.small { box-shadow: none; }
.btn.wide { width: 100%; }

.icon-btn {
  border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
  font-size: 1rem; min-width: 40px; min-height: 40px; padding: 6px 8px; border-radius: 10px;
}

.input {
  width: 100%; min-width: 0; padding: 12px 14px; border-radius: 12px;
  border: 2.5px solid var(--ink); background: var(--sheet); font-size: 1.1rem; outline: none;
}
.input:focus { box-shadow: 0 0 0 3px var(--yellow); }
.code-input { text-transform: uppercase; letter-spacing: 0.3em; font-weight: 900; text-align: center; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink);
  color: var(--ink); font-weight: 900;
}
.avatar.xs { width: 20px; height: 20px; font-size: 0.65rem; border-width: 1.5px; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.5rem; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px;
  border-radius: 999px; border: 2px solid var(--ink); background: var(--paper-2); font-size: 0.9rem; font-weight: 700;
}
.chip.pending { opacity: 0.45; border-style: dashed; }
.chip.done { background: #c8f0d5; }

.tag {
  margin-left: 6px; padding: 0 8px; border-radius: 999px; font-size: 0.75rem;
  border: 1.5px solid var(--ink); background: var(--paper); vertical-align: middle;
}
.tag.host { background: var(--yellow); }

.countdown {
  min-width: 3.2em; text-align: center; padding: 2px 10px; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--paper-2); font-weight: 900; font-variant-numeric: tabular-nums;
}
.countdown.urgent { background: var(--red); color: white; animation: pulse 1s infinite; }

.pill { padding: 2px 10px; border-radius: 999px; background: var(--ink); color: var(--paper-2); font-weight: 800; font-size: 0.85rem; white-space: nowrap; }

/* ---- Startseite ---- */

.hero { text-align: center; padding: max(18px, env(safe-area-inset-top)) 0 6px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero h1 { font-size: clamp(2.3rem, 10vw, 3.4rem); font-weight: 900; letter-spacing: -0.02em; }
.tagline { color: var(--ink-soft); margin: 0 auto; max-width: 30em; }

/* Das Faltblatt: drei Streifen, drei Leute, ein Monster – klappt beim Laden einmal auf */
.faltblatt { width: min(300px, 66vw); perspective: 900px; }
/* Startseite: der Titel steht groß darunter, die Kopfzeile wäre doppelt */
body.startseite .topbar { display: none; }
.falt {
  position: relative; display: block; width: 100%; height: auto;
  background: var(--sheet); border: 2.5px solid var(--ink); border-top-style: dashed; border-top-color: rgba(29, 27, 22, 0.35);
  transform-origin: 50% 0; animation: aufklappen 0.55s cubic-bezier(.3, 1.4, .5, 1) backwards;
}
.falt-wrap { position: relative; }
.falt-wrap:first-child .falt { border-top: 2.5px solid var(--ink); border-radius: 14px 14px 0 0; }
.falt-wrap:last-child .falt { border-radius: 0 0 14px 14px; box-shadow: 5px 5px 0 var(--ink); }
.falt-wrap:nth-child(1) { rotate: -1.2deg; }
.falt-wrap:nth-child(2) { rotate: 0.8deg; translate: 4px 0; }
.falt-wrap:nth-child(3) { rotate: -0.5deg; translate: -3px 0; }
.falt-wrap:nth-child(2) .falt { animation-delay: 0.45s; }
.falt-wrap:nth-child(3) .falt { animation-delay: 0.9s; }
.falt-wrap:nth-child(2) .falt-wer { animation-delay: 0.75s; }
.falt-wrap:nth-child(3) .falt-wer { animation-delay: 1.2s; }
.falt-wer {
  position: absolute; left: 6px; top: 6px; z-index: 1; display: flex; align-items: center; gap: 4px;
  padding: 1px 8px 1px 2px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--paper-2);
  font-size: 0.72rem; font-weight: 800; animation: einblenden 0.3s 0.3s backwards;
}
.falt-wer .avatar { width: 18px; height: 18px; font-size: 0.6rem; border-width: 1.5px; }
@keyframes aufklappen { from { transform: rotateX(-88deg); opacity: 0.4; } }

/* ---- Lobby ---- */

.room-code { font-size: 3rem; font-weight: 900; letter-spacing: 0.25em; padding-left: 0.25em; margin: 2px 0 10px; }
.room-code.xl { font-size: clamp(4rem, 9vw, 7rem); margin: 10px 0; }
.players, .ranking { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.player, .ranking li {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 10px; border-radius: 12px; border: 2px solid var(--ink); background: var(--sheet);
}
.player.offline { opacity: 0.5; }
.player-name { flex: 1; font-weight: 800; display: flex; flex-direction: column; }
.player .player-name { flex-direction: row; flex-wrap: wrap; align-items: center; }
.player-name .sub { font-weight: 600; font-size: 0.8rem; color: var(--ink-soft); }
.score { font-weight: 900; font-variant-numeric: tabular-nums; }
.players.big .player { font-size: 1.4rem; padding: 10px 14px; }

.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.type {
  display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px;
  border: 2px solid var(--ink); background: var(--sheet); font-weight: 800; cursor: pointer; text-align: left;
}
.type.on { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.type-emoji { font-size: 1.4rem; }
.type { font-size: 0.95rem; hyphens: auto; }

.waiting p { margin: 6px 0 0; }
/* Host: Start immer im Daumenbereich, ohne am Typen-Raster vorbeizuscrollen */
.start-bar {
  position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 10;
  display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 18px;
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px);
}
.start-bar p { margin: 0; }
.bounce { font-size: 2.4rem; animation: bounce 1.2s ease-in-out infinite; }
.rules summary { font-weight: 900; cursor: pointer; }
.rules ol { margin: 10px 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }

/* ---- Zeichnen ---- */

.draw-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.part-name { flex: 1; font-size: 1.3rem; font-weight: 900; }
.thema { margin: 0; font-size: 1.05rem; }
.thema b { background: linear-gradient(transparent 55%, var(--yellow) 55%); }
.challenge {
  margin: 0; padding: 10px 12px; border-radius: 12px; border: 2.5px solid var(--ink);
  background: var(--violet); color: white; animation: shake 0.6s 1;
}
.challenge.ehrenwort { background: var(--teal); color: var(--ink); }

.anschluss-wrap { position: relative; border: 2.5px solid var(--ink); border-bottom: 0; border-radius: 14px 14px 0 0; overflow: hidden; }
.anschluss { display: block; opacity: 0.55; filter: grayscale(0.3); }
.anschluss-label {
  position: absolute; right: 8px; bottom: 4px; font-size: 0.75rem; font-weight: 800;
  background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 999px; padding: 0 8px;
}
.anschluss-leer { margin: 0 0 4px; font-size: 0.85rem; color: var(--ink-soft); text-align: center; }
.rotor { position: relative; transform-origin: 50% 50%; }
.anschluss-wrap + .rotor .paper { border-radius: 0 0 14px 14px; border-top: 2px dashed var(--red); }
.paper { display: block; background: var(--sheet); border: 2.5px solid var(--ink); border-radius: 14px; touch-action: none; }
.rotor .paper { cursor: crosshair; }
.guides { position: absolute; inset: 0; pointer-events: none; border: 2.5px solid transparent; }

.overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; text-align: center;
  background: rgba(255, 250, 240, 0.94); border: 2.5px solid var(--ink); border-radius: 14px;
}
.overlay p { margin: 0; }
.overlay-big { font-size: 1.8rem; font-weight: 900; }

.tools { display: flex; flex-direction: column; gap: 8px; }
.swatches, .tool-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tool {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border-radius: 10px; border: 2px solid var(--ink); background: var(--sheet); cursor: pointer; font-size: 1.1rem;
}
.tool.on { background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); transform: translate(-1px, -1px); }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--ink); }
.dot { border-radius: 50%; background: var(--ink); }

/* ---- Taufe ---- */

.paper.small { width: 100%; height: auto; }
.taufe-ok { margin: 0; font-weight: 900; font-size: 1.2rem; }
.taufe-form { display: flex; flex-direction: column; gap: 10px; }
.taufe-form .row > .btn.primary { flex: 1; }
.taufe-stand { margin: 0; font-weight: 800; }

/* ---- Enthüllung ---- */

.thema-gross { margin: 6px 0 0; font-size: 1.5rem; font-weight: 700; }
.thema-gross.xl { font-size: clamp(2rem, 3.4vw, 3rem); }
.thema-gross b { background: linear-gradient(transparent 55%, var(--yellow) 55%); }
.monster-stack {
  margin: 0 auto; max-width: 100%; border: 3px solid var(--ink); border-radius: 16px; overflow: hidden;
  box-shadow: 6px 6px 0 var(--ink); background: var(--sheet); transition: width 0.8s ease;
}
.part-block { position: relative; opacity: 0.08; transition: opacity 0.3s; }
.part-block.shown { opacity: 1; }
.part-block .paper { border: 0; border-radius: 0; }
.part-tag {
  position: absolute; left: 6px; top: 6px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  font-size: 0.78rem; font-weight: 800; padding: 2px 8px 2px 3px; border-radius: 999px;
  background: rgba(255, 250, 240, 0.9); border: 1.5px solid var(--ink); max-width: 70%;
}
.tag-challenge { color: var(--violet); }
.reactions { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.part-block:not(.shown) .reactions, .part-block:not(.shown) .part-tag { visibility: hidden; }
.react {
  display: flex; align-items: center; gap: 3px; padding: 3px 7px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--ink); background: rgba(255, 250, 240, 0.92); font-size: 1.05rem;
}
.react:disabled { cursor: default; opacity: 0.4; }
.react.sticker-btn { gap: 4px; font-size: 0.85rem; font-weight: 900; background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }
.react.sticker-btn:disabled { background: rgba(255, 250, 240, 0.92); box-shadow: none; }
.monster-stack { position: relative; }
.stack-intro {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--sheet); font-size: 1.2rem; animation: einblenden 0.3s;
}
.stack-intro .bounce { font-size: 2.6rem; }
.react.mine { background: var(--yellow); }
.react .count { font-size: 0.8rem; font-weight: 900; min-width: 0.6em; }
.flying { position: absolute; bottom: 20%; font-size: 2rem; pointer-events: none; animation: fly 1.6s ease-out forwards; }
.monster-name { margin: 10px 0 0; text-align: center; font-size: 1.6rem; animation: pop 0.6s cubic-bezier(.2, 1.6, .4, 1); }
.monster-name b { font-weight: 900; color: var(--pink); }
.reveal-foot { position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 10; }
.reveal-foot.row > .btn { flex: 1; }
.reveal-foot p { margin: 0; padding: 8px; background: rgba(245, 236, 217, 0.92); border-radius: 12px; }

/* ---- Galerie ---- */

.gallery { display: grid; gap: 12px; align-items: start; }
.gallery-item { margin: 0; }
.gallery-stack { border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--sheet); box-shadow: 3px 3px 0 var(--ink); }
.gallery-part { position: relative; display: block; width: 100%; container-type: inline-size; }
.gallery-part .paper { border: 0; border-radius: 0; }
.gallery-part + .gallery-part { border-top: 1.5px dashed rgba(29, 27, 22, 0.28); }
.gallery-item figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 0.85rem; }
.gallery-item figcaption b { font-size: 1rem; }
.gallery-item figcaption .btn { align-self: flex-start; margin-top: 4px; }

/* ---- Siegerehrung ---- */

.podium-wrap { text-align: center; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin-top: 18px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 30%; max-width: 160px; animation: rise 0.7s ease-out backwards; }
.step b { font-size: 1rem; overflow-wrap: anywhere; }
.step .block {
  width: 100%; display: grid; place-items: center; font-size: 1.8rem; font-weight: 900;
  border: 2.5px solid var(--ink); border-radius: 10px 10px 0 0; box-shadow: var(--shadow);
}
.step-1 .block { height: 120px; background: var(--yellow); }
.step-2 .block { height: 86px; background: #d9d9d9; }
.step-3 .block { height: 64px; background: #e8a87c; }
.step-1 { animation-delay: 0.5s; }
.step-3 { animation-delay: 0.25s; }
.titles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.title-card { display: flex; flex-direction: column; gap: 6px; }
.titel-leer { grid-column: 1 / -1; margin: 0; }
.title-winner { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.title-winner .paper { border-radius: 10px; }
.ranking li .score { min-width: 2.5em; text-align: right; }

/* ---- Bildschirm (Präsentationsgerät) ---- */

.screen-center { text-align: center; padding: 3vh 0 1vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.screen-center.tight { padding-top: 1vh; }
.screen-title { font-size: clamp(2.2rem, 4.5vw, 4rem); font-weight: 900; }
.screen-sub { font-size: clamp(1.1rem, 2vw, 1.6rem); margin: 0; }
.screen-countdown .countdown { font-size: clamp(2rem, 5vw, 4rem); padding: 4px 26px; }
.screen-status .chip { font-size: 1.3rem; }
.big-emoji { font-size: 5rem; }
.screen-lobby { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; min-height: calc(100dvh - 110px); }
.screen-join { text-align: center; }
.qr { width: min(300px, 32vw); margin: 0 auto; background: white; border: 3px solid var(--ink); border-radius: 16px; padding: 10px; box-shadow: var(--shadow); }
.qr svg { display: block; width: 100%; height: auto; }
@media (max-width: 800px) {
  .screen-lobby { grid-template-columns: 1fr; }
}

/* ---- Bewegung ---- */

@keyframes wobble { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) scale(1.08); } }
.wobble { animation: wobble 2s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulse { 50% { transform: scale(1.1); } }
@keyframes shake { 20%, 60% { transform: rotate(-2deg); } 40%, 80% { transform: rotate(2deg); } }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } }
@keyframes fly { from { transform: translateY(0) scale(0.6); opacity: 1; } to { transform: translateY(-140px) scale(1.4); opacity: 0; } }

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

/* Auf dem Bildschirm: nur Reaktionen mit Zählerstand, Fußzeile nicht über dem Namen */
.is-screen .reveal-foot { position: static; }
.is-screen .react { font-size: 0.85rem; padding: 1px 6px; }
.is-screen .react:has(.count:empty) { display: none; }

/* ---- Bühne: gemeinsame Bausteine ---- */

.btn.attention { border-color: var(--pink); color: var(--pink); animation: pulse 1.6s infinite; }
.screen-card { border-style: dashed; }
.screen-wait { font-size: clamp(1.1rem, 1.6vw, 1.4rem); font-weight: 800; margin: 14px 0 0; }
.screen-rules {
  list-style: none; margin: 22px 0 0; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
  border: 2.5px solid var(--ink); border-radius: var(--radius); background: var(--paper-2); box-shadow: var(--shadow);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
}
.screen-rules li { display: flex; gap: 10px; }
.screen-players .card-head { align-items: center; }
.screen-players #typ { font-weight: 800; font-size: 1.1rem; }

/* ---- Bühne: Zeichnen ---- */

.draw-stage { position: relative; display: flex; flex-direction: column; gap: 14px; }
.draw-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.draw-stage-head .screen-title { font-size: clamp(1.8rem, 3.4vw, 3rem); }
.draw-stage-body { display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 24vw, 360px); gap: 20px; align-items: start; }
.towers { display: flex; gap: 14px; justify-content: center; align-items: flex-start; min-width: 0; }
.tower { flex: 1; min-width: 0; max-width: calc(var(--teil-b) + 8px); display: flex; flex-direction: column; gap: 6px; }
.tower-head { height: 64px; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 0.85rem; font-weight: 700; overflow: hidden; }
.tower-emoji { font-size: 1.5rem; line-height: 1.1; }
.tower-thema { color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tower-stack { display: flex; flex-direction: column; border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--sheet); box-shadow: 3px 3px 0 var(--ink); }
.slot {
  position: relative; height: var(--teil-h); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 4px 6px; font-size: 0.85rem; font-weight: 800; text-align: center; overflow: hidden;
}
.slot + .slot { border-top: 1.5px dashed rgba(29, 27, 22, 0.25); }
.slot.done { background: color-mix(in srgb, var(--farbe) 22%, var(--sheet)); }
.slot.active { background: color-mix(in srgb, var(--farbe) 14%, var(--sheet)); box-shadow: inset 0 0 0 3px var(--farbe); animation: atmen 1.6s ease-in-out infinite; }
.slot.active.fertig { animation: none; background: #c8f0d5; box-shadow: inset 0 0 0 3px var(--green); }
.slot.future { color: rgba(29, 27, 22, 0.32); font-weight: 700; }
.slot-wer { display: flex; align-items: center; gap: 5px; max-width: 100%; }
.slot-wer span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-challenge { font-size: 0.75rem; color: var(--violet); white-space: nowrap; }
.slot-ok { position: absolute; right: 6px; top: 4px; color: var(--green); font-size: 1rem; }
.tinte { width: 70%; height: 6px; border-radius: 999px; background: rgba(29, 27, 22, 0.1); overflow: hidden; }
.tinte span { display: block; height: 100%; background: var(--farbe); transition: width 0.6s; }
.towers.kompakt .slot { flex-direction: row; font-size: 0.75rem; }
.towers.kompakt .slot-challenge { display: none; }
.towers.kompakt .tinte { width: 30%; }
.ticker { border: 2.5px solid var(--ink); border-radius: var(--radius); background: var(--paper-2); box-shadow: var(--shadow); padding: 14px; }
.ticker h2 { display: flex; align-items: center; gap: 8px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: pulse 1.2s infinite; }
.ticker-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ticker-item { padding: 8px 10px; border-radius: 10px; background: var(--sheet); border: 2px solid var(--ink); font-weight: 700; font-size: clamp(0.95rem, 1.2vw, 1.1rem); animation: einrutschen 0.4s ease-out; }
.ticker-item:nth-child(n+4) { opacity: 0.6; }
.ticker-item.challenge { background: var(--violet); color: white; }
.ticker-item.erster { background: var(--yellow); }
.ticker-item.eilig { background: var(--red); color: white; }
.stage-pause {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(245, 236, 217, 0.95); text-align: center;
}
.stage-pause p { margin: 0; }
.stage-pause .kicker { font-size: 1.3rem; }
.stage-pause-big { font-size: clamp(2.2rem, 5vw, 4.4rem); font-weight: 900; }
.stage-pause-count { font-size: clamp(4rem, 10vw, 8rem); font-weight: 900; color: var(--pink); animation: pulse 1s infinite; }
@media (max-width: 900px) {
  .draw-stage-body { grid-template-columns: 1fr; }
}

/* ---- Bühne: Enthüllung ---- */

.reveal-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 30vw, 440px); gap: 20px; }
.stage {
  position: relative; overflow: hidden; border-radius: 20px; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
  background: radial-gradient(rgba(29, 27, 22, 0.08) 1px, transparent 1.2px) 0 0 / 18px 18px, var(--paper);
}
.kamera {
  position: absolute; left: 50%; top: 0; transform-origin: 50% 0;
  background: var(--sheet); border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; box-shadow: 6px 6px 0 var(--ink);
  transition: transform 0.9s cubic-bezier(.45, 0, .2, 1);
}
.kamera.sofort { transition: none; }
.kamera .part-block { opacity: 0.12; }
.kamera .part-block.shown { opacity: 1; }
.kamera .part-block + .part-block { border-top: 1px dashed rgba(29, 27, 22, 0.12); }
.kamera .part-tag { font-size: 1.05rem; padding: 4px 12px 4px 4px; }
.kamera .part-tag .avatar.xs { width: 28px; height: 28px; font-size: 0.9rem; }
.kamera.total .part-tag { opacity: 0; }
.stage-intro {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 24px; text-align: center; background: rgba(245, 236, 217, 0.96); animation: pop 0.5s cubic-bezier(.2, 1.4, .4, 1);
}
.stage-intro p { margin: 0; }
.stage-intro .kicker { font-size: 1.2rem; }
.stage-intro-thema { font-size: clamp(2.2rem, 5vw, 4.6rem); font-weight: 800; line-height: 1.15; max-width: 22ch; }
.stage-intro-thema b { display: block; }
.stage-intro-thema b span { background: linear-gradient(transparent 60%, var(--yellow) 60%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.stage-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.stage-side .kicker { font-size: 1rem; }
.stage-thema { margin: 0; font-size: clamp(1.4rem, 2.2vw, 2rem); font-weight: 700; line-height: 1.2; }
.stage-thema b { background: linear-gradient(transparent 55%, var(--yellow) 55%); }
.stage-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; overflow: auto; min-height: 0; }
.stage-part {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px;
  border: 2px solid var(--ink); background: var(--sheet); animation: einrutschen 0.4s ease-out;
}
.stage-part.jetzt { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.stage-part-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 1.05rem; }
.stage-part-text .muted { font-size: 0.85rem; }
.stage-part-reaktionen { display: flex; gap: 6px; font-size: 1.15rem; }
.stage-part-reaktionen > span:has(.count:empty) { opacity: 0.25; }
.stage-part-reaktionen .count { font-size: 0.85rem; font-weight: 900; margin-left: 1px; }
.stage-name {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px;
  border: 3px solid var(--ink); border-radius: var(--radius); background: var(--pink); color: white; box-shadow: var(--shadow);
  font-size: 1.1rem; font-weight: 800; animation: pop 0.6s cubic-bezier(.2, 1.6, .4, 1);
}
.stage-name.versteckt { visibility: hidden; animation: none; }
.stage-name b { font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1.1; overflow-wrap: anywhere; }
.stage-weiter { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.stage-weiter p { margin: 0; }
.flying.big { font-size: clamp(3rem, 6vw, 5.5rem); bottom: 6%; z-index: 7; animation: fly-gross 2.2s ease-out forwards; }
@keyframes fly-gross { from { transform: translateY(0) scale(0.5); opacity: 1; } 70% { opacity: 1; } to { transform: translateY(-55vh) scale(1.3) rotate(12deg); opacity: 0; } }
@media (max-width: 900px) {
  .reveal-stage { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .stage-parts { display: none; }
}

/* ---- Handy als Fernbedienung ---- */

.look-up { margin: 0; text-align: center; font-weight: 900; font-size: 1.2rem; animation: bounce 1.6s ease-in-out infinite; }
.look-up-card { padding: 30px 16px; }
.remote-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.remote-part { padding: 12px; border-radius: var(--radius); border: 2.5px solid var(--ink); background: var(--paper-2); animation: einrutschen 0.35s ease-out; }
.remote-part.jetzt { box-shadow: var(--shadow); background: #fff4c4; }
.remote-part:not(.jetzt) { opacity: 0.8; }
.remote-part-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 1rem; margin-bottom: 10px; }
.remote-part p { margin: 0; }
.remote-reactions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.react.big { justify-content: center; padding: 12px 6px; font-size: 2rem; border-width: 2.5px; border-radius: 16px; background: var(--sheet); box-shadow: 3px 3px 0 var(--ink); }
.react.big:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none; }
.react.big.mine { background: var(--yellow); }
.react.big .count { font-size: 1rem; }

/* ---- Bühne: Siegerehrung ---- */

.show { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 0; overflow: hidden; }
.show:not(.gross) { min-height: 70dvh; }
.show-intro, .show-titel, .show-podium { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; animation: pop 0.5s cubic-bezier(.2, 1.4, .4, 1); }
.show-title { font-size: clamp(2rem, 5vw, 4.4rem); font-weight: 900; margin: 0; overflow-wrap: anywhere; }
.show-sub { font-size: clamp(1.1rem, 2.2vw, 1.8rem); margin: 0; color: var(--ink-soft); }
.show .kicker { font-size: clamp(0.9rem, 1.4vw, 1.2rem); }
.show-winner { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; min-height: 120px; align-items: center; }
.show-dots { font-size: 4rem; font-weight: 900; margin: 0; letter-spacing: 0.2em; }
.show-dots span { animation: hops 0.9s infinite; display: inline-block; }
.show-dots span:nth-child(2) { animation-delay: 0.15s; }
.show-dots span:nth-child(3) { animation-delay: 0.3s; }
.show-card { margin: 0; display: flex; flex-direction: column; gap: 8px; animation: pop 0.6s cubic-bezier(.2, 1.6, .4, 1); }
.show-card .paper { box-shadow: 6px 6px 0 var(--ink); border-width: 3px; }
.show-card figcaption { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.show-card-wer { display: flex; align-items: center; gap: 8px; font-size: clamp(1.2rem, 2vw, 1.8rem); }
.show-podium .podium { width: 100%; max-width: 760px; }
.show.gross .podium .step { max-width: 220px; }
.show.gross .step-1 .block { height: 180px; }
.show.gross .step-2 .block { height: 130px; }
.show.gross .step-3 .block { height: 96px; }
.show.gross .step b { font-size: 1.5rem; }
.show.gross .step .score { font-size: 1.3rem; }
.step.wartet { visibility: hidden; animation: none; }
.konfetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.konfetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fallen 3s linear forwards; }
@keyframes fallen { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes hops { 50% { transform: translateY(-14px); } }
@keyframes einrutschen { from { transform: translateY(-10px); opacity: 0; } }
@keyframes atmen { 50% { filter: brightness(0.94); } }

/* ---- Zeichnen: Ansicht füllt den Bildschirm ---- */

body.zeichnet .app { max-width: 1200px; padding: 8px 10px max(8px, env(safe-area-inset-bottom)); gap: 8px; }
.draw-layout { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; }
.draw-top { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.draw-top .challenge { padding: 6px 10px; font-size: 0.95rem; }
.draw-area { min-height: 0; min-width: 0; display: flex; align-items: center; justify-content: center; }
.board { position: relative; flex: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.draw-side { display: flex; flex-direction: column; gap: 8px; }
.tool, .btn, .react { touch-action: manipulation; }
.anschluss-hinweis .guides { animation: blinken 0.8s ease-in-out 6; }
@keyframes blinken { 50% { opacity: 0.15; } }
@media (max-width: 420px) {
  .tool { width: 36px; height: 36px; }
  .swatches { gap: 4px; flex-wrap: nowrap; }
}
/* quer: Werkzeuge an die Seite, die Leinwand nutzt die Höhe */
@media (orientation: landscape) and (min-width: 600px) {
  .draw-layout { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); }
  .draw-top { grid-column: 1 / -1; }
  .draw-side { width: 104px; justify-content: center; }
  .draw-side .swatches, .draw-side .tool-row { display: grid; grid-template-columns: repeat(2, 40px); justify-content: center; gap: 6px; }
  .draw-side .fertig { padding: 12px 6px; }
}
/* Handy quer: wenig Höhe – Kopfzeile in eine Zeile, Topbar weg, solange gezeichnet wird */
@media (max-height: 520px) {
  body.zeichnet .topbar { display: none; }
  body.zeichnet .app { max-width: none; }
  .draw-top { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 4px 12px; }
  .draw-top .thema { font-size: 0.9rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .draw-top .challenge { flex: none; }
  .challenge-text, .anschluss-leer { display: none; }
  .draw-top .challenge { padding: 2px 8px; font-size: 0.85rem; animation: none; }
  .draw-top .part-name { font-size: 1.05rem; }
  .draw-side { width: 120px; gap: 6px; }
  .draw-side .tool { width: 34px; height: 34px; }
  .draw-side .swatches, .draw-side .tool-row { grid-template-columns: repeat(3, 34px); gap: 4px; }
  .draw-side .fertig { padding: 8px 4px; font-size: 0.95rem; }
}

/* ---- Taufe ---- */

.icon-wuerfel { padding: 8px 10px; flex: none; font-size: 1.3rem; }
.icon-wuerfel.rollt { animation: rollen 0.5s ease-out; }
@keyframes rollen { from { transform: rotate(-360deg) scale(0.6); } }

/* ---- Sticker ---- */

.part-block { container-type: inline-size; }
.sticker-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.part-block .part-tag, .part-block .reactions { z-index: 3; }
.sticker {
  position: absolute; max-width: 42%; padding: 0.35em 0.7em; border-radius: 0.5em;
  border: max(1.5px, 0.35cqw) solid var(--ink); box-shadow: 0.25em 0.25em 0 rgba(29, 27, 22, 0.85);
  font-size: clamp(8px, 3.4cqw, 30px); font-weight: 900; line-height: 1.15; color: var(--ink);
}
.sticker.neu { animation: klatsch 0.45s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes klatsch { from { scale: 2.4; opacity: 0; } 60% { opacity: 1; } }
.stage-part-sticker { font-size: 0.95rem; font-weight: 900; margin-left: 4px; }
.sticker-tray { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: var(--radius); border: 2px dashed var(--ink); background: var(--paper-2); font-size: 0.95rem; }
/* eine Zeile, zum Wischen – die Teile darunter sollen nicht nach unten rutschen */
.sticker-tray-list {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px 2px;
  mask-image: linear-gradient(to right, black calc(100% - 28px), transparent); /* zeigt: da geht’s weiter */
}
.sticker-tray-list .mini-sticker { flex: none; white-space: nowrap; }
.mini-sticker { padding: 2px 8px; border-radius: 8px; border: 1.5px solid var(--ink); font-size: 0.78rem; font-weight: 800; }
.mini-sticker.weg { opacity: 0.35; text-decoration: line-through; }
.remote-sticker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.remote-sticker:empty { display: none; }
.btn.sticker-wide { margin-top: 10px; padding: 9px 12px; font-size: 1rem; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(29, 27, 22, 0.4); animation: einblenden 0.2s; }
.sheet {
  width: min(520px, 100%); display: flex; flex-direction: column; gap: 10px;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0;
  border: 2.5px solid var(--ink); border-bottom: 0; background: var(--paper-2); animation: hochfahren 0.25s ease-out;
}
.sheet p { margin: 0; }
.sheet-sticker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0; }
.sticker-knopf {
  padding: 14px 10px; border-radius: 12px; border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  font: inherit; font-weight: 900; font-size: 1rem; cursor: pointer; color: var(--ink); touch-action: manipulation;
}
.sticker-knopf:nth-child(odd) { transform: rotate(-1.5deg); }
.sticker-knopf:nth-child(even) { transform: rotate(1.5deg); }
.sticker-knopf:active { transform: translate(3px, 3px); box-shadow: none; }
@keyframes einblenden { from { opacity: 0; } }
@keyframes hochfahren { from { transform: translateY(100%); } }

/* ---- Bühne: Abschluss mit Galerie ---- */

.final-stage { display: grid; grid-template-columns: clamp(280px, 28vw, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }
.final-side { display: flex; flex-direction: column; gap: 14px; }
.final-side .screen-title { font-size: clamp(1.8rem, 3vw, 2.8rem); text-align: center; }
.final-side .podium { margin-top: 6px; }
.final-side .ranking li { padding: 5px 8px; }
.final-gallery .section-h { margin-top: 0; }
.final-gallery .gallery { margin: 0 auto; }
@media (max-width: 900px) {
  .final-stage { grid-template-columns: 1fr; }
}
.gallery-part .sticker { font-size: clamp(7px, 2.6cqw, 22px); max-width: 52%; padding: 0.25em 0.5em; }
