/* ==========================================================================
   Spac2 Game Center - UI Design System & Styling
   Path: /game/css/game.css
   ========================================================================== */

:root {
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.35);
  
  --bg-dark: #070b09;
  --bg-gradient: radial-gradient(circle at 50% 15%, #0f2119 0%, #060a08 65%, #030605 100%);
  --bg-capsule: rgba(18, 28, 23, 0.78);
  --border-capsule: rgba(255, 255, 255, 0.1);
  --border-card: rgba(255, 255, 255, 0.12);

  --text-main: #ffffff;
  --text-muted: #8ea399;
  --text-dim: #5c7066;

  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  font-family: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Constellation Canvas */
.constellation-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

/* Ambient Glow Layer */
.ambient-glow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.25;
}

.glow-green {
  top: 10%;
  left: 20%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
}

.glow-cyan {
  top: 40%;
  right: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
}

/* ==========================================================================
   1. Top Floating Header Capsule
   ========================================================================== */
.game-top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 8px 16px;
}

.header-capsule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-capsule);
  border: 1px solid var(--border-capsule);
  border-radius: 9999px;
  padding: 8px 14px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  outline: none;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.header-icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.brand-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-box {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
}

.brand-name {
  color: #ffffff;
  letter-spacing: -0.2px;
}

.brand-divider {
  color: rgba(255, 255, 255, 0.3);
}

.brand-module {
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   Main Game Center Section
   ========================================================================== */
.game-center-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px 60px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

/* ==========================================================================
   2. 3D Cover Flow Hero Showcase
   ========================================================================== */
.coverflow-hero-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
}

.coverflow-stage-wrapper {
  position: relative;
  width: 100%;
  max-width: 680px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.stage-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(18, 28, 24, 0.85);
  border: 1px solid var(--border-capsule);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stage-nav-arrow:hover {
  background: rgba(30, 48, 40, 0.95);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.1);
}

.arrow-left {
  left: 10px;
}

.arrow-right {
  right: 10px;
}

.coverflow-cards-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
}

.coverflow-card {
  position: absolute;
  width: 165px;
  height: 165px;
  border-radius: 36px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, filter 0.4s ease;
  cursor: pointer;
  user-select: none;
  border: 4px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coverflow-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 3D Positions */
.coverflow-card.pos-center {
  transform: translateX(0px) scale(1) translateZ(0px);
  opacity: 1;
  z-index: 10;
  filter: brightness(1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.25);
}

.coverflow-card.pos-prev {
  transform: translateX(-130px) scale(0.72) rotateY(25deg);
  opacity: 0.55;
  z-index: 2;
  filter: brightness(0.65);
}

.coverflow-card.pos-next {
  transform: translateX(130px) scale(0.72) rotateY(-25deg);
  opacity: 0.55;
  z-index: 2;
  filter: brightness(0.65);
}

.coverflow-card.pos-hidden-left {
  transform: translateX(-240px) scale(0.5) rotateY(40deg);
  opacity: 0;
  pointer-events: none;
}

.coverflow-card.pos-hidden-right {
  transform: translateX(240px) scale(0.5) rotateY(-40deg);
  opacity: 0;
  pointer-events: none;
}

/* Game Title & Play CTA */
.hero-game-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 10px;
  gap: 4px;
}

.hero-game-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.hero-game-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 480px;
}

.hero-game-action {
  margin-top: 14px;
}

.hero-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 46px;
  border-radius: 9999px;
  background: #ffffff;
  color: #000000;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hero-play-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 28px rgba(255, 255, 255, 0.35);
  background: #f8fafc;
}

.hero-play-btn:active {
  transform: scale(0.97);
}

/* ==========================================================================
   3. Search Omnibar
   ========================================================================== */
.game-search-section {
  width: 100%;
  display: flex;
  justify-content: center;
}

.game-search-pill {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 400px;
}

.game-search-icon {
  position: absolute;
  left: 16px;
  width: 16px;
  height: 16px;
  stroke: var(--text-dim);
  pointer-events: none;
}

.game-search-input {
  width: 100%;
  height: 42px;
  background: rgba(18, 28, 23, 0.7);
  border: 1px solid var(--border-capsule);
  border-radius: 9999px;
  padding: 0 38px 0 44px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.game-search-input::placeholder {
  color: var(--text-dim);
}

.game-search-input:focus {
  border-color: var(--primary);
  background: rgba(22, 34, 28, 0.9);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-clear-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.5;
}

/* ==========================================================================
   4. Category Filter Tabs
   ========================================================================== */
.game-filter-section {
  width: 100%;
  display: flex;
  justify-content: center;
}

.game-filter-pills-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: none !important;
}

.game-filter-pills-bar::-webkit-scrollbar {
  display: none !important;
}

.filter-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 18px;
  border-radius: 9999px;
  background: rgba(20, 32, 26, 0.75);
  border: 1px solid var(--border-capsule);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  user-select: none;
}

.filter-pill-btn:hover {
  background: rgba(28, 44, 36, 0.9);
  color: #ffffff;
}

.filter-pill-btn.active {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25);
}

.count-badge {
  font-size: 11.5px;
  opacity: 0.75;
}

/* ==========================================================================
   5. Bottom Games Gallery Grid
   ========================================================================== */
.games-gallery-section {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.games-cards-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 920px;
}

.game-gallery-card {
  width: 128px;
  height: 128px;
  border-radius: 30px;
  overflow: hidden;
  background: #ffffff;
  border: 3px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  user-select: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.game-gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.65);
}

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

.game-gallery-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.4), 0 14px 32px rgba(0, 0, 0, 0.7);
  transform: translateY(-4px);
}

/* Empty State */
.game-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 640px) {
  .coverflow-stage-wrapper {
    height: 190px;
  }

  .coverflow-card {
    width: 140px;
    height: 140px;
    border-radius: 30px;
  }

  .coverflow-card.pos-prev {
    transform: translateX(-95px) scale(0.7) rotateY(20deg);
  }

  .coverflow-card.pos-next {
    transform: translateX(95px) scale(0.7) rotateY(-20deg);
  }

  .game-gallery-card {
    width: 96px;
    height: 96px;
    border-radius: 22px;
  }

  .hero-game-title {
    font-size: 22px;
  }

  .hero-play-btn {
    height: 38px;
    padding: 0 36px;
    font-size: 14px;
  }
}
