/* ============================================================
   Good Vibes Only Pug – SR+ Punkte – WoW-Classic-Stil
   Palette:
     --stone-0  #0e0c08  tiefer Hintergrund
     --stone-1  #17130c  Panel
     --stone-2  #211b11  Panel hell
     --gold     #c8a24b  Gold-Rahmen/Akzent
     --gold-lt  #e8c874  Gold hell
     --parch    #e8dcc0  Text (Pergament)
     --muted    #a2937040
   ============================================================ */
:root {
  --stone-0: #0e0c08;
  --stone-1: #17130c;
  --stone-2: #211b11;
  --gold: #c8a24b;
  --gold-lt: #e8c874;
  --parch: #e8dcc0;
  --muted: #a89a76;
  --red: #a5302a;
  --green: #6a9a3c;
  --line: #4a3c1e;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "EB Garamond", Georgia, serif;
  color: var(--parch);
  background:
    radial-gradient(1200px 600px at 50% -10%, #241d10 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 110%, #1a1408 0%, transparent 55%),
    var(--stone-0);
  background-attachment: fixed;
}

a { color: var(--gold-lt); text-decoration: none; }
a:hover { color: #fff; }
.muted { color: var(--muted); }
h1, h2, h3 { font-family: "Cinzel", serif; letter-spacing: 0.02em; color: var(--gold-lt); font-weight: 600; }

/* ---------- Kopfleiste ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: linear-gradient(180deg, #211a0f, #120e08);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }

/* Sprachumschalter */
.lang-switch { display: flex; gap: 4px; margin-left: auto; }
.lang-btn {
  font-family: "Cinzel", serif; font-size: 12px; letter-spacing: 0.06em;
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 3px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.lang-btn:hover { color: var(--gold-lt); border-color: var(--gold); }
.lang-btn.active { color: #1a1206; background: var(--gold); border-color: var(--gold); }
.brand-mark { color: var(--gold); font-size: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: "Cinzel", serif; font-size: 22px; color: var(--gold-lt); letter-spacing: 0.06em; }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }
.mainnav { display: flex; gap: 22px; margin-left: 8px; }
.mainnav a { font-family: "Cinzel", serif; font-size: 15px; color: var(--parch); padding-bottom: 4px; border-bottom: 2px solid transparent; }
.mainnav a.active { color: var(--gold-lt); border-color: var(--gold); }
.auth-area { margin-left: 12px; display: flex; align-items: center; gap: 12px; font-size: 15px; }

/* ---------- Layout ---------- */
.view { max-width: 1080px; margin: 34px auto 60px; padding: 0 22px; }
.footer { text-align: center; padding: 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* ---------- Panels mit Goldrahmen ---------- */
.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(40, 32, 18, 0.6), rgba(16, 12, 7, 0.85)),
    var(--stone-1);
  border: 1px solid var(--gold);
  border-radius: 4px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0, 0, 0, 0.5);
  padding: 22px 24px;
}
.panel::before, .panel::after {
  content: "◆";
  position: absolute;
  color: var(--gold);
  font-size: 12px;
  opacity: 0.8;
}
.panel::before { top: 6px; left: 8px; }
.panel::after { bottom: 6px; right: 8px; }

.page-title { font-size: 30px; margin: 0 0 6px; }
.page-sub { color: var(--muted); margin: 0 0 26px; font-size: 16px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: "Cinzel", serif;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #2a2213, #1a1409);
  color: var(--parch);
  cursor: pointer;
  transition: 0.15s;
  letter-spacing: 0.03em;
}
.btn:hover { border-color: var(--gold); color: #fff; }
.btn-gold { border-color: var(--gold); color: var(--gold-lt); }
.btn-gold:hover { background: linear-gradient(180deg, #3a2f18, #241b0c); box-shadow: 0 0 12px rgba(200, 162, 75, 0.35); }
.btn-danger:hover { border-color: var(--red); color: #ffbdbd; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

input, select {
  font-family: "EB Garamond", serif;
  font-size: 16px;
  width: 100%;
  padding: 10px 12px;
  margin: 8px 0;
  background: #0d0a06;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--parch);
}
input:focus, select:focus { outline: none; border-color: var(--gold); }
label.field { display: block; margin: 12px 0 2px; color: var(--muted); font-size: 14px; }

/* ---------- Raid-Liste (Questlog-Optik) ---------- */
.raid-list { display: flex; flex-direction: column; gap: 12px; }
.raid-row {
  display: grid;
  grid-template-columns: 1fr max-content;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  cursor: pointer;
  border-left: 3px solid var(--gold);
}
.raid-row:hover { background: linear-gradient(90deg, rgba(200,162,75,0.10), transparent); }
.raid-row > div { min-width: 0; } /* damit lange Namen die Spalte nicht sprengen */
.raid-row .r-title {
  font-family: "Cinzel", serif; font-size: 19px; color: var(--gold-lt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.raid-row .r-date { font-family: "Spectral", serif; font-size: 17px; color: var(--parch); white-space: nowrap; }
.raid-row .r-meta { text-align: right; min-width: 104px; }
.raid-row .r-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
@media (max-width: 520px) {
  .raid-row { padding: 14px; gap: 10px; }
  .raid-row .r-title { font-size: 16px; }
  .raid-row .r-date { font-size: 15px; }
}

/* ---------- Zusammenfassung ---------- */
.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 720px) { .summary-grid { grid-template-columns: 1fr; } }
.card-title { font-size: 17px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px dashed rgba(74,60,30,0.5); }
.rank-list li:last-child { border-bottom: none; }
.rank-num { color: var(--gold); font-family: "Cinzel", serif; width: 20px; flex-shrink: 0; }
.rank-tag { color: var(--gold); font-family: "Cinzel", serif; min-width: 46px; flex-shrink: 0; letter-spacing: 0.5px; }
.rank-val { margin-left: auto; font-family: "Spectral", serif; color: var(--muted); white-space: nowrap; }
.pname { font-weight: 600; cursor: pointer; }
.pname:hover { text-decoration: underline; }
.badge {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--muted); font-family: "Cinzel", serif;
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; margin: 24px 0 18px; }
.tab { font-family: "Cinzel", serif; font-size: 14px; padding: 8px 16px; border: 1px solid var(--line); border-bottom: none; border-radius: 4px 4px 0 0; cursor: pointer; color: var(--muted); background: #14100a; }
.tab.active { color: var(--gold-lt); border-color: var(--gold); background: var(--stone-1); }

/* ---------- Punkte-Tabelle ---------- */
.table-wrap { overflow-x: auto; }
table.points { width: 100%; border-collapse: collapse; font-size: 14px; }
table.points th, table.points td { padding: 7px 8px; text-align: center; border-bottom: 1px solid rgba(74,60,30,0.5); white-space: nowrap; }
table.points th { font-family: "Cinzel", serif; color: var(--gold); font-weight: 600; font-size: 12px; position: sticky; top: 0; background: #14100a; }
table.points td.name { text-align: left; font-weight: 600; cursor: pointer; }
table.points td.name:hover { text-decoration: underline; }
table.points td.total { font-family: "Spectral", serif; font-weight: 700; color: var(--gold-lt); font-size: 16px; }
table.points tr:hover td { background: rgba(200,162,75,0.06); }
table.points td.zero { color: #4b4436; }
table.points td.rank { color: var(--muted); font-family: "Spectral", serif; }

/* Kompakte Punkte-Tabelle mit hochkanten Überschriften */
table.points.compact { font-size: 13px; }
table.points th.sortable { cursor: pointer; user-select: none; }
table.points th.sortable:hover { color: var(--gold-lt); background: #1b160d; }
table.points th.total-col { vertical-align: middle; font-size: 14px; }
table.points.compact th, table.points.compact td { padding: 3px 5px; }
table.points.compact td.name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
table.points.compact th.rot { height: 96px; padding: 4px 1px; vertical-align: bottom; }
table.points.compact th.rot > span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  white-space: nowrap; display: inline-block; line-height: 1.1; font-size: 12px;
}

/* Legende: was zählt wofür */
.legende .leg-row {
  display: grid; grid-template-columns: 210px 1fr; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid rgba(74,60,30,0.4);
}
.legende .leg-row:last-of-type { border-bottom: none; }
.legende .leg-key { font-family: "Cinzel", serif; color: var(--gold-lt); font-size: 13px; }
.legende .leg-val { font-size: 13px; color: var(--parch); }
.legende .leg-val a { color: var(--muted); text-decoration: none; }
.legende .leg-val a:hover { color: var(--gold-lt); text-decoration: underline; }
@media (max-width: 700px) { .legende .leg-row { grid-template-columns: 1fr; gap: 2px; } }
table.points.compact td.total { font-size: 15px; }
/* Spieler-Spalte beim Scrollen sichtbar lassen */
table.points.compact td.name, table.points.compact th.sticky-name {
  position: sticky; left: 0; background: #14100a; z-index: 1;
}
table.points.compact tr:hover td.name { background: #1b160d; }
input[type="file"] { padding: 8px; cursor: pointer; }
input[type="file"]::file-selector-button {
  font-family: "EB Garamond", serif; margin-right: 10px; padding: 6px 12px;
  background: #1c1710; color: var(--gold-lt); border: 1px solid var(--line);
  border-radius: 3px; cursor: pointer;
}
.group-head th { border-bottom: 2px solid var(--gold); color: var(--muted); font-size: 11px; letter-spacing: 0.05em; }

/* ---------- Spieler-Seite ---------- */
.player-head { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.player-name { font-family: "Cinzel", serif; font-size: 40px; }
.class-tag { font-size: 15px; padding: 3px 12px; border-radius: 12px; border: 1px solid currentColor; }
.player-total { margin-left: auto; text-align: right; }
.player-total .num { font-family: "Spectral", serif; font-size: 40px; color: var(--gold-lt); }

/* ---------- Review-Editor ---------- */
.review-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.review-table th, .review-table td { padding: 5px 6px; border-bottom: 1px solid rgba(74,60,30,0.5); text-align: center; }
.review-table th { font-family: "Cinzel", serif; font-size: 11px; color: var(--gold); }
.review-table td.name { text-align: left; }
.review-table td.na { color: rgba(160,140,100,0.35); }
.review-table input.br-item {
  width: 150px; font-size: 12px; padding: 2px 5px; background: #0d0a06;
  color: var(--parch); border: 1px solid var(--line); border-radius: 3px;
}
.br-badge {
  font-family: "Cinzel", serif; font-size: 10px; letter-spacing: 0.08em;
  color: #1a1206; background: var(--gold); padding: 1px 6px; border-radius: 3px;
}

/* Item-Qualitäten (wie im Spiel; Wowhead nutzt dieselben Klassen q0–q6) */
.item-link { text-decoration: none; font-weight: 500; }
.item-link:hover { text-decoration: underline; }
.item-link.q0, a.q0 { color: #9d9d9d !important; } /* schlecht  – grau   */
.item-link.q1, a.q1 { color: #ffffff !important; } /* gewöhnlich – weiß  */
.item-link.q2, a.q2 { color: #1eff00 !important; } /* ungewöhnlich – grün */
.item-link.q3, a.q3 { color: #0070dd !important; } /* selten    – blau   */
.item-link.q4, a.q4 { color: #a335ee !important; } /* episch    – lila   */
.item-link.q5, a.q5 { color: #ff8000 !important; } /* legendär  – orange */
.item-link.q6, a.q6 { color: #e6cc80 !important; } /* Artefakt          */
.loot-table th.sortable { cursor: pointer; user-select: none; }
.loot-table th.sortable:hover { color: var(--gold-lt); }
.cap-mark { font-size: 10px; color: var(--muted); font-family: "Cinzel", serif; }
tr.verfallen td { opacity: 0.45; }
tr.verfallen td.total { text-decoration: line-through; }
.review-table td.idinfo { font-family: monospace; font-size: 11px; color: var(--muted); }
.review-table td.idinfo a { color: var(--muted); text-decoration: none; }
.review-table td.idinfo a:hover { color: var(--gold-lt); text-decoration: underline; }
.review-table tbody tr:nth-child(even) td { background: rgba(200,162,75,0.07); }
.review-table tbody tr:hover td { background: rgba(200,162,75,0.16); }
.review-table input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--gold); transform: scale(1.25); cursor: pointer; }


/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(420px, 92vw); }
.modal-close { position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.modal-error { color: #ff9b9b; min-height: 20px; font-size: 14px; }
.ornate { text-align: center; }

/* ---------- Diverses ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.notice { padding: 12px 16px; border-left: 3px solid var(--gold); background: rgba(200,162,75,0.07); margin: 14px 0; font-size: 14px; }
.notice.warn { border-color: var(--red); background: rgba(165,48,42,0.08); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; }
.config-grid .fld label { font-size: 13px; color: var(--muted); }
.config-grid .fld input { margin-top: 2px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.right { text-align: right; }
.chip-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* ID-Tabelle in den Consume-Einstellungen */
.id-details { margin-top: 6px; }
.id-details summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.id-details summary:hover { color: var(--gold-lt); }
.id-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
.id-table td { padding: 3px 6px; border-bottom: 1px solid rgba(74,60,30,0.4); }
.id-table td.idcell { font-family: monospace; color: var(--gold-lt); width: 70px; }
.id-table a { color: var(--muted); text-decoration: none; }
.id-table a:hover { color: var(--gold-lt); text-decoration: underline; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.chip { font-family: "Cinzel", serif; font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; color: var(--muted); }
.chip.active { border-color: var(--gold); color: var(--gold-lt); background: rgba(200,162,75,0.08); }
.zone-scores { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(74,60,30,0.5); }
.zone-score .num { font-family: "Spectral", serif; font-size: 32px; color: var(--gold-lt); line-height: 1.1; }
textarea {
  font-family: monospace; background: #0d0a06; color: var(--parch);
  border: 1px solid var(--line); border-radius: 3px; padding: 8px; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--gold); }
