/* Brawl Skia 1.6 — design system (dark default, light optional) */

:root {
  --bg: #0b0e17;
  --bg-soft: #10141f;
  --panel: #141928;
  --panel-2: #1a2032;
  --border: #232a3f;
  --border-2: #2d3550;
  --text: #eef1f8;
  --muted: #98a0b8;
  --dim: #6b7390;
  --inverse-bg: #f4f5f9;
  --inverse-text: #12172a;
  --gold: #fdcd25;
  --gold-2: #f7b500;
  --blue: #40a7ff;
  --green: #3fd06c;
  --red: #ff5d5d;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
}

html.light {
  --bg: #f5f6fa;
  --bg-soft: #eef0f6;
  --panel: #ffffff;
  --panel-2: #f2f3f8;
  --border: #e2e5ef;
  --border-2: #d3d7e6;
  --text: #171c2e;
  --muted: #59617c;
  --dim: #9097ae;
  --inverse-bg: #171c2e;
  --inverse-text: #ffffff;
  --shadow: 0 12px 32px rgba(23, 28, 46, .08);
}

* { box-sizing: border-box; }
html { min-height: 100vh; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.55;
  transition: background .25s, color .25s;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.logo-font { font-family: 'Space Grotesk', 'Inter', sans-serif; letter-spacing: .02em; }
.grad-text {
  background: linear-gradient(100deg, var(--gold) 20%, var(--blue) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-in { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #131722; font-weight: 800; box-shadow: 0 4px 14px rgba(253, 205, 37, .35);
}
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 15px;
  transition: .18s;
}
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.active { color: var(--text); background: var(--panel-2); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); color: var(--muted); cursor: pointer; display: grid; place-items: center;
  transition: .18s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.select-chip {
  appearance: none; border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  border-radius: 10px; height: 38px; padding: 0 30px 0 12px; font-size: 14px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.user-chip img { width: 26px; height: 26px; border-radius: 8px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: 15.5px; cursor: pointer; transition: .18s; white-space: nowrap;
}
.btn-gold {
  background: linear-gradient(160deg, var(--gold), var(--gold-2)); color: #181206;
  box-shadow: 0 6px 22px rgba(253, 205, 37, .28);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(253, 205, 37, .38); }
.btn-blue { background: linear-gradient(160deg, #57b1ff, var(--blue)); color: #07131f; }
.btn-blue:hover { transform: translateY(-1px); }
.btn-ghost { background: var(--panel); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-2); background: var(--panel-2); }
.btn-danger { background: transparent; border-color: rgba(255, 93, 93, .35); color: var(--red); }
.btn-danger:hover { background: rgba(255, 93, 93, .08); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 9px; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- hero / home ---------- */

.hero { position: relative; overflow: hidden; padding: 110px 0 70px; text-align: center; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px); z-index: -1; opacity: .5;
}
.hero::before { width: 480px; height: 480px; left: -140px; top: -140px; background: rgba(253, 205, 37, .13); }
.hero::after { width: 520px; height: 520px; right: -160px; bottom: -220px; background: rgba(64, 167, 255, .14); }
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--panel); color: var(--muted);
  font-size: 13.5px; font-weight: 600; margin-bottom: 26px;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.hero h1 { font-size: clamp(34px, 6vw, 58px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 18px; }
.hero p.lead { color: var(--muted); font-size: clamp(16px, 2vw, 19px); max-width: 640px; margin: 0 auto 38px; }
.search-bar {
  display: flex; gap: 12px; max-width: 640px; margin: 0 auto; padding: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.search-bar input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text);
  font-size: 16px; padding: 0 12px;
}
.search-bar input::placeholder { color: var(--dim); }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; padding: 40px 0 80px; }
.feature {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 28px;
  transition: .2s;
}
.feature:hover { transform: translateY(-3px); border-color: var(--border-2); }
.feature .ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 22px;
  margin-bottom: 16px; background: var(--panel-2); border: 1px solid var(--border);
}
.feature h3 { font-size: 17.5px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* ---------- panels & layout ---------- */

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: 42px 0 24px; }
.page-title { font-size: clamp(24px, 4vw, 32px); font-weight: 800; letter-spacing: -.01em; }
.page-sub { color: var(--muted); margin: 6px 0 0; font-size: 15px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.section-label {
  font-size: 12.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 14px;
}
.kv { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); font-size: 14.5px; }
.kv .v { font-weight: 700; font-size: 15.5px; }
.stat-tile { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px; text-align: center; }
.stat-tile .lbl { color: var(--dim); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.stat-tile .val { font-size: 24px; font-weight: 800; margin-top: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); font-size: 13px; font-weight: 600;
}
.chip.gold { color: var(--gold); border-color: rgba(253, 205, 37, .35); }
.chip.blue { color: var(--blue); border-color: rgba(64, 167, 255, .35); }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .92em; }

/* tabs */
.tabs { display: flex; gap: 6px; border: 1px solid var(--border); background: var(--panel); padding: 6px; border-radius: 14px; margin-bottom: 22px; overflow-x: auto; }
.tabs a {
  flex: 1; text-align: center; padding: 10px 16px; border-radius: 10px; color: var(--muted);
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: .16s;
}
.tabs a:hover { color: var(--text); background: var(--panel-2); }
.tabs a.active { color: #181206; background: linear-gradient(160deg, var(--gold), var(--gold-2)); }

/* progress */
.progress { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; }

/* player header */
.player-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; padding: 28px; }
.player-avatar {
  width: 92px; height: 92px; border-radius: 20px; object-fit: cover; background: var(--panel-2);
  border: 2px solid var(--border-2);
}
.player-name { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.01em; }

/* brawler tiles */
.brawlers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.brawler-card { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid rgba(0,0,0,.35); transition: .18s; }
.brawler-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.brawler-card .portrait { aspect-ratio: 3/3.4; display: block; width: 100%; object-fit: cover; }
.brawler-card .meta { padding: 8px 10px 10px; }
.brawler-card .row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; }
.brawler-card .name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brawler-card.locked { filter: saturate(.15); opacity: .75; }
.rk-badge {
  position: absolute; top: 7px; left: 7px; z-index: 2; padding: 2px 8px; border-radius: 8px;
  font-size: 11.5px; font-weight: 800; background: rgba(8, 10, 18, .72); color: #fff;
  border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(4px);
}
.dot-badges { display: flex; gap: 4px; }
.dot-badges i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* rarity tints (current game palette) */
.rar-starting { background: linear-gradient(170deg, #a8b4c2, #6c7a8c); }
.rar-rare { background: linear-gradient(170deg, #56e24a, #269e1e); }
.rar-superrare { background: linear-gradient(170deg, #42b2ff, #187ad2); }
.rar-epic { background: linear-gradient(170deg, #ba60f0, #842cc4); }
.rar-mythic { background: linear-gradient(170deg, #ff6868, #d63434); }
.rar-legendary { background: linear-gradient(170deg, #ffec50, #fabe14); }
.rar-ultra { background: linear-gradient(170deg, #ff6eeb, #aa28ff); }

/* battles list */
.match-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--dim);
}
.match-row + .match-row { margin-top: 8px; }
.match-row.win { border-left-color: var(--green); }
.match-row.loss { border-left-color: var(--red); }
.match-row.draw { border-left-color: var(--gold); }
.match-row img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--panel-2); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: right; color: var(--dim); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { text-align: right; padding: 10px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: 0; }
.pos { color: var(--green); } .neg { color: var(--red); }

/* forms */
.field {
  display: flex; gap: 10px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 8px;
}
.field input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text);
  font-size: 15.5px; padding: 8px 10px;
}
label.lbl { display: block; color: var(--muted); font-size: 13.5px; font-weight: 600; margin: 0 0 8px; }

/* track rows */
.track-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 20px; }
.track-row + .track-row { margin-top: 10px; }
.track-main { flex: 1; min-width: 200px; }
.track-name { font-weight: 700; font-size: 16px; }
.track-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.plan { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 30px; transition: .2s; }
.plan:hover { transform: translateY(-3px); border-color: var(--border-2); }
.plan.best { border-color: rgba(253, 205, 37, .5); box-shadow: 0 0 0 1px rgba(253, 205, 37, .25), var(--shadow); }
.plan .flag { position: absolute; top: -12px; left: 24px; padding: 4px 12px; border-radius: 999px; background: linear-gradient(160deg, var(--gold), var(--gold-2)); color: #181206; font-size: 12px; font-weight: 800; }
.plan .price { font-size: 40px; font-weight: 800; letter-spacing: -.03em; margin: 10px 0 2px; }
.plan .per { color: var(--dim); font-size: 13.5px; margin-bottom: 18px; }
.plan ul { list-style: none; margin: 0 0 24px; padding: 0; color: var(--muted); font-size: 14.5px; }
.plan li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; }
.plan li::before { content: "✓"; color: var(--green); font-weight: 800; }

/* graph */
.graph-box { padding: 18px; }
.graph-box img { width: 100%; border-radius: 12px; display: block; }

/* alerts / empty states */
.alert { padding: 14px 18px; border-radius: 12px; font-size: 14.5px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); }
.alert.err { border-color: rgba(255, 93, 93, .4); color: var(--red); background: rgba(255, 93, 93, .06); }
.alert.ok { border-color: rgba(63, 208, 108, .4); color: var(--green); background: rgba(63, 208, 108, .06); }
.empty { text-align: center; padding: 56px 20px; color: var(--dim); }
.empty .big { font-size: 44px; margin-bottom: 10px; }

/* footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; padding: 44px 0; }
.footer-grid h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.footer-grid a { display: block; color: var(--muted); padding: 5px 0; font-size: 14.5px; transition: .15s; }
.footer-grid a:hover { color: var(--text); }
.footer-note { color: var(--dim); font-size: 13.5px; padding: 18px 0; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }

/* misc */
.hidden { display: none !important; }
.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:40px}
.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.center { text-align: center; }

@media (max-width: 720px) {
  .nav { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .search-bar { flex-direction: column; }
  .search-bar .btn { width: 100%; }
}
