/* ==========================================================================
   1. VARIABLES & RESET (Tower Rush - Bright Construction Theme)
   ========================================================================== */
:root {
  /* Палитра "Sky & Construction" */
  --bg-color: #e0f2fe; /* Светлый небесно-голубой фон */
  --bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  
  --surface-color: #ffffff; /* Белые карточки и панели для контраста */
  --surface-border: #cbd5e1; /* Мягкий серый для границ карточек */
  
  --header-bg: #1e293b; /* Темно-сланцевый цвет асфальта для шапки и футера */
  
  --primary-color: #fbbf24; /* Строительный желтый/золотой для главных кнопок */
  --primary-hover: #f59e0b; /* Более глубокий оранжево-желтый для ховера */
  
  --accent-color: #3b82f6; /* Яркий синий (как кнопки ALL IN) */
  --accent-hover: #2563eb;
  
  --danger-color: #ef4444; /* Классический красный для системных элементов */
  
  --text-main: #0f172a; /* Очень темный сине-серый для заголовков (читаемость на светлом фоне) */
  --text-muted: #475569; /* Серый для основного текста */
  --text-light: #f8fafc; /* Светлый текст для элементов на темном фоне (шапка, футер) */
  
  --font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --border-radius: 12px;
  --btn-radius: 8px; /* Чуть более строгие кнопки */
  --transition: all 0.3s ease;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */
.header {
  background-color: var(--header-bg);
  border-bottom: 4px solid var(--primary-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 45px;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
}

.main-nav a {
  color: var(--text-light);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.main-nav a:hover, .main-nav a.active {
  color: var(--primary-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Стили кнопок */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--btn-radius);
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--transition);
}

/* Кнопка в стиле "BUILD" (желтая с черно-желтой каймой снизу при ховере) */
.btn-play {
  background-color: var(--primary-color);
  color: #111; /* Темный текст на желтом фоне */
  box-shadow: 0 4px 0 #d97706, 0 5px 10px rgba(0,0,0,0.1); /* Эффект объемной 3D кнопки */
  position: relative;
  overflow: hidden;
}

.btn-play:hover {
  background-color: var(--primary-hover);
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b45309, 0 3px 6px rgba(0,0,0,0.1); /* Кнопка "нажимается" */
}

/* Альтернативная синяя кнопка (в стиле ALL IN) */
.btn-demo {
  background-color: var(--accent-color);
  color: #fff;
  box-shadow: 0 4px 0 #1d4ed8;
}

.btn-demo:hover {
  background-color: var(--accent-hover);
  color: #fff;
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1e3a8a;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 28px;
  cursor: pointer;
}

/* ==========================================================================
   3. MOBILE SIDEBAR
   ========================================================================== */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100%;
  background: var(--surface-color);
  box-shadow: 2px 0 15px rgba(0,0,0,0.2);
  border-right: 4px solid var(--primary-color);
  z-index: 1001;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

.mobile-sidebar.active {
  left: 0;
}

.mobile-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--surface-border);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.close-menu {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 28px;
  cursor: pointer;
}

.mobile-nav ul {
  list-style: none;
}

.mobile-nav a {
  display: block;
  padding: 15px 0;
  color: var(--text-main);
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
  text-transform: uppercase;
}

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

.mobile-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  z-index: 1000;
  display: none;
  backdrop-filter: blur(3px);
}

.mobile-overlay.active {
  display: block;
}

/* ==========================================================================
   4. MAIN CONTENT & HERO
   ========================================================================== */
.page-wrapper {
  padding: 40px 20px;
  min-height: 70vh;
}

.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 60px;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 40px 30px;
  border: 1px solid var(--surface-border);
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.hero-content h1 {
  font-size: 42px;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text-main);
  font-weight: 900;
}

.hero-content h1 span {
  color: var(--accent-color);
}

.hero-content p {
  color: var(--text-muted);
  font-size: 18px;
  margin-bottom: 30px;
}

.hero-buttons {
  display: flex;
  gap: 20px;
}

.hero-image {
  display: flex;
  justify-content: center;
}

.hero-image img {
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  border: 4px solid var(--surface-color);
}

/* ==========================================================================
   5. DEMO GAME WRAPPER & LAZY LOAD
   ========================================================================== */
.demo-game-wrapper {
  background: var(--header-bg); /* Имитация панели управления из игры */
  padding: 20px;
  border-radius: var(--border-radius);
  border-bottom: 8px solid var(--primary-color);
  /* Полосатая граница в строительном стиле */
  border-image: repeating-linear-gradient(
    45deg,
    #fbbf24,
    #fbbf24 15px,
    #111 15px,
    #111 30px
  ) 8;
  margin-bottom: 60px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.demo-game-wrapper h2 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.iframe-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  height: 650px; /* Увеличена высота, чтобы панель управления не обрезалась */
  background-color: #87ceeb; /* Голубой фон неба как заглушка */
  border-radius: 8px;
  overflow: hidden;
  border: 3px solid #334155;
  box-shadow: 0 0 15px rgba(0,0,0,0.2) inset;
}

.iframe-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(15, 23, 42, 0.4);
  z-index: 10;
  cursor: pointer;
}

.iframe-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.iframe-overlay:hover .iframe-cover {
  transform: scale(1.05);
}

.iframe-play-btn {
  position: relative;
  z-index: 11;
  font-size: 24px;
  padding: 18px 50px;
  pointer-events: none;
}

.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ==========================================================================
   6. CONTENT TYPOGRAPHY (SEO Formatting)
   ========================================================================== */
.seo-article {
  background: var(--surface-color);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(0,0,0,0.03);
  border: 1px solid var(--surface-border);
}

.seo-article h2 {
  font-size: 28px;
  color: var(--text-main);
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

.seo-article h3 {
  font-size: 22px;
  color: var(--text-main);
  margin: 30px 0 15px;
}

.seo-article p {
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.8;
}

.seo-article ul {
  margin-bottom: 20px;
  padding-left: 20px;
  color: var(--text-muted);
}

.seo-article li {
  margin-bottom: 10px;
}

/* Grid Cards for content */
.games-grid-seo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.game-card {
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  padding: 25px;
  border-radius: var(--border-radius);
  transition: var(--transition);
  border-top: 4px solid var(--accent-color);
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.content-promo-btn {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 50px auto;
  padding: 18px 20px;
  background-color: var(--primary-color);
  color: #111;
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  border-radius: var(--btn-radius);
  text-transform: uppercase;
  letter-spacing: 1px;
  /* Добавляем жесткую обводку и мощную 3D-тень */
  border: 3px solid #1e293b; 
  box-shadow: 0 6px 0 #d97706, 0 15px 20px rgba(0,0,0,0.15);
  transition: var(--transition);
}

.content-promo-btn:hover {
  background-color: var(--primary-hover);
  color: #111;
  /* Эффект "нажатия" кнопки */
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b45309, 0 5px 10px rgba(0,0,0,0.1);
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.breadcrumbs {
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
}

.breadcrumbs ul {
  list-style: none;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breadcrumbs li:not(:last-child)::after {
  content: '/';
  color: var(--text-muted);
}

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

.breadcrumbs span {
  color: var(--text-muted);
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.footer {
  background: var(--header-bg);
  border-top: 4px solid var(--primary-color);
  padding: 50px 0 20px;
  margin-top: 60px;
  color: var(--text-light);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer h4 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 18px;
  text-transform: uppercase;
}

.footer-links ul {
  list-style: none;
}

.footer-links a {
  color: #94a3b8;
  display: block;
  margin-bottom: 10px;
}

.footer-links a:hover {
  color: #fff;
}

.footer-disclaimer {
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 30px;
  color: #94a3b8;
  font-size: 13px;
}

/* ==========================================================================
   8. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 992px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-buttons {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
  .menu-toggle {
    display: block;
  }
  .header-actions {
    display: none;
  }
  
  .iframe-container {
    height: 600px; /* Фиксированная высота для мобильных устройств, чтобы влезала панель */
    max-width: 100%;
  }
  .seo-article {
    padding: 25px 15px;
  }
}

/* ==========================================================================
   9. BACK TO TOP BUTTON
   ========================================================================== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: #111;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--primary-hover);
  transform: translateY(-5px);
}

/* ==========================================================================
   10. 404 ERROR PAGE
   ========================================================================== */
.error-section {
  text-align: center;
  padding: 80px 20px;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--surface-border);
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  max-width: 800px;
  margin: 60px auto;
}

.error-section h1 {
  font-size: 120px;
  line-height: 1;
  color: var(--primary-color);
  margin-bottom: 20px;
  text-shadow: 4px 4px 0px rgba(0,0,0,0.1);
}

.error-section h2 {
  font-size: 32px;
  color: var(--text-main);
  margin-bottom: 20px;
}

.error-section p {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 40px;
}

/* ==========================================================================
   11. TABLES (просто, в стиле Sky & Construction)
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 30px 0;
  border-radius: var(--border-radius);
  border: 1px solid var(--surface-border);
}

.seo-article table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  background: var(--surface-color);
}

.seo-article th {
  background-color: var(--header-bg);
  color: var(--text-light);
  text-align: left;
  padding: 14px 18px;
  font-weight: 700;
  border-bottom: 3px solid var(--primary-color);
}

.seo-article td {
  padding: 12px 18px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--surface-border);
}

.seo-article tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   12. ORDERED LISTS (доп. к существующим .seo-article ul/li)
   ========================================================================== */
.seo-article ol {
  margin-bottom: 20px;
  padding-left: 20px;
  color: var(--text-muted);
}

/* ==========================================================================
   13. RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .seo-article th,
  .seo-article td {
    padding: 10px 14px;
    font-size: 14px;
  }
}