:root {
  --bg: #070504;
  --stone: #1a120b;
  --panel: #140f0a;
  --ink: #f3e6c4;
  --muted: #b89a6a;
  --gold: #e0b432;
  --gold-dark: #8a6118;
  --line: #6d4e1e;
  --accent: #3d2a12;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Spectral, "Times New Roman", serif;
  background:
    radial-gradient(ellipse at 50% -10%, #3a2410 0%, transparent 46%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 4px),
    #070504;
}

.frame {
  max-width: 1120px;
  margin: 24px auto 40px;
  padding: 18px 20px 12px;
  background:
    linear-gradient(180deg, rgba(56, 38, 16, 0.55), rgba(10, 8, 6, 0.92));
  border: 2px solid var(--gold-dark);
  box-shadow:
    0 0 0 1px #f1d078 inset,
    0 0 0 6px #1c130a,
    0 0 0 8px var(--line),
    0 18px 50px rgba(0, 0, 0, 0.55);
}

.top, .import, .tabs, main, footer {
  padding: 12px 8px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.crest {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 3px #2a1c0c, 0 8px 18px rgba(0, 0, 0, 0.55);
  image-rendering: auto;
  background: #111;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--gold);
  font-family: Cinzel, Palatino, serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--gold);
  font-family: Cinzel, Palatino, serif;
  font-size: 2.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 0 #3a2508, 0 0 18px rgba(224, 180, 50, 0.25);
}

.sub, .hint, footer, .meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.sub { margin: 4px 0 0; }

.meta {
  text-align: right;
  max-width: 280px;
  font-family: Cinzel, Palatino, serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.import {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px #2b1d10;
}

.import.drag {
  outline: 2px solid var(--gold);
}

textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: #0b0906;
  color: var(--ink);
  border: 1px solid var(--gold-dark);
  padding: 10px;
  font-family: Consolas, monospace;
  font-size: 0.85rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

button, input[type="file"] {
  font-family: Cinzel, Palatino, serif;
}

button {
  background: linear-gradient(180deg, #f0c75a, #a0721c);
  color: #1a1208;
  border: 1px solid #6a4a12;
  box-shadow: inset 0 1px 0 rgba(255, 240, 180, 0.55);
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
}

button.ghost {
  background: linear-gradient(180deg, #3a2a16, #1c140c);
  color: var(--gold);
  border: 1px solid var(--gold-dark);
  box-shadow: none;
}

button:hover { filter: brightness(1.08); }

.tabs {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tab {
  background: linear-gradient(180deg, #4a3318, #24180c);
  color: var(--ink);
  font-weight: 600;
  border: 1px solid var(--gold-dark);
}

.tab.active {
  background: linear-gradient(180deg, #f0c75a, #a0721c);
  color: #1a1208;
}

#filter {
  margin-left: auto;
  background: #0b0906;
  color: var(--ink);
  border: 1px solid var(--gold-dark);
  padding: 8px 10px;
  min-width: 180px;
  font-family: Spectral, serif;
}

.panel { display: none; }
.panel.active { display: block; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #2d2114;
}

th {
  color: var(--gold);
  font-family: Cinzel, Palatino, serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  background: #1d140c;
}

.num { text-align: right; font-variant-numeric: tabular-nums; }

.raid-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.raid-card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--gold);
  font-family: Cinzel, Palatino, serif;
}

.members { color: var(--muted); line-height: 1.5; }

.class-WARRIOR { color: #c79c6e; }
.class-PALADIN { color: #f58cba; }
.class-HUNTER { color: #abd473; }
.class-ROGUE { color: #fff569; }
.class-PRIEST { color: #ffffff; }
.class-DEATHKNIGHT { color: #c41f3b; }
.class-SHAMAN { color: #0070de; }
.class-MAGE { color: #69ccf0; }
.class-WARLOCK { color: #9482c9; }
.class-MONK { color: #00ff96; }
.class-DRUID { color: #ff7d0a; }
.class-DEMONHUNTER { color: #a330c9; }
.class-EVOKER { color: #33937f; }

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: #245c28;
  color: #e8ffe8;
  font-family: Cinzel, Palatino, serif;
  font-size: 0.55rem;
  vertical-align: middle;
  letter-spacing: 0.08em;
  border: 1px solid #7dcc7d;
}
.hidden { display: none !important; }
.badge.hidden { display: none; }
.empty { padding: 24px; color: var(--muted); }

code { color: var(--gold); }

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gate.hidden, #app.hidden { display: none; }
.gate-card {
  width: min(420px, 100%);
  text-align: center;
  padding: 28px 24px;
  background: linear-gradient(180deg, rgba(56, 38, 16, 0.55), rgba(10, 8, 6, 0.92));
  border: 2px solid var(--gold-dark);
  box-shadow: 0 0 0 1px #f1d078 inset, 0 0 0 6px #1c130a, 0 18px 50px rgba(0, 0, 0, 0.55);
}
.gate-card h1 { font-size: 2rem; }
.bnet {
  display: inline-block;
  margin: 16px 0 8px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #148eff, #0a4d9e);
  color: #fff;
  text-decoration: none;
  font-family: Cinzel, Palatino, serif;
  font-weight: 700;
  border: 1px solid #083b7a;
}
.bnet.disabled {
  pointer-events: none;
  opacity: 0.45;
}
.pin-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  margin-top: 18px;
}
.pin-form input {
  background: #0b0906;
  color: var(--ink);
  border: 1px solid var(--gold-dark);
  padding: 8px 10px;
}
.account {
  text-align: right;
  max-width: 320px;
}
.account .meta { max-width: none; }
.account-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  margin-top: 6px;
}
.logout {
  color: var(--gold);
  font-family: Cinzel, Palatino, serif;
  font-size: 0.78rem;
  text-decoration: none;
}
.role-pill {
  display: inline-block;
  margin-left: 6px;
  color: var(--gold);
  font-family: Cinzel, Palatino, serif;
  font-size: 0.7rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px 16px;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}
.stat b {
  display: block;
  margin-top: 6px;
  color: var(--gold);
  font-family: Cinzel, Palatino, serif;
  font-size: 1.15rem;
  font-weight: 700;
}
#new-tag, #new-note {
  background: #0b0906;
  color: var(--ink);
  border: 1px solid var(--gold-dark);
  padding: 8px 10px;
  min-width: 160px;
  font-family: Spectral, serif;
}

@media (max-width: 720px) {
  .top { flex-direction: column; align-items: flex-start; }
  .meta { text-align: left; }
  .account { text-align: left; max-width: none; }
  .account-actions { justify-content: flex-start; }
  .crest { width: 72px; height: 72px; }
  h1 { font-size: 1.7rem; }
}
