/* Gilden-Feedback — Schwarz / Rot / Dunkelrot
   Performance: keine backdrop-filter, keine Layout-Animationen,
   Animationen nur über opacity/transform, sparsame Schatten. */

:root {
  color-scheme: dark;
  --bg: #0a0707;
  --surface: #120d0e;
  --surface-2: #171112;
  --elev: #201718;
  --input: #0d0909;
  --border: #2a1f21;
  --border-strong: #3b2b2e;
  --text: #f6f3f3;
  --muted: #b3a6a8;
  --faint: #7d6e70;
  --primary: #dc2626;
  --primary-soft: #f87171;
  --primary-deep: #7f1d1d;
  --grad: linear-gradient(#e23a3a, #a11818);
  --tipp: #34d399;
  --vorschlag: #f5b942;
  --beschwerde: #fb7185;
  --danger: #f87171;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Roter Schein + WoW-Emblem, oben fixiert.
   Eigene Compositing-Ebenen (translateZ) → beim Scrollen wird nichts neu gezeichnet. */
body::before,
body::after {
  content: "";
  position: fixed;
  left: 0; right: 0; top: 0;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform;
}
body::before {
  height: 620px;
  background: radial-gradient(55% 60% at 50% 0%, rgba(185, 28, 28, .26), transparent 70%);
}
/* Emblem dunkelrot eingefärbt: Bild × Rot (multiply), Maske = Form des Bildes,
   damit nur das Emblem gefärbt wird und nicht die ganze Fläche. Wird einmal
   gerendert und dann nur noch verschoben – kostet beim Scrollen nichts. */
body::after {
  --emblem: url("bg-wow.webp");
  --emblem-size: min(1500px, 240vw) auto;
  --emblem-tint: #8f1414;
  top: 0;
  height: 900px;
  opacity: .5;
  background: var(--emblem) center top / var(--emblem-size) no-repeat, var(--emblem-tint);
  background-blend-mode: multiply;
  -webkit-mask: var(--emblem) center top / var(--emblem-size) no-repeat;
  mask: var(--emblem) center top / var(--emblem-size) no-repeat;
}

.i {
  width: 1em; height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::selection { background: rgba(220, 38, 38, .45); }

/* ---------- Layout ---------- */
main {
  position: relative; z-index: 1;
  width: 100%; max-width: 640px;
  margin: 0 auto; padding: 56px 16px 72px;
  flex: 1;
}

/* Hero bricht aus der 640px-Spalte aus: bis zu 860px breit, auf dem Handy volle Breite */
.hero {
  text-align: center;
  margin: 24px calc(50% - min(430px, 50vw - 16px)) 44px;
}
h1 {
  margin: 0 0 16px;
  font: 700 clamp(34px, 6.4vw, 54px)/1.06 var(--display);
  letter-spacing: -.025em;
}
.lead { margin: 0 auto; max-width: 640px; color: var(--muted); font-size: 17px; }

/* Wer liest mit: Gildenleitung als Badges (Farben = WoW-Klassenfarben) */
.readers { margin-top: 26px; }
.readers-note {
  margin: 0 auto 12px;
  font-size: 13.5px; color: var(--faint);
  text-wrap: balance;
}
.readers-note .i { color: var(--primary-soft); vertical-align: -2px; margin-right: 4px; }
.readers-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.officer {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px 5px 11px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 600; line-height: 1.3;
  color: var(--oc);
  background: color-mix(in srgb, var(--oc) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--oc) 32%, transparent);
}
.officer::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--oc);
}
.muted { color: var(--muted); }
.small { font-size: 13px; }

.setup-note {
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 16px; padding: 12px 16px;
  border-radius: 14px; font-size: 14px;
  border: 1px solid rgba(251, 191, 36, .35);
  background: rgba(251, 191, 36, .08); color: #fde68a;
}
.setup-note .i { margin-top: 4px; }
.setup-note code { font-size: 13px; color: #fff; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .7);
}
.view { animation: fade-in .35s ease-out both; }

/* ---------- Felder ---------- */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field { margin: 0 0 26px; }
.field-tight { margin-bottom: 0; }
.label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  width: 100%; padding: 0;
  margin-bottom: 10px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.label small { color: var(--faint); font-weight: 500; font-size: 12.5px; }
.counter { font-variant-numeric: tabular-nums; }
.counter.is-warn { color: #fbbf24; }
.help { margin: 8px 0 0; font-size: 12.5px; color: var(--faint); }

textarea, input[type="text"] {
  display: block; width: 100%;
  padding: 14px 16px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
textarea {
  min-height: 150px; max-height: 520px;
  resize: vertical; line-height: 1.6;
  field-sizing: content; /* wächst mit dem Text, ganz ohne JavaScript */
}
textarea::placeholder, input::placeholder { color: #5f5153; }
textarea:hover, input[type="text"]:hover { border-color: var(--border-strong); }
textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: rgba(220, 38, 38, .75);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .18);
}
.has-error textarea, .has-error input[type="text"] {
  border-color: rgba(248, 113, 113, .7);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .14);
}
.has-error .cat-body, .has-error .drop { border-color: rgba(248, 113, 113, .6); }

/* ---------- Kategorien ---------- */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cat { position: relative; display: block; cursor: pointer; }
.cat input { position: absolute; opacity: 0; pointer-events: none; }
.cat-body {
  height: 100%;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  transition: border-color .15s, background-color .15s;
}
.cat-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; font-size: 15px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
}
.cat-text { display: flex; flex-direction: column; gap: 1px; }
.cat-title { font-weight: 600; font-size: 13.5px; }
.cat-hint { font-size: 11.5px; line-height: 1.35; color: var(--faint); }
.cat:hover .cat-body { border-color: var(--border-strong); }
.cat input:checked + .cat-body {
  border-color: color-mix(in srgb, var(--c) 65%, transparent);
  background: color-mix(in srgb, var(--c) 8%, var(--surface-2));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 14%, transparent);
}
.cat input:focus-visible + .cat-body { outline: 2px solid var(--primary-soft); outline-offset: 2px; }

/* ---------- Upload ---------- */
.drop {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.drop:hover { border-color: rgba(220, 38, 38, .55); }
.drop.is-over { border-color: var(--primary); background: rgba(220, 38, 38, .08); }
.drop:focus-within { outline: 2px solid var(--primary-soft); outline-offset: 2px; }
.drop-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 19px;
  color: var(--primary-soft); background: rgba(220, 38, 38, .12);
}
.drop-text strong { display: block; font-size: 14px; font-weight: 600; }
.drop-text > span { font-size: 12.5px; color: var(--faint); }
/* Ohne JS bleibt das native Dateifeld sichtbar */
.drop input[type="file"] { margin-left: auto; max-width: 45%; font-size: 12px; color: var(--muted); }
.js .drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.js-only { display: none; }
.js .js-only { display: inline; }

.thumbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px;
}
.thumbs:not(:empty) { margin-top: 12px; }
.thumb {
  position: relative; aspect-ratio: 1;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: var(--input);
  animation: fade-in .2s ease-out both;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.is-busy img { opacity: .35; }
.thumb.is-busy::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.thumb.is-leaving { opacity: 0; transition: opacity .2s; }
.thumb-size {
  position: absolute; left: 6px; bottom: 6px;
  padding: 1px 7px; border-radius: 6px;
  background: rgba(10, 7, 7, .85); font-size: 10.5px; font-weight: 500; color: var(--muted);
}
.thumb-remove {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: rgba(10, 7, 7, .85); color: #fff; font-size: 14px;
  cursor: pointer; opacity: 0;
  transition: opacity .15s, background-color .15s;
}
.thumb:hover .thumb-remove, .thumb-remove:focus-visible { opacity: 1; }
.thumb-remove:hover { background: var(--primary); }
@media (hover: none) { .thumb-remove { opacity: 1; } }

/* ---------- Anonym-Schalter ---------- */
.divider { height: 1px; background: var(--border); margin: 0 0 22px; }
.toggle { display: flex; align-items: center; gap: 14px; cursor: pointer; user-select: none; }
.toggle-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 19px;
  color: var(--primary-soft); background: rgba(220, 38, 38, .12);
}
.toggle-text { flex: 1; min-width: 0; }
.toggle-text strong { display: block; font-size: 14.5px; font-weight: 600; }
.toggle-text span { font-size: 13px; color: var(--faint); }
.switch { position: relative; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.track {
  display: block; position: relative;
  width: 46px; height: 27px; border-radius: 999px;
  background: var(--border-strong);
  transition: background-color .2s;
}
.track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%;
  background: #fff;
  transition: transform .25s var(--ease);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(19px); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary-soft); outline-offset: 3px; }

form:has(#anon:not(:checked)) .toggle-icon { color: var(--muted); background: var(--elev); }

/* Namensfeld: ein-/ausblenden ohne Höhen-Animation (die würde bei jedem Frame das Layout neu berechnen) */
.collapse { display: none; }
form:has(#anon:not(:checked)) .collapse { display: block; animation: fade-in .25s ease-out both; }
.collapse-inner { padding: 18px 2px 2px; }

/* ---------- Honeypot ---------- */
.hp {
  position: absolute !important;
  left: -10000px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

/* ---------- Meldungen & Aktionen ---------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 24px; padding: 12px 14px;
  border-radius: 12px; font-size: 14px;
  color: #fecaca;
  background: rgba(248, 113, 113, .08);
  border: 1px solid rgba(248, 113, 113, .3);
}
.alert .i { margin-top: 4px; color: var(--danger); }

.actions {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 26px;
}
.note {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 0; font-size: 12.5px; color: var(--faint);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 22px;
  border: 0; border-radius: 12px;
  font: 600 14.5px/1 var(--font);
  text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, transform .1s;
}
.btn:focus-visible { outline: 2px solid var(--primary-soft); outline-offset: 3px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff;
  background: var(--primary) var(--grad);
  box-shadow: 0 8px 20px -12px rgba(220, 38, 38, .8), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: #b91c1c; }
.btn-primary .btn-arrow { transition: transform .2s var(--ease); }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }
.btn-secondary { color: var(--text); background: var(--elev); box-shadow: inset 0 0 0 1px var(--border-strong); }
.btn-secondary:hover { background: #2a1e20; }
.btn[disabled] { cursor: progress; opacity: .85; }

.spinner {
  display: none;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn.is-loading .spinner { display: block; }
.btn.is-loading .btn-arrow { display: none; }

/* ---------- Erfolg ---------- */
.success { text-align: center; padding: 44px 28px 36px; }
.success h2 { margin: 0 0 6px; font: 700 26px/1.2 var(--display); letter-spacing: -.01em; }
.success p { margin: 0 auto; max-width: 380px; }
.success-crest { position: relative; width: 80px; height: 80px; margin: 0 auto 24px; }
.success-crest img {
  width: 100%; height: 100%; display: block;
  border-radius: 22px; object-fit: cover;
  box-shadow: 0 14px 34px -14px rgba(220, 38, 38, .7), 0 0 0 1px rgba(255, 255, 255, .08);
}
.success-badge {
  position: absolute; right: -8px; bottom: -8px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px; color: #fff;
  background: var(--primary);
  border: 3px solid var(--surface);
}
.success-badge .i { stroke-width: 3; }
.success .btn { margin-top: 28px; }

/* ---------- Animationen (nur opacity/transform) ---------- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.shake { animation: shake .25s ease-out; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Mobil ---------- */
@media (max-width: 580px) {
  main { padding-top: 36px; }
  .card { padding: 20px; border-radius: 18px; }
  .cats { grid-template-columns: 1fr; gap: 6px; }
  .cat-body { flex-direction: row; align-items: center; gap: 10px; padding: 9px 12px; }
  .actions { flex-direction: column-reverse; align-items: stretch; }
  .note { justify-content: center; }
  .btn { width: 100%; }
  .success { padding: 36px 20px 28px; }
}
