/* ==========================================================================
   Steeldart Radar – Dart Knights Grünbach
   Design-System: Farben aus dem Vereinswappen
   (Royalblau #0f3f8f · Navy #0a1428 · Gold #f8c000 · Grün #0e8a33/#5fc228)
   ========================================================================== */

:root {
  --navy-950: #071022;
  --navy-900: #0a1730;
  --navy-800: #10213f;
  --navy-700: #1a3159;
  --blue: #0f3f8f;
  --blue-600: #1d50a8;
  --blue-500: #2a66c7;
  --gold: #f8c000;
  --gold-soft: #ffd54a;
  --green: #0e8a33;
  --green-bright: #5fc228;
  --bg: #0b1526;
  --surface: #101d38;
  --surface-2: #16264a;
  --text: #eef2f9;
  --muted: #9fb0cc;
  --line: rgba(159, 176, 204, .16);
  --danger: #e5484d;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(3, 8, 18, .45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(15, 63, 143, .35), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(14, 138, 51, .12), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Views ---------- */
.view { display: none; padding-top: 4px; }
.view.active { display: block; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 500;
  background: rgba(7, 16, 34, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex; align-items: center; gap: 14px;
  min-height: 68px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img {
  width: 46px; height: 46px; object-fit: contain; display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5));
}
.brand .t { line-height: 1.15; min-width: 0; }
.brand .t b {
  display: block; font-size: 17px; letter-spacing: .3px; color: var(--text);
  white-space: nowrap;
}
.brand .t span {
  display: block; font-size: 12px; color: var(--gold-soft);
  letter-spacing: 2.2px; text-transform: uppercase;
}
nav { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 600; transition: all .18s ease;
  text-decoration: none;
}
.tab:hover { color: var(--text); border-color: var(--blue-500); }
.tab.active {
  background: linear-gradient(135deg, var(--blue), var(--blue-600));
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(15, 63, 143, .45);
}
.tab.link { display: inline-flex; align-items: center; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(800px 320px at 90% 20%, rgba(42, 102, 199, .25), transparent 60%),
    linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--blue) 130%);
}
.hero .wrap {
  display: flex; align-items: center; gap: 28px;
  padding-top: 34px; padding-bottom: 34px;
}
.hero .hgroup { flex: 1 1 auto; min-width: 0; }
.hero h1 {
  margin: 0 0 10px; font-size: clamp(24px, 4vw, 38px); line-height: 1.15;
  letter-spacing: .2px;
}
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { margin: 0 0 14px; color: var(--muted); max-width: 640px; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text);
  background: rgba(255, 255, 255, .04);
}
.chip.gold { color: var(--navy-950); background: var(--gold); border-color: transparent; }
.chip.green { color: #eafff0; background: rgba(14, 138, 51, .35); border-color: rgba(95, 194, 40, .4); }
.hero .crest { flex: 0 0 auto; }
.hero .crest img {
  width: clamp(120px, 18vw, 190px); height: auto; display: block;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .55));
}

/* ---------- Filter ---------- */
.filters {
  margin: 22px auto 0; padding: 18px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.4fr .9fr .9fr .9fr 1.2fr auto auto;
  gap: 12px; align-items: end;
}
.f label {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.f input, .f select, .f input[type="date"] {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(7, 16, 34, .6);
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.f input:focus, .f select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(42, 102, 199, .25);
}
.btn {
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  font-size: 14px; font-weight: 600; transition: all .18s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--blue-500); transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: var(--navy-950); border-color: transparent; font-weight: 800;
  box-shadow: 0 4px 16px rgba(248, 192, 0, .25);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }

/* ---------- Statuszeilen ---------- */
#meta-line { margin: 18px 0 12px; }
.status-error {
  margin: 14px 0; padding: 12px 16px; border-radius: 12px;
  border: 1px solid rgba(229, 72, 77, .45);
  background: rgba(229, 72, 77, .12); color: #ffd9da;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.status-error button {
  margin-left: auto; padding: 6px 14px; border-radius: 8px;
  border: 1px solid rgba(229, 72, 77, .5); background: transparent;
  color: #ffd9da; cursor: pointer; font-weight: 600;
}
.status-error button:hover { background: rgba(229, 72, 77, .18); }

/* ---------- Empty State ---------- */
.empty {
  padding: 44px 24px; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: rgba(16, 29, 56, .5);
}
.empty .big { font-size: 42px; line-height: 1; }
.empty h3 { margin: 14px 0 6px; font-size: 19px; }
.empty p { color: var(--muted); margin: 0 auto 18px; max-width: 560px; }
.empty .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Turnierkarten ---------- */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px; padding-bottom: 28px;
}
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(42, 102, 199, .55); }
.card h3 { margin: 0; font-size: 16.5px; line-height: 1.35; }
.card .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 11px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
}
.b-verified { background: rgba(14, 138, 51, .25); color: #b8f5cd; border: 1px solid rgba(95, 194, 40, .45); }
.b-unconfirmed { background: rgba(42, 102, 199, .2); color: #cfe0ff; border: 1px solid rgba(42, 102, 199, .5); }
.b-cancelled { background: rgba(229, 72, 77, .2); color: #ffc9cb; border: 1px solid rgba(229, 72, 77, .5); }
.meta {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 13.5px; color: var(--muted);
}
.meta b { color: var(--text); }
.meta .dist b { color: var(--gold); font-size: 14px; }
.actions {
  margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.actions button {
  padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600;
  border: 1px solid var(--line); background: rgba(7, 16, 34, .55); color: var(--text);
  font-size: 13px;
}
.actions button:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn-reg {
  padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: var(--navy-950) !important; text-decoration: none !important;
}
.actions a:not(.btn-reg) {
  font-size: 13px; color: var(--muted); padding: 7px 4px;
}
.actions a:not(.btn-reg):hover { color: var(--gold-soft); }

/* ---------- Kalender ---------- */
.cal-head {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin: 8px 0 14px;
}
.cal-head button {
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-size: 18px;
}
.cal-head button:hover { border-color: var(--gold); color: var(--gold-soft); }
.cal-head h2 { margin: 0; font-size: 20px; }
.calendar {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  padding-bottom: 28px;
}
.cal-dow {
  text-align: center; font-size: 11px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted); padding: 6px 0;
}
.cal-day {
  min-height: 86px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(16, 29, 56, .55); padding: 6px 7px;
  display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.cal-day .n { font-size: 12px; color: var(--muted); font-weight: 700; }
.cal-day.out { opacity: .25; }
.cal-ev {
  display: block; font-size: 11.5px; font-weight: 700; line-height: 1.25;
  padding: 3px 6px; border-radius: 7px; text-decoration: none !important;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-ev.verified { background: rgba(248, 192, 0, .16); color: var(--gold-soft); border-left: 3px solid var(--gold); }
.cal-ev.unconfirmed { background: rgba(42, 102, 199, .18); color: #cfe0ff; border-left: 3px solid var(--blue-500); }
.cal-ev.cancelled { background: rgba(229, 72, 77, .18); color: #ffc9cb; border-left: 3px solid var(--danger); text-decoration: line-through; }

/* ---------- Karte ---------- */
.map {
  height: 560px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.leaflet-container { background: var(--navy-950); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.leaflet-popup-content-wrapper { border: 1px solid var(--line); border-radius: 12px; }
.leaflet-control-attribution { background: rgba(7, 16, 34, .7) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--gold-soft) !important; }

/* ---------- Melden ---------- */
.panel {
  margin: 8px auto 30px; padding: 22px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 6px; }
.panel .hint { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.grid2 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.grid2 input, .grid2 textarea {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(7, 16, 34, .6); color: var(--text); font-size: 14px;
  width: 100%; font-family: inherit;
}
.grid2 input:focus, .grid2 textarea:focus {
  outline: none; border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(42, 102, 199, .25);
}
.grid2 textarea { grid-column: 1 / -1; min-height: 74px; resize: vertical; }
.grid2 button { grid-column: 1 / -1; justify-self: start; }
#report-msg { margin: 12px 0 0; font-weight: 600; }

/* ---------- Detail-Dialog ---------- */
dialog#detail {
  border: 1px solid var(--line); border-radius: 16px; padding: 0;
  background: var(--surface); color: var(--text);
  max-width: 640px; width: calc(100vw - 40px); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(4, 9, 20, .7); backdrop-filter: blur(3px); }
.dlg-body { padding: 22px 24px; }
.dlg-body h3 { margin: 0 0 12px; }
.dlg-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dlg-body td {
  padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.dlg-body td:first-child {
  color: var(--muted); font-weight: 600; width: 170px; white-space: nowrap;
}
.dlg-body form { padding: 14px 24px 20px; display: flex; justify-content: flex-end; }

/* ---------- Footer ---------- */
footer.wrap {
  border-top: 1px solid var(--line); margin-top: 10px;
  padding-top: 18px; padding-bottom: 30px; font-size: 13px;
}

/* ---------- Admin (gleiche Design-Sprache) ---------- */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left;
}
.admin-table th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px; }
.pill { padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill.pending { background: rgba(248, 192, 0, .18); color: var(--gold-soft); }
.pill.approved { background: rgba(14, 138, 51, .25); color: #b8f5cd; }
.pill.rejected { background: rgba(229, 72, 77, .2); color: #ffc9cb; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hero .wrap { flex-direction: column-reverse; text-align: center; padding-top: 24px; padding-bottom: 24px; }
  .hero .hgroup { display: flex; flex-direction: column; align-items: center; }
  .hero p { max-width: none; }
  .filters { grid-template-columns: 1fr; padding: 16px; }
  .f.btn { display: flex; gap: 8px; }
  .f.btn .btn { flex: 1; }
  .grid2 { grid-template-columns: 1fr; }
  .brand .t span { letter-spacing: 1.2px; }
  .topbar .wrap { gap: 10px; }
  .map { height: 420px; }
  .cal-day { min-height: 62px; }
  .cal-ev { font-size: 10px; }
}
