:root {
  --bg: #fff8ec;
  --card: #ffffff;
  --ink: #1d1a2f;
  --muted: #5d5873;
  --line: #e6dcc8;
  --brand: #6a3df0;
  --brand-ink: #ffffff;
  --accent: #ff7a1a;
  --good: #1f9d55;
  --warn: #c0392b;
  --star: #ffb400;
  --star-off: #d9d2c3;
  --k-feature: #2f80ed;
  --k-fix: #ff7a1a;
  --k-question: #9b51e0;
  --k-other: #8a8a8a;
  --k-build: #1f9d55;
  --k-answer: #b8a26a;
  --radius: 18px;
  font-size: clamp(16px, 0.6vw + 12px, 26px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); }
main { flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; padding: 1rem 16px 3rem; outline: none; }
h1 { font-size: 2rem; margin: .4rem 0 1rem; }
h2 { font-size: 1.4rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1.15rem; margin: 0 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem;
  padding: .7rem 16px; background: var(--brand); color: var(--brand-ink);
}
.brand { display: flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.3rem; }
.brand-star { width: 1.6rem; height: 1.6rem; fill: var(--star); }
.nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.nav a {
  color: var(--brand-ink); text-decoration: none; font-weight: 700;
  padding: .45rem .9rem; border-radius: 999px; background: rgba(255,255,255,.14);
}
.nav a.active { background: #fff; color: var(--brand); }
.foot { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 16px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.foot-admin { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.6rem; padding: .5rem 1.1rem; border-radius: 14px; border: 0;
  font: inherit; font-weight: 800; cursor: pointer; text-decoration: none;
  background: var(--brand); color: var(--brand-ink);
}
.btn.secondary { background: #efe9ff; color: var(--brand); }
.btn.orange { background: var(--accent); color: #fff; }
.btn.danger { background: var(--warn); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); border: 2px dashed var(--line); cursor: default; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 1.1em; height: 1.1em; fill: currentColor; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.card { background: var(--card); border-radius: var(--radius); padding: 1rem; box-shadow: 0 2px 0 var(--line); border: 1px solid var(--line); display: flex; flex-direction: column; gap: .6rem; }
.card .nr { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 900; flex: none; }
.card-head { display: flex; gap: .6rem; align-items: center; }
.card p { margin: 0; }
.card .btn-row { margin-top: auto; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: #f1ecdf; color: var(--muted); }

.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.box.warn { border-color: var(--accent); background: #fff1e5; }
.box.info { border-color: #c9bbff; background: #f5f1ff; }
.addr { font-size: 1.5rem; font-weight: 900; color: var(--brand); word-break: break-all; }

table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f6f0e3; font-size: .85rem; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: " \2195"; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.rank { font-weight: 900; width: 2.5rem; }
.rank-1 td { background: #fff4cc; }
.rank-2 td { background: #f1f3f6; }
.rank-3 td { background: #fbe9dd; }

.form { display: flex; flex-direction: column; gap: .7rem; max-width: 34rem; }
.form label { font-weight: 800; }
.form input {
  font: inherit; font-size: 1.4rem; padding: .6rem .8rem; border-radius: 14px; border: 2px solid var(--line); width: 100%;
}
.msg { font-weight: 800; }
.msg.ok { color: var(--good); }
.msg.err { color: var(--warn); }

/* Sterne */
.stars { display: inline-flex; gap: .15rem; }
.star-btn { border: 0; background: transparent; padding: .1rem; cursor: pointer; width: 2.6rem; height: 2.6rem; }
.star-btn svg { width: 100%; height: 100%; fill: var(--star-off); transition: transform .1s; }
.star-btn.on svg { fill: var(--star); }
.star-btn:active svg { transform: scale(1.2); }
.star-btn:disabled { cursor: default; }
.crit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .2rem .6rem; }
.crit-label { font-weight: 800; min-width: 8rem; }
.pick-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.pick { text-align: left; min-height: 3.4rem; justify-content: flex-start; background: #fff; color: var(--ink); border: 2px solid var(--line); }
.pick .nr { width: 1.9rem; height: 1.9rem; font-size: .9rem; }
.fav-btn { background: #fff; color: var(--muted); border: 2px solid var(--line); }
.fav-btn.on { background: #ffe1ef; color: #c2185b; border-color: #f48fb1; }
.sticky-bar { position: sticky; bottom: 0; background: var(--bg); padding: .7rem 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Prompts */
.chips { display: flex; flex-direction: column; gap: .4rem; }
.chip { border-left: 6px solid var(--k-other); background: var(--card); border-radius: 10px; padding: .4rem .6rem; }
.chip .kind { font-size: .75rem; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.chip.k-feature { border-color: var(--k-feature); }
.chip.k-fix { border-color: var(--k-fix); }
.chip.k-question { border-color: var(--k-question); }
.chip.k-build { border-color: var(--k-build); }
.chip.k-answer { border-color: var(--k-answer); }
.legend { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .85rem; margin: .4rem 0; }
.legend i { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; vertical-align: -2px; margin-right: .3rem; }
.quote { background: #f5f1ff; border-radius: 12px; padding: .6rem .8rem; margin: .3rem 0 .8rem; font-size: 1.05rem; }
.quote.better { background: #e8f7ee; }
.chart svg { width: 100%; height: auto; display: block; }
.two-col { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); }

/* Siegerehrung */
.reveal {
  position: fixed; inset: 0; background: #1d1a2f; color: #fff; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; text-align: center; padding: 16px; cursor: pointer;
}
.reveal .place { font-size: 2rem; font-weight: 900; color: var(--star); }
.reveal .winner { font-size: clamp(2rem, 6vw, 6rem); font-weight: 900; animation: pop .6s ease-out; }
.reveal .meta { font-size: 1.2rem; opacity: .85; }
.reveal .hint { position: absolute; bottom: 1rem; opacity: .5; font-size: .9rem; }
.reveal .big-star { width: clamp(4rem, 12vw, 10rem); height: auto; fill: var(--star); animation: spin 1.2s ease-out; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes spin { from { transform: rotate(-180deg) scale(.2); } to { transform: rotate(0) scale(1); } }

@media (max-width: 600px) {
  h1 { font-size: 1.6rem; }
  .star-btn { width: 2.3rem; height: 2.3rem; }
  .crit-label { min-width: 0; }
}

/* Weiterbauen */
.wb-prompt h3 { margin-top: 0; }
.wb-text { white-space: pre-wrap; font-family: inherit; font-size: 1rem; line-height: 1.45; margin: 0 0 .75rem; overflow-wrap: anywhere; }

/* Mini-Spiele (ChatGPT) */
.card .nr.mini { background: var(--brand); font-size: .85rem; }
.form.wide { max-width: 60rem; }
.form textarea {
  font: .8rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: .6rem .8rem;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); width: 100%; resize: vertical;
}
.form input[type=file] { border: 0; padding: 0; font-size: .85rem; }
iframe.mini-preview { width: 100%; height: 70vh; border: 2px solid var(--line); border-radius: 12px; background: #fff; margin-top: .6rem; }
.totals .addr { font-size: 1.3rem; }
