:root {
  --bg: #11141a;
  --panel: #1a1f29;
  --border: #2a3242;
  --text: #e6e9ef;
  --muted: #8b93a5;
  --accent: #ffb84d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
}
nav {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  padding: 0.8rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--text); }
nav .brand { color: var(--accent); font-size: 1.15rem; font-weight: 700; }
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; margin-top: 2rem; }
a { color: var(--accent); }
.muted { color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
}
.card h3 { margin: 0 0 0.3rem; }
.card h3 a { text-decoration: none; }
.stat-row { display: flex; justify-content: space-between; padding: 0.18rem 0; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 10px; overflow: hidden; }
th, td { padding: 0.5rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: #20283600; }
tbody tr:hover { background: #202836; }
td a { text-decoration: none; }

.tier {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.tier-legendary-iii { background: #4a2a5e; color: #e3b8ff; border: 1px solid #9a5ce0; }
.tier-legendary-ii { background: #3d2c54; color: #c9a0ff; }
.tier-legendary-i { background: #322546; color: #ab87e6; }
.tier-gold { background: #4a3b14; color: #ffd54d; }
.tier-silver { background: #333a45; color: #c0c9d8; }
.tier-bronze { background: #45301d; color: #e0a06a; }

.chart-box { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin: 1rem 0; }
form.inline { display: inline; }
input, select, button {
  background: #232a38;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
}
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
.error { color: #ff7b72; }
.up { color: #7ee787; }
.down { color: #ff7b72; }

.nav-right { margin-left: auto; font-size: 0.85rem; }
.nav-right a { color: var(--muted); }
.nav-right a:hover { color: var(--text); }

.landing { max-width: 540px; margin: 4rem auto; text-align: center; }
.landing h1 { font-size: 2.2rem; margin-bottom: 0.3rem; }
.landing p { line-height: 1.6; }
.discord-btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 1.5rem; padding: 0.7rem 1.4rem;
  background: #5865F2; color: #fff; font-weight: 600;
  border-radius: 8px; text-decoration: none;
}
.discord-btn:hover { background: #4752c4; }

.status { padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.status-pending { background: #4a3b14; color: #ffd54d; }
.status-approved { background: #1f3d29; color: #7ee787; }
.status-rejected { background: #45211d; color: #ff7b72; }
.badge-pending { background: #4a3b14; color: #ffd54d; font-size: 0.8rem; padding: 0.15rem 0.6rem; border-radius: 999px; vertical-align: middle; }

.colosseum { color: #ffb84d; font-weight: 600; font-size: 0.85rem; }

.clan-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 1.2rem; }
.clan-tab {
  padding: 0.35rem 0.85rem; border-radius: 999px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  font-size: 0.9rem;
}
.clan-tab.active { background: var(--accent); color: #1a1f29; border-color: var(--accent); font-weight: 600; }
.clan-tab:hover { color: var(--text); }

.war-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.5rem; }
.war-day-badge { display: inline-block; background: #3d2c54; color: #c9a0ff; padding: 0.15rem 0.7rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.us-row td { background: #20283a; }
.muted-row td { opacity: 0.55; }
.tag-note { color: var(--accent); cursor: help; }

.profile-banner { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; }
.collection-badge {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 4rem; padding: 0.4rem 0.7rem;
  background: linear-gradient(160deg, #3d2c54, #241a33);
  border-radius: 8px; border: 1px solid #9a5ce0;
}
.collection-badge .coll-num { font-size: 1.4rem; font-weight: 800; color: #e3b8ff; line-height: 1; }
.collection-badge .coll-label { font-size: 0.65rem; color: #9a86b8; text-transform: uppercase; letter-spacing: 0.05em; }
.profile-meta div { line-height: 1.4; }

.levelbars { display: flex; flex-direction: column; gap: 0.3rem; max-width: 520px; }
.levelbar-row { display: flex; align-items: center; gap: 0.6rem; }
.levelbar-lvl { width: 3.5rem; font-size: 0.82rem; color: var(--muted); }
.levelbar-lvl.hi { color: var(--accent); font-weight: 600; }
.levelbar-track { flex: 1; height: 1rem; background: #202836; border-radius: 4px; overflow: hidden; }
.levelbar-fill { display: block; height: 100%; background: #5a4e7a; }
.levelbar-fill.hi { background: var(--accent); }
.levelbar-count { width: 2rem; text-align: right; font-size: 0.85rem; }

.deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; }
.deck-card {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.5rem 0.7rem;
}
.deck-name { font-size: 0.9rem; }
.deck-lvl { font-size: 0.8rem; font-weight: 600; }
.rarity-common { color: #c0c9d8; }
.rarity-rare { color: #ffb84d; }
.rarity-epic { color: #c9a0ff; }
.rarity-legendary { color: #6fd3ff; }
.rarity-champion { color: #ffd54d; }
