:root {
  --nacht: #14213d;
  --nacht-2: #1d2d50;
  --tanne: #1f4d3a;
  --tanne-hell: #2e6b52;
  --gold: #e9b949;
  --gold-dunkel: #b8862b;
  --rot: #c0392b;
  --rot-hell: #e0574a;
  --papier: #fbf6ec;
  --papier-2: #f2e9d8;
  --tinte: #24201a;
  --grau: #6f675a;
  --linie: #e1d5bd;
  --gut: #2e7d4f;
  --radius: 18px;
  --schatten: 0 10px 30px rgba(10, 18, 40, .25);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--tinte);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: #0d162b; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #2a3f6e 0%, var(--nacht) 55%, #0d162b 100%) fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .serif { font-family: 'Fraunces', Georgia, serif; font-weight: 700; letter-spacing: -.01em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Schneefall im Hintergrund */
.schnee { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.schnee i {
  position: absolute; top: -10px; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, .7); animation: fall linear infinite;
}
@keyframes fall { to { transform: translate3d(var(--dx, 20px), 105vh, 0); } }
@media (prefers-reduced-motion: reduce) { .schnee { display: none; } }

.wrap { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; padding: 20px 16px 60px; }

/* Logo */
.logo { text-align: center; color: var(--papier); margin: 18px 0 22px; }
.logo h1 { font-size: clamp(2.3rem, 9vw, 3.4rem); margin: 0; line-height: 1; }
.logo h1 .b { color: var(--gold); font-weight: 600; }
.logo h1 .b span { color: var(--rot-hell); font-weight: 800; }
.logo p { margin: 8px 0 0; opacity: .8; font-size: 1rem; }
.logo .logo-bild { width: 120px; height: 120px; border-radius: 50%; display: block; margin: 0 auto 12px; box-shadow: 0 0 0 4px rgba(233, 185, 73, .55), 0 0 40px rgba(233, 185, 73, .35); }
.logo .stern { font-size: 1.6rem; display: block; margin-bottom: 4px; filter: drop-shadow(0 0 10px rgba(233, 185, 73, .7)); }

.karte {
  background: var(--papier); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 22px 20px; margin-bottom: 18px; position: relative;
}
.karte h2 { margin: 0 0 12px; font-size: 1.4rem; }
.karte.tanne { background: linear-gradient(160deg, var(--tanne-hell), var(--tanne)); color: var(--papier); }
.leise { color: var(--grau); font-size: .95rem; }
.karte.tanne .leise { color: rgba(251, 246, 236, .8); }

label { display: block; font-weight: 700; font-size: .92rem; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=number], input:not([type]), textarea, select {
  width: 100%; padding: 12px 14px; border: 2px solid var(--linie); border-radius: 12px;
  background: #fff; font-size: 1.05rem; outline: none; transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold-dunkel); }
textarea { min-height: 84px; resize: vertical; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 13px 22px; font-weight: 800; font-size: 1.05rem;
  background: var(--rot); color: #fff; cursor: pointer; box-shadow: 0 4px 0 #8e2a20;
  transition: transform .08s, box-shadow .08s, filter .15s; text-decoration: none;
}
.knopf:hover { filter: brightness(1.07); }
.knopf:active { transform: translateY(3px); box-shadow: 0 1px 0 #8e2a20; }
.knopf:disabled { opacity: .5; cursor: default; }
.knopf.gold { background: var(--gold); color: var(--tinte); box-shadow: 0 4px 0 var(--gold-dunkel); }
.knopf.zart { background: var(--papier-2); color: var(--tinte); box-shadow: 0 3px 0 var(--linie); }
.knopf.breit { width: 100%; margin-top: 18px; }
.knopf.klein { padding: 8px 14px; font-size: .9rem; }
.linkknopf { background: none; border: 0; color: var(--grau); text-decoration: underline; cursor: pointer; padding: 4px; }

.meldung { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-weight: 700; display: none; }
.meldung.zeigen { display: block; }
.meldung.fehler { background: #fde7e4; color: #9b2a1e; }
.meldung.ok { background: #e3f3e8; color: #1e5b37; }

/* Kopfzeile nach Anmeldung */
.kopf { display: flex; align-items: center; justify-content: space-between; color: var(--papier); margin-bottom: 14px; gap: 10px; }
.kopf .hallo { font-size: 1.05rem; }
.kopf .hallo b { color: var(--gold); }
.kopf .linkknopf { color: rgba(251, 246, 236, .7); }

.reiter { display: flex; gap: 8px; margin-bottom: 16px; background: rgba(255, 255, 255, .08); padding: 6px; border-radius: 999px; }
.reiter button {
  flex: 1; border: 0; background: none; color: var(--papier); padding: 10px; border-radius: 999px;
  font-weight: 800; cursor: pointer; font-size: 1rem;
}
.reiter button.an { background: var(--papier); color: var(--tinte); }
.reiter .punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--rot-hell); margin-left: 6px; vertical-align: middle; animation: puls 1.2s infinite; }
@keyframes puls { 50% { opacity: .3; } }

.zaehler { display: flex; gap: 12px; }
.zaehler div { flex: 1; text-align: center; }
.zaehler b { display: block; font-family: 'Fraunces', serif; font-size: 2.2rem; color: var(--gold); line-height: 1.1; }

.typwahl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.typwahl button {
  border: 2px solid var(--linie); background: #fff; border-radius: 14px; padding: 12px 10px; cursor: pointer; text-align: left;
}
.typwahl button b { display: block; font-size: 1rem; }
.typwahl button span { font-size: .85rem; color: var(--grau); }
.typwahl button.an { border-color: var(--gold-dunkel); background: #fff8e6; }
.falsch-zeile { margin-top: 8px; }
.richtig-feld { border-color: #9fd3b2 !important; }

.frageliste { list-style: none; margin: 0; padding: 0; }
.frageliste li { border-top: 1px solid var(--linie); padding: 14px 0; }
.frageliste li:first-child { border-top: 0; }
.frageliste .f { font-weight: 700; }
.frageliste .a { font-size: .92rem; color: var(--grau); margin-top: 4px; }
.frageliste .a .r { color: var(--gut); font-weight: 800; }
.frageliste .aktionen { margin-top: 8px; display: flex; gap: 6px; }
.etikett { display: inline-block; font-size: .75rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--papier-2); color: var(--grau); margin-right: 6px; vertical-align: 1px; }
.etikett.schaetzen { background: #e8eefc; color: #2c4a8a; }

/* Spielansicht am Handy */
.spiel { text-align: center; }
.spiel .nr { font-weight: 800; color: var(--gold-dunkel); letter-spacing: .05em; text-transform: uppercase; font-size: .85rem; }
.spiel .frage { font-family: 'Fraunces', serif; font-size: 1.5rem; margin: 8px 0 18px; line-height: 1.25; }
.optionen { display: grid; gap: 10px; }
.option {
  border: 0; border-radius: 14px; padding: 16px; font-size: 1.1rem; font-weight: 800; cursor: pointer; color: #fff;
  text-align: left; display: flex; gap: 12px; align-items: center; box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.option .bst { background: rgba(255, 255, 255, .25); border-radius: 8px; width: 32px; height: 32px; display: grid; place-items: center; flex: none; }
.option:nth-child(1) { background: #c0392b; }
.option:nth-child(2) { background: #1f6f54; }
.option:nth-child(3) { background: #b8862b; }
.option:nth-child(4) { background: #2c4a8a; }
.option.gewaehlt { outline: 4px solid var(--gold); outline-offset: 2px; }
.option.blass { opacity: .35; }
.option.richtig { outline: 4px solid #7ee2a8; outline-offset: 2px; }
.groß { font-size: 2.6rem; }
.punkte-plus { font-family: 'Fraunces', serif; font-size: 2.4rem; color: var(--gut); }

.rangliste { list-style: none; padding: 0; margin: 0; counter-reset: platz; text-align: left; }
.rangliste li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--linie); counter-increment: platz; }
.rangliste li:first-child { border-top: 0; }
.rangliste li::before { content: counter(platz); font-family: 'Fraunces', serif; font-weight: 700; width: 28px; text-align: center; color: var(--grau); }
.rangliste li:nth-child(1)::before { content: '🥇'; }
.rangliste li:nth-child(2)::before { content: '🥈'; }
.rangliste li:nth-child(3)::before { content: '🥉'; }
.rangliste .n { flex: 1; font-weight: 700; }
.rangliste .p { font-weight: 800; }
.rangliste li.ich { background: #fff3d1; border-radius: 10px; }

.versteckt { display: none !important; }
.mitte { text-align: center; }
.zeile { display: flex; gap: 10px; flex-wrap: wrap; }
.zeile > * { flex: 1; }

/* Zum Aktualisieren herunterziehen */
.ptr {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 6px); left: 50%; z-index: 50; opacity: 0;
  width: 46px; height: 46px; border-radius: 50%; background: var(--papier); box-shadow: var(--schatten);
  display: grid; place-items: center; font-size: 1.4rem; transform: translate(-50%, -60px); pointer-events: none;
}
.ptr.bereit { box-shadow: 0 0 0 3px var(--gold), var(--schatten); }
.ptr.laedt span { animation: ptr-dreh .8s linear infinite; }
@keyframes ptr-dreh { to { transform: rotate(360deg); } }

/* Ideen & Tickets */
.typwahl.drei { grid-template-columns: repeat(3, 1fr); }
.typwahl.drei button { text-align: center; padding: 12px 6px; }
.zahl-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--rot-hell); color: #fff; font-size: .78rem; line-height: 20px; margin-left: 4px; vertical-align: 1px; }
.reiter button { padding: 10px 4px; white-space: nowrap; font-size: .95rem; }
.filter { display: flex; gap: 6px; margin-top: 14px; }
.filter button { flex: 1; border: 0; border-radius: 999px; padding: 8px; font-weight: 800; cursor: pointer; background: rgba(255, 255, 255, .15); color: var(--papier); }
.filter button.an { background: var(--papier); color: var(--tinte); }
.ticket { border-top: 1px solid var(--linie); padding: 14px 0; }
.ticket:first-child { border-top: 0; padding-top: 0; }
.ticket:last-child { padding-bottom: 0; }
.ticket.erledigt .ticket-text { color: var(--grau); }
.ticket-kopf { font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ticket-text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-antwort { margin-top: 8px; background: #fff3d1; border-radius: 10px; padding: 8px 12px; font-size: .95rem; white-space: pre-wrap; }
.ticket .aktionen { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.antwort-form { margin-top: 10px; }
.etikett.erledigt { background: #e3f3e8; color: var(--gut); }
