/* Kuschelecke portal. Dark by design (it's a WotLK realm); gold for headings,
   class colors for people, item-quality colors for loot. */
:root {
  --bg: #0b0e14;
  --bg-2: #10141c;
  --panel: #151b26;
  --panel-2: #1b2331;
  --border: #283245;
  --text: #e6e1d3;
  --muted: #98a2b3;
  --gold: #e4bf5a;
  --gold-2: #f0d17c;
  --alliance: #4f8fe0;
  --horde: #c94040;
  --on: #48c774;
  --off: #55607a;
  --danger: #e66767;
  --series-1: #3987e5;
  --series-2: #d95926;
  --radius: 10px;
  --font-display: "Cinzel", "Georgia", serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: radial-gradient(1200px 600px at 50% -200px, #1a2233 0%, var(--bg) 60%) fixed;
  color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5;
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; overflow-x: auto; margin: 6px 0; }
h1, h2, h3 { font-family: var(--font-display); color: var(--gold); font-weight: 600; letter-spacing: 0.02em; margin: 0 0 12px; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 18px; margin-bottom: 10px; }
h3.chart-title { font-family: var(--font); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin: 14px 0 4px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
ul.plain { margin: 0; padding-left: 18px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* top bar */
.topbar { border-bottom: 1px solid var(--border); background: rgba(11, 14, 20, 0.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 58px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 20px; color: var(--gold); }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(160deg, var(--gold-2), #9c7a1f); color: #1b1408; font-weight: 700; font-family: var(--font-display); }
.brand-mark.big { width: 64px; height: 64px; font-size: 34px; border-radius: 16px; margin: 0 auto 12px; box-shadow: 0 8px 30px rgba(228, 191, 90, 0.25); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav a.active { color: var(--gold-2); background: var(--panel); }

main { padding: 26px 16px 40px; }
.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px 30px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }
.footer .inline { display: inline; }
.linkish { background: none; border: 0; padding: 0; color: var(--gold-2); cursor: pointer; font: inherit; }
.linkish:hover { text-decoration: underline; }

/* cards, grids, stats */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h1, .card-head h2 { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 22px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-value { font-size: 26px; font-weight: 600; color: var(--gold-2); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat-hint { color: var(--muted); font-size: 12px; margin-top: 2px; }

.hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 22px; }
.hero-side { text-align: right; }
.realmlist { display: inline-block; margin: 4px 0 10px; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 8px; border-bottom: 1px solid rgba(40, 50, 69, 0.6); vertical-align: middle; }
.table tbody tr:hover { background: var(--panel-2); }
.table.kv td:first-child { color: var(--muted); width: 45%; }
.card .table { margin: 0 -4px; width: calc(100% + 8px); }

/* boards */
.board { margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.board li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(40, 50, 69, 0.6); counter-increment: rank; }
.board li::before { content: counter(rank); color: var(--muted); font-size: 12px; width: 18px; text-align: right; }
.board li:first-child::before { color: var(--gold-2); }
.board-value { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* bits */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; vertical-align: middle; }
.pill-on { background: rgba(72, 199, 116, 0.15); color: var(--on); }
.pill-off { background: rgba(230, 103, 103, 0.15); color: var(--danger); }
.pill-muted { background: rgba(152, 162, 179, 0.15); color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot-on { background: var(--on); box-shadow: 0 0 6px var(--on); }
.dot-off { background: var(--off); }
.faction { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 5px; border-radius: 4px; margin-right: 4px; }
.faction-alliance { color: var(--alliance); background: rgba(79, 143, 224, 0.15); }
.faction-horde { color: var(--horde); background: rgba(201, 64, 64, 0.15); }
.class-name { font-weight: 600; }
.char-link { font-weight: 600; }
.coin { font-variant-numeric: tabular-nums; }
.coin-g { color: #f0c75e; }
.coin-s { color: #c7c7c7; }
.coin-c { color: #c47b4a; }
.item { font-weight: 600; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented a { padding: 4px 12px; font-size: 13px; color: var(--muted); }
.segmented a.active { background: var(--panel-2); color: var(--gold-2); }
.segmented a:hover { text-decoration: none; color: var(--text); }
ol.steps { padding-left: 20px; }
ol.steps li { margin-bottom: 8px; }

/* charts */
.chart { position: relative; height: 260px; }
.chart-sm { height: 150px; }
.chart canvas { width: 100% !important; height: 100% !important; }

/* forms */
.stack { display: flex; flex-direction: column; gap: 14px; }
.narrow { max-width: 520px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
label > span { color: var(--muted); }
.input { background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 10px 12px; font: inherit; }
.input:focus { outline: 2px solid rgba(228, 191, 90, 0.4); border-color: var(--gold); }
.input-center { text-align: center; letter-spacing: 0.2em; }
.btn { display: inline-block; border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; background: var(--panel-2); color: var(--text); }
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn-primary { background: linear-gradient(160deg, var(--gold-2), #b8912f); color: #1b1408; border-color: transparent; }
.btn-ghost { background: transparent; color: var(--gold-2); border-color: var(--gold); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; font-size: 14px; }
.flash-notice { background: rgba(72, 199, 116, 0.12); border-color: rgba(72, 199, 116, 0.4); color: #b9f0cb; }
.flash-alert { background: rgba(230, 103, 103, 0.12); border-color: rgba(230, 103, 103, 0.4); color: #ffc9c9; }

/* gate */
.gate-body { display: grid; place-items: center; min-height: 100vh; margin: 0; }
.gate { width: 100%; max-width: 380px; padding: 16px; }
.gate-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.gate-card h1 { margin-bottom: 4px; }
.gate-card p { margin-bottom: 18px; }

@media (max-width: 640px) {
  h1 { font-size: 24px; }
  .hero-side { text-align: left; }
  .table { font-size: 13px; }
  .card { padding: 14px; }
  .nav a { padding: 6px 8px; }
}

/* world map */
.map-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.map-tabs a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 14px; }
.map-tabs a:hover { text-decoration: none; color: var(--text); }
.map-tabs a.active { color: var(--gold-2); background: var(--panel-2); border-color: var(--gold); }
.map-tabs .count { color: var(--muted); font-size: 12px; margin-left: 4px; }
.map-wrap { position: relative; width: 100%; aspect-ratio: 1002 / 668; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #1a140c; }
.map-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-dot { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; }
.map-dot-bot { width: 7px; height: 7px; opacity: 0.85; border: 1px solid rgba(0, 0, 0, 0.5); }
.map-dot-bot.alliance { background: var(--alliance); }
.map-dot-bot.horde { background: var(--horde); }
.map-dot-player { width: 14px; height: 14px; background: var(--gold-2); border: 2px solid #1b1408; box-shadow: 0 0 0 3px rgba(240, 209, 124, 0.35), 0 0 14px rgba(240, 209, 124, 0.8); z-index: 2; }
.map-dot-player .map-label { position: absolute; left: 18px; top: -4px; white-space: nowrap; font-size: 12px; font-weight: 700; color: #1b1408; background: var(--gold-2); padding: 1px 6px; border-radius: 4px; }
.map-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0 0; color: var(--muted); font-size: 13px; align-items: center; }
.map-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* stats tables */
.stat-list { columns: 2; column-gap: 24px; }
.stat-list .row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid rgba(40, 50, 69, 0.6); break-inside: avoid; font-size: 14px; }
.stat-list .row span:last-child { color: var(--gold-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-group { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; margin: 14px 0 4px; break-after: avoid; }
.bar { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.ach { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(40, 50, 69, 0.6); font-size: 14px; }
.ach .points { margin-left: auto; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.ach .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
@media (max-width: 640px) { .stat-list { columns: 1; } }
