/* ==========================================================================
   GNOMEGAMES.TOP — Portal & Game Catalog
   Theme: Dwarven Underdeep / Dark Cavern & Amber Gold
   ========================================================================== */

:root {
  --bg-dark: #0d121c;
  --bg-surface: #131a27;
  --bg-card: #182233;
  --bg-card-hover: #1e2b40;
  --bg-accent-subtle: rgba(245, 158, 11, 0.08);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(245, 158, 11, 0.35);
  --border-gold-bright: #f59e0b;

  --gold-primary: #f59e0b;
  --gold-light: #fbbf24;
  --gold-dark: #b45309;
  --gold-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  --steam-gradient: linear-gradient(135deg, #1b2838 0%, #2a475e 100%);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #fbbf24;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 35px -5px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 158, 11, 0.2);

  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1360px;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  scroll-behavior: smooth;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: 
    radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.09) 0%, transparent 60%),
    radial-gradient(circle at 85% 30%, rgba(30, 58, 138, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 15% 70%, rgba(180, 83, 9, 0.08) 0%, transparent 50%),
    var(--bg-dark);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: #243044;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   TOP STATUS BAR (Placeholder & Server Indicator)
   ========================================================================== */
.top-bar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.brand:hover .brand-icon {
  transform: rotate(-10deg) scale(1.05);
  border-color: var(--gold-light);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--gold-primary);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  text-transform: uppercase;
}

.brand-name span {
  color: var(--gold-primary);
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.header-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
}

.tag-chip.highlight {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--border-gold);
  color: var(--gold-light);
}

.dot-gold {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.hero-title .highlight {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  font-size: 0.98rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
}

.btn-primary {
  background: var(--gold-gradient);
  color: #1a1202;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-gold);
  color: var(--gold-light);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gold-light);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Hero Visual & Mascot */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-art-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-glow-backdrop {
  position: absolute;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22) 0%, rgba(217, 119, 6, 0.08) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
  animation: breatheGlow 4s ease-in-out infinite alternate;
}

@keyframes breatheGlow {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.1); opacity: 1; }
}

.dwarf-illustration {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.7));
  animation: gentleBob 5s ease-in-out infinite;
}

@keyframes gentleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ==========================================================================
   SECTION HEADERS
   ========================================================================== */
.section {
  padding: 64px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 44px;
}

.section-eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: 8px;
  display: block;
}

.section-title {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.3px;
  text-transform: uppercase;
}

.section-desc {
  max-width: 600px;
  margin: 12px auto 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ==========================================================================
   FEATURES / WHAT AWAITS («ЧТО ВАС ЖДЕТ»)
   ========================================================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gold-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-hover);
}

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

.feature-icon-box {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  margin-bottom: 4px;
}

.feature-icon-box svg {
  width: 32px;
  height: 32px;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.feature-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   CATALOG CONTROLS & FILTER
   ========================================================================== */
.catalog-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 36px;
}

.filter-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-btn.active {
  background: var(--gold-gradient);
  color: #120e03;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.search-bar-wrap {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 12px 18px 12px 44px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* ==========================================================================
   GAMES GRID & CARDS
   ========================================================================== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  position: relative;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-hover);
}

.game-media {
  position: relative;
  width: 100%;
  aspect-ratio: 460 / 215;
  background: #0f1622;
  overflow: hidden;
}

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

.game-card:hover .game-img {
  transform: scale(1.04);
}

.game-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(13, 18, 28, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.game-content {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.game-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
  line-height: 1.3;
}

.game-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
  flex-grow: 1;
}

.game-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Steam Button */
.steam-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  color: var(--gold-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.22s ease;
}

.steam-link-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.steam-link svg.steam-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.steam-link svg.arrow-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
  transition: transform 0.22s ease;
}

.steam-link:hover {
  background: var(--gold-gradient);
  border-color: transparent;
  color: #150f02;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.steam-link:hover svg.arrow-icon {
  transform: translate(3px, -3px);
}

/* Empty search state */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
  display: none;
}

/* Sparks Easter Egg */

/* Sparks container */
.spark {
  position: fixed;
  pointer-events: none;
  width: 6px;
  height: 6px;
  background: #fbbf24;
  border-radius: 50%;
  box-shadow: 0 0 10px #f59e0b;
  animation: sparkFade 0.6s ease-out forwards;
  z-index: 9999;
}

@keyframes sparkFade {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  margin-top: auto;
  background: #090d14;
  border-top: 1px solid var(--border-subtle);
  padding: 36px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-copy strong {
  color: var(--text-secondary);
}

.footer-badges {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-badge {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVENESS (Mobile, Tablet, Desktop, Ultrawide)
   ========================================================================== */

/* Ultrawide (21:9, 32:9, 2560px+) */
@media (min-width: 1700px) {
  :root {
    --max-width: 1560px;
  }
  .games-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Large Desktop */
@media (max-width: 1280px) {
  .hero-grid {
    gap: 36px;
  }
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* Tablet & Smaller Desktop */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content {
    align-items: center;
  }
  .hero-desc {
    margin: 0 auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-stats {
    justify-content: center;
  }
  .hero-visual {
    order: -1;
    max-width: 380px;
    margin: 0 auto;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 680px) {
  .top-bar-inner {
    justify-content: center;
  }
  .header-tags {
    width: 100%;
    justify-content: center;
  }
  .hero {
    padding: 36px 0 40px;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .games-grid {
    grid-template-columns: 1fr;
  }
  .filter-tabs {
    flex-direction: column;
    width: 100%;
  }
  .filter-btn {
    width: 100%;
    justify-content: center;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
