:root {
  --bg: #030108;
  --neon: #8cff2e;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.7);
  --panel: rgba(10, 6, 20, 0.82);
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --safe-top: max(14px, env(safe-area-inset-top));
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--pixel);
  font-weight: normal;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hidden { display: none !important; }

button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

/* иконки Material Symbols */
.icon {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  display: inline-block;
  vertical-align: middle;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}
.icon.small { font-size: 16px; }

/* ---------- экраны поверх игры ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: var(--safe-top) 16px var(--safe-bottom);
  box-sizing: border-box;
  pointer-events: none;
  text-align: center;
}
.screen button, .screen a { pointer-events: auto; }
.screen.dim {
  justify-content: center;
  background: rgba(3, 1, 8, 0.55);
}

.top, .bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo {
  font-family: 'Russo One', system-ui, sans-serif;
  font-weight: normal;
  font-size: clamp(30px, 10vw, 54px);
  letter-spacing: 0.5px;
  margin-top: 1vh;
  text-shadow: 0 0 18px rgba(34, 211, 255, 0.55), 0 3px 0 #000;
}
.logo b { color: var(--neon); font-weight: inherit; }

.subtitle {
  font-size: clamp(11px, 3.4vw, 16px);
  letter-spacing: 0.6em;
  margin: -6px 0 6px 0.6em;
  color: var(--muted);
}

.note {
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
  text-shadow: 0 1px 2px #000;
}
.hint {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.title {
  font-size: clamp(16px, 5vw, 22px);
  line-height: 1.4;
  letter-spacing: 1px;
  text-shadow: 0 0 16px rgba(140, 255, 46, 0.5);
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(360px, 100%);
  padding: 24px 18px;
  box-sizing: border-box;
  background: var(--panel);
  border: 2px solid rgba(140, 255, 46, 0.45);
  border-radius: 6px;
  box-shadow: 0 0 40px rgba(155, 92, 255, 0.25);
}

.stats {
  width: 100%;
  display: grid;
  gap: 8px;
  margin: 4px 0 8px;
}
.stats > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}
.stats span:first-child { color: var(--muted); font-size: 11px; }
.stats b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(320px, 100%);
  padding: 13px 0;
  border: none;
  border-radius: 6px;
  background: var(--neon);
  color: #05020c;
  font-size: 16px;
  letter-spacing: 1px;
  box-shadow: 0 0 24px rgba(140, 255, 46, 0.5), 0 4px 0 #3f8a07;
}
.btn .icon { font-size: 26px; }
.btn:active { transform: translateY(2px); box-shadow: 0 0 16px rgba(140, 255, 46, 0.5), 0 2px 0 #3f8a07; }
.btn:disabled {
  background: #3a3550;
  color: rgba(255, 255, 255, 0.6);
  box-shadow: none;
  cursor: default;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: none;
  font-size: 13px;
  padding: 11px 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(140, 255, 46, 0.4);
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.skins {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}
.skins span { min-width: 96px; }

.lock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(20, 12, 40, 0.88);
  border: 2px solid #ffc93c;
  color: #ffe08a;
  font-size: 10px;
  line-height: 1.6;
  text-align: left;
}
.lock .icon { font-size: 28px; color: #ffc93c; }
.lock small { color: var(--muted); font-size: 8px; }

.sound-btn.corner {
  position: absolute;
  top: var(--safe-top);
  right: 12px;
}

/* ---------- счётчики ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid rgba(140, 255, 46, 0.35);
  font-size: 13px;
}
.pill.big { font-size: 18px; padding: 8px 20px; }
.pill.chip {
  margin-top: 2px;
  padding: 8px 14px;
  gap: 6px;
  color: var(--text);
  font-size: 9px;
  letter-spacing: 0.5px;
  border-color: rgba(140, 255, 46, 0.6);
  box-shadow: 0 0 14px rgba(140, 255, 46, 0.25);
}
.pill.chip .icon { color: var(--neon); }
.pill.chip:active { transform: translateY(1px); }

/* ---------- контакты обменника ---------- */
#contacts { pointer-events: auto; }   /* тапы мимо панели не должны уходить в игру */
.contacts {
  width: 100%;
  display: grid;
  gap: 8px;
  margin: 2px 0 6px;
}
.contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  text-align: left;
  text-decoration: none;
}
.contact:active { transform: translateY(1px); }
.contact .icon { font-size: 26px; color: var(--neon); }
.contact b { display: block; font-size: 11px; font-weight: normal; }
.contact small { display: block; margin-top: 5px; font-size: 9px; color: var(--muted); }
.contact .go { margin-left: auto; font-size: 22px; color: var(--muted); }
.contact.main {
  background: var(--neon);
  border-color: transparent;
  color: #05020c;
  box-shadow: 0 0 20px rgba(140, 255, 46, 0.45);
}
.contact.main .icon, .contact.main small { color: #05020c; }

.coin {
  flex: none;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe58a, #f39a12 70%);
  box-shadow: inset 0 0 0 2px #a5560a, 0 0 10px rgba(255, 190, 40, 0.6);
}

#hud {
  position: fixed;
  top: var(--safe-top);
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
#hud .icon-btn { pointer-events: auto; }
#hud .sound-btn { margin-left: auto; }

/* активные усилители: значок и полоска оставшегося времени */
#powers {
  display: flex;
  gap: 6px;
}
.power {
  position: relative;
  width: 34px;
  height: 34px;
}
.power img { width: 100%; height: 100%; display: block; }
.power i {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -5px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.power i::after {
  content: '';
  position: absolute;
  inset: 0;
  width: var(--left, 100%);
  background: var(--neon);
}

/* надпись о районе и о вертолёте */
#banner {
  position: fixed;
  top: calc(var(--safe-top) + 62px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  background: rgba(10, 6, 20, 0.85);
  border: 2px solid var(--neon);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  animation: banner 2.6s ease forwards;
}
#banner.alert { border-color: #ff3a3a; color: #ffd0d0; }
#banner.alert .icon { color: #ff3a3a; }
#banner .icon { font-size: 24px; color: var(--neon); }
@keyframes banner {
  0% { opacity: 0; transform: translate(-50%, -12px); }
  12% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- попытки, сообщения, вход только из Telegram (ТЗ от 20.10.2026) ---------- */
.attempts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  font-size: 9px;
}
.attempts .pill { padding: 5px 10px; font-size: 9px; gap: 5px; }
.attempts .pill .icon { font-size: 16px; color: var(--neon); }
.attempts .pill.off { opacity: 0.45; }
.small-coin { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; }
.big-note { font-size: 11px; line-height: 1.7; text-align: center; color: var(--text); }
a.btn { text-decoration: none; box-sizing: border-box; }
#notice, #gate { pointer-events: auto; }
#gate .logo { font-size: clamp(22px, 7vw, 30px); }
.next-cost { margin-top: -4px; font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; }
