:root {
  --grund: #F7F1E6; --karte: #FFFDF8; --rand: #E9DFCC; --tinte: #23201B; --leise: #8A8172;
  --akzent: #FF6B4A; --akzent-tief: #C9472C; --mint: #2FB18C; --mint-tief: #1F8467;
  --lila: #5B5BD6; --lila-tief: #3E3EA8; --grau: #8A8172; --grau-tief: #645C50;
  --traeger: #C6D3DC; --etikett: #FFFFFF;
  --rund: ui-rounded, "SF Pro Rounded", "Nunito", "Arial Rounded MT Bold", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --grund: #16130F; --karte: #25211B; --rand: #3A342B; --tinte: #F4EEE3; --leise: #A59C8C;
    --akzent: #FF7A5C; --mint: #4FC9A4; --lila: #7B7BF0; --traeger: #5D6E7A; --etikett: #F2EFE8; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--rund); color: var(--tinte); background: var(--grund);
  background-image: radial-gradient(color-mix(in srgb, var(--leise) 16%, transparent) 1.1px, transparent 1.3px);
  background-size: 22px 22px; -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) 20px max(14px, env(safe-area-inset-bottom)); }
.seite { flex: 1; display: flex; flex-direction: column; animation: rein .45s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes rein { from { opacity: 0; transform: translateX(34px); } }
.fuellen { flex: 1; }
h1 { font-size: 48px; font-weight: 900; margin: 0; letter-spacing: -.5px; text-align: center; }
.unter { text-align: center; color: var(--leise); font-weight: 600; font-size: 17px; margin: 4px 0 0; }
.kopf { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.kopf h2 { font-size: 24px; font-weight: 850; margin: 0; flex: 1; }
.rund-knopf { width: 42px; height: 42px; border-radius: 50%; background: var(--karte); border: 1px solid var(--rand);
  display: grid; place-items: center; font-size: 18px; font-weight: 800; flex: none; }
.abschnitt { font-size: 13px; font-weight: 900; letter-spacing: 1.2px; color: var(--leise); text-transform: uppercase; margin: 22px 0 10px; }

/* Knubbel-Tasten */
.knubbel { --f: var(--akzent); --t: var(--akzent-tief); display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 60px; border-radius: 20px; background: var(--f); color: #fff; font-weight: 850; font-size: 19px;
  box-shadow: 0 5px 0 var(--t), inset 0 1.5px 0 rgba(255,255,255,.3); transition: transform .12s, box-shadow .12s; margin-bottom: 5px; }
.knubbel:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--t); }
.knubbel:disabled { opacity: .55; }
.knubbel.mint { --f: var(--mint); --t: var(--mint-tief); }
.knubbel.lila { --f: var(--lila); --t: var(--lila-tief); }
.knubbel.grau { --f: var(--grau); --t: var(--grau-tief); }
.knubbel.hell { --f: var(--rand); --t: color-mix(in srgb, var(--rand) 60%, #000); color: var(--tinte); }
.knubbel.klein { min-height: 48px; font-size: 16px; border-radius: 16px; }
.knubbel.zwei { flex-direction: column; gap: 0; }
.knubbel small { display: block; font-size: 12px; opacity: .85; font-weight: 700; }
.leise-knopf { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 999px; background: var(--karte);
  border: 1.5px solid var(--rand); font-weight: 750; font-size: 16px; transition: transform .15s; }
.leise-knopf:active { transform: scale(.95); }
.link { color: var(--leise); font-weight: 650; font-size: 15px; padding: 8px; display: block; margin: 0 auto; }
.reihe { display: flex; gap: 12px; }

/* Druckerpille */
.pille { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--karte);
  border: 1px solid var(--rand); box-shadow: 0 3px 6px rgba(0,0,0,.06); font-weight: 750; font-size: 14px; }
.pille { white-space: nowrap; flex: none; }
.kopf .pille #pText { display: none; }
.kopf .pille { padding: 9px 12px; }
.punkt { width: 9px; height: 9px; border-radius: 50%; background: orange; position: relative; }
.punkt::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid currentColor; color: inherit; opacity: 0;
  animation: puls 1.4s ease-out infinite; }
.punkt.an { background: var(--mint); color: var(--mint); } .punkt.aus { background: orange; color: orange; } .punkt.druckt { background: var(--akzent); color: var(--akzent); }
@keyframes puls { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }

/* Etiketten */
.traeger { background: var(--traeger); border-radius: 4px; padding: calc(var(--b) * .066) calc(var(--b) * .05); display: inline-block; }
.etikett { width: var(--b); height: calc(var(--b) * .3); background: var(--etikett); border-radius: calc(var(--b) * .048);
  display: grid; place-items: center; color: #000; font-weight: 900; font-size: calc(var(--b) * .135); padding: 0 8%; text-align: center;
  line-height: 1.05; box-shadow: 0 1px 1.5px rgba(0,0,0,.12); overflow: hidden; }
.etikett .krakel { width: 64%; height: 36%; }
.stapel { position: relative; height: 230px; margin: 18px 0 10px; filter: drop-shadow(0 8px 10px rgba(0,0,0,.12)); }
.stapel > span { animation: schweben 3s ease-in-out infinite alternate; }
.stapel > span:nth-child(2) { animation-delay: -1s; } .stapel > span:nth-child(3) { animation-delay: -2s; }
@keyframes schweben { to { translate: 0 -6px; } }

/* Karten */
.modus { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 26px; background: var(--karte); text-align: left;
  border: 1.5px solid color-mix(in srgb, var(--f) 35%, transparent); box-shadow: 0 8px 16px color-mix(in srgb, var(--f) 18%, transparent);
  width: 100%; margin-bottom: 14px; transition: transform .15s; }
.modus:active { transform: scale(.98); }
.modus .emoji { width: 70px; height: 70px; border-radius: 20px; display: grid; place-items: center; font-size: 40px; flex: none;
  background: color-mix(in srgb, var(--f) 16%, transparent); }
.modus b { font-size: 22px; font-weight: 850; display: block; }
.modus span { color: var(--leise); font-size: 14px; font-weight: 550; }
.modus .pfeil { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; background: var(--f); color: #fff; display: grid; place-items: center; flex: none; font-weight: 900; }
.zeile { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; background: var(--karte); border: 1px solid var(--rand); margin-bottom: 10px; }
.zeile input { flex: 1; border: 0; background: none; outline: none; font-size: 18px; font-weight: 650; min-width: 0; }
.zeile input::placeholder { color: var(--leise); opacity: .7; }
.weg { font-size: 22px; color: var(--leise); opacity: .6; width: 28px; }
.avatar { width: var(--g, 44px); height: var(--g, 44px); border-radius: 50%; background: var(--f); color: #fff; display: grid; place-items: center;
  font-weight: 900; font-size: calc(var(--g, 44px) * .45); flex: none; box-shadow: 0 3px 6px color-mix(in srgb, var(--f) 35%, transparent), inset 0 0 0 2px rgba(255,255,255,.35); }
.raster { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 18px; background: var(--karte); border: 1px solid var(--rand);
  text-align: left; font-weight: 750; font-size: 15px; transition: transform .15s, background .2s; }
.chip:active { transform: scale(.96); }
.chip .em { font-size: 26px; }
.chip .haken { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--rand); flex: none; display: grid; place-items: center; color: #fff; font-size: 12px; }
.chip.an { background: color-mix(in srgb, var(--f) 16%, var(--karte)); border: 2px solid var(--f); }
.chip.an .haken { background: var(--f); border-color: var(--f); }
.hinweis { display: flex; gap: 10px; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--karte) 70%, transparent);
  color: var(--leise); font-size: 14px; font-weight: 550; margin-top: 18px; }
.dauer { flex: 1; padding: 12px 0; border-radius: 14px; background: var(--karte); border: 1px solid var(--rand); font-weight: 750; }
.dauer.an { background: var(--f, var(--lila)); color: #fff; }
.unten { position: sticky; bottom: 0; padding-top: 12px; background: linear-gradient(transparent, var(--grund) 30%); }

/* Druck */
.fortschritt { display: flex; gap: 8px; } .fortschritt i { flex: 1; height: 6px; border-radius: 3px; background: var(--rand); }
.mitte { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gross { font-size: 30px; font-weight: 900; margin: 0; }
.erklaer { color: var(--leise); font-size: 17px; font-weight: 550; margin: 0 6px; }
.druckbank { position: relative; height: 220px; display: flex; justify-content: center; margin: 10px 0; }
.druckbank .traeger { position: absolute; top: 60px; transform: translateY(0); transition: transform 4.5s ease-out, opacity .3s; opacity: 0; }
.druckbank.kommt .traeger { opacity: 1; transform: translateY(-70px); }
.druckbank.fertig .traeger { opacity: 1; transform: translateY(-92px); transition: transform .5s cubic-bezier(.3,1.6,.5,1); }
.geraet { position: absolute; top: 80px; width: 280px; height: 110px; border-radius: 28px;
  background: linear-gradient(#fff, #E7E1D6); box-shadow: 0 8px 14px rgba(0,0,0,.14); }
.geraet::before { content: ""; position: absolute; left: 20px; right: 20px; top: 14px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.75); }
.geraet::after { content: ""; position: absolute; right: 18px; bottom: 18px; width: 16px; height: 16px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.druckbank.kommt .geraet::after { background: var(--akzent); box-shadow: 0 0 10px var(--akzent); }
.fehler { color: #d33; font-weight: 650; text-align: center; margin: 4px 10px; }

/* Spiel */
.dran { padding: 20px; border-radius: 30px; background: var(--karte); border: 2px solid color-mix(in srgb, var(--f) 50%, transparent);
  box-shadow: 0 10px 20px color-mix(in srgb, var(--f) 25%, transparent); text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center;
  animation: rein .4s cubic-bezier(.2,.9,.3,1.1) both; }
.dran .avatar { --g: 70px; }
.zaehler { font-weight: 800; font-size: 14px; color: var(--f); padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--f) 14%, transparent); }
.liste { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.liste .z { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 16px; background: color-mix(in srgb, var(--karte) 60%, transparent); font-weight: 750; font-size: 17px; }
.liste .z.akt { background: var(--karte); }
.liste .z .r { margin-left: auto; color: var(--leise); font-weight: 850; }
.liste .z .ok { margin-left: auto; color: var(--mint); font-weight: 800; font-size: 14px; }
.uhr { font: 700 17px ui-monospace, monospace; padding: 7px 12px; border-radius: 999px; background: var(--karte); border: 1px solid var(--rand); }
.uhr.knapp { color: #d33; }
.auftrag { padding: 16px; border-radius: 24px; background: var(--karte); box-shadow: 0 5px 10px rgba(0,0,0,.06); margin-bottom: 12px; }
.auftrag .oben { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.auftrag .pkt { margin-left: auto; font-size: 30px; font-weight: 900; color: var(--f); }

/* Ende */
.pokal { font-size: 64px; text-align: center; animation: plopp .7s cubic-bezier(.3,1.7,.5,1) .15s both; }
@keyframes plopp { from { transform: scale(.3) rotate(-30deg); } }
.podest { display: flex; justify-content: center; align-items: flex-end; gap: 10px; height: 230px; margin: 10px 0 18px; }
.podest > div { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 850; font-size: 15px; }
.podest .block { width: 92px; border-radius: 14px; background: linear-gradient(color-mix(in srgb, var(--f) 85%, #fff), var(--f)); color: rgba(255,255,255,.9);
  font-size: 34px; font-weight: 900; display: grid; place-items: center; animation: wachsen .7s cubic-bezier(.3,1.4,.5,1) both; transform-origin: bottom; }
@keyframes wachsen { from { transform: scaleY(.08); } }
#konfetti { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

/* Blatt (Druckereinstellungen) */
.blatt-huelle { position: fixed; inset: 0; background: rgba(0,0,0,.3); display: flex; align-items: flex-end; justify-content: center; z-index: 10;
  animation: abdunkeln .25s both; }
@keyframes abdunkeln { from { background: transparent; } }
.blatt { width: 100%; max-width: 480px; background: var(--grund); border-radius: 26px 26px 0 0; padding: 18px 20px max(20px, env(safe-area-inset-bottom));
  animation: hoch .35s cubic-bezier(.2,.9,.3,1) both; max-height: 90dvh; overflow: auto; }
@keyframes hoch { from { transform: translateY(100%); } }
.blatt .griff { width: 40px; height: 5px; border-radius: 3px; background: var(--rand); margin: 0 auto 14px; }
.karte { padding: 16px; border-radius: 22px; background: var(--karte); border: 1px solid var(--rand); margin-bottom: 14px; }
input[type=range] { width: 100%; accent-color: var(--akzent); }
.klein-grau { color: var(--leise); font-size: 13px; font-weight: 550; }

/* Spielesammlung */
.spielraster { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spielkarte { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 24px; background: var(--karte);
  border: 1.5px solid color-mix(in srgb, var(--f) 35%, transparent); box-shadow: 0 8px 16px color-mix(in srgb, var(--f) 16%, transparent);
  text-align: left; transition: transform .15s; min-height: 170px; }
.spielkarte:active { transform: scale(.97); }
.spielkarte .emoji { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; margin-bottom: 4px;
  background: color-mix(in srgb, var(--f) 16%, transparent); }
.spielkarte b { font-size: 18px; font-weight: 850; line-height: 1.1; }
.spielkarte span:not(.emoji) { color: var(--leise); font-size: 13px; font-weight: 550; line-height: 1.25; }
.spielkarte i { margin-top: auto; font-style: normal; font-size: 12px; font-weight: 800; color: var(--f); }
.waehler { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wahlkarte { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: 22px; background: var(--karte);
  border: 1.5px solid color-mix(in srgb, var(--f) 40%, transparent); font-size: 17px; transition: transform .15s; }
.wahlkarte:active { transform: scale(.94); background: color-mix(in srgb, var(--f) 18%, var(--karte)); }
.karteninhalt { width: 100%; padding: 20px 16px; border-radius: 20px; background: color-mix(in srgb, var(--f) 10%, var(--grund));
  font-size: 22px; font-weight: 800; line-height: 1.25; }
.karteninhalt small { display: block; font-size: 12px; letter-spacing: 1.5px; color: var(--leise); margin-bottom: 8px; }
.orden { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 22px; border-radius: 18px;
  background: var(--etikett); color: #000; font-size: 22px; font-weight: 900; box-shadow: 0 0 0 7px var(--traeger), 0 6px 14px rgba(0,0,0,.12);
  margin: 8px auto; text-align: center; max-width: 300px; }
.orden span { font-size: 12px; letter-spacing: 2px; }
.trommel { animation: trommeln .5s ease-in-out infinite alternate; }
@keyframes trommeln { from { transform: rotate(-2deg) scale(.98); } to { transform: rotate(2deg) scale(1.03); } }
.sieger { animation: plopp .7s cubic-bezier(.3,1.7,.5,1) both; }
.nummer { width: 30px; height: 30px; border-radius: 50%; background: var(--rand); display: grid; place-items: center; font-weight: 900; flex: none; }
