:root {
  --bg: #14101c;
  --bg-2: #1d1729;
  --card: #251d34;
  --card-2: #2f2541;
  --line: #3d3152;
  --text: #f3eefa;
  --muted: #b8aecb;
  --orange: #ff8a1f;
  --orange-2: #ffb347;
  --green: #8be06b;
  --purple: #a77bff;
  --red: #ff5d6c;
  --radius: 14px;
  --max: 1080px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 50% -200px, #3a1f4f 0%, transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--orange-2); }
a:hover { color: var(--orange); }
h1, h2, h3 { line-height: 1.2; margin: 1.4em 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); margin-top: .4em; }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.8rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin: .3em 0; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Kopfzeile */
.top { border-bottom: 1px solid var(--line); background: rgba(20,16,28,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.logo span { color: var(--orange); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--card); }
@media (max-width: 720px) {
  .top { position: static; }
  .top .wrap { padding-top: 8px; padding-bottom: 8px; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; }
}

main { padding: 24px 0 56px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46em; }
.crumbs { font-size: .9rem; color: var(--muted); margin-top: 8px; }
.crumbs a { color: var(--muted); }

/* Bausteine */
.btn {
  display: inline-flex; align-items: center; gap: .4em; justify-content: center;
  background: var(--orange); color: #1a0f00; border: 0; border-radius: 10px;
  padding: 11px 18px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--orange-2); color: #1a0f00; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--card); color: var(--text); }
.btn:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 8px;
}
a.card { color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; }
a.card:hover { transform: translateY(-2px); border-color: var(--orange); }
.card h3 { margin: 0; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card .emoji { font-size: 2rem; line-height: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.tag { font-size: .78rem; padding: 2px 8px; border-radius: 99px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.tag.action { color: var(--orange-2); }
.tag.ruhig { color: var(--green); }

.hero { display: grid; gap: 24px; grid-template-columns: 1.3fr 1fr; align-items: center; padding: 16px 0 8px; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2:first-child, .panel h3:first-child { margin-top: 0; }

/* Countdown */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.countdown div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 4px; }
.countdown b { display: block; font-size: clamp(1.6rem, 6vw, 2.6rem); color: var(--orange); font-variant-numeric: tabular-nums; line-height: 1.1; }
.countdown small { color: var(--muted); font-size: .8rem; }
.countdown-big b { font-size: clamp(2.2rem, 10vw, 4.5rem); }
.cd-note { text-align: center; color: var(--muted); margin: 10px 0 0; font-size: .95rem; }

table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .95rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* Spielseite */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 18px 0 8px; }
.facts div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.facts small { display: block; color: var(--muted); font-size: .8rem; }
.facts b { font-size: 1.05rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; margin: 0 0 14px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--orange); color: #1a0f00; font-weight: 800; display: grid; place-items: center; font-size: .9rem;
}
.tip { border-left: 4px solid var(--purple); background: var(--bg-2); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 18px 0; }

/* Filter und Formulare */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 16px 0 20px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
select, input[type="number"], input[type="search"] {
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; min-width: 150px;
}
.count { color: var(--muted); font-size: .95rem; margin: 0 0 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }

/* Generator-Ergebnis */
.plan { list-style: none; padding: 0; margin: 0; }
.plan li { display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.plan time { color: var(--orange); font-weight: 700; font-variant-numeric: tabular-nums; }
.plan h3 { margin: 0 0 4px; font-size: 1.05rem; }
.plan p { margin: 0; color: var(--muted); font-size: .95rem; }
.shopping { columns: 2 220px; }
@media print {
  .top, footer, .no-print, .filters { display: none !important; }
  body { background: #fff; color: #000; }
  .panel, .card { border-color: #ccc; background: #fff; }
  .plan p, .muted { color: #333; }
}

/* Minispiele */
.game-area { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; max-width: 560px; margin: 0 auto; }
.game-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; color: var(--muted); }
.game-bar b { color: var(--text); font-variant-numeric: tabular-nums; }
.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.memory button {
  aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2);
  font-size: clamp(1.6rem, 8vw, 2.6rem); cursor: pointer; color: transparent; padding: 0;
}
.memory button.open, .memory button.done { background: var(--card); color: inherit; }
.memory button.done { border-color: var(--green); opacity: .75; }
.ghosts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ghosts button {
  aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line); background: #0e0b14;
  font-size: clamp(2rem, 11vw, 3.4rem); cursor: pointer; padding: 0; color: inherit; touch-action: manipulation;
}
.ghosts button span { visibility: hidden; }
.ghosts button.up span { visibility: visible; }
.ghosts button.hit { border-color: var(--green); }
.quiz-q { font-size: 1.15rem; font-weight: 700; margin: 0 0 14px; }
.quiz-a { display: grid; gap: 8px; }
.quiz-a button {
  text-align: left; background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 12px 14px; font: inherit; cursor: pointer;
}
.quiz-a button:hover:not(:disabled) { border-color: var(--orange); }
.quiz-a button.right { border-color: var(--green); background: #1f3320; }
.quiz-a button.wrong { border-color: var(--red); background: #3a1d23; }
.quiz-info { color: var(--muted); margin: 12px 0; min-height: 1.6em; }
.center { text-align: center; }

.disclosure { font-size: .85rem; color: var(--muted); }
.notice { border: 1px dashed var(--orange); padding: 12px 16px; border-radius: 10px; background: #2a1c10; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
footer a { color: var(--muted); }
footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.memory button:not(.open):not(.done) {
  background-image: url("/assets/favicon.svg"); background-repeat: no-repeat; background-position: center; background-size: 38%;
}

/* Neu-Markierung und Sterne */
.neu { display: inline-block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: var(--green); color: #0d1a08; padding: 2px 7px; border-radius: 6px; vertical-align: middle; }
.sterne-tag { color: var(--orange-2); }
.schnitt { margin: -6px 0 10px; color: var(--muted); }
.sterne-anzeige { color: var(--orange); letter-spacing: 2px; }
.bewertung { margin: 24px 0; }
.sterne-wahl { display: flex; gap: 4px; }
.sterne-wahl button { background: none; border: 0; padding: 2px 4px; font-size: 2.4rem; line-height: 1; color: var(--line); cursor: pointer; }
.sterne-wahl button.an { color: var(--orange); }
.muted { color: var(--muted); }
.print-only { display: none; }

/* Druckansicht der Spielanleitungen */
@media print {
  @page { size: A4; margin: 14mm 16mm; }
  body { font-size: 11.5pt; line-height: 1.45; background: #fff !important; color: #000; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .print-only { display: block; }
  .print-kopf { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 4px; margin-bottom: 8px; font-size: 10pt; }
  .print-fuss { border-top: 1px solid #999; padding-top: 6px; margin-top: 14px; font-size: 9pt; color: #444; }
  h1 { font-size: 22pt; margin: 6px 0 4px; }
  h2 { font-size: 13.5pt; margin: 12px 0 4px; }
  .lead { color: #222; font-size: 12pt; }
  a { color: #000; text-decoration: none; }
  .facts { grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 8px 0; }
  .facts div { background: #fff; border: 1px solid #999; border-radius: 6px; padding: 4px 6px; }
  .facts small { color: #444; }
  .facts b { font-size: 10pt; }
  .two { grid-template-columns: 1fr 1.3fr; gap: 18px; }
  .material { list-style: none; padding-left: 0; }
  .material li::before { content: "☐ "; }
  .steps li { padding-left: 32px; margin-bottom: 8px; break-inside: avoid; }
  .steps li::before { width: 22px; height: 22px; font-size: 9pt; background: #fff; color: #000; border: 1.5px solid #000; }
  .tip { background: #fff; border-left-color: #000; color: #000; break-inside: avoid; }
  ul, ol, .facts { break-inside: avoid; }
}

/* Illustrationen */
.szene-wrap { margin: 8px -16px 0; overflow: hidden; }
.szene { display: block; width: 100%; height: auto; max-height: 260px; }
.karten-icon { font-size: 2rem; line-height: 1; display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--card-2); }
a.card:hover .karten-icon { transform: rotate(-8deg) scale(1.08); transition: transform .15s; }
.titel-icon { display: inline-block; margin-right: 4px; }
@media print { .szene-wrap, .karten-icon { display: none !important; } }
