/* ============================================================
   Os Primim Dashboard – Stylesheet
   Adapted from mails-bot's CoC dashboard
   ============================================================ */

:root,
:root[data-theme="dark"] {
  --c-bg:       #0b0b18;
  --c-surface:  #12122a;
  --c-card:     #191930;
  --c-card2:    #1e1e38;
  --c-border:   rgba(255,255,255,0.07);
  --c-border2:  rgba(255,255,255,0.04);
  --c-text:     #dde0f0;
  --c-muted:    #7a7a9a;
  --c-dim:      #4a4a6a;

  --c-gold:     #f0a020;
  --c-gold-d:   #c07810;
  --c-green:    #3dc870;
  --c-red:      #e84545;
  --c-orange:   #f08020;
  --c-blue:     #4e8ef7;
  --c-purple:   #a855f7;

  --nav-h: 56px;
  --r:     8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.55);
}

:root[data-theme="light"] {
  --c-bg:       #f4f5fb;
  --c-surface:  #ffffff;
  --c-card:     #ffffff;
  --c-card2:    #f0f0f5;
  --c-border:   rgba(0,0,0,0.08);
  --c-border2:  rgba(0,0,0,0.04);
  --c-text:     #1c1f2e;
  --c-muted:    #6a6a8a;
  --c-dim:      #a0a0b8;
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
}

/* Theme-Icon-Sichtbarkeit */
:root[data-theme="dark"]  .theme-icon-light { display: none; }
:root[data-theme="light"] .theme-icon-dark  { display: none; }

/* Copy-to-Clipboard chip */
[data-copy] { cursor: pointer; transition: all 0.15s ease; }
[data-copy].copied { background: var(--c-green); color: white; padding: 0 4px; border-radius: 3px; }

/* HTMX-Spinner / loading marker */
[hx-get].htmx-request { opacity: 0.7; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

a { color: var(--c-text); text-decoration: none; }
a:hover { color: var(--c-gold); }
code {
  background: var(--c-card);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'Consolas', monospace;
}

/* ── Navigation ─────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--nav-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* Fallback: lieber umbrechen als überlappen */
  padding: 0 20px;
  gap: 0;
  box-shadow: 0 2px 16px rgba(0,0,0,0.5);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--c-text);
  font-weight: 700;
  font-size: 15px;
  margin-right: 16px;
  white-space: nowrap;
  flex-shrink: 0;
}
.navbar-brand img {
  width: 34px; height: 34px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--c-card2);
}
.navbar-brand .brand-name { color: var(--c-gold); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: max-content; /* nie unsichtbar abschneiden — eher Zeilenumbruch */
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--r);
  text-decoration: none;
  color: var(--c-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--c-text); background: var(--c-card); }
.nav-link.active { color: var(--c-gold); background: rgba(240,160,32,0.1); }
.nav-icon { font-size: 15px; }

.navbar-search {
  margin-left: auto;
  margin-right: 12px;
  flex-shrink: 0;
}
.navbar-search-input {
  background: var(--c-card2);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-family: inherit;
  width: 180px;
  transition: border-color .15s, width .2s;
}
.navbar-search-input:focus {
  outline: none;
  border-color: var(--c-gold);
  width: 240px;
}
.navbar-search-input::placeholder { color: var(--c-dim); }

.navbar-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.navbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-muted);
}
.navbar-user .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--c-card2);
}
.navbar-user .username { color: var(--c-text); font-weight: 500; }

/* ── Nav: "Kriege"-Dropdown (Details-Pattern, tastaturbedienbar) ── */
.nav-dd { position: relative; }
.nav-dd > summary { list-style: none; cursor: pointer; user-select: none; }
.nav-dd > summary::-webkit-details-marker { display: none; }
.nav-dd > summary::marker { content: none; }
.nav-dd-caret { font-size: 9px; opacity: .75; margin-left: 1px; }
.nav-dd[open] > summary { color: var(--c-text); background: var(--c-card); }
.nav-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 185px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  z-index: 120;
}
.nav-dd-menu .nav-link { width: 100%; }

/* ── Nav: Burger-Button (nur mobil sichtbar) ── */
.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin-left: 8px;
  background: var(--c-card2);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.nav-burger:hover { border-color: var(--c-gold); color: var(--c-gold); }

/* ── A11y-Utilities: Screenreader-only + Skip-Link ── */
.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 300;
  background: var(--c-gold);
  color: #241500;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 0 0 8px 8px;
  transition: top .15s;
}
.skip-link:focus { top: 0; color: #241500; }

/* ── HTMX-Fehler-Toast (unaufdringlich, verschwindet nach 5s) ── */
.net-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 400;
  max-width: min(92vw, 420px);
  background: var(--c-surface);
  color: var(--c-text);
  border: 2px solid var(--c-border);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.net-toast.show { opacity: 1; }

/* ── Layout ──────────────────────────────────────────────── */
.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 24px;
}
.page-meta {
  font-size: 12px;
  color: var(--c-dim);
  margin-bottom: 18px;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(520px,100%), 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px,100%), 1fr)); gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mb-16  { margin-bottom: 16px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--c-card);
  border-radius: var(--r);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.card-header {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 16px 18px; }
.card-body-flush { padding: 0; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  transition: opacity 0.15s, filter 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.1); }
.btn-gold     { background: var(--c-gold); color: #000; }
.btn-primary  { background: var(--c-gold); color: #000; }
.btn-ghost    { background: transparent; color: var(--c-text); border: 1px solid var(--c-border); }
.btn-ghost:hover { background: var(--c-card2); filter: none; }
.btn-sm       { padding: 6px 12px; font-size: 12px; }

/* ── Clan hero ───────────────────────────────────────────── */
.clan-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: var(--c-card);
  border-radius: var(--r);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow);
}
.clan-hero img.clan-badge {
  width: 72px; height: 72px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--c-surface);
  flex-shrink: 0;
}
.clan-hero-body { flex: 1; min-width: 0; }
.clan-hero-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clan-hero-tag { font-size: 12px; color: var(--c-muted); margin-bottom: 8px; }
.clan-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--c-muted);
}
.clan-hero-pill {
  background: var(--c-surface);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 4px;
}
.clan-hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.hs { text-align: center; }
.hs-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--c-gold);
  line-height: 1;
}
.hs-lbl {
  font-size: 10px;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 2px;
}

/* ── Stat boxes ──────────────────────────────────────────── */
.stat-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.stat-box {
  background: var(--c-surface);
  border-radius: 6px;
  padding: 10px 14px;
  flex: 1;
  min-width: 110px;
  border: 1px solid var(--c-border);
}
.stat-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  margin-bottom: 4px;
}
.stat-val { font-size: 20px; font-weight: 700; color: #fff; }
.stat-sub { font-size: 10px; color: var(--c-muted); margin-top: 1px; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}
.b-win, .badge-win   { background: rgba(61,200,112,.2);  color: var(--c-green); border: 1px solid rgba(61,200,112,.35); }
.b-lose, .badge-loss { background: rgba(232,69,69,.2);   color: var(--c-red);   border: 1px solid rgba(232,69,69,.35); }
.b-tie, .badge-tie   { background: rgba(240,160,32,.2);  color: var(--c-gold);  border: 1px solid rgba(240,160,32,.35); }
.badge-cwl           { background: rgba(168,85,247,.2);  color: var(--c-purple); border: 1px solid rgba(168,85,247,.35); }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.r-leader,   .role-leader   { background: rgba(240,160,32,.2);   color: var(--c-gold); }
.r-coLeader, .role-co       { background: rgba(232,69,69,.2);    color: var(--c-red); }
.r-elder,    .role-admin    { background: rgba(78,142,247,.2);   color: var(--c-blue); }
.r-member,   .role-member   { background: rgba(120,120,154,.15); color: var(--c-muted); }

.th-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 20px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  background: rgba(240,160,32,.15);
  color: var(--c-gold);
  border: 1px solid rgba(240,160,32,.3);
  padding: 0 4px;
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.dt {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.dt th {
  text-align: left;
  padding: 8px 10px;
  color: var(--c-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  user-select: none;
}
table.dt td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}
table.dt tr:last-child td { border-bottom: none; }
table.dt tbody tr:hover td { background: var(--c-card2); }
.c-pos  { color: var(--c-dim); font-size: 12px; width: 40px; }
.c-name { font-weight: 600; color: #fff; }
.c-r    { text-align: right; }
.c-c    { text-align: center; }

/* ── Member link ─────────────────────────────────────────── */
.member-link {
  color: var(--c-text);
  text-decoration: none;
  transition: color 0.15s;
}
.member-link:hover { color: var(--c-gold); text-decoration: underline; }

.check-mark {
  background: var(--c-green);
  color: #0f1d12;
  width: 14px; height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── League icon ─────────────────────────────────────────── */
.league-icon-sm { width: 20px; height: 20px; vertical-align: middle; object-fit: contain; }
.league-icon-md { width: 32px; height: 32px; flex-shrink: 0; object-fit: contain; }
.league-icon-xl { width: 92px; height: 92px; object-fit: contain; }

/* ── Section label ───────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  margin: 14px 0 8px;
}

/* ── Player hero (profile) ───────────────────────────────── */
.player-hero {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
  padding: 18px 20px;
  background: var(--c-card);
  border-radius: var(--r);
  border: 1px solid var(--c-border);
}
.player-th {
  width: 72px; height: 72px;
  border-radius: 10px;
  background: var(--c-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
  color: var(--c-gold);
  border: 2px solid rgba(240,160,32,.3);
  flex-shrink: 0;
}
.player-body { flex: 1; min-width: 0; }
.player-name { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 2px; }
.player-tag  { font-size: 12px; color: var(--c-muted); margin-bottom: 8px; }
.player-pills { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--c-muted); }
.player-pill {
  background: var(--c-surface);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 4px;
}
.player-pill img {
  width: 16px; height: 16px;
  object-fit: contain;
  border-radius: 3px;
}
.player-league {
  text-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.player-league-name { font-size: 12px; font-weight: 600; color: var(--c-text); }
.player-league-sub { font-size: 11px; color: var(--c-muted); }

/* ── Heroes ──────────────────────────────────────────────── */
.heroes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.hero-card {
  background: var(--c-surface);
  border-radius: 6px;
  padding: 12px 10px;
  text-align: center;
  border: 1px solid var(--c-border);
}
.hero-card.hero-maxed { border-color: rgba(61,200,112,.5); }
.hero-name {
  font-size: 10px;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-lvl  { font-size: 26px; font-weight: 700; color: var(--c-gold); line-height: 1; }
.hero-max  { font-size: 10px; color: var(--c-dim); margin-top: 1px; }

/* ── Unit grid (troops, spells, equipment) ───────────────── */
.units-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 12px;
}
.unit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  padding: 7px 5px 6px;
  background: var(--c-card2);
  border: 1px solid var(--c-border);
  border-radius: 7px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.unit-card:hover { border-color: rgba(240,160,32,.3); }
.unit-card.unit-maxed {
  border-color: rgba(61,200,112,.4);
  background: rgba(61,200,112,.06);
}
.unit-name {
  color: var(--c-muted);
  font-size: 9px;
  line-height: 1.2;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.unit-lvl {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 1px;
}
.unit-max  { font-size: 9px; color: var(--c-muted); font-weight: 400; }

/* ── Progress bars ───────────────────────────────────────── */
.prog-wrap { margin: 6px 0; }
.prog-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.prog-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.prog-gold   { background: linear-gradient(90deg, var(--c-gold-d), var(--c-gold)); }
.prog-green  { background: linear-gradient(90deg, #27a055, var(--c-green)); }
.prog-red    { background: linear-gradient(90deg, #b02020, var(--c-red)); }
.prog-blue   { background: linear-gradient(90deg, #2255cc, var(--c-blue)); }
.prog-purple { background: linear-gradient(90deg, #7020cc, var(--c-purple)); }

/* ── Forms (Admin) ───────────────────────────────────────── */
.form-grid    { display: grid; grid-template-columns: 1fr; gap: 16px; }
.form-grid-2  { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.form-row     { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-weight: 500; font-size: 13px; color: var(--c-text); }
.form-row-divider { border-top: 1px solid var(--c-border); padding-top: 16px; margin-top: 4px; }

.select, .input-group input, input[type="text"], input[type="number"] {
  background: var(--c-card2);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
.select:focus, .input-group input:focus, input:focus {
  outline: none;
  border-color: var(--c-gold);
}
.select option { background: var(--c-card); }
.select optgroup { color: var(--c-muted); font-weight: 600; }

.input-group {
  display: flex; align-items: stretch;
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  overflow: hidden;
}
.input-group input { border: none; border-radius: 0; }
.input-suffix {
  padding: 10px 14px;
  background: var(--c-surface);
  color: var(--c-muted);
  font-size: 13px;
  border-left: 1px solid var(--c-border);
}
.form-actions {
  display: flex; gap: 12px; margin-top: 20px;
  position: sticky; bottom: 0;
  padding: 16px 0;
  background: linear-gradient(to top, var(--c-bg) 60%, transparent);
}
.readonly {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px;
}
.readonly > div { display: flex; flex-direction: column; }
.readonly dt { color: var(--c-muted); font-size: 11px; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.readonly dd { font-size: 14px; color: var(--c-text); }
.big-num { font-size: 22px; font-weight: 700; color: var(--c-gold); }

/* ── Flash banner ────────────────────────────────────────── */
.flash {
  padding: 14px 18px;
  border-radius: var(--r);
  margin-bottom: 20px;
  border: 1px solid;
}
.flash-success {
  background: rgba(61,200,112,.08);
  color: var(--c-green);
  border-color: rgba(61,200,112,.3);
}
.flash-error {
  background: rgba(232,69,69,.08);
  color: var(--c-red);
  border-color: rgba(232,69,69,.3);
}

/* ── Misc info boxes ─────────────────────────────────────── */
.error-box {
  background: rgba(232,69,69,.1);
  border: 1px solid rgba(232,69,69,.3);
  border-radius: var(--r);
  padding: 14px 18px;
  color: var(--c-red);
  margin-bottom: 16px;
}
.info-box {
  background: rgba(78,142,247,.08);
  border: 1px solid rgba(78,142,247,.2);
  border-radius: var(--r);
  padding: 14px 18px;
  color: var(--c-blue);
  margin-bottom: 16px;
}
.empty-box {
  text-align: center;
  padding: 60px 24px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  color: var(--c-muted);
}
.empty-box h2 { color: var(--c-text); margin-bottom: 8px; }

.player-link { color: var(--c-text); text-decoration: none; }
.player-link:hover { color: var(--c-gold); }

.text-muted  { color: var(--c-muted); }
.text-dim    { color: var(--c-dim); }
.text-gold   { color: var(--c-gold); }
.text-green  { color: var(--c-green); }
.text-red    { color: var(--c-red); }
.text-orange { color: var(--c-orange); }
.text-purple { color: var(--c-purple); }
.text-blue   { color: var(--c-blue); }
.fw7 { font-weight: 700; }

/* ── Landing hero ────────────────────────────────────────── */
.lp-hero {
  background: linear-gradient(135deg, #0e0e22 0%, #13132c 55%, #181030 100%);
  border: 1px solid rgba(240,160,32,.22);
  border-radius: var(--r);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.lp-hero-inner {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 28px 28px 16px;
  position: relative;
}
.lp-hero-glow {
  position: absolute;
  top: -80px; left: -80px;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(240,160,32,.14) 0%, transparent 70%);
  pointer-events: none;
}
.lp-badge {
  width: 100px; height: 100px;
  border-radius: 14px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 20px rgba(240,160,32,.35));
}
.lp-info { flex: 1; min-width: 0; }
.lp-name {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 6px;
}
.lp-tag {
  font-size: 12px;
  color: var(--c-dim);
  font-family: Consolas, monospace;
  margin-bottom: 10px;
}
.lp-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lp-pill {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  font-size: 12px;
  color: var(--c-muted);
}
.lp-desc {
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.5;
  max-width: 520px;
}
.lp-war-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  flex-shrink: 0;
  background: rgba(0,0,0,.2);
  border-left: 1px solid var(--c-border);
  padding: 20px 24px;
  border-radius: 0 var(--r) 0 0;
}
.lp-winbar {
  padding: 14px 28px;
  border-top: 1px solid var(--c-border);
  background: rgba(0,0,0,.15);
}
.lp-winbar-track {
  height: 5px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.lp-winbar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}
.lp-winbar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--c-muted);
}

/* card with left accent border */
.card-accent {
  border-left: 3px solid var(--accent, var(--c-border));
}

/* ── Home banner (legacy) ─────────────────────────────────── */
.home-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  border: 1px solid rgba(240,160,32,.25);
  margin-bottom: 16px;
  box-shadow: 0 6px 32px rgba(0,0,0,.6);
  background: linear-gradient(135deg, #16162e 0%, #1a1a38 60%, #1e1832 100%);
}
.home-banner-glow {
  position: absolute;
  top: -60px; left: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(240,160,32,.18) 0%, transparent 70%);
  pointer-events: none;
}
.home-banner-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 24px 16px;
}
.home-body  { flex: 1; min-width: 0; }
.home-name  { font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 8px; letter-spacing: -0.5px; }
.home-meta  { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.home-pill  {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  font-size: 12px;
  color: var(--c-muted);
}
.home-desc  { font-size: 12px; color: var(--c-muted); margin-top: 4px; line-height: 1.5; }
.home-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.home-hint    { font-size: 12px; color: var(--c-muted); margin-top: 10px; }

/* ── Profil: einklappbare Account-Karten (/me) ───────────────── */
.acc {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  margin-bottom: 12px;
  overflow: hidden;
}
.acc-sum {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.acc-sum::-webkit-details-marker { display: none; }
.acc-sum::after {
  content: "❯";
  margin-left: 2px;
  color: var(--c-muted);
  font-size: 12px;
  transition: transform .15s ease;
}
.acc[open] > .acc-sum::after { transform: rotate(90deg); }
.acc[open] > .acc-sum { border-bottom: 1px solid var(--c-border); }
.acc-sum:hover { background: var(--c-card2); }
.acc-sum-th { flex-shrink: 0; display: flex; align-items: center; }
.acc-sum-th img { display: block; }
.acc-sum-th-ph { font-size: 30px; line-height: 1; }
.acc-sum-id { display: flex; flex-direction: column; min-width: 0; }
.acc-sum-name {
  font-weight: 800; color: #fff; font-size: 15px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acc-sum-tag { font-size: 11px; color: var(--c-muted); }
.acc-sum-meta { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.acc-sum-clan {
  display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--c-muted);
  max-width: 170px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.acc-sum-clan img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.acc-sum-league { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; }
.acc-sum-troph { font-weight: 800; color: var(--c-gold); font-size: 14px; white-space: nowrap; }
.acc-body { padding: 14px 16px 2px; }
@media (max-width: 640px) {
  .acc-sum-clan { display: none; }
  .acc-sum { gap: 9px; padding: 10px 12px; }
  .acc-body { padding: 10px 10px 1px; }
}

/* Statistik-Diagramme: dunkler Backdrop, damit die hellen Achsen-Labels
   auf jedem Hintergrund (Holz/Dunkel) gut lesbar sind. */
.stats-canvas {
  height: 150px;
  background: rgba(0, 0, 0, .42);
  border: 1px solid rgba(0, 0, 0, .28);
  border-radius: 8px;
  padding: 8px 10px 6px;
}

/* ── War Map ─────────────────────────────────────────────── */
.wm-container { background:var(--c-card); border:1px solid var(--c-border); border-radius:var(--r); overflow:hidden; margin-bottom:4px; }
.wm-header { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:12px; padding:14px 16px; background:linear-gradient(135deg,rgba(20,20,50,.6),rgba(30,24,50,.6)); border-bottom:1px solid var(--c-border); }
.wm-header-side { display:flex; align-items:center; gap:10px; min-width:0; }
.wm-header-side-r { justify-content:flex-end; flex-direction:row-reverse; }
.wm-badge-img { width:48px; height:48px; object-fit:contain; border-radius:6px; flex-shrink:0; }
.wm-header-name { font-size:15px; font-weight:700; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wm-header-sub  { font-size:11px; color:var(--c-muted); }
.wm-name-r { text-align:right; }
.wm-header-score { text-align:center; flex-shrink:0; display:flex; flex-direction:column; align-items:center; gap:4px; }
.wm-score-block  { display:flex; align-items:center; gap:8px; }
.wm-score-stars  { font-size:20px; font-weight:800; color:var(--c-muted); }
.wm-score-lead   { color:var(--c-gold); }
.wm-score-sep    { font-size:18px; font-weight:700; color:var(--c-dim); }
.wm-score-destr  { font-size:11px; color:var(--c-muted); }
.wm-infobar { display:flex; justify-content:space-between; align-items:center; padding:7px 14px; background:rgba(0,0,0,.2); border-top:1px solid var(--c-border); font-size:12px; color:var(--c-muted); flex-wrap:wrap; gap:6px; }
.wm-ib-atts { font-weight:700; color:var(--c-gold); }
.wm-legend { display:flex; flex-wrap:wrap; gap:8px; padding:7px 16px; border-bottom:1px solid var(--c-border); background:rgba(255,255,255,.02); }
.wm-leg { font-size:11px; padding:2px 8px; border-radius:4px; border-left:3px solid; }
.wm-leg.wm-3star { border-color:var(--c-green); background:rgba(61,200,112,.08); }
.wm-leg.wm-2star { border-color:var(--c-gold);  background:rgba(240,160,32,.08); }
.wm-leg.wm-1star { border-color:#a07820;         background:rgba(160,120,32,.08); }
.wm-leg.wm-0star { border-color:#884444;         background:rgba(136,68,68,.08); }
.wm-leg.wm-none  { border-color:var(--c-dim);    background:rgba(255,255,255,.03); }
.wm-field { padding:8px 10px; display:flex; flex-direction:column; gap:5px; }
.wm-row   { display:grid; grid-template-columns:minmax(0,1fr) 6px minmax(0,1fr); gap:4px; align-items:stretch; }
.wm-vsline { width:6px; background:linear-gradient(180deg,rgba(255,200,0,.08),rgba(255,200,0,.18),rgba(255,200,0,.08)); border-radius:3px; align-self:stretch; }
.wm-card { border-radius:7px; border:1px solid var(--c-border); padding:7px 9px; background:var(--c-card2); transition:background .15s; min-height:58px; min-width:0; overflow:hidden; }
.wm-card:hover { background:rgba(255,255,255,.06); }
.wm-card-top   { display:flex; align-items:center; gap:6px; margin-bottom:5px; }
.wm-card-top-r { flex-direction:row-reverse; }
.wm-pos  { font-size:11px; font-weight:700; color:var(--c-muted); flex-shrink:0; min-width:24px; }
.wm-name { font-size:12px; font-weight:600; color:#ddd; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wm-sec-label { font-size:10px; color:var(--c-muted); text-transform:uppercase; letter-spacing:.4px; margin-top:4px; margin-bottom:2px; }
.wm-def-lbl   { color:rgba(200,200,200,.35); }
.wm-chips   { display:flex; flex-wrap:wrap; gap:3px; }
.wm-chips-r { justify-content:flex-end; }
.wm-def-chips { display:flex; flex-wrap:wrap; gap:3px; margin-top:2px; opacity:.6; }
.wm-chip { display:inline-flex; align-items:center; gap:3px; font-size:11px; padding:2px 7px; border-radius:10px; font-weight:600; }
.wm-chip-stars  { font-size:10px; letter-spacing:-.5px; }
.wm-chip-target { color:rgba(255,255,255,.8); }
.wm-chip-pct    { color:rgba(255,255,255,.65); font-size:10px; }
.chip-3 { background:rgba(61,200,112,.2);  border:1px solid rgba(61,200,112,.5);  color:var(--c-green); }
.chip-2 { background:rgba(240,160,32,.18); border:1px solid rgba(240,160,32,.4);  color:var(--c-gold); }
.chip-1 { background:rgba(200,140,40,.14); border:1px solid rgba(200,140,40,.3);  color:#c8a028; }
.chip-0 { background:rgba(180,60,60,.14);  border:1px solid rgba(180,60,60,.3);   color:#c06060; }
.wm-noatt { font-size:11px; color:var(--c-muted); font-style:italic; }
.wm-3star { border-left:3px solid var(--c-green); }
.wm-2star { border-left:3px solid var(--c-gold); }
.wm-1star { border-left:3px solid #a07820; }
.wm-0star { border-left:3px solid #884444; }
.wm-none  { border-left:3px solid var(--c-dim); }
.wm-card-them.wm-3star { border-right:3px solid var(--c-green); border-left:none; }
.wm-card-them.wm-2star { border-right:3px solid var(--c-gold);  border-left:none; }
.wm-card-them.wm-1star { border-right:3px solid #a07820;        border-left:none; }
.wm-card-them.wm-0star { border-right:3px solid #884444;        border-left:none; }
.wm-card-them.wm-none  { border-right:3px solid var(--c-dim);   border-left:none; }

/* ── Capital Raid Weekend ────────────────────────────────── */
.b-inwar { background: rgba(232,69,69,.2);   color: var(--c-red);   border: 1px solid rgba(232,69,69,.35); }
.b-ended { background: rgba(61,200,112,.2);  color: var(--c-green); border: 1px solid rgba(61,200,112,.35); }

.raid-details {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  margin-bottom: 10px;
  overflow: hidden;
}
.raid-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background .15s;
}
.raid-summary::marker            { display: none; }
.raid-summary::-webkit-details-marker { display: none; }
.raid-summary:hover { background: var(--c-card2); }
.raid-details[open] .raid-summary { border-bottom: 1px solid var(--c-border); }
.raid-sum-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.raid-arrow {
  font-size: 10px;
  color: var(--c-muted);
  transition: transform .2s;
  display: inline-block;
}
.raid-details[open] .raid-arrow { transform: rotate(90deg); }
.raid-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.raid-sum-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.raid-pill {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 20px;
  background: rgba(255,255,255,.07);
  color: var(--c-text);
  white-space: nowrap;
}
.raid-pill-gold  { background: rgba(240,160,32,.18); color: var(--c-gold);  font-weight: 700; }
.raid-pill-green { background: rgba(61,200,112,.18); color: var(--c-green); font-weight: 600; }
.raid-pill-red   { background: rgba(220,60,60,.18);  color: #f06060;        font-weight: 600; }
.raid-body { padding: 14px 16px 16px; }
.raid-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.raid-stat {
  background: var(--c-card2);
  border: 1px solid var(--c-border);
  border-radius: 7px;
  padding: 7px 12px;
  min-width: 90px;
  text-align: center;
}
.raid-stat-lbl { font-size: 11px; color: var(--c-muted); margin-bottom: 2px; }
.raid-stat-val { font-size: 16px; font-weight: 700; color: #fff; }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--c-border);
  padding: 24px 20px;
  margin-top: 60px;
  color: var(--c-dim);
  font-size: 12px;
  text-align: center;
}
.footer a { color: var(--c-muted); text-decoration: underline; }
.footer a:hover { color: var(--c-gold); }

/* ── Search page ─────────────────────────────────────────── */
.search-hero {
  background: linear-gradient(135deg, var(--c-card) 0%, var(--c-card2) 100%);
  border: 1px solid rgba(240,160,32,.2);
  border-radius: var(--r);
  padding: 28px 24px 20px;
  margin-bottom: 24px;
}
.search-hero-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.search-hero-sub {
  font-size: 13px;
  color: var(--c-muted);
  margin-bottom: 18px;
}
.search-form { display: flex; flex-direction: column; gap: 12px; }
.search-input-row { display: flex; gap: 8px; }
.search-input {
  flex: 1;
  background: var(--c-bg);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color .15s;
}
.search-input:focus { outline: none; border-color: var(--c-gold); }
.search-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.search-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.search-filter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-muted);
  font-weight: 600;
}
.search-chip {
  position: relative; /* Anker für das sr-only-Radio */
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--c-card2);
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
/* Radios per sr-only-Technik verstecken (statt display:none):
   bleiben fokussier- und mit Pfeiltasten bedienbar. */
.search-chip input[type="radio"] {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.search-chip:has(input:focus-visible) {
  outline: 3px solid var(--coc-gold-2, var(--c-gold));
  outline-offset: 2px;
}
.search-chip.active,
.search-chip:has(input:checked) {
  background: rgba(240,160,32,.15);
  border-color: rgba(240,160,32,.45);
  color: var(--c-gold);
}
.search-chip:hover { border-color: rgba(240,160,32,.3); color: var(--c-text); }
/* Expliziter Filter-Submit-Button neben den Chips (WCAG 3.2.2) */
.search-filter-submit { margin-left: 4px; border-radius: 20px; }
.search-num-input {
  width: 56px;
  background: var(--c-bg);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: inherit;
  text-align: center;
}
.search-num-input:focus { outline: none; border-color: var(--c-gold); }

/* hint cards */
.search-hint { margin-top: 16px; }
.search-hint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.search-hint-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 18px;
}
.search-hint-icon  { font-size: 28px; margin-bottom: 8px; }
.search-hint-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.search-hint-body  { font-size: 12px; color: var(--c-muted); line-height: 1.6; }

/* player result card */
.search-player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--c-text);
  transition: border-color .15s, background .15s;
  margin-bottom: 4px;
}
.search-player-card:hover { border-color: rgba(240,160,32,.4); background: var(--c-card2); color: var(--c-text); }
.search-player-name { font-size: 18px; font-weight: 700; color: #fff; }
.search-player-tag  { font-size: 11px; color: var(--c-dim); font-family: Consolas, monospace; }
.search-player-clan { font-size: 12px; color: var(--c-muted); margin-top: 2px; display:flex; align-items:center; gap:4px; }
.search-player-stats { display: flex; align-items: center; gap: 8px; }
.search-arrow { font-size: 18px; color: var(--c-gold); margin-left: 8px; }

/* clan result grid */
.search-clan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.search-clan-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s;
}
.search-clan-card:hover { border-color: rgba(240,160,32,.3); }
.search-clan-top  { display: flex; gap: 12px; align-items: flex-start; }
.search-clan-badge { width: 52px; height: 52px; border-radius: 8px; object-fit: contain; flex-shrink: 0; }
.search-clan-name { font-size: 15px; font-weight: 700; color: #fff; }
.search-clan-tag  { font-size: 11px; color: var(--c-dim); font-family: Consolas, monospace; margin-bottom: 4px; }
.search-clan-desc { font-size: 11px; color: var(--c-muted); line-height: 1.4; }
.search-clan-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.search-clan-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255,255,255,.06);
  color: var(--c-muted);
  white-space: nowrap;
}
.search-clan-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Leaderboard ─────────────────────────────────────────── */
.leaderboard { list-style: none; padding: 0; }
.leaderboard li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border2);
}
.leaderboard li:last-child { border-bottom: none; }
.leaderboard .rank {
  background: var(--c-card2);
  border-radius: 6px;
  width: 28px;
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  padding: 3px 0;
  color: var(--c-muted);
}
.leaderboard li:nth-child(1) .rank { background: rgba(240,160,32,.25); color: var(--c-gold); }
.leaderboard li:nth-child(2) .rank { background: rgba(180,180,200,.18); color: #d0d0e0; }
.leaderboard li:nth-child(3) .rank { background: rgba(200,140,40,.18); color: #c8a028; }
.leaderboard .name { color: var(--c-text); font-weight: 500; }
.leaderboard .value { font-weight: 700; color: var(--c-gold); }

/* ── Donation bar (member row) ───────────────────────────── */
.don-numbers {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  white-space: nowrap;
}
.don-out  { color: var(--c-green); font-weight: 600; }
.don-in   { color: var(--c-muted); }
.don-bar {
  margin-top: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--c-surface);
  overflow: hidden;
  min-width: 60px;
}
.don-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-gold-d), var(--c-gold));
  border-radius: 999px;
}

/* ── Responsive ──────────────────────────────────────────── */

/* Breite Desktops (≤ 1380px): Suchfeld verkleinern, damit es die
   Nav-Links ("Hall of Fame"/"Suche") nicht überlappt. */
@media (max-width: 1380px) {
  .navbar-search-input { width: 130px; }
  .navbar-search-input:focus { width: 170px; }
}

/* ≤ 1280px: Username einsparen (Avatar + Logout reichen) */
@media (max-width: 1280px) {
  .navbar-user .username { display: none; }
}

/* ≤ 1230px: Suchfeld ausblenden — der Nav-Punkt "Suche" übernimmt */
@media (max-width: 1230px) {
  .navbar-search { display: none; }
}

/* ≤ 1100px: Burger-Menü statt unsichtbarem Scrollstreifen.
   Alle Links liegen in einem aufklappbaren Panel unter der Navbar —
   voll beschriftet, ≥44px Touch-Targets, nichts liegt unter
   Clan-Switcher oder Login-Button. */
@media (max-width: 1100px) {
  .nav-burger { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: 0;
    padding: 10px 12px 14px;
    background: var(--c-surface);
    border-bottom: 2px solid var(--c-border);
    box-shadow: 0 16px 28px rgba(0,0,0,.5);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    z-index: 110;
  }
  .navbar.nav-open .nav-links { display: flex; }
  .nav-link { min-height: 44px; padding: 10px 14px; font-size: 14px; }
  /* Kriege-Untermenü im Panel: eingerückt statt Overlay */
  .nav-dd { position: static; }
  .nav-dd > summary { width: 100%; }
  .nav-dd-menu {
    position: static;
    min-width: 0;
    margin: 2px 0 4px;
    padding: 4px 4px 4px 16px;
    background: rgba(0,0,0,.18);
    border: none;
    box-shadow: none;
  }
}

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
  .lp-war-stats { border-left: none; border-top: 1px solid var(--c-border); border-radius: 0 0 var(--r) 0; flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 14px 20px; gap: 20px; }
}

/* Mobile (≤ 680px) */
@media (max-width: 680px) {
  /* Layout */
  .page { padding: 10px 12px; }

  /* Navbar: kompakt — Links liegen im Burger-Panel (Labels bleiben sichtbar!) */
  .navbar { padding: 0 10px; gap: 0; min-height: 52px; }
  .navbar-brand .brand-name { display: none; }
  .navbar-user .avatar { width: 26px; height: 26px; }
  .btn-sm { padding: 8px 12px; font-size: 11px; }

  /* Touch-Targets: Filterchips greifbar machen */
  .search-chip { padding: 10px 14px; }
  .chip { padding: 10px 14px; }

  /* Search page: full-width */
  .search-hero { padding: 16px; }
  .search-form { flex-direction: column; gap: 8px; }
  .search-input { font-size: 15px; }
  .search-clan-grid { grid-template-columns: 1fr; }
  .search-filters { flex-wrap: wrap; gap: 6px; }

  /* Tables */
  table.dt th, table.dt td { padding: 7px 8px; font-size: 12px; }

  /* Cards */
  .card-body { padding: 12px 14px; }
  .card-header { padding: 10px 14px; }

  /* Landing page hero */
  .lp-hero-inner { flex-direction: column; gap: 14px; padding: 16px 14px 12px; }
  .lp-badge { width: 68px; height: 68px; }
  .lp-name { font-size: 22px; }
  .lp-war-stats { flex-direction: row; flex-wrap: wrap; justify-content: center; border-left: none; border-top: 1px solid var(--c-border); border-radius: 0; padding: 12px 16px; gap: 16px; }
  .lp-winbar { padding: 10px 16px; }

  /* Clan hero */
  .clan-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .clan-hero img.clan-badge { width: 56px; height: 56px; }
  .clan-hero-name { font-size: 20px; }
  .clan-hero-stats { gap: 14px; }

  /* Player hero */
  .player-hero { flex-direction: column; gap: 12px; }

  /* War map: stack us/them vertically */
  .wm-header { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .wm-header-side-r { flex-direction: row; justify-content: flex-start; }
  .wm-name-r { text-align: left; }
  .wm-header-score { order: -1; flex-direction: row; gap: 12px; align-items: center; justify-content: center; background: rgba(0,0,0,.2); border-radius: var(--r); padding: 8px 12px; }
  .wm-score-destr { order: 2; }
  .wm-row { grid-template-columns: 1fr; gap: 3px; }
  .wm-vsline { display: none; }
  .wm-card-them { border-left: 1px solid var(--c-border); border-right: none; }
  .wm-card-them.wm-3star { border-left: 3px solid var(--c-green); border-right: none; }
  .wm-card-them.wm-2star { border-left: 3px solid var(--c-gold);  border-right: none; }
  .wm-card-them.wm-1star { border-left: 3px solid #a07820;        border-right: none; }
  .wm-card-them.wm-0star { border-left: 3px solid #884444;        border-right: none; }
  .wm-card-them.wm-none  { border-left: 3px solid var(--c-dim);   border-right: none; }
  .wm-card-top-r { flex-direction: row; }
  .wm-chips-r { justify-content: flex-start; }
  .wm-field { padding: 6px 8px; }
  .wm-infobar { padding: 6px 12px; font-size: 11px; }
  .wm-legend { padding: 6px 12px; gap: 5px; }

  /* Capital */
  .raid-summary { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; }
  .raid-sum-pills { flex-wrap: wrap; gap: 4px; }
  .raid-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px 12px; }
  .raid-stat { padding: 8px 10px; }
  .raid-body { padding: 10px; }
  .section-label { padding: 6px 10px; }

  /* Grids */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .heroes-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
  .units-grid  { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }

  /* Stat boxes */
  .stat-box { min-width: 80px; padding: 10px 12px; }
  .stat-val  { font-size: 20px; }

  /* Home legacy */
  .home-banner-inner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px 14px 10px; }
  .home-name { font-size: 20px; }
}

/* Small phones (≤ 400px) */
@media (max-width: 400px) {
  .page { padding: 8px 8px; }
  .navbar { padding: 0 8px; }
  table.dt th, table.dt td { padding: 5px 6px; font-size: 11px; }
  .wm-name { font-size: 11px; }
  .wm-chip { font-size: 10px; padding: 2px 5px; }
  .lp-name { font-size: 19px; }
  .raid-stats { grid-template-columns: 1fr 1fr; }
}


/* ── Empty-States (3.7) ────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 20px 12px;
}
.empty-icon { font-size: 32px; margin-bottom: 6px; }
.empty-title { font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.empty-hint { font-size: 12px; }

/* ── Quick-Filter Roster (QoL 3) ──────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 0 0 14px 0;
}
.filter-bar input {
  flex: 1; min-width: 200px;
  padding: 7px 10px; border-radius: var(--r);
  background: var(--c-card2); color: var(--c-text);
  border: 1px solid var(--c-border);
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 10px; border-radius: 999px;
  background: var(--c-card2); color: var(--c-text);
  border: 1px solid var(--c-border);
  font-size: 12px; cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--c-gold); }
.chip.active { background: var(--c-gold); color: #000; border-color: var(--c-gold); }
.member-row.hidden { display: none !important; }

/* ── CWL-Roster-Planner (QoL 15 / F1) ─────────────────────────────────── */
.cwl-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .cwl-grid { grid-template-columns: 1fr; } }
.cwl-pool, .cwl-team {
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--r); padding: 10px; min-height: 200px;
}
.cwl-team { border-color: var(--c-gold); }
.cwl-card {
  background: var(--c-card2); padding: 8px 10px; margin-bottom: 6px;
  border-radius: 6px; cursor: grab;
  display: flex; align-items: center; justify-content: space-between;
}
.cwl-card:hover { background: var(--c-surface); }
.sortable-ghost { opacity: 0.4; }
.sortable-drag { opacity: 0.8; }

/* ── Recruitment public page (F18) ────────────────────────────────────── */
.req-list { list-style: none; padding: 0; }
.req-list li { padding: 6px 0; border-bottom: 1px solid var(--c-border2); }

/* ── Permissions checker (QoL 5) ──────────────────────────────────────── */
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th, .perm-table td {
  padding: 8px 10px; text-align: left;
  border-bottom: 1px solid var(--c-border2); font-size: 13px;
}
.perm-yes { color: var(--c-green); }
.perm-no  { color: var(--c-red); }

/* ── war-card vs landing layout helpers ───────────────────────────────── */
.war-card .war-headline {
  display: flex; align-items: center; gap: 12px;
}
.war-card .opp-badge { width: 48px; height: 48px; }
.war-card .war-score { font-size: 18px; font-weight: 700; }
.capital-loot { font-size: 22px; font-weight: 700; color: var(--c-gold); margin: 6px 0; }
.capital-meta { display: flex; gap: 12px; font-size: 12px; color: var(--c-muted); }

/* F22 Phase 3a — Navbar Clan-Switcher */
.navbar-select {
  background: var(--c-card2);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 4px 26px 4px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%237a7a9a' stroke-width='1.5' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.navbar-select:hover { border-color: var(--c-gold); }

/* ── Mobile polish (Politur) ── */
/* Optional/secondary columns: shown on desktop, hidden on small phones.
   Add `col-optional` to the least-important <th>/<td> (and matching <col>). */
@media (max-width: 600px) {
  .col-optional { display: none !important; }

  /* Fixed-width colgroup tables (capital / clan / clan_profile) squeeze badly
     on phones — let them flow naturally and wrap long names. */
  table.dt { table-layout: auto; }
  table.dt td.c-name { white-space: normal; word-break: break-word; }
  table.dt td.c-name a.player-link { word-break: break-word; }
}

/* Warlog clan-stats: stack vertically and drop dividers on very small phones. */
@media (max-width: 400px) {
  .warlog-stats { flex-direction: column; gap: 10px; }
  .warlog-divider { display: none; }
}

/* ── C1: '⚡ Jetzt wichtig' auf /me ──────────────────────────────────────────
   Dunkles Backing nach dem Muster von coc-theme .leaderboard li (bleibt auch
   auf Textur-Hintergründen lesbar) — coc-theme.css selbst bleibt unangetastet,
   alle Regeln leben additiv hier. */
.me-now-card {
  background: rgba(16, 12, 7, .62);
  border: 1px solid rgba(0, 0, 0, .5);
  border-left: 3px solid var(--c-gold);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .3);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.me-now-title {
  font-size: 14px; font-weight: 800;
  color: var(--c-gold); letter-spacing: .02em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
  margin-bottom: 6px;
}
.me-now-acc { padding: 7px 0 4px; }
.me-now-acc + .me-now-acc { border-top: 1px solid rgba(255, 255, 255, .08); }
.me-now-acc-name {
  font-size: 13px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
  margin-bottom: 2px;
}
.me-now-acc-tag { font-size: 11px; font-weight: 400; color: var(--c-muted); margin-left: 4px; }
.me-now-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
  padding: 3px 0; font-size: 13px; color: var(--c-text);
}
.me-now-row strong { color: var(--c-gold); font-weight: 800; }
.me-now-row.is-muted { color: var(--c-muted); }
.me-now-link { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--c-gold); white-space: nowrap; }
.me-now-link:hover { color: var(--c-gold); text-decoration: underline; }

/* ── C2: eigene Accounts auf /capital (Gold-Outline + 'Du'-Badge) ───────────
   Additiv zu coc-theme .coc-table. style.css lädt VOR coc-theme.css, daher
   der .coc-root-Prefix für höhere Spezifität als `.coc-table tbody tr.is-alt`.
   Der Gold-Rahmen läuft über die td-Border, damit die 9px-Eckenrundung der
   Zeilen-Pille erhalten bleibt (Outline/Box-Shadow auf <tr> wäre eckig). */
.coc-root .coc-table tbody tr.is-me {
  background-image: linear-gradient(180deg, #6e5a2e, #4a3a17);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.coc-root .coc-table tbody tr.is-me > td { border-color: var(--c-gold); }
.me-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--c-gold), var(--c-gold-d));
  color: #2a1c0d; font-size: 10px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
  vertical-align: 1px; text-shadow: none;
}
