/* Основа: цвета, шрифты, разметка экрана, нижняя панель. */

:root {
  /* «Вечерний витраж»: глубокий синий зал и тёплый золотой свет. */
  --night: #151833;
  --night-2: #1d2147;
  --night-3: #272c5c;
  --line: rgba(222, 214, 255, 0.10);
  --line-2: rgba(222, 214, 255, 0.18);
  --text: #f5efe4;
  --text-2: #b3b2d4;
  --text-3: #7d7ea8;
  --gold: #f6c453;
  --gold-soft: rgba(246, 196, 83, 0.14);
  --teal: #4fd1c0;
  --rose: #f0789b;
  --violet: #8c7cf0;
  --danger: #ff6b6b;

  --font: 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Unbounded', 'Manrope', -apple-system, sans-serif;

  --r-lg: 26px;
  --r-md: 16px;
  --r-sm: 11px;
  --pad: 18px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

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

html, body { margin: 0; background: var(--night); }
/* Двойной тап не увеличивает сайт (щипок двумя пальцами по-прежнему работает),
   и кнопки срабатывают сразу, без задержки на ожидание второго тапа. */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* Мягкое свечение сверху — как свет из окна в тёмном зале. */
.glow {
  position: fixed; inset: -20vh -20vw auto; height: 60vh; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 50% at 25% 40%, rgba(140, 124, 240, 0.28), transparent 70%),
    radial-gradient(35% 45% at 80% 30%, rgba(240, 120, 155, 0.16), transparent 70%),
    radial-gradient(30% 40% at 55% 60%, rgba(79, 209, 192, 0.10), transparent 70%);
  filter: blur(20px);
}

[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { margin: 0; font-weight: 700; }
.h1 { font-family: var(--display); font-size: 27px; line-height: 1.15; letter-spacing: -0.01em; }
.h2 { font-family: var(--display); font-size: 19px; line-height: 1.25; font-weight: 600; }
.h3 { font-size: 17px; font-weight: 700; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 14px; }

/* ---------- Экран ---------- */

.view {
  position: relative; z-index: 1;
  max-width: 720px; margin: 0 auto;
  padding: calc(var(--safe-t) + 14px) var(--pad) calc(var(--tab-h) + var(--safe-b) + 28px);
  animation: enter 0.28s cubic-bezier(.2, .8, .2, 1);
}
.view.no-tabs { padding-bottom: calc(var(--safe-b) + 28px); }

@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

.topbar {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; margin-bottom: 14px;
}
.topbar .title { flex: 1; min-width: 0; }
.topbar .title .h1, .topbar .title .h2 { overflow: hidden; text-overflow: ellipsis; }

.section { margin-top: 30px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.section-head a { color: var(--gold); font-weight: 600; font-size: 15px; }

.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.grow { flex: 1; }

/* ---------- Нижняя панель ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  padding: 6px 8px calc(var(--safe-b) + 6px);
  background: rgba(21, 24, 51, 0.82);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; max-width: 140px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0 4px; border-radius: 14px;
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  transition: color .2s;
}
.tabbar a.on { color: var(--gold); }
.tabbar a:active { transform: scale(0.94); }
body.hide-tabs .tabbar { display: none; }

.offline {
  position: fixed; left: 12px; right: 12px; z-index: 30;
  top: calc(var(--safe-t) + 8px);
  padding: 10px 14px; border-radius: var(--r-md);
  background: #3a2a14; color: var(--gold); font-size: 13.5px; font-weight: 600; text-align: center;
}

@media (min-width: 900px) {
  .view { padding-top: 40px; }
}

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