:root {
  --accent: #AC1301;
  --telegram: #229ED9;
  --bg: #ffffff;
  --text: #1a1a1a;
  --nav-bg: #000000;
  --nav-text: #ffffff;
  --header-h: 47px;
  --footer-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --gold: #F5A623;

  --text-main: #0F172A;
  --text-muted: #64748B;
  --accent-soft: rgba(172, 19, 1, 0.1);
  --border: #E2E8F0;
  --surface: #F8FAFC;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ========== HEADER ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: 10px;
  padding-right: 12px;
  background: #AC1301;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font);
}

.brand {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  height: 100%;
}

.logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.brand-text {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.03em;
  line-height: 1;
}

/* Header Telegram button */
.telegram-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px 0 12px;
  background: #229ED9;
  color: #ffffff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    0 3px 0 #1A7BB0,
    0 4px 10px rgba(34, 158, 217, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.telegram-btn:active {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 #1A7BB0,
    0 2px 6px rgba(34, 158, 217, 0.3);
  background: #1F93CC;
}

.telegram-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
  pointer-events: none;
}

/* ========== CONTENT ========== */
.content {
  position: absolute;
  top: calc(var(--header-h) + var(--safe-top));
  bottom: calc(var(--footer-h) + var(--safe-bottom));
  left: 0;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -30%, rgba(172, 19, 1, 0.08), transparent),
    radial-gradient(ellipse 50% 40% at 100% 110%, rgba(34, 158, 217, 0.05), transparent);
}

.page {
  display: none;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  min-height: 100%;
}

.page.active {
  display: flex;
  flex-direction: column;
}

/* ========== BOTTOM NAV ========== */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(var(--footer-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--nav-bg);
  display: flex;
  align-items: stretch;
  z-index: 100;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--nav-text);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-item img {
  width: 22px;
  height: 22px;
  filter: invert(1);
  transition: none;
  pointer-events: none;
}

.nav-item.active {
  color: var(--accent);
}

.nav-item.active img {
  filter: invert(18%) sepia(95%) saturate(5000%) hue-rotate(350deg) brightness(85%) contrast(110%);
}

.nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

@media (prefers-reduced-motion: reduce) {
  .nav-item,
  .nav-item img,
  .telegram-btn {
    transition: none;
  }
}
