:root { color-scheme: dark;
  --bg: #15181F; --card: #1E222A; --line: #2A2F3A; --line2: #2F3540; --dim: #3A4150;
  --text: #E8EAED; --text2: #C2C7D0; --muted: #8C94A3; --faint: #5C6370;
  --blue: #5B8DEF; --red: #FF5A5F; --green: #3BD671; --purple: #A78BFA; --gold: #F5C542;
  --green-bg: #173A2A; --red-bg: #3A1E22;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Noto Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
button, input { font-family: inherit; }
.sr { position: absolute; left: -9999px; }

#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.logo { height: 26px; width: auto; flex-shrink: 0; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line2); color: var(--muted); min-width: 0; }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font-size: 15px; outline: none; }
.search input::placeholder { color: var(--muted); }
.chip { height: 40px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg); color: var(--text2); font-weight: 800; font-size: 13px; letter-spacing: 1px; cursor: pointer; }

main { flex: 1; padding: 12px 16px calc(84px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }

.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; display: flex; justify-content: space-around; padding: 8px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); z-index: 5; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 52px; min-height: 44px; color: var(--muted); font-size: 11px; font-weight: 600; }
.nav a.active { color: var(--blue); }

/* tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { flex: 1; height: 34px; min-width: 64px; border: 0; border-radius: 8px; background: var(--bg); color: var(--text2); font-weight: 800; font-size: 13px; letter-spacing: 1px; cursor: pointer; }
.tabs button.on { background: var(--blue); color: #fff; }
.tabs button.fixed { flex: 0 0 auto; padding: 0 10px; }

/* cards */
.card { background: var(--card); border-radius: 12px; padding: 12px; }
.card.pad0 { padding: 0; overflow: hidden; }
.label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; }
.h { display: flex; align-items: center; gap: 12px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--blue); object-fit: cover; flex-shrink: 0; background: var(--line); }
.avatar.sm { width: 34px; height: 34px; border: 0; }
.name { font-weight: 800; font-size: 22px; line-height: 1.05; }
.tag { padding: 2px 7px; border-radius: 6px; background: var(--line); font-weight: 800; font-size: 12px; letter-spacing: 1px; color: var(--text2); }
.sub { font-size: 12px; color: var(--muted); }
.tier { font-weight: 800; font-size: 13px; letter-spacing: 1px; color: var(--blue); text-transform: uppercase; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: var(--card); }
.tile .v { font-weight: 800; font-size: 20px; line-height: 1; }
.tile .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; text-align: center; }
.tile .p { font-weight: 800; font-size: 11px; color: var(--muted); }
.tile .p.good { color: var(--green); }

.list { display: flex; flex-direction: column; gap: 6px; }
.match { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--card); color: var(--text); border-left: 3px solid var(--dim); }
.match.win { border-left-color: var(--blue); }
.match.top { border-left-color: var(--muted); }
.place { min-width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; background: var(--line); }
.match.win .place { background: var(--blue); color: #fff; }
.match .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.match .map { font-weight: 600; font-size: 14px; }
.match .kv { display: flex; gap: 12px; }
.match .kv div { display: flex; flex-direction: column; align-items: center; }
.match .kv b { font-weight: 800; font-size: 17px; line-height: 1; }
.match .kv span { font-size: 9px; color: var(--muted); letter-spacing: .8px; }
.ranked { font-size: 9px; font-weight: 800; letter-spacing: 1px; color: var(--gold); }

/* compare */
.vs { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 6px; align-items: center; }
.vs .p { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--blue); min-width: 0; }
.vs .p.b { border-color: var(--red); }
.vs .p input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font-weight: 800; font-size: 14px; outline: none; }
.vs .p .n { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs .p .s { font-size: 10px; color: var(--muted); }
.vs .x { text-align: center; font-weight: 800; color: var(--muted); }
.score { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.score .n { font-weight: 800; font-size: 34px; line-height: 1; min-width: 40px; text-align: center; }
.score .n.a { color: var(--blue); } .score .n.b { color: var(--red); }
.score .mid { display: flex; flex-direction: column; align-items: center; z-index: 1; }
.score .lead { font-weight: 800; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }
.score .mug { width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--line2); opacity: .55; }
.score .mug.win { border-color: var(--green); opacity: 1; }
.score .mug.lose { border-color: var(--red); opacity: .85; }
.score .mid { flex: 1; text-align: center; }
.srow { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow .t { display: flex; align-items: baseline; justify-content: space-between; }
.srow .va, .srow .vb { font-weight: 800; font-size: 18px; color: var(--muted); width: 100px; }
.srow .vb { text-align: right; }
.srow .va.win { color: var(--blue); } .srow .vb.win { color: var(--red); }
.bars { display: flex; gap: 3px; height: 5px; }
.bars div { flex: 1; background: var(--bg); border-radius: 3px; overflow: hidden; display: flex; }
.bars .l { justify-content: flex-end; } .bars .r { justify-content: flex-start; }
.bars i { display: block; height: 100%; border-radius: 3px; background: var(--dim); }
.bars .l i.win { background: var(--blue); } .bars .r i.win { background: var(--red); }

.btn { height: 44px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: 1px; cursor: pointer; width: 100%; }
.btn:disabled { opacity: .5; }
.center { text-align: center; }
.note { font-size: 11px; color: var(--faint); text-align: center; }
.err { background: var(--red-bg); color: #FF8A9D; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px 16px; text-align: center; color: var(--muted); }
.empty img { width: 120px; border-radius: 50%; }
.spin { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: s 0.8s linear infinite; margin: 30px auto; }
@keyframes s { to { transform: rotate(360deg); } }
.trend svg { display: block; width: 100%; height: 56px; }
.trend .d { font-weight: 800; font-size: 14px; }
.trend .d.up { color: var(--green); } .trend .d.down { color: var(--red); }

/* autofill / paste highlight */
input:-webkit-autofill, input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px var(--bg) inset; -webkit-text-fill-color: var(--text); caret-color: var(--text); transition: background-color 9999s ease-out; }
input::selection { background: var(--blue); color: #fff; }

/* dropdowns */
.selects { display: flex; gap: 8px; }
.selects select { flex: 1; height: 40px; padding: 0 36px 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238C94A3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--text); font-weight: 800; font-size: 13px; letter-spacing: 1px; appearance: none; -webkit-appearance: none; }

/* landing */
.hero { position: relative; border-radius: 14px; background: #0C0E13; min-height: 460px; display: flex; align-items: flex-end; }
.hero-bg { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.hero-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,14,19,0) 30%, rgba(12,14,19,.85) 68%, #0C0E13 100%); }
.hero-copy { position: relative; padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 10px; width: 100%; }
.hero-kicker { font-weight: 800; font-size: 12px; letter-spacing: 3px; color: var(--blue); }
.hero-h1 { margin: 0; font-weight: 800; font-size: 28px; line-height: 1.05; }
.hero-p { margin: 0; color: var(--text2); font-size: 14px; line-height: 1.4; }
.hero-form { display: flex; gap: 8px; margin-top: 4px; }
.hero-form input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font-size: 16px; font-weight: 600; outline: none; }
.hero-form .btn { width: 76px; height: 46px; }
.hero-plat { display: flex; gap: 6px; }
.hero-plat button { height: 30px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 8px; background: transparent; color: var(--muted); font-weight: 800; font-size: 12px; letter-spacing: 1px; }
.hero-plat button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.feat { display: flex; flex-direction: column; gap: 8px; }
.feat-card { padding: 12px 14px; border-radius: 12px; background: var(--card); border-left: 3px solid var(--blue); }
.feat-t { font-weight: 800; font-size: 15px; }
.feat-d { color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.soon { padding: 10px 14px; border-radius: 12px; background: var(--card); color: var(--text2); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }

#logo { display: flex; }
/* compare header, stacked */
.vs2 { display: flex; flex-direction: column; gap: 6px; }
.vs2 .p { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--blue); }
.vs2 .p.b { border-color: var(--red); }
.vs2 .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; width: 42px; flex-shrink: 0; }
.vs2 .p input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font-weight: 800; font-size: 16px; outline: none; }
.vs2 .x { text-align: center; font-weight: 800; font-size: 12px; color: var(--muted); letter-spacing: 2px; line-height: 1; }

.install { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line2); }
.install[hidden], .install-btn[hidden] { display: none; }
.install-icon { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; }
.install-txt { flex: 1; min-width: 0; }
.install-btn { width: auto; padding: 0 16px; height: 40px; font-size: 13px; flex-shrink: 0; }

.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--card); border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.suggest button { display: block; width: 100%; text-align: left; padding: 11px 14px; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 15px; }
.suggest button:last-child { border-bottom: 0; }
.suggest button:active { background: var(--line); }
.search { position: relative; }
.soon-hero { min-height: 520px; }
.trend svg { height: 74px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.wordmark { font-weight: 800; font-size: 17px; letter-spacing: 2px; }
.wordmark em { font-style: normal; color: var(--blue); text-shadow: 0 0 14px rgba(91,141,239,.55); }
.hero-form { position: relative; }

/* ---- match rows are links now ---- */
a.match { text-decoration: none; }
.match .chev { color: var(--muted); font-size: 22px; line-height: 1; padding-left: 2px; }

/* ---- Replay ---- */
.back { display: inline-block; font-weight: 800; font-size: 12px; letter-spacing: 1px; color: var(--muted); text-decoration: none; padding: 6px 0; }
.replay-load { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 0; color: var(--muted); font-weight: 600; }
.replay-load img { width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--blue); object-fit: cover; }
.replay { display: flex; flex-direction: column; gap: 10px; }
.map-wrap { scroll-margin-top: 72px; position: relative; border-radius: 12px; overflow: hidden; background: #0E1116; border: 1px solid var(--line); }
.map-wrap canvas { display: block; width: 100%; }
.hud { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; font-weight: 800; font-size: 12px; }
.hud span { background: rgba(14,17,22,.8); padding: 4px 8px; border-radius: 6px; }
.hud-btn { position: absolute; top: 8px; right: 8px; background: rgba(14,17,22,.8); color: var(--text); border: 1px solid var(--line); border-radius: 6px; font: 800 11px 'Noto Sans', system-ui, sans-serif; letter-spacing: 1px; padding: 5px 9px; }
.feed { position: absolute; left: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 4px; max-width: 80%; pointer-events: none; }
.feed .fi { background: rgba(14,17,22,.82); padding: 4px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .fi.me { border-left: 3px solid var(--red); }
.feed .w, .ev .w { color: var(--muted); font-size: 11px; }
.bubble[hidden] { display: none; }
.bubble { position: absolute; left: 8px; right: 8px; top: 40px; display: flex; gap: 10px; align-items: flex-start; background: rgba(30,34,42,.96); border: 1px solid var(--line2, var(--line)); border-left: 4px solid var(--blue); border-radius: 12px; padding: 10px; animation: pop .25s ease-out; }
.bubble.bad { border-left-color: var(--red); } .bubble.warn { border-left-color: #F5C542; } .bubble.good { border-left-color: var(--green); }
.bubble img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--blue); }
.bubble .bt { font-weight: 800; font-size: 14px; } .bubble .bs { font-size: 12px; color: var(--text2, #c6cad2); margin-top: 2px; }
@keyframes pop { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.controls { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 12px; padding: 8px; }
.controls button { background: var(--line); color: var(--text); border: 0; border-radius: 8px; height: 40px; min-width: 40px; font: 800 16px 'Noto Sans', system-ui, sans-serif; }
.controls button.main { background: var(--blue); color: #fff; min-width: 48px; }
.controls button.spd { font-size: 13px; min-width: 46px; }
.scrub { flex: 1; position: relative; height: 40px; display: flex; align-items: center; }
.scrub .ticks { position: absolute; left: 0; right: 0; top: 6px; height: 6px; pointer-events: none; }
.scrub .ticks i { position: absolute; top: 0; width: 3px; height: 6px; border-radius: 1px; transform: translateX(-1px); }
.scrub input[type=range] { width: 100%; margin: 0; accent-color: var(--blue); }
.squad .sq { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.squad .sq:last-child { border-bottom: 0; }
.squad .sq i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.squad .n { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.squad .you { font-size: 9px; color: var(--blue); letter-spacing: 1px; text-transform: uppercase; }
.squad .k { display: flex; flex-direction: column; align-items: center; min-width: 34px; } .squad .k b { font-weight: 800; line-height: 1; } .squad .k span { font-size: 9px; color: var(--muted); letter-spacing: .8px; }
.squad .died { min-width: 54px; text-align: right; color: var(--muted); font-size: 12px; }
.vee-head { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.vee-head img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--blue); }
.pointers { display: flex; flex-direction: column; gap: 6px; }
.ptr, .ev { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: var(--card); color: var(--text); border: 0; border-left: 4px solid var(--muted); border-radius: 10px; padding: 10px; font-family: inherit; }
.ptr.bad { border-left-color: var(--red); } .ptr.warn { border-left-color: #F5C542; } .ptr.good { border-left-color: var(--green); } .ptr.info { border-left-color: var(--blue); }
.ptr.on { outline: 2px solid var(--blue); }
.pt { font-weight: 800; font-size: 12px; color: var(--muted); min-width: 38px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.pt-t { font-weight: 800; font-size: 14px; } .pt-s { font-size: 12px; color: var(--text2, #c6cad2); margin-top: 2px; }
.evlist .ev { border-radius: 0; border-left-width: 3px; border-left-color: transparent; border-bottom: 1px solid var(--line); padding: 8px 10px; font-size: 13px; align-items: center; }
.evlist .ev.kill { border-left-color: var(--green); } .evlist .ev.knock { border-left-color: #F5C542; } .evlist .ev.me { border-left-color: var(--red); }
.evlist .ev:last-child { border-bottom: 0; }
