:root {
  --bg: #0c0e13; --bg2: #12151c; --card: #161a23; --line: #232837; --text: #e8eaf0; --dim: #8b92a6;
  --acc: #8b6cff; --acc2: #22d3ee; --win: #22c55e; --loss: #ef4444; --warn: #f59e0b; --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 480px; background: radial-gradient(600px 300px at 20% -10%, rgba(139,108,255,.18), transparent 70%), radial-gradient(500px 260px at 90% 0%, rgba(34,211,238,.10), transparent 70%); pointer-events: none; z-index: -1; }
a { color: inherit; }
img { display: block; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-bottom: 48px; }
.dim { color: var(--dim); font-weight: 500; }

.top { border-bottom: 1px solid var(--line); background: rgba(12,14,19,.8); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -.02em; }
.logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--acc), var(--acc2)); color: var(--bg); font-size: 13px; }
.top nav { display: flex; gap: 4px; }
.top nav a { text-decoration: none; color: var(--dim); padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.top nav a:hover, .top nav a.on { color: var(--text); background: var(--card); }
@media (max-width: 560px) { .top nav { display: none; } }

.hero { padding: 64px 0 32px; text-align: center; }
.hero h1 { font-size: clamp(32px, 6vw, 56px); line-height: 1.05; letter-spacing: -.035em; margin: 0 0 16px; }
.grad { background: linear-gradient(90deg, var(--acc), var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--dim); font-size: 17px; max-width: 560px; margin: 0 auto 32px; }

.search { max-width: 720px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px; text-align: left; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tabs label { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px; cursor: pointer; color: var(--dim); font-size: 14px; font-weight: 600; user-select: none; }
.tabs label:has(input:checked) { background: var(--bg2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.tabs input { position: absolute; opacity: 0; pointer-events: none; }
.tabs label:has(input:focus-visible) { outline: 2px solid var(--acc); }
.tabs svg { width: 16px; height: 16px; }
.search .row { display: flex; gap: 8px; }
.search input[type=search], .search select { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 0 14px; height: 48px; font: inherit; min-width: 0; }
.search input[type=search] { flex: 1; font-size: 16px; }
.search input:focus, .search select:focus { outline: none; border-color: var(--acc); }
.search select { max-width: 190px; }
.search button { height: 48px; padding: 0 22px; border: 0; border-radius: 12px; font: inherit; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--acc), #6d4dff); cursor: pointer; }
.search button:hover { filter: brightness(1.1); }
.search button.busy { opacity: .7; cursor: progress; }
[hidden] { display: none !important; }
@media (max-width: 640px) { .search .row { flex-wrap: wrap; } .search input[type=search] { flex-basis: 100%; } .search select { flex: 1; max-width: none; } .search button { flex: 1; } }

.plats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 24px 0 40px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.pcard b { font-size: 15px; }
.pcard span { font-size: 13px; color: var(--dim); }
.pcard.live { border-color: rgba(34,197,94,.35); }
.pcard.live b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--win); margin-left: 8px; vertical-align: middle; box-shadow: 0 0 8px var(--win); }
.pcard.soon { opacity: .6; }

.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 32px 0 12px; font-weight: 700; }
.recent { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; text-decoration: none; font-size: 14px; max-width: 100%; }
.chip:hover { border-color: var(--acc); }
.chip img { border-radius: 50%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip em { font-style: normal; font-size: 11px; color: var(--dim); }

.phead { display: flex; align-items: center; gap: 20px; padding: 36px 0 8px; }
.ava { width: 112px; height: 112px; border-radius: 22px; border: 2px solid var(--line); object-fit: cover; flex: none; background: var(--card); }
.pinfo { flex: 1; min-width: 0; }
.pinfo h1 { font-size: clamp(26px, 5vw, 38px); margin: 2px 0 4px; letter-spacing: -.03em; line-height: 1.1; overflow-wrap: anywhere; }
.tag { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 13px; font-weight: 600; }
.tag svg { width: 14px; height: 14px; }
.presence { color: var(--dim); }
.presence.online { color: var(--acc2); }
.presence.ingame { color: var(--win); }
.ext { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--dim); text-decoration: none; }
.ext:hover { color: var(--text); }
.lvl { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 18px; flex: none; }
.lvl span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.lvl b { font-size: 26px; }
@media (max-width: 560px) { .phead { flex-wrap: wrap; gap: 14px; } .ava { width: 80px; height: 80px; border-radius: 16px; } .lvl { order: 3; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 24px; }
.stat, .rank { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; }
.stat span, .rank span { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat b, .rank b { font-size: 24px; letter-spacing: -.02em; }
.stat small, .rank small { color: var(--dim); font-size: 13px; }
.rank em { font-style: normal; font-weight: 700; }
.rank { border-left: 3px solid var(--tc, var(--line)); }
.rank.none b { color: var(--dim); }
.t-iron { --tc: #6b6b6b; } .t-bronze { --tc: #a0643c; } .t-silver { --tc: #9aa4b1; } .t-gold { --tc: #e2b04a; } .t-platinum { --tc: #3fb7a6; }
.t-emerald { --tc: #2bc46b; } .t-diamond { --tc: #6f8cff; } .t-master { --tc: #b25cff; } .t-grandmaster { --tc: #ef4444; } .t-challenger { --tc: #f4d27a; }
.pos { color: var(--win); } .neg { color: var(--loss); }

.note { margin-top: 24px; background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.3); color: #fcd9a0; border-radius: var(--r); padding: 14px 16px; }

.glist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.grow { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 10px 10px; }
.grow img { border-radius: 8px; background: var(--bg2); flex: none; }
.gname { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gname small { display: block; color: var(--dim); font-weight: 400; font-size: 12px; }
.topg { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.tg { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; align-items: center; padding-right: 14px; }
.tg img { width: 140px; height: 65px; object-fit: cover; flex: none; background: var(--bg2); }
.tgb { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 6px 10px; align-items: center; }
.tgb .gname { grid-column: 1 / -1; }
.rk { color: var(--dim); margin-right: 8px; font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--bg2); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--acc), var(--acc2)); border-radius: 3px; }
.tgb b { font-size: 14px; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .tg img { width: 96px; height: 45px; } .topg, .glist { grid-template-columns: 1fr; } }

.cols { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.matches { display: flex; flex-direction: column; gap: 6px; }
.match { display: grid; grid-template-columns: 48px 1.3fr 1fr 1fr; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 12px; padding: 10px 14px 10px 10px; }
.match.win { border-left-color: var(--win); background: linear-gradient(90deg, rgba(34,197,94,.07), var(--card) 40%); }
.match.loss { border-left-color: var(--loss); background: linear-gradient(90deg, rgba(239,68,68,.07), var(--card) 40%); }
.match img { border-radius: 10px; }
.match > div { display: flex; flex-direction: column; min-width: 0; }
.match span, .match small { color: var(--dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match.win .mq b { color: var(--win); } .match.loss .mq b { color: var(--loss); } .match.remake .mq b { color: var(--dim); }
.mk b em { font-style: normal; color: var(--loss); }
@media (max-width: 560px) { .match { grid-template-columns: 44px 1fr 1fr; } .match .mc { display: none; } .match img { width: 44px; height: 44px; } }
.mastery { display: flex; flex-direction: column; gap: 6px; }
.mrow { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px 8px 8px; }
.mrow img { border-radius: 8px; }
.mrow div { flex: 1; display: flex; flex-direction: column; }
.mrow small { color: var(--dim); font-size: 12px; }
.mrow em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }

.err { text-align: center; padding: 64px 0; }
.err .code { font-size: 80px; font-weight: 900; letter-spacing: -.05em; line-height: 1; background: linear-gradient(90deg, var(--acc), var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.err h1 { margin: 8px 0; }
.err p { color: var(--dim); margin: 0 0 32px; }

.foot { border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; padding: 24px 0; }
.foot p { margin: 0 0 8px; }
.foot .legal { font-size: 11px; opacity: .7; }

.nowplay { display: flex; gap: 18px; align-items: center; margin-top: 24px; background: linear-gradient(120deg, rgba(34,197,94,.10), var(--card) 55%); border: 1px solid rgba(34,197,94,.3); border-radius: var(--r); padding: 14px; }
.nowplay img { border-radius: 12px; flex: none; width: 96px; height: 96px; object-fit: cover; }
.nowplay h2 { margin: 2px 0; font-size: 22px; letter-spacing: -.02em; }
.nowplay small { color: var(--dim); }
.live-dot { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--win); font-weight: 700; }
.live-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--win); margin-right: 6px; box-shadow: 0 0 8px var(--win); vertical-align: middle; }
.sessions { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.srow { display: grid; grid-template-columns: 1fr auto 90px; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); align-items: center; }
.srow:first-child { border-top: 0; }
.srow b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow span { color: var(--dim); font-size: 13px; }
.srow em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.fine { color: var(--dim); font-size: 12px; margin-top: 24px; }
.fine a { color: var(--dim); }
