:root {
  color-scheme: dark;
  --bg: #080b14;
  --panel: rgba(12, 17, 29, .82);
  --line: rgba(255, 255, 255, .1);
  --text: #f3f7ff;
  --muted: #8290a8;
  --accent: #b9f24a;
  --accent-dark: #18230d;
  --danger: #ff6178;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); }
body { color: var(--text); user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hidden { display: none !important; }

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.glass { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0, 0, 0, .22); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.hud button { pointer-events: auto; }

.brand-panel { position: absolute; top: max(18px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left)); padding: 13px 16px 12px; border-radius: 14px; min-width: 258px; }
.brand { font-size: 14px; font-weight: 850; letter-spacing: 1.6px; display: flex; align-items: center; gap: 5px; }
.brand b { color: var(--accent); }
.brand-mark { width: 9px; height: 9px; margin-right: 4px; border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 0 12px rgba(185, 242, 74, .45); }
.stats { display: flex; gap: 24px; margin-top: 12px; }
.stats div { display: grid; gap: 1px; }
.stats span, .death-stats span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: 1.2px; }
.stats strong { font-size: 18px; font-variant-numeric: tabular-nums; }

.leaders { position: absolute; top: max(18px, env(safe-area-inset-top)); right: max(20px, env(safe-area-inset-right)); width: 220px; padding: 14px 15px 12px; border-radius: 14px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; font-size: 10px; font-weight: 850; letter-spacing: 1.5px; }
.panel-title small { color: var(--accent); font-size: 8px; letter-spacing: 1px; }
.panel-title small::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: var(--accent); }
.leaders ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.leaders li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 6px; color: #a6b1c4; font-size: 10px; }
.leaders li.player { color: var(--accent); font-weight: 750; }
.leaders li .rank { color: #59667c; font-variant-numeric: tabular-nums; }
.leaders li .leader-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaders li strong { color: #dce4f1; font-size: 10px; font-variant-numeric: tabular-nums; }
.leaders li.player strong { color: var(--accent); }

.top-actions { position: absolute; top: max(18px, env(safe-area-inset-top)); right: calc(max(20px, env(safe-area-inset-right)) + 234px); }
.icon-button { width: 38px; height: 38px; padding: 9px; border-radius: 11px; font-size: 20px; line-height: 1; }
.icon-button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; }
.icon-button:hover { border-color: rgba(185, 242, 74, .45); }
.kill-feed { position: absolute; top: 112px; left: max(20px, env(safe-area-inset-left)); width: 280px; display: grid; gap: 5px; }
.kill-feed div { color: #a8b3c5; font-size: 10px; text-shadow: 0 1px 4px #000; animation: feed-in .25s ease-out; }
.kill-feed b { color: #e7edf7; font-weight: 650; }
.kill-feed i { color: var(--danger); font-style: normal; padding: 0 5px; }
@keyframes feed-in { from { opacity: 0; transform: translateX(-8px); } }

.minimap-wrap { position: absolute; left: max(20px, env(safe-area-inset-left)); bottom: max(20px, env(safe-area-inset-bottom)); width: 150px; height: 150px; border-radius: 50%; overflow: hidden; }
#minimap { width: 150px; height: 150px; display: block; }
.map-label { position: absolute; left: 50%; bottom: 9px; transform: translateX(-50%); color: #77859a; font-size: 7px; font-weight: 800; letter-spacing: 2px; }
.zoom-controls { position: absolute; left: max(20px, env(safe-area-inset-left)); bottom: calc(max(20px, env(safe-area-inset-bottom)) + 164px); height: 34px; border-radius: 10px; display: flex; align-items: center; overflow: hidden; }
.zoom-controls button { width: 34px; height: 34px; padding: 0; border: 0; background: transparent; font-size: 20px; }
.zoom-controls button:hover { background: rgba(255, 255, 255, .07); color: var(--accent); }
.zoom-controls span { width: 52px; text-align: center; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }

.boost-status { position: absolute; bottom: max(23px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: 8px auto; column-gap: 8px; align-items: center; text-align: left; transition: color .15s; }
.boost-status > span { grid-row: 1 / 3; width: 6px; height: 24px; border-radius: 5px; background: var(--accent); box-shadow: 0 0 14px rgba(185, 242, 74, .4); }
.boost-status b { font-size: 10px; letter-spacing: 1.4px; }
.boost-status small { color: var(--muted); font-size: 8px; letter-spacing: .8px; margin-top: 2px; }
.boost-status.active > span { background: #fff; animation: boost-pulse .35s infinite alternate; }
.boost-status.blocked { color: var(--danger); }
.boost-status.blocked > span { background: var(--danger); box-shadow: none; }
@keyframes boost-pulse { to { opacity: .35; } }
.touch-boost { display: none; position: absolute; right: max(24px, env(safe-area-inset-right)); bottom: max(26px, env(safe-area-inset-bottom)); width: 82px; height: 82px; border-radius: 50%; border: 1px solid rgba(185, 242, 74, .4); background: rgba(24, 35, 13, .75); color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: 1px; touch-action: none; }
.touch-boost.active { background: var(--accent); color: var(--accent-dark); }
.perf { position: absolute; right: max(20px, env(safe-area-inset-right)); bottom: max(17px, env(safe-area-inset-bottom)); color: rgba(150, 164, 186, .58); font: 8px ui-monospace, monospace; }

.overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 45%, rgba(8, 11, 20, .36), rgba(5, 7, 13, .86)); overflow-y: auto; }
.menu-card { width: min(440px, 100%); text-align: center; padding: 26px 0; }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: 2.6px; }
h1 { margin: 17px 0 8px; font-size: clamp(58px, 8vw, 84px); line-height: .82; letter-spacing: -5px; font-weight: 950; }
h1 span { color: transparent; -webkit-text-stroke: 1px rgba(185, 242, 74, .82); text-stroke: 1px rgba(185, 242, 74, .82); }
.tagline { margin: 20px 0 26px; color: #96a3b8; font-size: 13px; }
.name-field { display: block; width: min(330px, 100%); margin: 0 auto 12px; text-align: left; }
.name-field span { display: block; margin: 0 0 7px 3px; color: #728097; font-size: 8px; font-weight: 800; letter-spacing: 1.5px; }
.name-field input { width: 100%; height: 46px; padding: 0 15px; border: 1px solid var(--line); border-radius: 11px; background: rgba(10, 14, 24, .8); color: var(--text); user-select: text; -webkit-user-select: text; }
.primary-button { width: min(330px, 100%); height: 52px; padding: 0 19px; display: inline-flex; align-items: center; justify-content: space-between; border: 0; border-radius: 11px; background: var(--accent); color: var(--accent-dark); font-size: 11px; font-weight: 900; letter-spacing: 1.2px; box-shadow: 0 10px 32px rgba(145, 196, 46, .15); transition: transform .15s, filter .15s; }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:active { transform: translateY(1px); }
.primary-button i { font-size: 21px; font-style: normal; font-weight: 500; }
.rules { width: min(360px, 100%); margin: 28px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rules > div { min-width: 0; }
.rules b { color: #445066; font-size: 10px; }
.rules p { margin: 6px 0 0; color: #6f7d93; font-size: 9px; line-height: 1.5; }
.rules strong { display: block; color: #c1cbd9; font-size: 10px; font-weight: 650; }
.bot-note { margin-top: 24px; color: #748298; font-size: 9px; }
.bot-note span { display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--accent); }
.overlay footer { position: absolute; bottom: max(20px, env(safe-area-inset-bottom)); color: #526076; font-size: 9px; }
.overlay footer i { padding: 0 8px; font-style: normal; }

.death-overlay { background: rgba(5, 7, 13, .48); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.death-card { width: min(390px, 100%); padding: 30px; border-radius: 20px; text-align: center; }
.death-card h2 { margin: 12px 0 7px; font-size: 28px; letter-spacing: -1px; }
.death-card > p { margin: 0; color: var(--muted); font-size: 12px; }
.death-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 26px 0; }
.death-stats > div { display: grid; gap: 5px; border-right: 1px solid var(--line); }
.death-stats > div:last-child { border: 0; }
.death-stats strong { font-size: 25px; font-variant-numeric: tabular-nums; }
.secondary-button { display: block; width: 100%; height: 42px; margin-top: 9px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .03); color: #9aa8bb; font-size: 10px; font-weight: 750; letter-spacing: 1px; }
.secondary-button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.death-card > small { display: block; margin-top: 16px; color: #647187; font-size: 9px; line-height: 1.5; }
.rotate-hint { position: fixed; z-index: 20; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 9px 13px; border-radius: 8px; background: #151c29; color: #b8c3d3; font-size: 10px; white-space: nowrap; }

@media (pointer: coarse) {
  .touch-boost { display: block; }
  .boost-status { bottom: calc(max(26px, env(safe-area-inset-bottom)) + 94px); left: auto; right: max(26px, env(safe-area-inset-right)); transform: none; }
  .boost-status small { display: none; }
  .boost-status > span { grid-row: auto; height: 14px; }
  #game { cursor: default; }
}

@media (max-width: 700px) {
  .brand-panel { top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); min-width: 0; padding: 10px 12px; }
  .brand { font-size: 11px; }
  .stats { gap: 16px; margin-top: 8px; }
  .stats strong { font-size: 15px; }
  .leaders { top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); width: 156px; padding: 10px; }
  .leaders li { grid-template-columns: 13px minmax(0, 1fr) auto; gap: 3px; font-size: 8px; }
  .leaders li:nth-child(n+7) { display: none; }
  .leaders li strong { font-size: 8px; }
  .top-actions { top: auto; right: auto; left: max(10px, env(safe-area-inset-left)); bottom: calc(max(10px, env(safe-area-inset-bottom)) + 116px); }
  .icon-button { width: 34px; height: 34px; }
  .minimap-wrap { width: 102px; height: 102px; left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); }
  #minimap { width: 102px; height: 102px; }
  .map-label { bottom: 5px; }
  .zoom-controls { left: calc(max(10px, env(safe-area-inset-left)) + 114px); bottom: max(10px, env(safe-area-inset-bottom)); }
  .kill-feed { top: 92px; left: max(10px, env(safe-area-inset-left)); width: 210px; }
  .kill-feed div { font-size: 8px; }
  .perf { display: none; }
  .menu-card { padding: 12px 0 42px; }
  .rules { margin-top: 22px; }
  .overlay footer { display: none; }
}

@media (max-height: 620px) {
  .menu-card { padding: 6px 0; }
  h1 { font-size: 52px; margin-top: 12px; }
  .tagline { margin: 14px 0; }
  .rules { margin-top: 15px; }
  .bot-note { margin-top: 14px; }
  .minimap-wrap { width: 92px; height: 92px; }
  #minimap { width: 92px; height: 92px; }
  .zoom-controls { bottom: max(12px, env(safe-area-inset-bottom)); left: calc(max(10px, env(safe-area-inset-left)) + 102px); }
  .top-actions { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
