:root {
  --bg1: #2b1055;
  --bg2: #d53a9d;
  --card: #ffffff;
  --text: #1f1d2b;
  --muted: #6b6880;
  --accent: #e8465b;
  --accent2: #ffb400;
  --ok: #1a9e5c;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--bg2); }

body {
  margin: 0;
  min-height: 100vh;
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
}

main { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; }

.step { display: none; }
.step.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

#step-name { margin-top: 12vh; text-align: center; }
.emoji { font-size: 48px; text-align: center; line-height: 1.2; }
h1, h2 { margin: .3em 0 .6em; text-align: center; line-height: 1.25; }
h1 { font-size: 1.6rem; }
h1 span { font-weight: 400; color: var(--muted); font-size: 1.1rem; }
h2 { font-size: 1.35rem; }
p { margin: .6em 0; }
.small, .hint { font-size: .9rem; color: var(--muted); }
.hint { margin-top: 1em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

label[for=name] { display: block; font-weight: 600; margin: 1em 0 .4em; }
input[type=text], textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 2px solid #ddd;
  border-radius: 12px;
  text-align: inherit;
}
input[type=text]:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; text-align: left; }

.btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.btn:disabled { opacity: .6; }
.btn-ghost { background: #fff; color: var(--accent); border: 2px solid var(--accent); }
.link {
  background: none; border: 0; padding: 8px; font: inherit; font-size: .9rem;
  color: var(--muted); text-decoration: underline; cursor: pointer;
}
#step-known .link { display: block; margin: 10px auto 0; }
.error { color: #c0152f; font-weight: 600; }

/* Rätsel */
.puzzle-answer, .puzzle-pool {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  min-height: 56px; padding: 10px; border-radius: 12px;
}
.puzzle-answer { background: #f4f1fb; margin: 16px 0 8px; }
.puzzle-answer.solved { background: #dff5e8; }
.puzzle-answer.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.slot { width: 56px; height: 40px; border: 2px dashed #cfc8e6; border-radius: 10px; }
.tile {
  font: inherit; font-weight: 600; padding: 8px 14px; min-height: 44px;
  border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent2); color: #3a2a00; box-shadow: 0 3px 0 #c98d00;
}
.tile.placed { background: #7b5cd6; color: #fff; box-shadow: 0 3px 0 #54399e; }
.tile.fixed { background: var(--ok); color: #fff; box-shadow: 0 3px 0 #0f6b3d; cursor: default; }
.puzzle-msg { text-align: center; min-height: 1.5em; font-weight: 600; }
.puzzle-tools { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }

/* Infos */
.facts > div { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid #eee; }
.facts > div > span { font-size: 1.5rem; line-height: 1.2; }

.calendar {
  width: 250px; margin: 20px auto; border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15); background: #fff; user-select: none;
}
.cal-head { background: var(--accent); color: #fff; text-align: center; font-weight: 700; padding: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 8px; text-align: center; font-size: .9rem; }
.cal-wd { font-weight: 700; color: var(--muted); font-size: .75rem; }
.cal-day { padding: 4px 0; border-radius: 50%; }
.cal-mark { background: var(--accent); color: #fff; font-weight: 700; position: relative; }
.cal-mark::after { content: "🎂"; position: absolute; top: -12px; right: -8px; font-size: .9rem; }

.map { position: relative; padding-top: 65%; border-radius: 12px; overflow: hidden; background: #eee; }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.links { text-align: center; font-size: .95rem; }
.links a { color: var(--accent); }

/* Abstimmung */
.deadline { text-align: center; }
fieldset { border: 0; padding: 0; margin: 0; }
.options { display: grid; gap: 10px; margin: 16px 0 6px; }
.option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 2px solid #e3e0ee; border-radius: 12px; background: #fff;
  cursor: pointer; line-height: 1.3;
}
.option:has(input:checked) { border-color: var(--accent); background: #fff1f3; }
.option input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); margin: 0; }
.small-option { padding: 10px 12px; }
.option.runaway {
  position: fixed; z-index: 50; margin: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  transition: left .25s ease, top .25s ease;
}
.option.tired { border-color: #999; }
.nein-msg { text-align: center; min-height: 1.4em; margin: 0; }
.sub { margin: 12px 0; padding: 12px; border-radius: 12px; background: #f7f6fb; display: grid; gap: 8px; }
.sub legend { font-weight: 600; padding: 0; margin-bottom: 8px; float: left; width: 100%; }
.sub[hidden] { display: none; }
.field-label { display: block; font-weight: 600; margin: 14px 0 6px; }

#step-thanks { text-align: center; }
