/* Florian Rostbach – Comic-Stil · © 2026 ff144 */
:root {
  --ink: #141414;
  --yellow: #f5c518;
  --red: #c8102e;
  --red-dark: #8e0b20;
  --paper: #fffaf0;
  --brick: #9c4a2f;
  --bg: #2a1d14;
  --green: #2f8f46;
  --radius: 14px;
  --shadow: 4px 4px 0 var(--ink);
  --font-comic: "Arial Black", "Arial Bold", Impact, "Helvetica Neue", sans-serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.5 var(--font); color: var(--ink);
  background: radial-gradient(circle at 20% 0%, #4a3220 0, transparent 60%), repeating-linear-gradient(45deg, #2e2016 0 12px, #2a1d14 12px 24px);
  background-color: var(--bg);
}
a { color: var(--red); font-weight: 600; }
img { max-width: 100%; display: block; }
code { background: #0001; padding: 1px 5px; border-radius: 4px; font-size: .9em; word-break: break-all; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--ink); border-bottom: 4px solid var(--yellow);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--yellow); }
.logo-badge { background: var(--red); color: #fff; font: 900 15px var(--font-comic); padding: 4px 8px; border: 2px solid var(--yellow); border-radius: 8px; }
.logo-text { font: 900 20px var(--font-comic); letter-spacing: .5px; text-transform: uppercase; }
.mainnav { display: flex; align-items: center; gap: 4px; }
.mainnav a, .linkbtn { color: #fff; text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: 8px; background: none; border: 0; font-size: 15px; cursor: pointer; font-family: var(--font); }
.mainnav a:hover, .linkbtn:hover { background: #ffffff1a; }
.nav-orga { color: var(--yellow) !important; }
.menu-toggle { display: none; background: none; border: 2px solid var(--yellow); color: var(--yellow); font-size: 22px; border-radius: 8px; padding: 2px 10px; cursor: pointer; }
.inline { display: inline; margin: 0; }

/* ---------- Grundlayout ---------- */
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px; flex: 1; }
.wrap.narrow, .narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.box {
  background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 18px;
}
.box-danger { border-color: var(--red); }
.center { text-align: center; }
h1, h2, h3 { line-height: 1.2; margin-top: 0; }
h2 { font: 900 20px var(--font-comic); text-transform: uppercase; letter-spacing: .3px; }
.comic {
  font: 900 clamp(26px, 6vw, 40px) var(--font-comic); text-transform: uppercase; color: var(--yellow); letter-spacing: 1px;
  text-shadow: 3px 3px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 0 3px 0 var(--ink);
  margin-bottom: 14px;
}
.page-orga > main > .comic { margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 18px; }
.hint { color: #6b5a4a; font-size: 14px; }
.links { margin-top: 16px; font-size: 15px; }
.code-big { font: 900 34px var(--font-comic); letter-spacing: 4px; color: var(--red); text-align: center; background: var(--ink); color: var(--yellow); border-radius: 10px; padding: 10px; }

/* ---------- Formulare ---------- */
.form label { display: block; font-weight: 700; margin-bottom: 14px; }
.form input:not([type=checkbox]), .form select, .form textarea, .search input {
  display: block; width: 100%; margin-top: 6px; padding: 12px; font: 16px var(--font);
  border: 3px solid var(--ink); border-radius: 10px; background: #fff;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 3px solid var(--yellow); outline-offset: 1px; }
.form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.form label.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--red); }
.row { display: flex; gap: 12px; } .row > * { flex: 1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.parentbox { background: #fff3c4; border: 2px dashed var(--ink); border-radius: 10px; padding: 12px 12px 0; margin-bottom: 14px; }
.parentbox[hidden] { display: none; }
.search { display: flex; gap: 10px; margin-bottom: 14px; } .search input { margin: 0; }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-block; text-align: center; text-decoration: none; cursor: pointer;
  font: 900 16px var(--font-comic); text-transform: uppercase; letter-spacing: .5px;
  color: #fff; background: var(--red); border: 3px solid var(--ink); border-radius: 10px;
  padding: 12px 20px; box-shadow: 3px 3px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.btn:hover { background: var(--red-dark); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn-big { width: 100%; font-size: 18px; padding: 15px; }
.btn-ghost { background: var(--yellow); color: var(--ink); } .btn-ghost:hover { background: #ffd84d; }
.btn-danger { background: #5a0a14; }
.btn-small { padding: 6px 10px; font-size: 12px; box-shadow: 2px 2px 0 var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; } .btn-row .btn { flex: 1 1 200px; width: auto; }

/* ---------- Meldungen ---------- */
.flash { border: 3px solid var(--ink); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; background: #fff; }
.flash-success { background: #d8f5dc; } .flash-error { background: #ffd6d6; } .flash-info { background: #dbeafe; } .flash-warn { background: #fff0b3; }
.checks { list-style: none; padding: 0; } .checks .ok { color: var(--green); } .checks .fail { color: var(--red); font-weight: 700; }

/* ---------- Szene (Wache) ---------- */
.scene {
  position: relative; overflow: hidden; border: 4px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  background: linear-gradient(#87b7e0, #cfe3f2 55%, #a8865e 55%, #8a6a46);
  aspect-ratio: 4 / 5; max-height: 78vh; width: 100%; margin-bottom: 18px;
}
@media (min-width: 800px) { .scene { aspect-ratio: 16 / 9; } }
.scene-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene .placeholder.scene-bg { border: 0; border-radius: 0; background: transparent; }
.hud { position: absolute; top: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.hud-left { left: 12px; } .hud-right { right: 12px; align-items: flex-end; }
.hud-box {
  display: flex; align-items: baseline; gap: 12px; background: var(--ink); border: 3px solid var(--yellow); border-radius: 12px;
  padding: 6px 14px; box-shadow: 0 0 0 3px #fff8, 3px 3px 0 #0008;
}
.hud-box span { font: 900 clamp(14px, 3.4vw, 22px) var(--font-comic); color: var(--yellow); letter-spacing: 1px; }
.hud-box b { font: 900 clamp(16px, 4vw, 26px) var(--font-comic); color: #ff5a3c; }
.hud-box.big { flex-direction: column; gap: 0; } .hud-box.big span { font-size: 13px; } .hud-box.big b { font-size: 32px; }
.scene-vehicle { position: absolute; left: 3%; bottom: 13%; width: 42%; z-index: 2; }
.scene-vehicle .meter { margin-top: 6px; }
.scene-hero { position: absolute; right: 6%; bottom: 3%; width: 30%; z-index: 2; }
@media (min-width: 800px) { .scene-vehicle { width: 30%; bottom: 6%; } .scene-hero { width: 18%; right: 12%; } }
.chapter-tag {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 3; white-space: nowrap;
  font: 900 clamp(12px, 3vw, 18px) var(--font-comic); text-transform: uppercase; color: var(--yellow);
  background: var(--ink); border: 3px solid var(--yellow); border-radius: 10px; padding: 4px 12px;
}
.hero .scene { margin-bottom: 18px; }

/* ---------- Platzhalter für fehlende Bilder ---------- */
.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  min-height: 80px; padding: 8px; background: repeating-linear-gradient(-45deg, #fff6 0 10px, #fff3 10px 20px);
  border: 3px dashed #0007; border-radius: 10px; color: #000a; font-size: 12px;
}
.placeholder span { font: 900 13px var(--font-comic); text-transform: uppercase; }
.placeholder code { background: #fff9; font-size: 11px; }
.vehicle.placeholder { aspect-ratio: 3 / 2; } .hero-figure.placeholder { aspect-ratio: 2 / 3; }
.face.placeholder, .thumb.placeholder { aspect-ratio: 1; min-height: 0; }
.action-icon.placeholder { width: 56px; height: 56px; min-height: 0; padding: 2px; } .action-icon.placeholder code { display: none; }

/* ---------- Anzeigen ---------- */
.meter { position: relative; height: 26px; background: #0003; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(#ff7b54, var(--red)); transition: width .6s ease; }
.meter-mot i { background: linear-gradient(#7fdc8f, var(--green)); }
.meter span { position: relative; display: block; text-align: center; font: 900 12px/20px var(--font-comic); color: #fff; text-shadow: 1px 1px 0 var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.stat > span { display: block; font: 900 14px var(--font-comic); text-transform: uppercase; margin-bottom: 4px; }

/* ---------- Dialog ---------- */
.dialog { display: flex; gap: 16px; align-items: flex-start; }
.dialog-face { width: 96px; flex: none; }
.dialog-face img, .dialog-face .placeholder { border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); }
.speaker { font: 900 15px var(--font-comic); text-transform: uppercase; color: var(--red); margin: 0 0 6px; }
@media (max-width: 520px) { .dialog { flex-direction: column; align-items: center; text-align: left; } }

/* ---------- Aktionen ---------- */
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.action-card {
  position: relative; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; text-align: center; display: flex; flex-direction: column; align-items: center;
}
.action-card img { width: 56px; height: 56px; object-fit: contain; }
.action-card h3 { font: 900 16px var(--font-comic); text-transform: uppercase; margin: 8px 0 4px; }
.action-card p { font-size: 13px; margin: 0 0 8px; color: #5b4a3a; }
.action-card.is-locked { opacity: .75; }
.soon { font: 900 11px var(--font-comic); text-transform: uppercase; background: var(--ink); color: var(--yellow); padding: 2px 8px; border-radius: 6px; }

.news { border-top: 2px dashed #0003; padding-top: 10px; margin-top: 10px; }
.news h3 { margin: 0; } .news time { font-size: 13px; color: #6b5a4a; }

/* ---------- Konto ---------- */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; } .facts dt { font-weight: 700; } .facts dd { margin: 0; word-break: break-all; }
.legal h2 { font-size: 17px; margin-top: 22px; }

/* ---------- Orga ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 4px; }
.tabs a { flex: none; text-decoration: none; color: var(--yellow); background: var(--ink); border: 3px solid var(--yellow); border-radius: 10px; padding: 8px 14px; font: 900 14px var(--font-comic); text-transform: uppercase; }
.tabs a.active { background: var(--yellow); color: var(--ink); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #0002; vertical-align: middle; }
.table th { background: var(--ink); color: var(--yellow); font-family: var(--font-comic); text-transform: uppercase; font-size: 12px; }
.actions-cell { display: flex; flex-wrap: wrap; gap: 6px; } .actions-cell form { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; border: 2px solid var(--ink); white-space: nowrap; }
.badge-active { background: #b8ecc2; } .badge-pending, .badge-parent_pending { background: #fff0b3; } .badge-blocked { background: #ffc2c2; } .badge-admin { background: var(--yellow); }
.bar-row { display: grid; grid-template-columns: 80px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; font-weight: 700; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.img-item { border: 3px solid var(--ink); border-radius: 10px; padding: 6px; background: #fff; text-align: center; }
.img-item.ok { border-color: var(--green); } .img-item.missing { opacity: .8; }
.img-item img { aspect-ratio: 1; object-fit: contain; width: 100%; background: #eee; border-radius: 6px; }
.img-item .placeholder code { display: none; }
.img-item > code { display: block; font-size: 10px; margin-top: 4px; background: none; }

/* ---------- Fußzeile ---------- */
.footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: var(--ink); color: #bbb; font-size: 14px; border-top: 4px solid var(--yellow); }
.footer a { color: var(--yellow); }

/* ---------- Handy ---------- */
@media (max-width: 720px) {
  .menu-toggle { display: block; }
  .mainnav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--ink); border-bottom: 4px solid var(--yellow); padding: 8px; }
  .mainnav.open { display: flex; }
  .mainnav a, .linkbtn { padding: 12px; font-size: 17px; text-align: left; width: 100%; }
  .wrap { padding: 12px; }
  .box { padding: 16px; }
  .logo-text { font-size: 16px; }
  .row { flex-direction: column; gap: 0; }
  .table { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
