:root {
  --bg: #1e1f22;
  --panel: #2b2d31;
  --panel-2: #313338;
  --line: #3f4147;
  --text: #dbdee1;
  --muted: #949ba4;
  --accent: #5865f2;
  --green: #23a55a;
  --blue: #3498db;
  --red: #da373c;
  --gold: #f0b232;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "gg sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: #00a8fc; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
h1 { font-size: 1.6rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0; }
h3 { font-size: .95rem; margin: 0 0 .4rem; display: flex; align-items: center; gap: 6px; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .82rem; }
.right { text-align: right; }
.icon { vertical-align: middle; border-radius: 4px; flex: none; }

/* Kopfzeile */
.top {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { border-radius: 50%; }
.guild-icon { border-radius: 30%; vertical-align: middle; object-fit: cover; }
.guild-icon.placeholder { display: inline-grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; }
.switcher { position: relative; }
.switcher summary, .switcher-static { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 8px; font-weight: 600; }
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary:hover { background: var(--panel-2); }
.switcher .menu { position: absolute; top: 110%; left: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px; min-width: 220px; box-shadow: 0 8px 24px #0006; }
.switcher .menu a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--text); }
.switcher .menu a:hover { background: var(--line); text-decoration: none; }

.tabs { display: flex; gap: 4px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 20px 40px; flex: 1; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 16px; }

/* Knöpfe & Kleinkram */
.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 600; border: 0; cursor: pointer; }
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.small { padding: 4px 10px; font-size: .85rem; margin-top: 10px; }
.btn.discord { font-size: 1.05rem; padding: 12px 22px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.pill.green { background: #23a55a33; color: #57d68d; }
.pill.grey { background: #ffffff14; color: var(--muted); }
.pill.blue { background: #3498db33; color: #6cb6ec; }
.alert { background: #da373c22; border: 1px solid #da373c66; padding: 8px 12px; border-radius: 8px; }
.empty { color: var(--muted); margin: 0; }

.hero { text-align: center; padding: 60px 10px; }
.hero p { color: var(--muted); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.card h2 { margin-bottom: 10px; }

.guild-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card.guild { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 600; margin: 0; }
.card.guild:hover { border-color: var(--accent); text-decoration: none; }

/* Raid-Karte */
.raid { border-left: 4px solid var(--green); }
.raid-head { display: flex; gap: 14px; align-items: flex-start; }
.raid-img { border-radius: 8px; object-fit: contain; background: #0003; flex: none; }
.raid-title { flex: 1; min-width: 0; }
.raid-title h2 { margin: 0; }
.raid-no { color: var(--muted); font-weight: 400; font-size: .9rem; }
.raid-title p { margin: 2px 0; }
.content { color: var(--muted); font-weight: 600; }
.rel { color: var(--gold); font-weight: 600; margin-left: 6px; }
.delay { color: var(--gold); }
.raid-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.big { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.desc { white-space: pre-line; color: var(--text); background: var(--panel-2); padding: 8px 12px; border-radius: 8px; margin: 12px 0 0; }
.roles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.role { background: var(--panel-2); border-radius: 8px; padding: 10px; min-width: 0; }
.role .count { background: var(--line); border-radius: 99px; padding: 0 7px; font-size: .78rem; }
.role .avg { margin-left: auto; color: var(--muted); font-weight: 500; font-size: .78rem; }
.role ol { list-style: none; margin: 0; padding: 0; }
.role li { display: flex; align-items: center; gap: 6px; padding: 3px 0; border-top: 1px solid #ffffff0a; min-width: 0; }
.role li:first-child { border-top: 0; }
.role .num { color: var(--muted); font-size: .75rem; width: 1.4em; text-align: right; flex: none; }
.role .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.role .cp { color: var(--muted); font-size: .82rem; flex: none; }
.status { margin: 10px 0 0; color: var(--muted); }
.status b { color: var(--text); }

/* Tabellen */
.stats { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.stat { display: flex; flex-direction: column; padding: 6px 14px 6px 0; margin-right: 6px; border-right: 1px solid var(--line); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 99px; padding: 4px 12px 4px 6px; cursor: pointer; font: inherit; font-size: .85rem; }
.chip:hover { border-color: var(--muted); }
.chip.on { border-color: var(--accent); background: #5865f233; }
.search { width: 100%; max-width: 360px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; background: var(--panel-2); }
th.right, td.right { text-align: right; }
tbody tr:hover { background: #ffffff06; }
tbody tr:last-child td { border-bottom: 0; }
td.num { color: var(--muted); width: 1%; }
.cls { display: inline-flex; align-items: center; gap: 6px; }
th.sort { cursor: pointer; user-select: none; }
th.sort::after { content: " ↕"; opacity: .4; }
th.sort.desc::after { content: " ↓"; opacity: 1; }
th.sort.asc::after { content: " ↑"; opacity: 1; }
.card table { background: transparent; }
.card .table-wrap { border: 0; }
.bar-cell { width: 40%; min-width: 80px; }
.bar { display: block; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #8b93ff); min-width: 4px; }
.roles-inline { display: flex; gap: 8px; align-items: center; }
.roles-inline .icon { width: 16px; height: 16px; margin-right: 2px; }

@media (max-width: 860px) {
  .roles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  main { padding: 16px 12px 32px; }
  .top { padding: 8px 12px; gap: 8px; }
  .brand span, .me-name { display: none; }
  .tabs { padding: 0 8px; }
  .roles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .role { padding: 8px; }
  .raid-head { flex-wrap: wrap; }
  .raid-meta { flex-direction: row; align-items: baseline; gap: 8px; width: 100%; }
  .hide-sm { display: none; }
  th, td { padding: 7px 8px; }
}
