:root {
  color-scheme: dark;
  --bg: #07090f;
  --glass: rgba(18, 21, 31, .62);
  --glass-strong: rgba(22, 26, 38, .82);
  --glass-hover: rgba(30, 35, 50, .72);
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);
  --text-primary: #f4f5f8;
  --text-secondary: #b0b5c3;
  --text-muted: #727890;
  --accent: #3987e5;
  --accent-2: #9085e9;
  --accent-soft: rgba(57, 135, 229, .16);
  --loss-bar: #4b5168;
  --win: #34c77b;
  --loss: #e66767;
  --team-red: #e66767;
  --team-green: #3fbf5f;
  --gold: #e8b339;
  --silver: #c3cad6;
  --bronze: #cf8a55;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font: 14px/1.5 Inter, system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- blurred background ---------- */
.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.bg canvas, .bg img { position: absolute; inset: -60px; width: calc(100% + 120px); height: calc(100% + 120px); object-fit: cover; filter: blur(22px) saturate(1.45) brightness(1); transform: scale(1.05); }
.bg::after { content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(57,135,229,.18), transparent 70%),
    radial-gradient(800px 500px at 90% 10%, rgba(144,133,233,.14), transparent 70%),
    linear-gradient(180deg, rgba(7,9,15,.1) 0%, rgba(7,9,15,.55) 50%, rgba(7,9,15,.86) 100%); }
.grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- glass primitives ---------- */
.glass, .card, .tile, .table-wrap, .game-card, .pod, .map-card, .leader {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
}
.card { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(9, 11, 18, .6); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 22px; height: 64px; }
.brand { font-family: "Space Grotesk", sans-serif; font-size: 20px; font-weight: 500; display: flex; align-items: center; gap: 10px; white-space: nowrap; letter-spacing: -.01em; }
.brand b { font-weight: 700; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-bed { width: 24px; height: 15px; border-radius: 3px; background: linear-gradient(90deg, #d13c3c 0 60%, #f1efe8 60% 100%); box-shadow: inset 0 -4px 0 rgba(0,0,0,.28), 0 0 18px rgba(209,60,60,.45); }
nav { display: flex; gap: 2px; background: rgba(255,255,255,.03); border: 1px solid var(--line); padding: 3px; border-radius: 11px; }
nav a { padding: 6px 14px; border-radius: 8px; color: var(--text-secondary); font-weight: 500; transition: background .15s, color .15s; }
nav a:hover { color: var(--text-primary); }
nav a.active { color: var(--text-primary); background: rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.search { margin-left: auto; position: relative; }
.search input { width: 240px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--text-primary); border-radius: 10px; padding: 9px 12px 9px 34px; font: inherit; outline: none; transition: border-color .15s, background .15s; }
.search input:focus { border-color: var(--accent); background: rgba(255,255,255,.07); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.live { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-secondary); white-space: nowrap; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--win); animation: pulse 2s infinite; }
.live.stale .dot { background: var(--text-muted); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,199,123,.6); } 70% { box-shadow: 0 0 0 8px rgba(52,199,123,0); } 100% { box-shadow: 0 0 0 0 rgba(52,199,123,0); } }

main { padding: 32px 16px 80px; }
.loading, .empty { padding: 80px 0; text-align: center; color: var(--text-muted); }
h1 { font-family: "Space Grotesk", sans-serif; font-size: 34px; margin: 0 0 4px; letter-spacing: -.02em; line-height: 1.1; }
h2 { font-family: "Space Grotesk", sans-serif; font-size: 17px; margin: 0 0 14px; font-weight: 500; letter-spacing: -.01em; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 14px; flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: 19px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { padding: 16px 18px; position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent); }
.tile .label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.tile .value { font-family: "Space Grotesk", sans-serif; font-size: 28px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tile.clickable { cursor: pointer; transition: border-color .15s, background .15s; }
.tile.clickable:hover { border-color: var(--line-strong); background: var(--glass-hover); }

/* ---------- podium & leaders ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.pod { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px; overflow: hidden; transition: transform .2s, border-color .2s; }
.pod:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.pod::before { content: ""; position: absolute; inset: 0; background: radial-gradient(260px 120px at 0% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent); pointer-events: none; }
.pod .place { position: absolute; right: 16px; top: 6px; font-family: "Space Grotesk"; font-size: 48px; font-weight: 700; color: var(--c); opacity: .22; }
.pod img { width: 58px; height: 58px; border-radius: 10px; image-rendering: pixelated; box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 60%, transparent), 0 8px 20px rgba(0,0,0,.4); }
.pod > div { min-width: 0; padding-right: 44px; position: relative; }
.pod .n { font-weight: 600; font-size: 16px; position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .e { font-family: "Space Grotesk"; font-size: 24px; font-weight: 700; color: var(--c); position: relative; line-height: 1.2; }
.pod .s { position: relative; }
.leaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.leader { display: flex; align-items: center; gap: 12px; padding: 12px 14px; transition: border-color .15s, background .15s; }
.leader:hover { border-color: var(--line-strong); background: var(--glass-hover); }
.leader img { width: 36px; height: 36px; border-radius: 7px; image-rendering: pixelated; }
.leader .k { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.leader .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader .v { font-family: "Space Grotesk"; font-weight: 700; color: var(--accent); margin-left: auto; font-size: 17px; font-variant-numeric: tabular-nums; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 12px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--line); }
th.sortable { cursor: pointer; user-select: none; transition: color .15s; }
th.sortable:hover { color: var(--text-secondary); }
th.sorted { color: var(--accent); }
th.sorted::after { content: " ↓"; }
th.sorted.asc::after { content: " ↑"; }
td { border-bottom: 1px solid rgba(255,255,255,.04); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; transition: background .12s; }
tbody tr.clickable:hover td { background: rgba(255,255,255,.04); }
.left { text-align: left !important; }
.player-cell { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.player-cell img { width: 26px; height: 26px; border-radius: 5px; image-rendering: pixelated; }
.rank { color: var(--text-muted); width: 44px; }
.rank.top { color: var(--gold); font-weight: 700; }
.elo { font-weight: 700; }
.pos { color: var(--win); }
.neg { color: var(--loss); }
.wr-cell { display: inline-flex; align-items: center; gap: 8px; }
.wr-bar { width: 46px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.wr-bar > div { height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------- controls ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.input, .select { background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--text-primary); border-radius: 10px; padding: 8px 12px; font: inherit; outline: none; }
.input:focus, .select:focus { border-color: var(--accent); }
.select option { background: #161a26; }
.seg { display: inline-flex; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--text-secondary); padding: 5px 12px; border-radius: 7px; cursor: pointer; font-weight: 500; font-size: 13px; }
.seg button:hover { color: var(--text-primary); }
.seg button.on { background: rgba(255,255,255,.1); color: var(--text-primary); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.chip-group .g { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; width: 82px; }
.chip { background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--text-secondary); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all .12s; }
.chip:hover { color: var(--text-primary); border-color: var(--line-strong); }
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--text-primary); }
.pager { display: flex; justify-content: center; gap: 10px; margin-top: 16px; align-items: center; color: var(--text-secondary); }
.btn { background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--text-primary); border-radius: 10px; padding: 7px 14px; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s, background .15s; }
.btn:hover:not(:disabled) { border-color: var(--accent); background: rgba(255,255,255,.08); }
.btn:disabled { opacity: .4; cursor: default; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.badge.w { background: rgba(52,199,123,.15); color: var(--win); }
.badge.l { background: rgba(230,103,103,.15); color: var(--loss); }
.badge.mvp { background: rgba(232,179,57,.16); color: var(--gold); }
.badge.map { background: rgba(255,255,255,.08); color: var(--text-secondary); text-transform: capitalize; font-weight: 500; }
.team-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.team-RED { background: var(--team-red); }
.team-GREEN { background: var(--team-green); }
.tier { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--t); padding: 1px 7px; border-radius: 5px; border: 1px solid color-mix(in srgb, var(--t) 35%, transparent); background: color-mix(in srgb, var(--t) 10%, transparent); }

/* ---------- games ---------- */
.games-list { display: grid; gap: 10px; }
.game-card { display: grid; grid-template-columns: 120px 1fr 1fr 140px; gap: 18px; align-items: center; padding: 14px 18px; transition: border-color .15s, background .15s, transform .15s; }
.game-card:hover { border-color: var(--line-strong); background: var(--glass-hover); transform: translateX(2px); }
.game-card .id { font-family: "Space Grotesk"; font-weight: 700; font-size: 17px; }
.game-card .team { font-size: 13px; color: var(--text-secondary); min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; }
.game-card .team.won { color: var(--text-primary); background: rgba(52,199,123,.06); border-color: rgba(52,199,123,.18); }
.game-card .team-head { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); display: flex; align-items: center; }
.game-card .team.won .team-head { color: var(--win); }
.heads { display: flex; gap: 4px; flex-wrap: wrap; }
.heads img { width: 22px; height: 22px; border-radius: 4px; image-rendering: pixelated; }
.game-card .meta { text-align: right; font-size: 12px; color: var(--text-muted); }
.game-card .meta b { color: var(--text-secondary); font-weight: 500; }

/* ---------- player ---------- */
.hero { display: grid; grid-template-columns: auto 1fr auto; gap: 26px; align-items: center; padding: 26px; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 200px at 0% 0%, rgba(57,135,229,.2), transparent), radial-gradient(400px 200px at 100% 100%, rgba(144,133,233,.14), transparent); pointer-events: none; }
.hero > * { position: relative; }
.hero .body-render { height: 170px; filter: drop-shadow(0 14px 22px rgba(0,0,0,.55)); image-rendering: pixelated; }
.hero .rank-chip { display: inline-block; font-family: "Space Grotesk"; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 7px; margin-right: 6px; }
.hero .big { text-align: right; }
.hero .big .v { font-family: "Space Grotesk"; font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.form { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.form a { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; transition: transform .12s; }
.form a:hover { transform: translateY(-2px); }
.form .w { background: rgba(52,199,123,.18); color: var(--win); }
.form .l { background: rgba(230,103,103,.18); color: var(--loss); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-2b { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* comparison rows (player vs server) */
.cmp { display: grid; gap: 9px; }
.cmp-row { display: grid; grid-template-columns: 110px 1fr 64px; gap: 10px; align-items: center; font-size: 13px; cursor: pointer; }
.cmp-row .k { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-row .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.cmp-row:hover .k { color: var(--text-primary); }
.cmp-track { position: relative; height: 8px; border-radius: 4px; background: rgba(255,255,255,.06); }
.cmp-track .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--text-muted); }
.cmp-track .fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.cmp-track .fill.up { left: 50%; background: var(--accent); }
.cmp-track .fill.down { right: 50%; background: var(--loss-bar); }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: rgba(255,255,255,.06); stroke-width: 1; }
.chart .axis text { fill: var(--text-muted); font-size: 11px; font-family: Inter, sans-serif; }
.chart .zero { stroke: var(--text-muted); stroke-width: 1; }
.chart .avg { stroke: var(--text-secondary); stroke-dasharray: 4 4; stroke-width: 1; }
.chart .avg-label { fill: var(--text-secondary); font-size: 11px; font-family: Inter, sans-serif; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--text-secondary); stroke-width: 1; }
.chart .marker { fill: var(--accent); stroke: #10131c; stroke-width: 2; }
.chart .bar { transition: opacity .1s; }
.chart .bar.dim { opacity: .45; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-secondary); align-items: center; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.dash { height: 0; width: 14px; border-top: 1px dashed var(--text-secondary); border-radius: 0; }

.hbars { display: grid; gap: 6px; }
.hbar { display: grid; grid-template-columns: 26px 170px 1fr 76px; gap: 10px; align-items: center; padding: 4px 6px; border-radius: 8px; transition: background .12s; }
.hbar:hover { background: rgba(255,255,255,.04); }
.hbar .r { color: var(--text-muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.hbar .track { height: 18px; border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar .track > div { height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent)); border-radius: 0 4px 4px 0; transform-origin: left; animation: grow .5s ease both; }
.hbar .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes grow { from { transform: scaleX(0); } }

.vs { display: grid; gap: 12px; }
.vs-row { display: grid; grid-template-columns: 70px 1fr 120px 1fr 70px; gap: 10px; align-items: center; font-size: 13px; }
.vs-row .lbl { text-align: center; color: var(--text-secondary); font-size: 12px; }
.vs-row .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.vs-row .val.r { text-align: right; }
.vs-track { height: 10px; display: flex; }
.vs-track.left { justify-content: flex-end; }
.vs-track > div { height: 100%; border-radius: 4px; transition: width .5s ease; }
.vs-row.lead .val.win-side { color: var(--text-primary); }

/* maps */
.maps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.map-card { padding: 16px 18px; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.map-card:hover { border-color: var(--line-strong); background: var(--glass-hover); transform: translateY(-2px); }
.map-card .name { font-family: "Space Grotesk"; font-size: 19px; font-weight: 700; text-transform: capitalize; }
.map-card .stats { display: flex; gap: 16px; color: var(--text-secondary); font-size: 12px; margin: 6px 0 12px; }
.split-bar { display: flex; height: 8px; gap: 2px; }
.split-bar > div { height: 100%; }
.split-bar > div:first-child { border-radius: 4px 0 0 4px; }
.split-bar > div:last-child { border-radius: 0 4px 4px 0; }
.split-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-top: 6px; }

/* game page */
.winner-banner { display: flex; align-items: center; gap: 12px; }
.team-block { margin-bottom: 16px; }
.team-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.team-title h2 { margin: 0; }
.upgrades { display: flex; gap: 6px; flex-wrap: wrap; }
.upgrade { font-size: 11px; padding: 2px 9px; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 7px; color: var(--text-secondary); text-transform: capitalize; }

.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--glass-strong); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 11px; font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); min-width: 150px; }
.tooltip .t { font-weight: 600; margin-bottom: 4px; }
.tooltip .r { display: flex; justify-content: space-between; gap: 16px; color: var(--text-secondary); }
.tooltip .r b { color: var(--text-primary); font-variant-numeric: tabular-nums; }

footer { text-align: center; color: var(--text-muted); font-size: 12px; padding: 0 16px 40px; }

@media (max-width: 1100px) {
  .search input { width: 180px; }
  #live-text { display: none; }
  .live { padding: 8px; }
}
@media (max-width: 960px) {
  .grid-2, .grid-2b { grid-template-columns: 1fr; }
  .hero { grid-template-columns: auto 1fr; }
  .hero .big { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 760px) {
  .topbar-inner { gap: 8px 10px; height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  nav { order: 3; width: 100%; justify-content: space-between; }
  nav a { flex: 1; text-align: center; padding: 6px 4px; }
  .search input { width: 150px; }
  .podium { grid-template-columns: 1fr; }
  .game-card { grid-template-columns: 1fr 1fr; }
  .game-card .meta { text-align: left; }
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero .body-render { height: 120px; }
  h1 { font-size: 28px; }
  .hbar { grid-template-columns: 20px 120px 1fr 60px; gap: 6px; }
  .vs-row { grid-template-columns: 50px 1fr 84px 1fr 50px; gap: 6px; }
  .cmp-row { grid-template-columns: 92px 1fr 56px; }
  .chip-group .g { width: 100%; }
}

/* ---------- share modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(4,6,10,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .2s ease both; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; background: var(--glass-strong); }
.card-preview { position: relative; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.3); aspect-ratio: 800 / 420; border: 1px solid var(--line); }
.card-preview img { width: 100%; height: 100%; display: block; transition: opacity .2s; }
.card-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-secondary); font-size: 13px; }
.card-loading[hidden] { display: none; }
.share-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.share-row .input { flex: 1; min-width: 200px; font-size: 13px; }

/* ---------- search autocomplete ---------- */
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 300px; z-index: 30; padding: 6px; max-height: 420px; overflow-y: auto;
  background: var(--glass-strong); border: 1px solid var(--line-strong); border-radius: 12px;
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: fade .15s ease both; }
.suggest[hidden] { display: none; }
.sug { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 7px 9px; border-radius: 8px; cursor: pointer; }
.sug img { grid-row: 1 / 3; width: 28px; height: 28px; border-radius: 5px; image-rendering: pixelated; }
.sug-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-name mark { background: none; color: var(--accent); }
.sug-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug.on { background: rgba(255,255,255,.08); }
.sug-empty { padding: 10px; color: var(--text-muted); font-size: 13px; }
@media (max-width: 760px) { .suggest { left: auto; right: 0; width: min(340px, calc(100vw - 32px)); } }

/* ---------- admin ---------- */
.login-wrap { display: grid; place-items: center; min-height: 60vh; }
.login { width: min(380px, 100%); display: grid; gap: 14px; padding: 28px; }
.login label { display: grid; gap: 6px; font-size: 12px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.login .input { font-size: 14px; text-transform: none; letter-spacing: 0; }
.login-error { color: var(--loss); font-size: 13px; }
.login-error[hidden] { display: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); justify-content: center; font-weight: 600; padding: 10px 14px; }
.btn.primary:hover:not(:disabled) { background: #4a95ee; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--win); margin-right: 8px; vertical-align: 2px; box-shadow: 0 0 0 0 rgba(52,199,123,.6); animation: pulse 2s infinite; }
.tile .value .online-dot { width: 10px; height: 10px; vertical-align: 5px; }
code { font-family: ui-monospace, Consolas, monospace; background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 5px; }

/* ---------- legal pages ---------- */
.legal { max-width: 780px; margin: 0 auto; padding: 32px 36px; line-height: 1.7; }
.legal h1 { margin-bottom: 2px; }
.legal h2 { font-size: 18px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--text-secondary); }
.legal b { color: var(--text-primary); font-weight: 600; }
.legal ul { padding-left: 20px; margin: 8px 0; }
.legal li { margin: 4px 0; }
.legal a, footer a { color: var(--accent); }
.legal a:hover, footer a:hover { text-decoration: underline; }
footer { line-height: 1.9; }
@media (max-width: 760px) { .legal { padding: 22px 18px; } }
