/* ==========================================================================
   Luna Game Studio - Core Stylesheet
   ========================================================================== */

:root {
  --bg-main: #0c081e;
  --bg-card: rgba(26, 18, 56, 0.7);
  --bg-card-hover: rgba(38, 28, 80, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(168, 85, 247, 0.4);

  --primary: #8b5cf6;
  --primary-glow: #a855f7;
  --secondary: #ec4899;
  --accent: #f59e0b;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 10px 30px rgba(139, 92, 246, 0.35);
  --shadow-card: 0 12px 36px rgba(0, 0, 0, 0.45);

  --transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  background: radial-gradient(circle at 50% 0%, #24144e 0%, #0c081e 65%, #05030d 100%);
  background-attachment: fixed;
}

/* Background Animated Canvas / Sparkles */
#star-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

.site-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --------------------------------------------------------------------------
   Navigation Bar
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 16px;
  z-index: 100;
  margin: 16px 20px 0 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(18, 12, 42, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  transition: transform 0.3s ease;
}

.brand:hover .brand-logo-img {
  transform: rotate(-6deg) scale(1.08);
}

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

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.5);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.98);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 14px 30px;
  font-size: 1.1rem;
}

.btn-pwa-install {
  display: inline-flex;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  padding: 60px 0 40px;
  text-align: center;
  position: relative;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-full);
  color: #f3e8ff;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
  animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(139, 92, 246, 0.2); }
  50% { box-shadow: 0 0 25px rgba(236, 72, 153, 0.4); }
}

.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-title-highlight {
  background: linear-gradient(135deg, #a78bfa 0%, #f472b6 50%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-description {
  max-width: 760px;
  margin: 0 auto 36px;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.7;
  color: var(--text-muted);
}

.hero-description strong {
  color: #ffffff;
  font-weight: 700;
}

.hero-stats-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
}

.stat-pill .icon {
  font-size: 1.1rem;
}

/* --------------------------------------------------------------------------
   Featured Game Card (Macskafogó)
   -------------------------------------------------------------------------- */
.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 40px 0 24px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 60px;
}

.featured-game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  position: relative;
}

@media (max-width: 860px) {
  .featured-game-card {
    grid-template-columns: 1fr;
  }
}

.featured-game-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 20px 45px rgba(139, 92, 246, 0.25);
  transform: translateY(-4px);
}

.game-media-wrap {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}

.game-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.game-overlay-play {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 8, 30, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(3px);
}

.featured-game-card:hover .game-overlay-play,
.game-media-wrap:focus .game-overlay-play {
  opacity: 1;
}

.play-circle-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.8);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.featured-game-card:hover .play-circle-btn {
  transform: scale(1.1);
}

.game-overlay-text {
  font-weight: 800;
  font-size: 1.1rem;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.game-info-wrap {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-badge {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-badge.featured {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
}

.tag-badge.category {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.tag-badge.mode {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.game-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.game-summary {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.game-highlights-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .game-highlights-list {
    grid-template-columns: 1fr;
  }
}

.game-highlights-list li {
  font-size: 0.86rem;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
}

/* --------------------------------------------------------------------------
   Coming Soon Cards Grid
   -------------------------------------------------------------------------- */
.secondary-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.mini-game-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: var(--transition);
}

.mini-game-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-2px);
}

.mini-card-icon {
  font-size: 2.2rem;
}

.mini-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.mini-card-desc {
  font-size: 0.88rem;
  color: var(--text-subtle);
  line-height: 1.5;
}

.mini-card-badge {
  align-self: flex-start;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   "How It's Made" Story Section
   -------------------------------------------------------------------------- */
.story-section {
  background: linear-gradient(135deg, rgba(30, 20, 70, 0.6) 0%, rgba(15, 10, 35, 0.8) 100%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  margin-bottom: 60px;
}

.story-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 36px;
}

.story-header h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.story-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

.story-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.step-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

.step-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(236, 72, 153, 0.3);
  transform: translateY(-3px);
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.step-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.step-desc {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Fullscreen Game Runner Modal
   -------------------------------------------------------------------------- */
#game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 99999;
  background: #000000;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#game-modal.active {
  display: flex;
  opacity: 1;
}

.modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(12, 8, 30, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  z-index: 10;
  user-select: none;
}

.modal-game-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-game-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-game-creator {
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.15);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.modal-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.modal-btn.close-btn {
  background: #ef4444;
  border-color: #f87171;
}

.modal-btn.close-btn:hover {
  background: #dc2626;
}

.iframe-container {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
}

#game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.game-loader-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #fff;
  font-weight: 600;
  pointer-events: none;
}

.spinner-icon {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ec4899;
  border-right-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   PWA Installation Guide Modal
   -------------------------------------------------------------------------- */
.pwa-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pwa-dialog.active {
  display: flex;
}

.pwa-dialog-card {
  background: #181235;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-card);
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.pwa-dialog-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin: 0 auto 16px;
  display: block;
}

.pwa-dialog-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.pwa-dialog-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.pwa-steps-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  margin-bottom: 24px;
}

.pwa-steps-box ol {
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.pwa-dialog-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-glass);
  background: rgba(10, 6, 25, 0.85);
  backdrop-filter: blur(12px);
  padding: 32px 20px;
  text-align: center;
  position: relative;
  z-index: 10;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

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

.footer-domain {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}
