/* ============================================================
   PlayHub — базовый слой: сброс, переменные, фон, типографика
   ============================================================ */

/* ---- Сброс ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
img,
svg {
  display: block;
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: none;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
}

/* ---- Тема (по умолчанию тёмная) ---- */
:root {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --violet: #7c5cff;
  --violet-2: #9d7bff;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;

  --accent: var(--violet);
  --accent-rgb: 124, 92, 255;
  --grad-accent: linear-gradient(135deg, #7c5cff 0%, #22d3ee 100%);
  --grad-warm: linear-gradient(135deg, #f472b6 0%, #fbbf24 100%);

  /* тёмные поверхности */
  --bg: #08080e;
  --bg-soft: #0c0c15;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #ececf5;
  --text-dim: #a6a6bd;
  --text-faint: #6f6f88;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
  --glow: 0 0 40px rgba(var(--accent-rgb), 0.35);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --nav-h: 68px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme='light'] {
  --bg: #f4f4fb;
  --bg-soft: #ececf6;
  --surface: rgba(20, 20, 45, 0.04);
  --surface-2: rgba(20, 20, 45, 0.06);
  --surface-3: rgba(20, 20, 45, 0.09);
  --border: rgba(20, 20, 55, 0.1);
  --border-strong: rgba(20, 20, 55, 0.18);
  --text: #16162a;
  --text-dim: #4c4c66;
  --text-faint: #85859c;
  --shadow: 0 14px 40px rgba(40, 40, 90, 0.14);
  --shadow-lg: 0 24px 70px rgba(40, 40, 90, 0.18);
}

/* ---- Базовое тело ---- */
html,
body {
  min-height: 100%;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---- Живой градиентный фон (аврора) ---- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 0%, var(--bg-soft) 0%, var(--bg) 60%);
}
.aurora__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}
.aurora__blob--1 {
  width: 46vw;
  height: 46vw;
  background: radial-gradient(circle, #7c5cff, transparent 70%);
  top: -12vw;
  left: -8vw;
  animation: drift1 22s var(--ease) infinite alternate;
}
.aurora__blob--2 {
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, #22d3ee, transparent 70%);
  top: 20vh;
  right: -10vw;
  animation: drift2 26s var(--ease) infinite alternate;
}
.aurora__blob--3 {
  width: 38vw;
  height: 38vw;
  background: radial-gradient(circle, #f472b6, transparent 70%);
  bottom: -14vw;
  left: 30vw;
  animation: drift3 30s var(--ease) infinite alternate;
}
:root[data-theme='light'] .aurora__blob {
  opacity: 0.28;
}
.aurora__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 40%, transparent 100%);
}
:root[data-theme='light'] .aurora__grid {
  background-image: linear-gradient(rgba(20, 20, 55, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 55, 0.04) 1px, transparent 1px);
}

@keyframes drift1 {
  to {
    transform: translate(8vw, 10vh) scale(1.15);
  }
}
@keyframes drift2 {
  to {
    transform: translate(-10vw, 6vh) scale(1.1);
  }
}
@keyframes drift3 {
  to {
    transform: translate(6vw, -8vh) scale(1.2);
  }
}

/* ---- Каркас приложения ---- */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) clamp(16px, 4vw, 30px);
  padding-bottom: calc(var(--nav-h) + 40px);
}
@media (min-width: 768px) {
  .app-main {
    padding-bottom: 60px;
  }
}

/* ---- Заставка загрузки ---- */
.boot {
  flex: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 22px;
}
.boot__logo {
  font-size: 54px;
  animation: floaty 2.4s ease-in-out infinite;
}
.boot__spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes floaty {
  50% {
    transform: translateY(-10px);
  }
}

/* ---- Заголовки ---- */
h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.gradient-text {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Скроллбар ---- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ---- Доступность ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Переходы между экранами ---- */
.view-enter {
  animation: viewIn 0.4s var(--ease) both;
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

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

/* ---- Утилиты ---- */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.col {
  display: flex;
  flex-direction: column;
}
.wrap {
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.center {
  justify-content: center;
  align-items: center;
}
.gap-sm {
  gap: 8px;
}
.gap-lg {
  gap: 20px;
}
.mt {
  margin-top: 16px;
}
.mt-lg {
  margin-top: 28px;
}
.muted {
  color: var(--text-dim);
}
.faint {
  color: var(--text-faint);
}
.hidden {
  display: none !important;
}
.text-center {
  text-align: center;
}
