/* CYBER SNIPER look, step 5U.1: colors, fonts, base layout, the faint grid and the motion rules.
   Plain CSS, no inline styles anywhere (the page's Content-Security-Policy would block them).
   Phone first (Galaxy S23, about 360 CSS pixels wide). No hover effects: touch only. */

/* Orbitron for titles (SIL Open Font License, see fonts/OFL.txt), saved in the repo: no outside font site. */
@font-face {
  font-family: "Orbitron";
  src: url("../fonts/orbitron.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050809;
  --ink: #d9f7fb;
  --mute: #7d9aa2;
  --dim: #3b5057;
  --cyan: #00e5ff;
  --green: #39ff14;
  --turq: #2de2c0;
  --orange: #ff9a1f;
  --red: #ff2d55;
  --glass: #07161a;
  --cyan-rgb: 0, 229, 255;
  --green-rgb: 57, 255, 20;
  --orange-rgb: 255, 154, 31;
  --red-rgb: 255, 45, 85;
  --turq-rgb: 45, 226, 192;

  --font-title: "Orbitron", "Rajdhani", system-ui, sans-serif;
  --font-num: system-ui, -apple-system, "Segoe UI", Roboto, "Samsung One", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "Roboto Mono", Menlo, Consolas, monospace;

  /* Safe areas: the phone's own plus Telegram's (set by js/lib/telegram.js). */
  --sa-t: calc(env(safe-area-inset-top, 0px) + var(--tg-sa-top, 0px));
  --sa-b: calc(env(safe-area-inset-bottom, 0px) + var(--tg-sa-bottom, 0px));
  --banner-h: calc(32px + var(--sa-t));
  --tabbar-h: 62px;
  --gap: 12px;
  --cut: 12px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-num);
  font-size: 15px;
  line-height: 1.4;
  color-scheme: dark;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow: hidden;
  position: relative;
}

body.modal-open .main {
  overflow: hidden;
}

/* The faint moving grid behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(var(--cyan-rgb), 0.055) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--cyan-rgb), 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 20%, transparent 85%);
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 20%, transparent 85%);
  animation: grid-drift 24s linear infinite;
}

@keyframes grid-drift {
  to {
    background-position: 0 32px, 32px 0;
  }
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: var(--app-h, 100dvh);
  max-width: 560px;
  margin: 0 auto;
}

.app.is-locked > .topbar,
.app.is-locked > .main,
.app.is-locked > .tabbar {
  visibility: hidden;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon--sm {
  width: 18px;
  height: 18px;
}

.icon--lg {
  width: 34px;
  height: 34px;
}

.icon--xl {
  width: 64px;
  height: 64px;
  stroke-width: 1.3;
}

.muted {
  color: var(--mute);
}

.small {
  font-size: 12.5px;
}

.center {
  text-align: center;
}

.pad {
  padding: 18px 8px;
}

.tone-up {
  color: var(--green);
}

.tone-down {
  color: var(--red);
}

.tone-warn {
  color: var(--orange);
}

.tone-mute {
  color: var(--mute);
}

.noscript {
  padding: 24px;
  text-align: center;
}

/* ---- Motion ---- */
@keyframes edge-run {
  from {
    background-position: 0% 0;
  }
  to {
    background-position: 300% 0;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-9px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(4px);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes eq {
  0%,
  100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}

/* The phone's "reduce motion" / "remove animations" setting: everything that moves stops. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
