:root {
  --color-primary: #1B2838;
  --color-primary-dark: #0F1419;
  --color-primary-light: #66C0F4;
  --color-sale: #FF5E62;

  --bg-body: linear-gradient(135deg, #171a21 0%, #0f1419 100%);
  --bg-card: #2a3442;
  --bg-card-hover: #273247;
  --bg-header: rgba(27, 40, 56, 0.9);
  --bg-secondary: #2d3748;

  --text-primary: #ffffff;
  --text-secondary: #acb2b9;
  --text-muted: #8b95a1;

  --border-color: #3a475b;
  --steam-shadow: 0 8px 32px rgba(27, 40, 56, 0.5);
}

:root.light {
  --bg-body: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fa;
  --bg-header: rgba(255, 255, 255, 0.95);
  --bg-secondary: #f1f3f4;

  --text-primary: #1a1a1a;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;

  --border-color: #e0e4e8;
  --steam-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: "Segoe UI", -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 0;
  min-height: 100vh;
}

.container { max-width: 1300px; margin: 0 auto; padding: 20px; }

/* ✅ КРАСИВАЯ ШАПКА */
.header {
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 30px 40px;
  margin-bottom: 50px;
  box-shadow: var(--steam-shadow);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary), var(--color-primary-light));
}

.header-logo-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.header-logo { 
  height: 60px; 
  filter: drop-shadow(0 4px 12px rgba(102, 192, 244, 0.3));
}

.header-content {
  text-align: center;
}

.header-title {
  font-size: 3.2em;
  font-weight: 900;
  background: linear-gradient(135deg, var(--color-primary-light), #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  letter-spacing: -1px;
}

.header-subtitle {
  color: var(--text-secondary);
  font-size: 1.4em;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.header-subtitle i { color: var(--color-primary-light); font-size: 1.2em; }

.games-list { margin-bottom: 60px; }

/* 🔥 НОВАЯ СТРУКТУРА КАРТОЧКИ */
.game-item {
  background: var(--bg-card);
  border-left: 6px solid var(--color-primary);
  margin-bottom: 35px;
  border-radius: 0 20px 20px 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--steam-shadow);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 25px;
  padding: 30px;
}

.game-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--color-primary-light), var(--color-primary));
}

.game-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(27, 40, 56, 0.6);
  border-color: var(--color-primary-light);
}

/* 🔥 БЛОК 1: КАРТИНКА */
.game-image {
  flex: 0 0 460px;
  height: 215px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--steam-shadow);
  border: 3px solid var(--border-color);
  transition: all 0.4s ease;
}

.game-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.game-item:hover .game-image img { 
  transform: scale(1.05); 
}

/* 🔥 БЛОК 2: ВСЁ ОСТАЛЬНОЕ СПРАВА */
.game-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 5px 0 0 0;
  min-width: 0;
}

.game-name {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.2;
}

.game-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.genre-tag {
  background: var(--color-primary);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.game-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.price-item {
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
  flex: 1;
  min-width: 130px;
  max-width: 180px;
}

.price-item:hover {
  border-color: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(27, 40, 56, 0.3);
}

.region-flag { 
  font-size: 20px; 
  display: block; 
  margin-bottom: 3px; 
}

.price-final { 
  font-size: 17px;
  font-weight: 900;
  color: var(--text-primary);
  display: block;
  margin-bottom: 1px;
}

.price-discount {
  color: var(--color-sale);
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 0 6px rgba(255,94,98,0.4);
}

.steam-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: auto;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: white;
  box-shadow: var(--steam-shadow);
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border: 2px solid var(--color-primary-light);
  transition: all 0.3s ease;
}

.steam-link:hover {
  background: linear-gradient(135deg, var(--color-primary-light), #66C0F4);
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(102, 192, 244, 0.4);
}

.steam-link i { 
  margin-right: 10px; 
  font-size: 22px; 
}

.game-time {
  color: var(--text-muted);
  font-size: 15px;
  font-style: italic;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.empty-state {
  text-align: center;
  padding: 120px 80px;
  color: var(--color-primary-light);
  border: 3px dashed var(--border-color);
  border-radius: 28px;
  font-size: 28px;
  background: var(--bg-card);
  margin: 100px 0;
  box-shadow: var(--steam-shadow);
}

.footer {
  text-align: center;
  padding: 60px 40px;
  background: var(--bg-secondary);
  border-radius: 24px;
  border: 1px solid var(--border-color);
  margin-top: 80px;
  box-shadow: var(--steam-shadow);
}

.last-update {
  color: var(--color-primary-light);
  font-weight: 900;
  font-size: 22px;
  margin-bottom: 20px;
}

.scroll-panel {
  position: fixed;
  bottom: 40px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 1000;
}

.scroll-btn, .theme-btn {
  width: 65px;
  height: 65px;
  border-radius: 20px;
  font-size: 26px;
  color: white;
  cursor: pointer;
  background: var(--color-primary);
  border: none;
  box-shadow: var(--steam-shadow);
  transition: all 0.4s ease;
}

.scroll-btn:hover, .theme-btn:hover {
  background: var(--color-primary-light);
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(102, 192, 244, 0.4);
}

.theme-btn { 
  position: relative; 
  overflow: hidden; 
}

.fa-sun, .fa-moon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
}

html.light .fa-sun { opacity: 1; }
html.light .fa-moon { opacity: 0; }
html:not(.light) .fa-moon { opacity: 1; }
html:not(.light) .fa-sun { opacity: 0; }

/* ✅ МОБИЛЬНАЯ АДАПТАЦИЯ */
@media (max-width: 1300px) {
  .game-image { 
    flex: 0 0 380px; 
    height: 178px; 
  }
}

@media (max-width: 768px) {
  .container { padding: 15px; }
  .header { 
    padding: 25px 30px; 
    margin-bottom: 40px; 
  }
  .header-title { font-size: 2.4em; }
  
  .game-item { 
    flex-direction: column; 
    gap: 20px; 
    padding: 25px; 
  }
  .game-image { 
    flex: none; 
    width: 100%; 
    max-width: 400px; 
    height: 200px; 
    margin: 0 auto; 
  }
  .game-content { padding: 0; }
  .game-name { font-size: 24px; }
  .game-prices { 
    justify-content: center; 
    gap: 10px; 
  }
  .price-item { 
    padding: 10px 14px; 
    min-width: 120px; 
  }
  .price-final { font-size: 16px; }
  .price-discount { font-size: 12px; }
}

@media (max-width: 480px) {
  .header-title { font-size: 2em; }
  .game-name { font-size: 20px; }
  .price-item { 
    min-width: 110px; 
    padding: 8px 12px; 
  }
  .price-final { font-size: 15px; }
}
