:root {
  /* base colors */
  --bg-light: #ffffff;
  --bg-dark: #111217;
  --bg-card-light: #f8fafc;
  --bg-card-dark: #232527;
  --text-light: #111827;
  --text-dark: #e6eef8;
  --muted-light: #6b7280;
  --muted-dark: #9ca3af;
  --roblox-blue: #00A2FF;
  
  /* default -> dark */
  --bg: var(--bg-dark);
  --text: var(--text-dark);
  --card-bg: var(--bg-card-dark);
  --muted: var(--muted-dark);
  --border-color: rgba(255, 255, 255, 0.08);
}

html.light {
  --bg: var(--bg-light);
  --text: var(--text-light);
  --card-bg: var(--bg-card-light);
  --muted: var(--muted-light);
  --border-color: rgba(0, 0, 0, 0.08);
}

html.dark {
  --bg: var(--bg-dark);
  --text: var(--text-dark);
  --card-bg: var(--bg-card-dark);
  --muted: var(--muted-dark);
  --border-color: rgba(255, 255, 255, 0.08);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.2s ease;
  line-height: 1.5;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* Header */
.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

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

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--roblox-blue), #6b5eff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-controls {
  display: flex;
  gap: 0.5rem;
}

.theme-toggle, .lang-toggle {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.theme-toggle:hover, .lang-toggle:hover {
  border-color: var(--roblox-blue);
}

/* Page header */
.page-header {
  text-align: center;
  padding: 2rem 0 1.5rem;
  animation: fadeInUp 0.6s ease-out;
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, var(--text), var(--roblox-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  color: var(--muted);
  font-size: 1rem;
}

/* Sections */
.section {
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--roblox-blue);
}

/* Game Card - компактная версия */
.game-card-wrapper {
  transition: all 0.3s ease;
}

.game-card {
  display: flex;
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  padding: 1rem;
  gap: 1rem;
  align-items: center;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -8px rgba(0, 162, 255, 0.15);
  border-color: var(--roblox-blue);
}

/* Маленький квадратный thumbnail */
.game-thumbnail-container {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

.game-thumbnail-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  padding: 0.5rem;
}

.game-thumbnail {
  width: auto;
  height: auto;
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  transition: transform 0.3s ease;
  border-radius: 10px;
}

.game-card:hover .game-thumbnail {
  transform: scale(1.1);
}

.game-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 0.65rem;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-info {
  flex: 1;
  min-width: 0;
}

.game-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.game-price {
  background: rgba(0, 162, 255, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-weight: 600;
  color: var(--roblox-blue);
  border: 1px solid rgba(0, 162, 255, 0.2);
  font-size: 0.8rem;
}

.game-rating {
  background: rgba(255, 215, 0, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-weight: 600;
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.2);
  font-size: 0.8rem;
}

.game-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.25rem 0.6rem;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.game-categories {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.category-tag {
  background: rgba(0, 162, 255, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--border-color);
}

/* Community Card - компактная версия */
.community-card-wrapper {
  transition: all 0.3s ease;
}

.community-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease-out;
  cursor: pointer;
}

.community-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -8px rgba(0, 162, 255, 0.15);
  border-color: var(--roblox-blue);
}

.community-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.community-avatar {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.community-card:hover .community-avatar {
  border-color: var(--roblox-blue);
}

.community-title-info {
  flex: 1;
}

.community-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  color: var(--text);
}

.community-owner {
  color: var(--muted);
  font-size: 0.8rem;
}

.owner-link {
  color: var(--roblox-blue);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.8rem;
}

.community-stats {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--roblox-blue);
}

.stat-card-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-card-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--roblox-blue);
}

.community-actions {
  display: flex;
  gap: 0.75rem;
}

.community-button {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  text-align: center;
  flex: 1;
  font-size: 0.8rem;
}

.community-button.primary {
  background: var(--roblox-blue);
  color: white;
}

.community-button.primary:hover {
  background: #0095ff;
}

.community-button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-color);
}

.community-button.secondary:hover {
  border-color: var(--roblox-blue);
}

/* About Section */
.about-content {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Footer */
.site-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
  padding: 1.25rem 0;
}

.footer-text {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer-link {
  color: var(--roblox-blue);
  font-weight: 600;
  text-decoration: none;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading states */
.loading {
  opacity: 0.6;
  animation: pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Data updated animation */
.data-updated {
  animation: highlight 1s ease-out;
}

@keyframes highlight {
  0% { background-color: rgba(0, 162, 255, 0.2); }
  100% { background-color: transparent; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--card-bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 162, 255, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--roblox-blue);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .game-card {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .game-thumbnail-container {
    width: 80px;
    height: 80px;
  }
  
  .game-title {
    font-size: 1rem;
  }
  
  .game-stats {
    gap: 0.5rem;
  }
  
  .community-header {
    gap: 0.75rem;
  }
  
  .community-avatar {
    width: 56px;
    height: 56px;
  }
  
  .community-name {
    font-size: 1rem;
  }
  
  .community-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .stat-card-value {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .game-stats {
    flex-wrap: wrap;
  }
  
  .game-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .community-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .game-thumbnail-container {
    width: 70px;
    height: 70px;
  }
  
  .game-thumbnail-wrapper {
    padding: 0.35rem;
  }
}
