/* GRAPE RP — тёмная тема + фиолетовый акцент */
:root {
  --bg: #08080c;
  --bg-card: #0f0f14;
  --bg-elevated: #16161e;
  --bg-glass: rgba(15, 15, 20, 0.75);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --accent-dark: #6d28d9;
  --border: rgba(167, 139, 250, 0.15);
  --gradient: linear-gradient(135deg, #6d28d9 0%, #7c3aed 40%, #a78bfa 100%);
  --gradient-subtle: linear-gradient(180deg, rgba(109, 40, 217, 0.12) 0%, transparent 60%);
  --shadow-glow: 0 0 60px rgba(109, 40, 217, 0.2);
  --radius: 16px;
  --radius-sm: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

/* Фоновый градиент-сетка и картинка фона */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(109, 40, 217, 0.25), transparent 50%),
    radial-gradient(ellipse 80% 60% at 90% 20%, rgba(124, 58, 237, 0.12), transparent 45%),
    radial-gradient(ellipse 70% 50% at 10% 70%, rgba(139, 92, 246, 0.08), transparent 45%),
    linear-gradient(180deg, rgba(8, 8, 12, 0.7) 0%, rgba(8, 8, 12, 0.85) 100%),
    url('../images/background.jpg') center / cover no-repeat;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: color 0.2s, transform 0.2s;
}

.logo:hover,
.logo.active {
  color: var(--accent);
}

.logo:hover {
  transform: scale(1.02);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  display: block;
  height: 36px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: inherit;
}

.logo:hover .logo-text,
.logo.active .logo-text {
  color: var(--accent);
}

.logo-img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(167, 139, 250, 0.08);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(167, 139, 250, 0.12);
}

.nav-donate {
  color: var(--accent) !important;
  font-weight: 600;
}

.nav-donate:hover,
.nav-donate.active {
  color: var(--accent-hover) !important;
  background: rgba(167, 139, 250, 0.15);
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.burger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.burger.burger-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger.burger-open span:nth-child(2) { opacity: 0; }
.burger.burger-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.main {
  padding-top: 68px;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.page-content {
  padding: 48px 0 80px;
}

.page-content-narrow {
  max-width: 440px;
  margin: 0 auto;
}

.page-title {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.page-desc {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 1rem;
}

/* Карточки */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: rgba(167, 139, 250, 0.25);
  box-shadow: var(--shadow-glow);
}

/* Hero (Главная) */
.hero {
  position: relative;
  width: 100%;
  padding: 80px 0 100px;
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background: var(--gradient-subtle);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  padding: 6px 14px;
  background: rgba(167, 139, 250, 0.12);
  border-radius: 100px;
  animation: fadeInDown 0.6s ease-out;
}

.hero-title {
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 18px;
  letter-spacing: -0.03em;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-subtitle {
  font-size: 1.06rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.65;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 48px;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 24px rgba(109, 40, 217, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(109, 40, 217, 0.45);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: rgba(167, 139, 250, 0.1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-online {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 36px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hero-online-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: lowercase;
  margin-bottom: 4px;
}

.hero-online-count {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Форум */
.forum-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.forum-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  cursor: pointer;
}

.forum-card-icon {
  font-size: 2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(167, 139, 250, 0.1);
  border-radius: var(--radius-sm);
}

.forum-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.forum-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.forum-stat {
  font-size: 0.8rem;
  color: var(--accent);
}

/* Начать играть */
.play-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.play-card {
  text-align: center;
  padding: 32px 24px;
}

.play-card-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.play-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.play-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.play-steps h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  text-align: center;
}

.steps-list {
  max-width: 480px;
  margin: 0 auto;
  padding-left: 24px;
  color: var(--text-muted);
  line-height: 2;
}

.steps-list li {
  margin-bottom: 8px;
}

/* Пополнить */
.donate-card {
  padding: 32px;
}

.donate-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.donate-btn {
  padding: 12px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.donate-btn:hover {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.06);
}

.donate-btn-active {
  border-color: var(--accent);
  background: rgba(167, 139, 250, 0.12);
  color: var(--accent);
}

.donate-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 36px 0;
}

.footer-inner {
  text-align: center;
}

.footer-copy {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.footer-company {
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.85;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-email {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-email:hover {
  text-decoration: underline;
}

/* ========== Мобильная адаптация ========== */

/* Планшеты и узкий десктоп */
@media (max-width: 900px) {
  .nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 16px;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .nav.nav-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    padding: 14px 16px;
    min-height: 48px;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
  }

  .burger {
    display: flex;
  }

  .hero {
    padding: 48px 0 64px;
    min-height: calc(100vh - 68px);
    min-height: calc(100dvh - 68px);
  }

  .hero-inner {
    padding: 0 8px;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 6px 12px;
    margin-bottom: 16px;
  }

  .hero-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
    margin-bottom: 14px;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 28px;
    line-height: 1.6;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 36px;
  }

  .btn {
    width: 100%;
    max-width: 320px;
    padding: 16px 24px;
    font-size: 1rem;
    min-height: 48px;
  }

  .hero-online {
    padding: 16px 28px;
    width: 100%;
    max-width: 200px;
  }

  .hero-online-count {
    font-size: 1.75rem;
  }

  .page-content {
    padding: 32px 0 56px;
  }

  .page-title {
    font-size: clamp(1.5rem, 5vw, 1.9rem);
    margin-bottom: 6px;
  }

  .page-desc {
    margin-bottom: 28px;
    font-size: 0.95rem;
  }

  .card {
    padding: 20px;
  }

  .play-cards {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 36px;
  }

  .play-card {
    padding: 24px 20px;
  }

  .play-card-icon {
    font-size: 2.5rem;
  }

  .forum-card {
    padding: 20px;
    gap: 16px;
  }

  .forum-card-icon {
    width: 48px;
    height: 48px;
    font-size: 1.75rem;
    flex-shrink: 0;
  }

  .footer {
    padding: 28px 0;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }
}

/* Телефоны */
@media (max-width: 600px) {
  .header-inner {
    height: 56px;
  }

  .nav {
    top: 56px;
    max-height: calc(100vh - 56px);
  }

  .main {
    padding-top: 56px;
  }

  .logo {
    font-size: 1.25rem;
  }

  .logo-icon {
    height: 30px;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  .hero {
    padding: 32px 0 48px;
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
  }

  .hero-title {
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
    margin-bottom: 12px;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    margin-bottom: 24px;
  }

  .hero-buttons {
    margin-bottom: 28px;
  }

  .btn {
    max-width: none;
    min-height: 50px;
  }

  .hero-online {
    padding: 14px 24px;
    max-width: none;
  }

  .hero-online-count {
    font-size: 1.6rem;
  }

  .page-content {
    padding: 24px 0 48px;
  }

  .page-content-narrow .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-title {
    font-size: clamp(1.35rem, 5vw, 1.65rem);
  }

  .page-desc {
    margin-bottom: 24px;
    font-size: 0.9rem;
  }

  .card {
    padding: 18px;
    border-radius: 14px;
  }

  .forum-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 18px;
  }

  .forum-card-icon {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }

  .forum-card h3 {
    font-size: 1rem;
  }

  .forum-card p {
    font-size: 0.85rem;
  }

  .play-card {
    padding: 22px 18px;
  }

  .play-card h3 {
    font-size: 1.15rem;
  }

  .play-card p {
    font-size: 0.85rem;
    margin-bottom: 16px;
  }

  .play-steps h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }

  .steps-list {
    padding-left: 20px;
    font-size: 0.9rem;
    line-height: 1.85;
  }

  .donate-card {
    padding: 24px 18px;
  }

  .donate-amounts {
    gap: 10px;
  }

  .donate-btn {
    flex: 1 1 calc(50% - 6px);
    min-width: calc(50% - 6px);
    padding: 14px 12px;
    min-height: 48px;
    font-size: 0.95rem;
  }

  .footer {
    padding: 24px 0;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .footer-copy,
  .footer-company,
  .footer-links a,
  .footer-email {
    font-size: 0.8rem;
  }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
  .hero-badge {
    font-size: 0.7rem;
    padding: 5px 10px;
  }

  .hero-title {
    font-size: 1.3rem;
  }

  .hero-subtitle {
    font-size: 0.85rem;
  }

  .donate-btn {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .page-content-narrow {
    max-width: 100%;
  }
}

/* Очень узкие экраны (напр. в портрете) */
@media (max-width: 380px) {
  .container {
    padding: 0 12px;
  }

  .hero-title {
    font-size: 1.2rem;
  }

  .hero-subtitle {
    font-size: 0.82rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .card {
    padding: 16px;
  }

  .forum-card,
  .play-card,
  .kb-card {
    padding: 16px;
  }
}

/* Отключение hover-эффектов на тач-устройствах (меньше задержки) */
@media (hover: none) {
  .btn:hover {
    transform: none;
  }

  .card:hover {
    border-color: var(--border);
    box-shadow: none;
  }

  .nav-link:hover {
    background: transparent;
  }

  .logo:hover {
    transform: none;
  }
}
