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

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --border: rgba(255, 255, 255, 0.06);
  --text: #e0e0e0;
  --text-secondary: #888;
  --accent: #c0392b;
  --accent-glow: rgba(192, 57, 43, 0.3);
  --nav-bg: rgba(10, 10, 10, 0.8);
  --card-bg: rgba(20, 20, 20, 0.8);
  --input-bg: #1a1a1a;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="light"] {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --accent: #c0392b;
  --accent-glow: rgba(192, 57, 43, 0.15);
  --nav-bg: rgba(245, 245, 247, 0.75);
  --card-bg: rgba(255, 255, 255, 0.9);
  --input-bg: #ffffff;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  transition: background 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Анимированный сетчатый фон */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(192, 57, 43, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192, 57, 43, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
  animation: meshMove 20s infinite alternate;
}

@keyframes meshMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-10px, -10px); }
}

.content-wrapper {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Навигация */
nav {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: center; /* Центрируем всё содержимое */
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.3s;
  position: relative; /* Для абсолютного позиционирования правого блока */
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%); /* Точное центрирование */
}

/* Правый блок с IP и темой */
nav > div:last-child {
  position: absolute;
  right: 2rem;
  display: flex;
  align-items: center;
}

/* Адаптивность */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    height: auto;
    padding: 1rem;
    gap: 1rem;
  }
  
  .nav-links {
    position: static;
    transform: none;
    gap: 1.5rem;
    order: 1;
  }
  
  nav > div:last-child {
    position: static;
    order: 2;
    width: 100%;
    justify-content: center;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-item {
    font-size: 0.85rem;
  }
  
  .ip-box {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
  }
}

.nav-item {
  font-weight: 500;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  padding: 0.5rem 0;
  transition: color 0.2s;
  cursor: pointer;
  background: none;
  border: none;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
  box-shadow: 0 0 12px var(--accent-glow);
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
}

.nav-item.active::after,
.nav-item:hover::after {
  width: 100%;
}

.ip-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 0.5rem 1.2rem;
  border-radius: 40px;
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  backdrop-filter: blur(12px);
  transition: all 0.2s;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap; /* Предотвращает перенос IP-адреса */
}

.ip-box:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.ip-text {
  letter-spacing: 0.5px;
}

.copy-icon {
  color: var(--accent);
  font-size: 0.9rem;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  margin-left: 1.2rem;
  transition: color 0.2s;
}

.theme-toggle:hover {
  color: var(--accent);
}

/* Основной контент */
main {
  flex: 1;
  padding: 2.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page {
  display: none;
}

.page.active-page {
  display: block;
}

.hero {
  text-align: center;
  margin: 2rem 0 3rem;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #c0392b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

html[data-theme="light"] .hero h1 {
  background: linear-gradient(to right, #1d1d1f, #c0392b);
  -webkit-background-clip: text;
  background-clip: text;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
  border-color: rgba(192, 57, 43, 0.25);
}

.rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.rules-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.8rem;
}

.rules-list i {
  color: var(--accent);
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.donate-section h2 {
  font-size: 2rem;
  margin-bottom: 1.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Trademc форма стилизация */
#buyform {
  margin-top: 0.5rem;
}

#buyform input,
#buyform select,
#buyform button {
  width: 100%;
  padding: 0.9rem 1.2rem;
  margin: 0.6rem 0;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: 0.2s;
  outline: none;
}

#buyform button {
  background: var(--accent);
  border: none;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}

#buyform button:hover {
  background: #e74c3c;
  box-shadow: 0 10px 25px var(--accent-glow);
}

/* Футер */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.8rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  backdrop-filter: blur(12px);
  background: var(--nav-bg);
  z-index: 5;
}

.socials a {
  color: var(--text-secondary);
  margin-left: 1.8rem;
  font-size: 1.3rem;
  transition: color 0.2s;
}

.socials a:hover {
  color: var(--accent);
}

/* Адаптивность */
@media (max-width: 640px) {
  nav {
    flex-wrap: wrap;
    height: auto;
    padding: 1rem;
  }
  
  .nav-links {
    gap: 1.2rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
}

/* Стили для страницы лаунчера */
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.launcher-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.launcher-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.launcher-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px var(--accent-glow);
}

.launcher-card:hover::before {
  opacity: 1;
}

.launcher-icon {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.launcher-card:hover .launcher-icon {
  transform: scale(1.1);
}

.launcher-card h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.launcher-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.launcher-arrow {
  margin-top: auto;
  color: var(--accent);
  font-size: 1.2rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.launcher-card:hover .launcher-arrow {
  opacity: 1;
  transform: translateX(0);
}

.launcher-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
}

.web-version {
  border: 2px dashed var(--border);
}

.web-version:hover {
  border-style: solid;
}

/* Адаптивность для лаунчера */
@media (max-width: 640px) {
  .launcher-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .launcher-card {
    padding: 1.5rem;
  }
  
  .launcher-icon {
    font-size: 2.5rem;
  }
}