/* Taverne-Look: dunkel, warme Gold-Akzente, Serifen für Überschriften.
   Eigene Gestaltung -- keine Blizzard-Logos oder -Grafiken außer den
   Klassen-Icons aus der API. */
:root {
  color-scheme: dark;
  --page: #120f0b;
  --surface: #1d1812;
  --surface-2: #241d14;
  --border: #3a2f20;
  --text: #efe6d2;
  --text-2: #c9bb9c;
  --muted: #8f8370;
  --gold: #d9a646;
  --gold-2: #a77a2a;
  --gold-ink: #1a140c;
  --grid: #2e271d;
  --axis: #4a3f2f;
  --track: #2e271d;
  --up: #7fc56b;
  --danger: #e66767;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", Georgia, serif;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #241c12 0%, var(--page) 60%) fixed, var(--page);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--gold); }
h1, h2, h3, .serif { font-family: var(--serif); }
h2 { color: var(--gold); font-size: 1.25rem; letter-spacing: .04em; margin: 0 0 1rem; font-weight: 600; }
h3 { color: var(--text); font-size: 1.05rem; margin: 1.4rem 0 .6rem; }

/* --- Kopf ----------------------------------------------------------------- */
.topnav {
  display: flex; justify-content: flex-end; align-items: center; gap: 1rem;
  max-width: 1100px; margin: 0 auto; padding: .8rem 16px 0; flex-wrap: wrap; font-size: .92rem;
}
.topnav .who { color: var(--muted); }
.hero { text-align: center; padding: 1.2rem 16px 1rem; }
.hero .orn { color: var(--gold); letter-spacing: .6em; font-size: .8rem; margin-left: .6em; }
.hero h1 {
  margin: .25rem 0 0; font-size: clamp(1.8rem, 6vw, 2.5rem); letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); text-shadow: 0 2px 12px rgba(217, 166, 70, .25); font-weight: 600;
}
.hero h1 a { color: inherit; text-decoration: none; }
.hero p { margin: .2rem 0 0; color: var(--text-2); font-style: italic; font-family: var(--serif); }

main { max-width: 1100px; margin: 0 auto; padding: 0 16px 2rem; }
footer { max-width: 1100px; margin: 0 auto; padding: 0 16px 2.5rem; color: var(--muted); font-size: .82rem; text-align: center; }

/* --- Bausteine ------------------------------------------------------------ */
.panel {
  background: linear-gradient(180deg, #221c14, var(--surface));
  border: 1px solid var(--border); border-radius: 10px;
  padding: 1.2rem 1.4rem; margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.flash {
  border: 1px solid var(--border); border-left: 3px solid var(--up); background: var(--surface);
  padding: .6rem 1rem; border-radius: 8px; margin-bottom: 18px;
}
.back { display: inline-block; margin-bottom: 14px; }

.button, button {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px;
  padding: .42rem .95rem; border: 1px solid var(--gold); text-decoration: none;
  background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: var(--gold-ink);
}
.button:hover, button:hover { filter: brightness(1.08); }
button.secondary, .button.secondary { background: transparent; color: var(--text-2); border-color: var(--axis); font-weight: 500; }
button.link { background: none; border: none; color: var(--gold); padding: 0; font-weight: 400; text-decoration: underline; }
form.inline { display: inline-flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 0; }
input, textarea {
  font: inherit; color: var(--text); background: #15110c; border: 1px solid var(--axis);
  border-radius: 6px; padding: .4rem .55rem;
}
input:focus, textarea:focus { outline: 2px solid var(--gold-2); outline-offset: 1px; }
textarea { width: 100%; resize: vertical; }
label { color: var(--text-2); }

/* --- Kennzahlen ----------------------------------------------------------- */
.stats { display: flex; justify-content: center; gap: clamp(1.5rem, 6vw, 3.5rem); margin: .4rem 0 1.8rem; flex-wrap: wrap; }
.stats div { text-align: center; }
.stats b { display: block; font-family: var(--serif); font-size: 2rem; line-height: 1.15; }
.stats span { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; }

/* --- Char-Karten ---------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; margin-bottom: 26px; }
.char {
  position: relative; display: grid; grid-template-columns: 48px 1fr auto;
  grid-template-areas: "icon who lv" "bar bar bar" "extra extra extra" "note note note" "when when when";
  column-gap: .8rem; row-gap: .5rem; padding: 1rem 1.1rem; border-radius: 12px;
  background: linear-gradient(180deg, #241d14, var(--surface)); border: 1px solid var(--border);
  box-shadow: inset 3px 0 0 var(--cls, var(--gold)), 0 8px 22px rgba(0, 0, 0, .35);
  transition: transform .12s ease, border-color .12s ease;
}
.char:hover { transform: translateY(-2px); border-color: #4d3f2a; }
.char .cover { position: absolute; inset: 0; border-radius: 12px; z-index: 1; }
.char .cover:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.char .rank {
  position: absolute; top: -10px; left: -10px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: var(--gold); color: var(--gold-ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.char .icon { grid-area: icon; }
.icon {
  display: block; width: 48px; height: 48px; border-radius: 10px; background: var(--track);
  box-shadow: 0 0 0 2px var(--cls, var(--axis)), 0 0 14px color-mix(in srgb, var(--cls, #000) 35%, transparent);
}
.char .who { grid-area: who; min-width: 0; }
.char h3 { margin: 0; font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char h3 span, .title-surname { font-weight: 400; color: var(--muted); font-size: .92em; }
.char .meta { margin: .1rem 0 0; color: var(--text-2); font-size: .87rem; }
.char .lv { grid-area: lv; text-align: right; }
.char .lv b { display: block; font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.up { color: var(--up); font-weight: 600; font-size: .85rem; }
.bar { grid-area: bar; display: block; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.char .extra { grid-area: extra; margin: 0; color: var(--text-2); font-size: .87rem; }
.char .note { grid-area: note; margin: 0; color: var(--text-2); font-style: italic; }
.char .when { grid-area: when; margin: 0; color: var(--muted); font-size: .8rem; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--text-2); }

/* --- Char-Seite ------------------------------------------------------------ */
.charhead { display: grid; grid-template-columns: 72px 1fr auto; gap: 1.1rem; align-items: center; }
.charhead .icon { width: 72px; height: 72px; border-radius: 14px; }
.charhead h1 { margin: 0; font-size: 1.8rem; }
.charhead .meta { margin: .15rem 0 0; color: var(--text-2); }
.charhead .lv { text-align: right; }
.charhead .lv b { display: block; font-family: var(--serif); font-size: 2.8rem; line-height: 1; }
.charhead .lv span { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.charbar { margin: 1rem 0 .4rem; height: 8px; }
.quote { margin: 1.1rem 0 0; padding: .7rem 1rem; border-left: 3px solid var(--gold-2); background: #17130e; border-radius: 0 8px 8px 0; }
.quote p { margin: 0; font-style: italic; font-size: 1.05rem; }
.quote small { color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 0 0 .4rem; }
.facts div { background: #17130e; border: 1px solid var(--grid); border-radius: 8px; padding: .55rem .8rem; }
.facts dt { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; }
.facts dd { margin: .1rem 0 0; font-weight: 600; font-size: 1.05rem; }
.profs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem 1.2rem; }
.prof-top { display: flex; justify-content: space-between; gap: 1rem; }
.prof .bar { height: 5px; margin-top: .3rem; }

.gear { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.gear td, .gear th { padding: .45rem .6rem; border-top: 1px solid var(--grid); text-align: left; }
.gear th { color: var(--muted); font-weight: 500; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; border-top: 0; }
.gear .slot { color: var(--text-2); width: 9rem; }
.gear .item { font-weight: 600; }
.gear .num { text-align: right; }
.table-wrap { overflow-x: auto; }
.placeholder { text-align: center; padding: 1.2rem .5rem; color: var(--text-2); }
.placeholder .orn { color: var(--gold-2); letter-spacing: .5em; display: block; margin-bottom: .4rem; }

/* --- Meine Chars ------------------------------------------------------------ */
.row-form { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.edit-card { display: grid; gap: .8rem; }
.edit-card.is-hidden { opacity: .6; }
.edit-head { display: grid; grid-template-columns: 48px 1fr auto; gap: .8rem; align-items: center; }
.edit-head h3 { margin: 0; }
.edit-head .lv { font-family: var(--serif); font-size: 1.8rem; }
.flash-error { border-left-color: var(--danger); }
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.add-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; align-items: end; }
.add-form label { display: grid; gap: .3rem; font-size: .9rem; }
.add-form button { height: 2.35rem; }
.note-form { display: grid; gap: .45rem; }
.note-form button { justify-self: start; }

/* --- Level-Verlauf ---------------------------------------------------------- */
.range { display: inline-flex; flex-wrap: wrap; gap: 0; margin: 0 0 .8rem; border: 1px solid var(--axis); border-radius: 8px; overflow: hidden; }
.range button {
  background: transparent; color: var(--text-2); border: 0; border-right: 1px solid var(--axis);
  border-radius: 0; padding: .3rem .75rem; font-weight: 500; font-size: .88rem;
}
.range button:last-child { border-right: 0; }
.range button:hover { background: #2a2218; filter: none; }
.range button[aria-pressed="true"] { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: var(--gold-ink); font-weight: 650; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1rem; padding: 0; margin: 0 0 .5rem; font-size: .9rem; }
.legend li { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-2); }
.legend .swatch { width: 14px; height: 3px; border-radius: 2px; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .endlabel { fill: var(--text-2); font-size: 12px; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart .endpoint { stroke: var(--surface); stroke-width: 2; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.tooltip {
  position: absolute; pointer-events: none; background: #15110c; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: .45rem .65rem; font-size: .85rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5); white-space: nowrap; z-index: 2;
}
.tooltip .t-head { color: var(--text-2); margin-bottom: .25rem; }
.tooltip .t-row { display: flex; align-items: center; gap: .45rem; }
.tooltip .t-row b { margin-left: auto; padding-left: 1rem; font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .panel { padding: 1rem; }
  .charhead { grid-template-columns: 56px 1fr; }
  .charhead .icon { width: 56px; height: 56px; }
  .charhead .lv { grid-column: 1 / -1; text-align: left; display: flex; align-items: baseline; gap: .5rem; }
  .gear .slot { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .char { transition: none; }
  .char:hover { transform: none; }
}
