/* NEON SNAKE — мобильная PWA. Без внешних шрифтов и ресурсов. */

:root {
  --bg: #04070f;
  --bg2: #0a1122;
  --panel: rgba(8, 16, 32, 0.78);
  --panel-solid: #081020;
  --text: #e8f6ff;
  --muted: #5d6f8f;
  --cyan: #7ef9ff;
  --mid: #3fd0ff;
  --blue: #4a7dff;
  --violet: #b06bff;
  --magenta: #ff4d9d;
  --gold: #ffd24a;
  --orange: #ff9a4d;
  --green: #39ff88;
  --line: rgba(126, 249, 255, 0.18);
  --font: "Bahnschrift", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SF Mono", ui-monospace, monospace;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-appearance: none; appearance: none; }
button:focus-visible, input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.hidden { display: none !important; }

/* ---------------------------------------------------------------- фон */
#bgfx {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, #0e1a36 0%, transparent 55%),
    radial-gradient(100% 70% at 50% 110%, #140b2c 0%, transparent 60%),
    linear-gradient(180deg, #04070f 0%, #060a16 45%, #04070f 100%);
}
#bgfx .scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(126, 249, 255, 0.022) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
  opacity: 0.6;
  pointer-events: none;
}
#bgfx .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.32;
  will-change: transform;
}
.orb-a {
  width: 58vw; height: 58vw; max-width: 520px; max-height: 520px;
  left: -18vw; top: -12vh;
  background: radial-gradient(circle, rgba(63, 208, 255, 0.55), transparent 68%);
  animation: drift-a 18s ease-in-out infinite alternate;
}
.orb-b {
  width: 66vw; height: 66vw; max-width: 620px; max-height: 620px;
  right: -24vw; bottom: -18vh;
  background: radial-gradient(circle, rgba(176, 107, 255, 0.45), transparent 68%);
  animation: drift-b 22s ease-in-out infinite alternate;
}
.orb-c {
  width: 42vw; height: 42vw; max-width: 380px; max-height: 380px;
  right: 8vw; top: 22vh;
  background: radial-gradient(circle, rgba(255, 77, 157, 0.28), transparent 70%);
  animation: drift-c 26s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(8vw, 6vh, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(-7vw, -5vh, 0) scale(0.92); } }
@keyframes drift-c { to { transform: translate3d(-5vw, 8vh, 0) scale(1.18); } }

/* ---------------------------------------------------------------- экраны */
#app { position: fixed; inset: 0; z-index: 1; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-t) + 22px) calc(var(--safe-r) + 18px) calc(var(--safe-b) + 18px) calc(var(--safe-l) + 18px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.995);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  overflow: hidden;
}
.screen.active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ---------------------------------------------------------------- меню */
.screen-menu {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow-y: auto;
  padding-left: calc(var(--safe-l) + 24px);
  padding-right: calc(var(--safe-r) + 24px);
}
.menu-top { text-align: center; margin-top: max(4vh, 18px); }
.eyebrow {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: 0.42em;
  color: var(--muted);
  text-transform: uppercase;
}
.brand {
  margin: 0;
  display: flex;
  flex-direction: column;
  line-height: 0.82;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: clamp(52px, 17.5vw, 118px);
  text-transform: uppercase;
}
.brand span:first-child {
  color: #d9fbff;
  text-shadow:
    0 0 6px rgba(126, 249, 255, 0.9),
    0 0 22px rgba(63, 208, 255, 0.75),
    0 0 52px rgba(74, 125, 255, 0.55);
}
.brand span:last-child {
  color: #9ff7ff;
  text-shadow:
    0 0 8px rgba(126, 249, 255, 0.8),
    0 0 26px rgba(176, 107, 255, 0.65),
    0 0 64px rgba(255, 77, 157, 0.35);
}
.tagline {
  margin: 18px 0 0;
  color: #9fb4cf;
  font-size: clamp(13px, 3.6vw, 16px);
  line-height: 1.55;
  letter-spacing: 0.04em;
}
.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 210, 74, 0.36);
  border-radius: 999px;
  background: rgba(255, 210, 74, 0.06);
  color: #ffe9a0;
  box-shadow: inset 0 0 18px rgba(255, 210, 74, 0.05), 0 0 18px rgba(255, 210, 74, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}
.coin-pill:hover { border-color: rgba(255, 210, 74, 0.7); box-shadow: 0 0 24px rgba(255, 210, 74, 0.18); }
.coin-pill:active { transform: scale(0.98); }
.coin-glyph { color: var(--gold); font-size: 15px; text-shadow: 0 0 10px rgba(255, 210, 74, 0.8); }
.coin-pill b { font-family: var(--mono); font-size: 16px; font-weight: 400; color: #fff3c4; }
.coin-word { font-size: 8px; letter-spacing: 0.18em; color: #b79a52; }
.daily-dot {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 210, 74, 0.16);
  color: var(--gold);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.12em;
  animation: daily-glow 1.8s ease-in-out infinite;
}
@keyframes daily-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 210, 74, 0); }
  50% { box-shadow: 0 0 12px rgba(255, 210, 74, 0.55); }
}

.menu-actions {
  width: min(100%, 380px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 22px;
  border: 1px solid rgba(126, 249, 255, 0.28);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(19, 38, 64, 0.72), rgba(7, 14, 28, 0.85));
  color: #cfeeff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: transform 0.12s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: inset 0 0 22px rgba(63, 208, 255, 0.05);
}
.btn:hover { border-color: rgba(126, 249, 255, 0.6); box-shadow: 0 0 24px rgba(63, 208, 255, 0.16), inset 0 0 24px rgba(63, 208, 255, 0.08); }
.btn:active { transform: scale(0.985); }
.btn-primary {
  border-color: rgba(126, 249, 255, 0.85);
  background: linear-gradient(180deg, #8ffcff, #3fd0ff 55%, #2aa3e6);
  color: #031019;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 26px rgba(63, 208, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn-primary:hover { box-shadow: 0 0 38px rgba(63, 208, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.65); }
.btn-primary .btn-glow {
  position: absolute;
  inset: -40% -10%;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  transform: translateX(-120%) skewX(-18deg);
  animation: sheen 4.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen {
  0%, 55% { transform: translateX(-130%) skewX(-18deg); }
  75%, 100% { transform: translateX(130%) skewX(-18deg); }
}
.btn-shop {
  border-color: rgba(255, 210, 74, 0.45);
  background: linear-gradient(180deg, rgba(58, 43, 14, 0.72), rgba(20, 14, 5, 0.85));
  color: #ffe9a0;
  box-shadow: inset 0 0 22px rgba(255, 210, 74, 0.05);
}
.btn-shop:hover {
  border-color: rgba(255, 210, 74, 0.8);
  box-shadow: 0 0 24px rgba(255, 210, 74, 0.16), inset 0 0 24px rgba(255, 210, 74, 0.08);
}
.btn-ghost {
  border-color: rgba(93, 111, 143, 0.35);
  background: transparent;
  color: #93a8c4;
  min-height: 46px;
  font-size: 12px;
}
.btn-ghost:hover { color: #cfeeff; border-color: rgba(126, 249, 255, 0.35); }
.btn-danger {
  width: min(100%, 380px);
  margin: 18px auto 0;
  border-color: rgba(255, 77, 157, 0.4);
  background: rgba(255, 77, 157, 0.06);
  color: #ff9ec4;
  min-height: 46px;
  font-size: 12px;
}
.btn:disabled { opacity: 0.45; pointer-events: none; }

.menu-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  width: min(100%, 440px);
  border: 1px solid rgba(126, 249, 255, 0.12);
  background: rgba(126, 249, 255, 0.12);
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 6px;
  background: rgba(5, 11, 22, 0.88);
  text-align: center;
}
.stat-label { font-size: 8px; letter-spacing: 0.22em; color: var(--muted); }
.stat-value { font-family: var(--mono); font-size: 24px; line-height: 1; color: var(--cyan); text-shadow: 0 0 12px rgba(126, 249, 255, 0.55); }
.stat-value-sm { font-size: 18px; color: var(--gold); text-shadow: 0 0 12px rgba(255, 210, 74, 0.45); }
.stat-sub { font-size: 7px; letter-spacing: 0.12em; color: #43536b; }

.menu-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 4px; }
.install-btn {
  border: 1px solid rgba(57, 255, 136, 0.5);
  background: rgba(57, 255, 136, 0.08);
  color: #8dffb9;
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  border-radius: 3px;
  box-shadow: 0 0 18px rgba(57, 255, 136, 0.14);
}
.install-btn:active { transform: scale(0.98); }
.menu-note { margin: 0; color: #43536b; font-size: 10px; letter-spacing: 0.14em; }

/* ---------------------------------------------------------------- шапка экранов */
.screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding-bottom: 16px;
}
.screen-head h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.34em;
  color: #cfeaff;
  text-shadow: 0 0 14px rgba(126, 249, 255, 0.35);
}
.head-spacer { width: 44px; }
.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(126, 249, 255, 0.22);
  border-radius: 4px;
  background: rgba(8, 18, 34, 0.7);
  color: #bfe9ff;
  font-size: 18px;
  line-height: 1;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}
.icon-btn:hover { border-color: rgba(126, 249, 255, 0.55); box-shadow: 0 0 18px rgba(63, 208, 255, 0.2); }
.icon-btn:active { transform: scale(0.94); }

/* ---------------------------------------------------------------- список режимов */
.screen-modes, .screen-settings, .screen-net { align-items: center; }
.screen-modes > *, .screen-settings > *, .screen-net > * { width: min(100%, 620px); }
.mode-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
}
.mode-list::-webkit-scrollbar { display: none; }
.mode-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 14px;
  text-align: left;
  border: 1px solid rgba(126, 249, 255, 0.13);
  border-left: 2px solid var(--accent);
  border-radius: 5px;
  background: linear-gradient(100deg, rgba(10, 22, 40, 0.92), rgba(6, 12, 24, 0.75));
  box-shadow: inset 0 0 26px rgba(63, 208, 255, 0.03);
  transition: transform 0.12s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.mode-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 140% at 0% 50%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%);
  opacity: 0.55;
  pointer-events: none;
}
.mode-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 14%, transparent); }
.mode-card:active { transform: scale(0.99); }
.mode-badge {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
  text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  box-shadow: inset 0 0 16px color-mix(in srgb, var(--accent) 12%, transparent);
}
.mode-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mode-name { font-size: 13px; font-weight: 700; letter-spacing: 0.16em; color: #e2f6ff; }
.mode-desc { font-size: 11px; line-height: 1.35; color: #7d90ab; letter-spacing: 0.015em; }
.mode-best { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; gap: 2px; }
.mode-best small { font-size: 7px; letter-spacing: 0.16em; color: #43536b; }
.mode-best b { font-family: var(--mono); font-size: 17px; color: var(--accent); text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 45%, transparent); }
.mode-card-net { border-style: solid; }
.mode-card-net .mode-badge { animation: net-pulse 2.8s ease-in-out infinite; }
@keyframes net-pulse {
  0%, 100% { box-shadow: inset 0 0 16px rgba(57, 255, 136, 0.1), 0 0 0 rgba(57, 255, 136, 0); }
  50% { box-shadow: inset 0 0 18px rgba(57, 255, 136, 0.22), 0 0 18px rgba(57, 255, 136, 0.18); }
}

/* ---------------------------------------------------------------- настройки */
.settings-list {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(126, 249, 255, 0.12);
  border-radius: 5px;
  background: rgba(6, 13, 26, 0.72);
  overflow-y: auto;
  scrollbar-width: none;
}
.settings-list::-webkit-scrollbar { display: none; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(126, 249, 255, 0.075);
}
.setting-row:last-child { border-bottom: 0; }
.setting-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.setting-text span { font-size: 11px; font-weight: 700; letter-spacing: 0.13em; color: #d7ecff; }
.setting-text small { font-size: 10px; color: #61738e; line-height: 1.3; }
.segment {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid rgba(126, 249, 255, 0.16);
  border-radius: 3px;
  overflow: hidden;
  background: rgba(3, 8, 16, 0.7);
}
.segment button {
  border: 0;
  padding: 8px 9px;
  background: transparent;
  color: #7286a1;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  white-space: nowrap;
}
.segment button + button { border-left: 1px solid rgba(126, 249, 255, 0.1); }
.segment button.active { background: rgba(63, 208, 255, 0.16); color: #bff6ff; box-shadow: inset 0 0 12px rgba(63, 208, 255, 0.18); }
.switch {
  flex: 0 0 auto;
  width: 50px;
  height: 28px;
  padding: 3px;
  border: 1px solid rgba(126, 249, 255, 0.2);
  border-radius: 999px;
  background: rgba(3, 8, 16, 0.85);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.switch span {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4a5c74;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.switch[aria-checked="true"] { background: rgba(63, 208, 255, 0.22); border-color: rgba(126, 249, 255, 0.65); box-shadow: 0 0 14px rgba(63, 208, 255, 0.2); }
.switch[aria-checked="true"] span { transform: translateX(22px); background: #8ffcff; box-shadow: 0 0 12px rgba(126, 249, 255, 0.75); }
.settings-note { margin: 14px 0 0; color: #43536b; font-size: 10px; letter-spacing: 0.08em; text-align: center; }

/* ---------------------------------------------------------------- магазин */
.screen-shop { align-items: center; }
.screen-shop > * { width: min(100%, 620px); }
.shop-balance {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 44px;
  justify-content: flex-end;
  font-family: var(--mono);
  color: var(--gold);
  font-size: 15px;
  text-shadow: 0 0 10px rgba(255, 210, 74, 0.45);
}
.shop-balance span { font-size: 11px; }
.shop-balance b { font-weight: 400; }
.shop-scroll {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  padding: 2px 2px 18px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.shop-scroll::-webkit-scrollbar { display: none; }
.daily-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 210, 74, 0.28);
  border-radius: 6px;
  background:
    radial-gradient(120% 160% at 0% 50%, rgba(255, 210, 74, 0.13), transparent 55%),
    rgba(8, 14, 26, 0.85);
  box-shadow: inset 0 0 30px rgba(255, 210, 74, 0.04);
}
.daily-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 210, 74, 0.45);
  border-radius: 50%;
  color: var(--gold);
  font-size: 17px;
  text-shadow: 0 0 12px rgba(255, 210, 74, 0.8);
  background: rgba(255, 210, 74, 0.08);
}
.daily-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.daily-copy b { font-size: 11px; letter-spacing: 0.14em; color: #ffe9a0; }
.daily-copy small { font-size: 9px; line-height: 1.35; color: #8f7f55; }
.daily-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 210, 74, 0.55);
  border-radius: 4px;
  background: linear-gradient(180deg, #ffe28a, #f2b93c);
  color: #241600;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  box-shadow: 0 0 18px rgba(255, 210, 74, 0.18);
}
.daily-btn:disabled {
  border-color: rgba(255, 210, 74, 0.15);
  background: rgba(255, 210, 74, 0.05);
  color: #6e6248;
  box-shadow: none;
}
.shop-tabs { display: flex; gap: 7px; margin-bottom: 12px; }
.shop-tab {
  flex: 1;
  padding: 10px 6px;
  border: 1px solid rgba(126, 249, 255, 0.16);
  border-radius: 4px;
  background: rgba(6, 13, 26, 0.7);
  color: #7286a1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
}
.shop-tab.active {
  border-color: rgba(255, 210, 74, 0.55);
  background: rgba(255, 210, 74, 0.12);
  color: #ffe9a0;
  box-shadow: inset 0 0 18px rgba(255, 210, 74, 0.08);
}
.shop-panel { display: flex; flex-direction: column; gap: 10px; }
.shop-lead { margin: 0; color: #8fa7c2; font-size: 10px; line-height: 1.5; }
.shop-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
.shop-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border: 1px solid rgba(126, 249, 255, 0.12);
  border-radius: 5px;
  background: linear-gradient(100deg, rgba(10, 22, 40, 0.9), rgba(6, 12, 24, 0.72));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.shop-item.equipped { border-color: rgba(255, 210, 74, 0.45); box-shadow: inset 0 0 24px rgba(255, 210, 74, 0.05); }
.shop-item.owned { border-color: rgba(57, 255, 136, 0.28); }
.skin-preview {
  position: relative;
  flex: 0 0 auto;
  width: 62px;
  height: 38px;
  border: 1px solid rgba(126, 249, 255, 0.14);
  border-radius: 4px;
  background: #050b16;
  overflow: hidden;
}
.skin-preview::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 13px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, var(--s0), var(--s1), var(--s2));
  box-shadow: 0 0 10px var(--s1);
}
.skin-preview::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #04101c;
  transform: translateY(-50%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.cheat-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(176, 107, 255, 0.45);
  border-radius: 8px;
  background: rgba(176, 107, 255, 0.08);
  color: #d9b8ff;
  font-family: var(--mono);
  font-size: 13px;
  text-shadow: 0 0 12px rgba(176, 107, 255, 0.65);
}
.shop-item-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shop-item-body b { font-size: 11px; letter-spacing: 0.12em; color: #e2f6ff; }
.shop-item-body small { font-size: 9px; line-height: 1.35; color: #7d90ab; }
.shop-buy {
  flex: 0 0 auto;
  min-height: 34px;
  max-width: 112px;
  padding: 7px 9px;
  border: 1px solid rgba(126, 249, 255, 0.3);
  border-radius: 3px;
  background: rgba(63, 208, 255, 0.09);
  color: #bff6ff;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.08em;
}
.shop-buy:active { transform: scale(0.97); }
.shop-buy.buy { border-color: rgba(255, 210, 74, 0.4); background: rgba(255, 210, 74, 0.08); color: #ffe9a0; }
.shop-buy.equipped { border-color: rgba(255, 210, 74, 0.7); background: rgba(255, 210, 74, 0.16); color: #fff3c4; }
.shop-buy.owned { border-color: rgba(57, 255, 136, 0.35); background: rgba(57, 255, 136, 0.07); color: #8dffb9; }
.shop-buy.cheat-on { border-color: rgba(176, 107, 255, 0.65); background: rgba(176, 107, 255, 0.16); color: #e0c8ff; box-shadow: 0 0 12px rgba(176, 107, 255, 0.18); }
.shop-buy.cheat-off { border-color: rgba(93, 111, 143, 0.4); background: transparent; color: #7286a1; }
.shop-buy:disabled { opacity: 0.45; }
.code-row { display: flex; gap: 8px; }
.promo-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 12px;
  border: 1px solid rgba(126, 249, 255, 0.28);
  border-radius: 4px;
  background: rgba(3, 8, 16, 0.9);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  caret-color: var(--cyan);
}
.promo-input::placeholder { color: #2f3d52; letter-spacing: 0.08em; }
.promo-input:focus { border-color: var(--cyan); box-shadow: 0 0 18px rgba(63, 208, 255, 0.2); outline: 0; }
.code-btn { flex: 0 0 auto; width: 84px; min-height: 46px; padding: 8px; font-size: 11px; letter-spacing: 0.16em; }
.code-status { min-height: 18px; color: #7286a1; font-size: 10px; line-height: 1.4; letter-spacing: 0.03em; }
.code-status.ok { color: var(--green); }
.code-status.err { color: #ff7ca8; }
.code-hints {
  margin-top: 4px;
  padding: 12px 13px;
  border: 1px solid rgba(126, 249, 255, 0.1);
  border-radius: 5px;
  background: rgba(6, 13, 26, 0.6);
}
.code-hints b { display: block; margin-bottom: 6px; font-size: 9px; letter-spacing: 0.18em; color: #8fa7c2; }
.code-hints p { margin: 0 0 6px; color: #61738e; font-size: 9.5px; line-height: 1.5; }
.code-hints p:last-child { margin-bottom: 0; }
.code-hints .code-example { color: #8dffb9; }
.code-hints .code-example span { font-family: var(--mono); letter-spacing: 0.08em; color: var(--gold); }

/* ---------------------------------------------------------------- сеть */
.screen-net { justify-content: flex-start; }
.net-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.net-tab {
  flex: 1;
  padding: 11px 8px;
  border: 1px solid rgba(126, 249, 255, 0.16);
  border-radius: 4px;
  background: rgba(6, 13, 26, 0.7);
  color: #7286a1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.net-tab.active { color: #031019; background: linear-gradient(180deg, #8ffcff, #3fd0ff); border-color: transparent; box-shadow: 0 0 22px rgba(63, 208, 255, 0.3); }
.net-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 16px;
  border: 1px solid rgba(126, 249, 255, 0.12);
  border-radius: 6px;
  background: rgba(6, 13, 26, 0.75);
  text-align: center;
}
.net-lead { margin: 0; color: #9fb4cf; font-size: 12px; line-height: 1.5; }
.room-code {
  font-family: var(--mono);
  font-size: clamp(34px, 13vw, 56px);
  letter-spacing: 0.22em;
  color: var(--green);
  text-shadow: 0 0 10px rgba(57, 255, 136, 0.55), 0 0 36px rgba(57, 255, 136, 0.22);
  padding: 8px 0 6px 0.22em;
  line-height: 1;
}
.net-status { min-height: 18px; color: #7286a1; font-size: 11px; letter-spacing: 0.04em; }
.net-status.ok { color: var(--green); }
.net-status.err { color: #ff7ca8; }
.net-actions { display: flex; flex-direction: column; gap: 8px; width: min(100%, 320px); margin-top: 4px; }
.net-note { margin: 4px 0 0; color: #43536b; font-size: 10px; line-height: 1.45; max-width: 360px; }
.code-label { font-size: 9px; letter-spacing: 0.24em; color: var(--muted); align-self: flex-start; margin-left: max(0px, calc(50% - 150px)); }
.code-input {
  width: min(100%, 300px);
  padding: 12px 8px;
  border: 1px solid rgba(126, 249, 255, 0.3);
  border-radius: 4px;
  background: rgba(3, 8, 16, 0.9);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 30px;
  letter-spacing: 0.28em;
  text-align: center;
  text-transform: uppercase;
  caret-color: var(--cyan);
}
.code-input::placeholder { color: #2f3d52; }
.code-input:focus { border-color: var(--cyan); box-shadow: 0 0 20px rgba(63, 208, 255, 0.22); outline: 0; }

/* ---------------------------------------------------------------- игра */
.screen-game {
  padding: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(14, 26, 54, 0.55), transparent 60%);
}
.hud {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 8px;
  padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 14px) 6px calc(var(--safe-l) + 14px);
}
.hud-block { display: flex; flex-direction: column; min-width: 0; }
.hud-left { align-items: flex-start; }
.hud-center { align-items: center; text-align: center; }
.hud-right { align-items: flex-end; }
.hud-label { font-size: 8px; letter-spacing: 0.24em; color: var(--muted); }
.hud-score {
  font-family: var(--mono);
  font-size: clamp(26px, 8vw, 38px);
  line-height: 1.05;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(126, 249, 255, 0.6), 0 0 24px rgba(63, 208, 255, 0.3);
}
.hud-best { font-size: 8px; letter-spacing: 0.1em; color: #4d5f78; }
.hud-best b { color: #8fa7c2; font-family: var(--mono); }
.hud-mode { font-size: 10px; font-weight: 700; letter-spacing: 0.2em; color: #cfeaff; }
.hud-timer { font-family: var(--mono); font-size: 18px; color: var(--gold); text-shadow: 0 0 10px rgba(255, 210, 74, 0.45); }
.hud-timer.low { color: #ff6b9b; text-shadow: 0 0 12px rgba(255, 77, 157, 0.6); animation: timer-pulse 0.8s ease-in-out infinite; }
@keyframes timer-pulse { 50% { opacity: 0.55; } }
.hud-sub { font-size: 8px; letter-spacing: 0.14em; color: #4d5f78; margin-top: 2px; }
.hud-right .icon-btn { width: 40px; height: 40px; font-size: 13px; }

.rivals-bar {
  display: flex;
  gap: 6px;
  padding: 0 calc(var(--safe-r) + 14px) 6px calc(var(--safe-l) + 14px);
  flex: 0 0 auto;
}
.rival-chip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(126, 249, 255, 0.12);
  border-radius: 3px;
  background: rgba(5, 11, 22, 0.7);
  font-size: 9px;
  letter-spacing: 0.08em;
}
.rival-chip .rname { color: var(--c, #ff9ad0); }
.rival-chip .rscore { font-family: var(--mono); font-size: 13px; color: #dff6ff; }
.rival-chip.me { border-color: rgba(126, 249, 255, 0.4); }
.rival-chip.dead { opacity: 0.5; }

.field-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 2px 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.fx-chips {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  pointer-events: none;
  flex-wrap: wrap;
  justify-content: center;
  width: 96%;
}
.fx-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--c, rgba(126, 249, 255, 0.5));
  border-radius: 999px;
  background: rgba(4, 10, 20, 0.82);
  color: var(--c, #bff6ff);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  box-shadow: 0 0 14px color-mix(in srgb, var(--c, #7ef9ff) 22%, transparent);
  animation: chip-in 0.2s ease;
}
.fx-chip b { font-family: var(--mono); font-weight: 400; opacity: 0.8; }
.fx-chip.fx-cheat { border-style: dashed; background: rgba(28, 18, 4, 0.85); letter-spacing: 0.12em; }
@keyframes chip-in { from { opacity: 0; transform: translateY(-4px); } }
.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: clamp(70px, 26vw, 150px);
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(126, 249, 255, 0.75), 0 0 70px rgba(63, 208, 255, 0.45);
  pointer-events: none;
}
.swipe-hint {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(126, 249, 255, 0.45);
  pointer-events: none;
  transition: opacity 0.4s ease;
  white-space: nowrap;
}
.swipe-hint.fade { opacity: 0; }

.touch-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px calc(var(--safe-r) + 16px) calc(var(--safe-b) + 12px) calc(var(--safe-l) + 16px);
  min-height: 132px;
}
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(3, 46px);
  gap: 4px;
  place-items: center;
}
.dpad-btn {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(126, 249, 255, 0.24);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(15, 32, 55, 0.85), rgba(5, 12, 24, 0.9));
  color: #9fe9ff;
  font-size: 15px;
  box-shadow: inset 0 0 14px rgba(63, 208, 255, 0.08);
  touch-action: none;
  transition: transform 0.08s ease, background 0.1s ease, box-shadow 0.1s ease;
}
.dpad-btn:active, .dpad-btn.pressed {
  transform: scale(0.9);
  background: rgba(63, 208, 255, 0.25);
  box-shadow: 0 0 18px rgba(63, 208, 255, 0.3), inset 0 0 18px rgba(126, 249, 255, 0.2);
}
.dpad-btn.up { grid-column: 2; grid-row: 1; }
.dpad-btn.left { grid-column: 1; grid-row: 2; }
.dpad-btn.right { grid-column: 3; grid-row: 2; }
.dpad-btn.down { grid-column: 2; grid-row: 3; }
.dpad-core {
  grid-column: 2;
  grid-row: 2;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(126, 249, 255, 0.4);
  box-shadow: 0 0 12px rgba(126, 249, 255, 0.5);
}
.touch-side { display: flex; flex-direction: column; gap: 6px; max-width: 120px; }
.swipe-note { color: #43536b; font-size: 9px; line-height: 1.45; letter-spacing: 0.06em; }

/* ---------------------------------------------------------------- оверлей */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-t) + 20px) 20px calc(var(--safe-b) + 20px);
  background: rgba(2, 5, 11, 0.72);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: overlay-in 0.18s ease;
}
@keyframes overlay-in { from { opacity: 0; } }
.overlay-card {
  width: min(100%, 380px);
  max-height: calc(100dvh - var(--safe-t) - var(--safe-b) - 40px);
  overflow-y: auto;
  padding: 24px 20px 20px;
  border: 1px solid rgba(126, 249, 255, 0.2);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(10, 22, 42, 0.97), rgba(4, 9, 18, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65), 0 0 40px rgba(63, 208, 255, 0.08);
  text-align: center;
}
.overlay-card h3 {
  margin: 0 0 6px;
  font-size: 19px;
  letter-spacing: 0.18em;
  color: #dff8ff;
  text-shadow: 0 0 16px rgba(126, 249, 255, 0.4);
}
.overlay-card .overlay-kicker { margin: 0 0 10px; font-size: 9px; letter-spacing: 0.28em; color: var(--muted); }
.overlay-card .overlay-text { margin: 8px 0 0; color: #8fa7c2; font-size: 12px; line-height: 1.55; }
.overlay-score {
  margin: 16px 0;
  font-family: var(--mono);
  font-size: 48px;
  line-height: 1;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(126, 249, 255, 0.6), 0 0 40px rgba(63, 208, 255, 0.3);
}
.overlay-score small { display: block; margin-top: 6px; font-family: var(--font); font-size: 9px; letter-spacing: 0.22em; color: var(--muted); }
.overlay-record { display: inline-block; margin-bottom: 8px; padding: 4px 10px; border: 1px solid rgba(255, 210, 74, 0.5); border-radius: 999px; color: var(--gold); font-size: 9px; letter-spacing: 0.16em; box-shadow: 0 0 16px rgba(255, 210, 74, 0.18); }
.overlay-reward { display: inline-block; margin: 8px 0 0; padding: 5px 12px; border: 1px solid rgba(255, 210, 74, 0.3); border-radius: 999px; background: rgba(255, 210, 74, 0.07); color: #ffe9a0; font-size: 10px; letter-spacing: 0.1em; }
.overlay-vs { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 18px 0 4px; }
.overlay-vs div { display: flex; flex-direction: column; gap: 4px; }
.overlay-vs span { font-size: 8px; letter-spacing: 0.16em; color: var(--muted); }
.overlay-vs b { font-family: var(--mono); font-size: 28px; color: #dff8ff; }
.overlay-vs .vs-sign { font-size: 10px; color: #43536b; letter-spacing: 0.2em; }
.overlay-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.overlay-actions .btn { width: 100%; min-height: 48px; font-size: 12px; }
.overlay-actions .btn-ghost { min-height: 42px; }

/* ---------------------------------------------------------------- тост */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 22px);
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100vw - 40px);
  padding: 10px 16px;
  border: 1px solid rgba(126, 249, 255, 0.3);
  border-radius: 4px;
  background: rgba(5, 12, 24, 0.95);
  color: #bfe9ff;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 18px rgba(63, 208, 255, 0.12);
  animation: toast-in 0.2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } }

/* ---------------------------------------------------------------- адаптив */
@media (max-height: 620px) {
  .menu-top { margin-top: 4px; }
  .tagline { margin-top: 10px; }
  .coin-pill { margin-top: 8px; padding: 6px 12px; }
  .menu-stats { display: none; }
  .menu-actions { gap: 7px; }
  .btn { min-height: 46px; }
  .daily-card { padding: 9px 11px; }
  .daily-copy small { display: none; }
  .shop-lead { display: none; }
  .touch-controls { min-height: 104px; padding-top: 2px; padding-bottom: calc(var(--safe-b) + 4px); }
  .dpad { grid-template-columns: repeat(3, 40px); grid-template-rows: repeat(3, 40px); }
  .dpad-btn { width: 40px; height: 40px; }
  .hud { padding-top: calc(var(--safe-t) + 4px); }
}

@media (min-width: 560px) {
  .shop-list { grid-template-columns: 1fr 1fr; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .touch-controls { min-height: 84px; }
  .dpad { grid-template-columns: repeat(3, 36px); grid-template-rows: repeat(3, 36px); }
  .dpad-btn { width: 36px; height: 36px; font-size: 12px; }
  .touch-side { display: none; }
}

@media (min-width: 760px) {
  .screen-menu { justify-content: center; gap: 28px; }
  .menu-top { margin-top: 0; }
  .touch-controls { min-height: 150px; }
}

@media (hover: hover) and (pointer: fine) {
  .screen-game { cursor: default; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  .screen { transition: none; }
}
