:root {
  --bg: #120e0b;
  --bg-2: #1b1612;
  --bg-3: #241d18;
  --line: #352b24;
  --text: #e8dcc2;
  --muted: #a39682;
  --red: #b3241d;
  --red-hi: #d23a2f;

  --font-body: "Inter", system-ui, sans-serif;
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* WoW-Klassenfarben */
  --c-warrior: #c69b6d;
  --c-paladin: #f48cba;
  --c-hunter: #aad372;
  --c-rogue: #fff468;
  --c-priest: #ffffff;
  --c-shaman: #2c8ef0;
  --c-mage: #3fc7eb;
  --c-warlock: #8788ee;
  --c-druid: #ff7c0a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--red-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 32px; padding-bottom: 48px; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.15;
  margin: 0 0 .5em;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.5rem; color: var(--text); }
h3 { font-size: 1.15rem; }
h1 .br, .brand .br { color: var(--text); }
.page-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title h1 { margin: 0; }
.page-title .sub { color: var(--muted); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(18, 14, 11, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--red); }
.brand:hover { text-decoration: none; }
.brand-mark { height: 22px; }
.brand-name { font: 700 1.15rem var(--font-mono); }

.nav { display: flex; gap: 4px; align-items: center; }
.nav > a {
  font: 600 1.05rem var(--font-head);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 4px;
}
.nav > a:hover { color: var(--text); text-decoration: none; background: var(--bg-3); }
.nav > a.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--red); }
.nav > a.locked::after { content: "🔒"; font-size: .7em; margin-left: 4px; opacity: .6; }

/* Login */
.auth { display: flex; align-items: center; gap: 8px; margin-left: 12px; }
.auth .avatar { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); }
.auth .user { font: 600 1rem var(--font-head); letter-spacing: .06em; }
.auth .logout { color: var(--muted); font-size: 1.1rem; padding: 2px 6px; }
.auth .logout:hover { color: var(--red-hi); text-decoration: none; }
.btn {
  display: inline-block; background: var(--red); color: var(--text); border: 1px solid var(--red); border-radius: 6px;
  padding: 6px 14px; font: 600 1rem var(--font-head); letter-spacing: .1em; text-transform: uppercase;
}
.btn:hover { background: var(--red-hi); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.gate { max-width: 520px; margin: 40px auto; text-align: center; }
.gate p { color: var(--muted); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); color: var(--text);
  font-size: 1.2rem; border-radius: 4px; padding: 4px 10px; cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px 16px;
  }
  .nav.open { display: flex; }
  .nav > a { width: 100%; }
  .auth { margin: 8px 0 4px; }
}

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font: .95rem var(--font-head); letter-spacing: .2em; text-transform: uppercase; padding: 20px 0; text-align: center; }

/* Cards & grids */
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.section { margin-top: 40px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 8px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.stat .v { font: 700 2rem var(--font-mono); color: var(--red-hi); line-height: 1.1; }
.stat .l { font: 600 .95rem var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.rules { counter-reset: rule; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.rules li { counter-increment: rule; display: grid; grid-template-columns: 44px 1fr; gap: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.rules li::before { content: counter(rule, decimal-leading-zero); font: 700 1.3rem var(--font-mono); color: var(--red); }
.rules b { display: block; font: 700 1.1rem var(--font-head); letter-spacing: .08em; text-transform: uppercase; }
.rules p { margin: 2px 0 0; color: var(--muted); }

.kv { list-style: none; padding: 0; margin: 0; }
.kv li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv li:last-child { border-bottom: 0; }
.kv span:last-child { font-family: var(--font-mono); color: var(--muted); }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th {
  font: 600 .95rem var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  background: var(--bg-3); position: sticky; top: 0;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th .arrow { color: var(--red-hi); margin-left: 4px; }
tbody tr:hover { background: var(--bg-3); }
td.num, th.num { text-align: right; font-family: var(--font-mono); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 32px; }

/* Klassen */
.cls { font-weight: 600; }
.cls-warrior { color: var(--c-warrior); } .cls-paladin { color: var(--c-paladin); }
.cls-hunter { color: var(--c-hunter); }   .cls-rogue { color: var(--c-rogue); }
.cls-priest { color: var(--c-priest); }   .cls-shaman { color: var(--c-shaman); }
.cls-mage { color: var(--c-mage); }       .cls-warlock { color: var(--c-warlock); }
.cls-druid { color: var(--c-druid); }

.tag {
  display: inline-block; font: 600 .8rem var(--font-head); letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 3px; padding: 1px 7px; color: var(--muted);
}
.tag.red { border-color: var(--red); color: var(--red-hi); }

.item { color: #a335ee; font-weight: 500; } /* episch */

/* Filter */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filters input, .filters select {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 9px 12px; font: inherit; min-width: 0;
}
.filters input { flex: 1 1 240px; }
.filters select { flex: 0 1 180px; }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--red); }
.result-count { color: var(--muted); font-size: .9rem; margin: -6px 0 10px; }

/* Raid-Liste */
.raid-list { display: grid; gap: 12px; }
.raid-row {
  display: grid; grid-template-columns: 140px 1fr auto; gap: 16px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; color: var(--text);
}
.raid-row:hover { border-color: var(--red); text-decoration: none; }
.raid-row .date { font-family: var(--font-mono); color: var(--muted); }
.raid-row .name { font: 700 1.25rem var(--font-head); letter-spacing: .05em; text-transform: uppercase; }
.raid-row .note { color: var(--muted); font-size: .9rem; }
.raid-row .meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) {
  .raid-row { grid-template-columns: 1fr; gap: 4px; }
  .raid-row .meta { justify-content: flex-start; }
}

.attendee-list { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.back { display: inline-block; margin-bottom: 16px; font: 600 1rem var(--font-head); letter-spacing: .12em; text-transform: uppercase; }

/* Attendance */
.bar { width: 120px; height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; display: inline-block; vertical-align: middle; }
.bar > i { display: block; height: 100%; background: var(--red); }
.bar.good > i { background: #4f9d4a; }
.bar.mid > i { background: #c9922c; }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dot { width: 12px; height: 12px; border-radius: 2px; background: var(--bg-3); border: 1px solid var(--line); }
.dot.yes { background: var(--red); border-color: var(--red); }
.dot.na { background: transparent; border-style: dashed; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: .9rem; margin-bottom: 12px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.more { text-align: center; margin-top: 16px; }
a.stat { color: inherit; }
a.stat:hover { border-color: var(--red); text-decoration: none; }
.tag.green { border-color: #4f9d4a; color: #7cc576; }
.tag.warn { border-color: #c9922c; color: #e0b057; }
.small { font-size: .85rem; }

/* Regler Kommend / Vergangen / Alle */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 20px; max-width: 100%; }
.segmented button, .segmented a {
  background: var(--bg-2); color: var(--muted); border: 0; border-right: 1px solid var(--line);
  padding: 8px 16px; font: 600 1rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
}
.segmented > :last-child { border-right: 0; }
.segmented button span { font-family: var(--font-mono); font-size: .8rem; opacity: .7; margin-left: 4px; }
.segmented .active { background: var(--red); color: var(--text); }
.segmented a:hover { text-decoration: none; color: var(--text); }

/* Buttons & Formulare */
.btn { cursor: pointer; }
.btn.small { padding: 4px 10px; font-size: .9rem; }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red-hi); }
.btn.danger:hover { background: var(--red); color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }
button.link { background: none; border: 0; color: var(--red-hi); cursor: pointer; padding: 0; font: inherit; }
button.link:hover { text-decoration: underline; }
button.link.danger { color: var(--muted); }

.form label, .player-head label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.form .grid { gap: 0 16px; }
input, select, textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 10px; font: inherit; font-size: .95rem; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); }
input[readonly] { opacity: .6; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--red); width: 16px; height: 16px; }
label.inline { flex-direction: row; align-items: center; margin: 0; color: var(--text); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
tr.error td { background: rgba(179, 36, 29, .15); }
.flash { display: inline-block; font-size: .9rem; margin: 0 0 8px; }
.flash.ok { color: #7cc576; }
.flash.err { color: var(--red-hi); }
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary h2::before { content: "▸ "; color: var(--red); }
details[open] summary h2::before { content: "▾ "; }

/* Spieler-Verwaltung */
.player { margin-bottom: 12px; }
.player-head { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
.player-head label { margin-bottom: 8px; }
.player-head > span { margin-bottom: 8px; display: flex; gap: 6px; }
table.chars td { border: 0; padding: 4px 8px 4px 0; }
table.chars tr.new-char td { padding-top: 10px; }
.filter-input { width: 100%; max-width: 320px; margin-bottom: 12px; }
.card table td { white-space: normal; }
