@font-face {
  font-family: "Pixel";
  src: url("/fonts/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #090b0a;
  --text: #f3f4f3;
  --text-2: #d8dbd9;
  --muted: #8b948f;
  --card-a: #181e1b;
  --card-b: #0d110f;
  --line: #2a2f2c;
  --gold: #f0c84b;
  --gold-line: rgba(244, 214, 120, .26);
  --green: #35d07f;
  --green-line: rgba(53, 208, 127, .28);
  --red: #ef5350;
  --yellow: #f0c84b;
  --blue: #4c9dff;
  --radius: 14px;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 22%, rgba(53, 208, 127, .07), transparent 480px),
    linear-gradient(rgba(255, 255, 255, .012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .012) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  display: flex; flex-direction: column; min-height: 100vh;
}
.hidden { display: none !important; }

/* ---------- Kopfzeile ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px; position: sticky; top: 0; z-index: 5;
  background: rgba(9, 11, 10, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.eyebrow-nav { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.eyebrow-nav b { color: var(--gold); font-weight: 600; }
.topnav { display: flex; gap: 8px; align-items: center; }

main { width: 100%; max-width: 1000px; margin: 0 auto; padding: 28px 18px 56px; flex: 1; }
.footer {
  text-align: center; padding: 22px 16px 30px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line);
}
.footer button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0 10px; text-decoration: underline; text-underline-offset: 3px; }
.footer button:hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero { text-align: center; margin: 34px 0 40px; }
.title {
  font-family: "Pixel", var(--sans); font-weight: normal; margin: 0;
  font-size: clamp(22px, 6.4vw, 46px); line-height: 1.25; color: #fff;
  text-shadow: 0 3px 0 #1f5c3a, 0 6px 0 #0a2a19, 0 12px 26px rgba(53, 208, 127, .35);
}
.title span { color: var(--green); }
.subline {
  display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px;
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.subline::before, .subline::after { content: ""; width: 34px; height: 1px; background: var(--line); }

h1, h2, h3 { font-weight: 700; margin: 0 0 14px; letter-spacing: -.01em; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.page-title { font-size: 26px; margin-bottom: 20px; }
.eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 6px; }

/* ---------- Karten ---------- */
.card {
  position: relative;
  background: radial-gradient(circle at 0% 0%, rgba(240, 200, 75, .07), transparent 50%),
              linear-gradient(145deg, rgba(24, 30, 27, .96), rgba(13, 17, 15, .96));
  border: 1px solid var(--gold-line); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .043), 0 14px 34px rgba(0, 0, 0, .35);
  padding: 24px; margin-bottom: 18px;
}
.card.narrow { max-width: 430px; margin-left: auto; margin-right: auto; }

/* ---------- Formulare ---------- */
label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
input, textarea, select {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--text);
  background: rgba(0, 0, 0, .38); border: 1px solid var(--line); border-radius: 10px; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(53, 208, 127, .16); }
textarea { min-height: 140px; resize: vertical; }
select option { background: #101412; }

.btn {
  font: inherit; font-weight: 600; font-size: 14px; color: var(--text-2); cursor: pointer; padding: 10px 18px;
  background: #181818; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .024); transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: #222826; border-color: #3a423e; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #2fbf74, #229a5b); border-color: #35d07f; color: #04140b; }
.btn.primary:hover { background: linear-gradient(180deg, #3bd383, #27a862); }
.btn.danger { background: #3a1a1b; border-color: #7b2f31; color: #ffb3b5; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.back { border-color: var(--gold-line); color: var(--gold); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.row:first-child { margin-top: 0; }

.msg { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; border: 1px solid; font-size: 13px; }
.msg.err { color: #ffc2c3; border-color: rgba(239, 83, 80, .5); background: rgba(239, 83, 80, .1); }
.msg.ok { color: #c5f2d8; border-color: var(--green-line); background: rgba(53, 208, 127, .1); }

/* ---------- Menue-Kacheln ---------- */
.menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.tile {
  position: relative; overflow: hidden; text-align: left; min-height: 172px; padding: 22px; cursor: pointer; color: var(--text); font: inherit;
  background: radial-gradient(circle at 0% 0%, rgba(240, 200, 75, .09), transparent 50%),
              linear-gradient(145deg, rgba(24, 30, 27, .96), rgba(13, 17, 15, .96));
  border: 1px solid var(--gold-line); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .043), 0 14px 34px rgba(0, 0, 0, .35);
  transition: transform .15s, border-color .15s;
  display: flex; flex-direction: column; gap: 6px;
}
.tile:hover { transform: translateY(-3px); border-color: rgba(244, 214, 120, .5); }
.tile .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px;
  color: var(--gold); background: rgba(240, 200, 75, .08); border: 1px solid var(--gold-line);
}
.tile .ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile .t { font-size: 17px; font-weight: 700; }
.tile .d { color: var(--muted); font-size: 13px; }
.tile .stat { margin-top: auto; padding-top: 10px; font-size: 13px; font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }

/* Wahl-Kachel leuchtet je nach Phase */
.phase-term { border-color: rgba(239, 83, 80, .6); animation: glow-red 2.2s infinite alternate; }
.phase-apply { border-color: rgba(240, 200, 75, .65); animation: glow-yellow 2.2s infinite alternate; }
.phase-vote { border-color: rgba(53, 208, 127, .65); animation: glow-green 2.2s infinite alternate; }
.phase-runoff { border-color: rgba(76, 157, 255, .65); animation: glow-blue 2.2s infinite alternate; }
.phase-term .stat { color: var(--red); } .phase-apply .stat { color: var(--yellow); } .phase-runoff .stat { color: var(--blue); }
@keyframes glow-red { to { box-shadow: 0 0 26px 2px rgba(239, 83, 80, .45), 0 14px 34px rgba(0, 0, 0, .35); } }
@keyframes glow-yellow { to { box-shadow: 0 0 26px 2px rgba(240, 200, 75, .45), 0 14px 34px rgba(0, 0, 0, .35); } }
@keyframes glow-green { to { box-shadow: 0 0 26px 2px rgba(53, 208, 127, .45), 0 14px 34px rgba(0, 0, 0, .35); } }
@keyframes glow-blue { to { box-shadow: 0 0 26px 2px rgba(76, 157, 255, .45), 0 14px 34px rgba(0, 0, 0, .35); } }
@media (prefers-reduced-motion: reduce) { .tile { animation: none !important; } }

/* ---------- Inhalt ---------- */
.mayor-name { color: var(--red); font-size: clamp(28px, 7vw, 46px); font-weight: 800; margin: 4px 0 14px; letter-spacing: -.02em; word-break: break-word; }
.police-name { color: var(--blue); font-size: clamp(22px, 5vw, 32px); }
.text { white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; background: rgba(0, 0, 0, .35); }
.badge.red { color: var(--red); border-color: rgba(239, 83, 80, .5); }
.badge.yellow { color: var(--yellow); border-color: var(--gold-line); }
.badge.green { color: var(--green); border-color: var(--green-line); }
.badge.blue { color: var(--blue); border-color: rgba(76, 157, 255, .5); }

.item { border-top: 1px solid var(--line); padding: 16px 0; }
.item:first-child { border-top: 0; padding-top: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; }
details { border-top: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }

@media (max-width: 560px) {
  .topbar { padding: 10px 12px; }
  .eyebrow-nav { display: none; }
  .topnav { width: 100%; justify-content: space-between; }
  main { padding: 20px 14px 40px; }
  .card { padding: 18px; }
}
