:root {
  --bg: #060907;
  --surface: #0d1510;
  --surface-2: #121e17;
  --surface-3: #17261e;
  --text: #f2f6f0;
  --muted: #9caea3;
  --green: #2fe37a;
  --green-2: #0aa85f;
  --gold: #f0c15a;
  --danger: #fb6b6b;
  --line: rgba(255,255,255,.08);
  --shadow: 0 26px 80px rgba(0,0,0,.42);
  --radius: 24px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body {
  background:
    radial-gradient(circle at 10% 0%, rgba(47, 227, 122, .16), transparent 28rem),
    radial-gradient(circle at 90% 18%, rgba(240, 193, 90, .11), transparent 24rem),
    linear-gradient(180deg, #06100a 0%, #050806 100%);
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(100%, 760px); margin: 0 auto; padding: 16px 14px 0; }
.topbar { position: sticky; top: 0; z-index: 10; padding: 8px 0 12px; backdrop-filter: blur(16px); }
.tg-pill { display: inline-flex; align-items: center; gap: 6px; color: #bcd9cb; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: rgba(255,255,255,.04); font-size: 12px; margin-bottom: 10px; }
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; color: var(--gold); background: linear-gradient(145deg, rgba(47,227,122,.16), rgba(240,193,90,.12)); border: 1px solid rgba(240,193,90,.18); font-size: 24px; box-shadow: inset 0 0 30px rgba(47,227,122,.08); }
.brand-title { font-weight: 850; letter-spacing: -.02em; font-size: 22px; }
.brand-subtitle { color: var(--muted); margin-top: 2px; font-size: 14px; }

.hero-card { position: relative; overflow: hidden; margin-top: 8px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(18, 43, 30, .96), rgba(8, 13, 10, .98)); border-radius: 32px; padding: 24px; box-shadow: var(--shadow); min-height: 186px; display: flex; justify-content: space-between; gap: 18px; }
.hero-card::before { content: ""; position: absolute; inset: -20%; background-image: radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; opacity: .24; transform: rotate(-6deg); }
.hero-card > * { position: relative; z-index: 1; }
.eyebrow { color: var(--green); text-transform: uppercase; letter-spacing: .14em; font-weight: 800; font-size: 11px; }
h1 { margin: 8px 0 10px; font-size: clamp(30px, 8vw, 48px); line-height: .95; letter-spacing: -.06em; }
p { color: var(--muted); line-height: 1.5; margin: 0; }
.chip-orbit { flex: 0 0 110px; display: grid; place-items: center; }
.chip { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: repeating-conic-gradient(from 9deg, #103b28 0 12deg, #06120c 12deg 24deg); border: 7px solid rgba(240, 193, 90, .72); box-shadow: 0 0 60px rgba(47,227,122,.17), inset 0 0 0 8px rgba(0,0,0,.3); color: var(--gold); font-size: 44px; }

.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.kpi { border: 1px solid var(--line); border-radius: 22px; padding: 16px; background: rgba(13,21,16,.78); box-shadow: 0 12px 36px rgba(0,0,0,.2); }
.kpi span { color: var(--muted); font-size: 12px; }
.kpi strong { display: block; font-size: 26px; line-height: 1; margin-top: 8px; letter-spacing: -.04em; }
.kpi.gold strong { color: var(--gold); }
.kpi.green strong { color: var(--green); }

.search-card { border: 1px solid var(--line); background: rgba(13,21,16,.86); border-radius: 22px; padding: 14px; margin-bottom: 12px; }
.search-card label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.search-box { display: flex; align-items: center; gap: 10px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); padding: 0 12px; }
.search-box span { color: var(--gold); font-size: 20px; }
.search-box input { width: 100%; min-height: 46px; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-box input::placeholder { color: #6f8278; }

.tabs { display: flex; gap: 8px; margin: 12px 0; padding: 5px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.tab { flex: 1; border: 0; color: var(--muted); background: transparent; border-radius: 14px; padding: 11px 10px; font-weight: 800; }
.tab.active { color: #06110b; background: linear-gradient(135deg, var(--green), #a0ffc2); box-shadow: 0 8px 22px rgba(47,227,122,.22); }

.content-card { border: 1px solid var(--line); border-radius: 28px; background: rgba(9, 15, 11, .72); box-shadow: var(--shadow); overflow: hidden; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 18px 16px 12px; border-bottom: 1px solid var(--line); }
.section-head h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.section-head small { color: var(--muted); }
.rating-list { display: grid; gap: 8px; padding: 12px; }
.player-row { width: 100%; text-align: left; display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; border: 1px solid rgba(255,255,255,.07); background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.02)); color: var(--text); border-radius: 18px; padding: 12px; }
.player-row:hover, .player-row:focus-visible { border-color: rgba(47,227,122,.45); outline: none; }
.rank { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.06); color: var(--muted); font-weight: 900; }
.rank.top { background: linear-gradient(135deg, rgba(240,193,90,.24), rgba(47,227,122,.14)); color: var(--gold); border: 1px solid rgba(240,193,90,.24); }
.player-name { font-weight: 850; letter-spacing: -.02em; }
.player-meta { margin-top: 4px; color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.points { text-align: right; }
.points strong { display: block; font-size: 18px; color: var(--green); }
.points small { color: var(--muted); font-size: 11px; }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px 12px 4px; }
.podium-card { min-height: 138px; padding: 14px 10px; border-radius: 22px; border: 1px solid var(--line); background: rgba(255,255,255,.04); display: flex; flex-direction: column; justify-content: space-between; text-align: center; }
.podium-card:first-child { order: 2; background: linear-gradient(145deg, rgba(240,193,90,.2), rgba(47,227,122,.08)); transform: translateY(-8px); }
.podium-card:nth-child(2) { order: 1; }
.podium-card:nth-child(3) { order: 3; }
.medal { width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; font-weight: 950; background: rgba(240,193,90,.16); color: var(--gold); border: 1px solid rgba(240,193,90,.28); }
.podium-name { font-weight: 850; font-size: 13px; min-height: 34px; display: flex; align-items: center; justify-content: center; }
.podium-score { margin-top: 8px; color: var(--green); font-weight: 900; }

.empty-state { text-align: center; padding: 46px 20px; }
.empty-state > div { color: var(--gold); font-size: 42px; }
.empty-state h3 { margin: 10px 0 6px; }

.bottom-nav { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(calc(100% - 24px), 720px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border: 1px solid rgba(255,255,255,.08); background: rgba(8, 13, 10, .8); backdrop-filter: blur(18px); padding: 8px; border-radius: 24px; box-shadow: 0 18px 60px rgba(0,0,0,.45); z-index: 40; }
.nav-item { border: 0; background: transparent; color: var(--muted); border-radius: 18px; padding: 10px 8px; display: grid; gap: 4px; place-items: center; }
.nav-item span { font-size: 19px; }
.nav-item b { font-size: 12px; }
.nav-item.active { background: rgba(47,227,122,.13); color: var(--green); }

.modal { position: fixed; inset: 0; display: none; z-index: 100; }
.modal[aria-hidden="false"] { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(10px); }
.modal-card { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 760px); max-height: 88vh; overflow: auto; border-radius: 30px 30px 0 0; background: #08100b; border: 1px solid var(--line); padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -30px 80px rgba(0,0,0,.48); }
.modal-close { position: sticky; top: 0; margin-left: auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text); font-size: 24px; z-index: 1; }
.profile-top { display: flex; gap: 14px; align-items: center; margin: 4px 0 18px; }
.avatar { width: 68px; height: 68px; flex: 0 0 68px; display: grid; place-items: center; border-radius: 22px; color: var(--gold); background: linear-gradient(135deg, rgba(47,227,122,.18), rgba(240,193,90,.16)); border: 1px solid rgba(240,193,90,.2); font-size: 30px; font-weight: 900; }
.profile-top h2 { margin: 0 0 6px; font-size: 24px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 6px 9px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); font-size: 12px; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.profile-card { border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 20px; padding: 14px; }
.profile-card small { display: block; color: var(--muted); margin-bottom: 8px; }
.profile-card strong { font-size: 24px; color: var(--green); }
.timeline { display: grid; gap: 8px; }
.event-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.event-row b { color: var(--gold); }
.share-btn { width: 100%; border: 0; margin-top: 14px; border-radius: 18px; padding: 14px; font-weight: 900; color: #06110b; background: linear-gradient(135deg, var(--green), #9fffc2); }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); border-radius: 999px; padding: 10px 14px; color: #06110b; background: var(--green); z-index: 200; font-weight: 900; box-shadow: 0 12px 40px rgba(47,227,122,.24); }

@media (max-width: 520px) {
  .hero-card { padding: 20px; }
  .chip-orbit { flex-basis: 82px; }
  .chip { width: 82px; height: 82px; font-size: 32px; border-width: 6px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .podium { gap: 6px; }
  .podium-card { padding: 12px 6px; }
  .player-row { grid-template-columns: 40px 1fr auto; padding: 10px; }
  .rank { width: 38px; height: 38px; }
  .points strong { font-size: 16px; }
}
