/**
 * VectorLoom Labs - Master Stylesheet (styles.css)
 * ========================================================
 * Visual Palette & Design System:
 * - Deep Obsidian Background:  #0B0E17
 * - Elevated Card Surface:     #141A29
 * - Subtle Card Border:        #242E45
 * - Warm Gold Primary Accent:  #E2B866 (Complements Chenne Mane)
 * - Crisp Cyan Secondary:      #38BDF8
 * - High-Contrast Off-White:   #F3F5F9
 * - Muted Secondary Text:      #94A3B8
 * - Typography: Space Grotesk (Headings) & Inter (Body/UI)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@600;700;800;900&display=swap');

:root {
  --bg-deep: #0B0E17;
  --bg-surface: #141A29;
  --bg-surface-hover: #1A2338;
  --bg-glass: rgba(11, 14, 23, 0.88);
  --border-color: #242E45;
  --border-glow: rgba(226, 184, 102, 0.35);

  --accent-gold: #E2B866;
  --accent-gold-hover: #ecd08c;
  --accent-gold-dim: rgba(226, 184, 102, 0.12);

  --accent-cyan: #38BDF8;
  --accent-cyan-hover: #7dd3fc;
  --accent-cyan-dim: rgba(56, 189, 248, 0.12);

  --text-primary: #F3F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --font-headings: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  --nav-height: 68px;
  --max-width: 1120px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
  user-select: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--accent-gold);
  color: #0B0E17;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ========================================================
   COMPACT STICKY HEADER
   ======================================================== */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition), border-color var(--transition);
}

.site-header.scrolled {
  background: rgba(11, 14, 23, 0.98);
  border-bottom-color: rgba(226, 184, 102, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-img {
  height: 38px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
  padding: 0.35rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-gold);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gold);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  gap: 5px;
}

.mobile-nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.mobile-nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-nav-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-drawer {
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 23, 0.98);
  backdrop-filter: blur(20px);
  z-index: 105;
  display: flex;
  flex-direction: column;
  padding: 5.5rem 1.75rem 2.5rem;
  transform: translateX(100%);
  transition: transform var(--transition);
}

.mobile-drawer.open { transform: translateX(0); }

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.mobile-drawer-link {
  font-family: var(--font-headings);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.6rem;
}

.mobile-drawer-link.active,
.mobile-drawer-link:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

/* ========================================================
   BUTTONS & BADGES
   ======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-size: 0.925rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gold);
  color: #0B0E17;
  box-shadow: 0 4px 15px rgba(226, 184, 102, 0.2);
}

.btn-primary:hover {
  background: var(--accent-gold-hover);
  box-shadow: 0 6px 20px rgba(226, 184, 102, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: translateY(-1px);
}

.btn-cyan {
  background: var(--accent-cyan);
  color: #0B0E17;
}

.btn-cyan:hover {
  background: var(--accent-cyan-hover);
  transform: translateY(-1px);
}

.btn-disabled {
  background: #192033;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: not-allowed;
  opacity: 0.8;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.813rem;
}

.btn-lg {
  padding: 0.85rem 1.85rem;
  font-size: 1.05rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  line-height: 1.2;
}

.badge-live {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.badge-coming-soon {
  background: rgba(226, 184, 102, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(226, 184, 102, 0.4);
}

/* ========================================================
   TIGHT, PUNCHY HERO SECTION
   ======================================================== */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-gold-dim);
  border: 1px solid rgba(226, 184, 102, 0.3);
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--accent-gold);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-headings);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  max-width: 820px;
  margin: 0 auto 0.85rem;
}

.hero-title .highlight-gold {
  color: var(--accent-gold);
}

.hero-title .highlight-cyan {
  color: var(--accent-cyan);
}

.hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 1.85rem;
  line-height: 1.5;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========================================================
   GENRE FILTER PILLS & CATALOG GRID
   ======================================================== */
.catalog-section {
  padding: 1.5rem 0 4rem;
}

.catalog-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-heading {
  font-family: var(--font-headings);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.filter-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-pill {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: rgba(226, 184, 102, 0.4);
}

.filter-pill.active {
  background: var(--accent-gold-dim);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(226, 184, 102, 0.15);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

/* Game Card Component */
.game-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(226, 184, 102, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(226, 184, 102, 0.08);
}

.card-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

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

.card-badge-pos {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
}

.card-orientation-tag {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(11, 14, 23, 0.75);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-muted);
}

.card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-genre-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.775rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.card-title {
  font-family: var(--font-headings);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.25;
}

.card-tagline {
  font-size: 0.885rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* ========================================================
   DEDICATED GAME PLAYER (play.html)
   ======================================================== */
.player-page-container {
  padding: 2rem 0 5rem;
}

.player-stage-wrap {
  width: 100%;
  margin: 0 auto 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Landscape stage: 16:9, max-width 1080px */
.stage-container.landscape {
  width: 100%;
  max-width: 1080px;
  aspect-ratio: 16 / 9;
}

/* Portrait stage: 9:16, max-height 82vh on desktop */
.stage-container.portrait {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 9 / 16;
  max-height: 82vh;
}

.stage-container {
  position: relative;
  background: #000000;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  transition: all var(--transition);
}

/* CLICK-TO-PLAY CURTAIN BANNER */
.click-to-play-curtain {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background: rgba(11, 14, 23, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 300ms ease, visibility 300ms ease;
}

.curtain-backdrop-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
  filter: blur(10px);
  transform: scale(1.1);
  pointer-events: none;
}

.curtain-content {
  position: relative;
  z-index: 2;
  max-width: 480px;
}

.curtain-title {
  font-family: var(--font-headings);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.curtain-tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.btn-play-game {
  padding: 0.9rem 2.5rem;
  font-size: 1.15rem;
  font-weight: 800;
  background: var(--accent-gold);
  color: #0B0E17;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 25px rgba(226, 184, 102, 0.4);
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-play-game:hover {
  background: var(--accent-gold-hover);
  box-shadow: 0 0 35px rgba(226, 184, 102, 0.6);
  transform: scale(1.05);
}

.curtain-disclaimer {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* Loading Spinner Behind Curtain */
.stage-loader {
  position: absolute;
  inset: 0;
  background: #0B0E17;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  gap: 1rem;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(226, 184, 102, 0.2);
  border-top-color: var(--accent-gold);
  animation: spin 0.8s linear infinite;
}

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

/* The Game Iframe */
.player-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  display: block;
}

/* PLAYER ACTION BAR */
.player-action-bar {
  width: 100%;
  max-width: 1080px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 2.5rem;
}

.action-bar-left, .action-bar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-action-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  background: #0B0E17;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-action-tool:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.btn-action-tool svg {
  width: 15px;
  height: 15px;
}

.pill-store-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.775rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* How to Play & Controls Layout */
.game-info-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  margin-bottom: 4rem;
}

.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.info-card-title {
  font-family: var(--font-headings);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-step-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-gold-dim);
  border: 1px solid rgba(226, 184, 102, 0.4);
  color: var(--accent-gold);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.controls-pill-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.controls-pill-item {
  padding: 0.75rem 1rem;
  background: #0B0E17;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.controls-pill-item svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
}

/* ========================================================
   TOAST NOTIFICATION COMPONENT
   ======================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--transition);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ========================================================
   FOOTER
   ======================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-brand-title {
  font-family: var(--font-headings);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--accent-gold);
}

/* ========================================================
   RESPONSIVE BREAKPOINTS
   ======================================================== */
@media (max-width: 840px) {
  .nav-links { display: none; }
  .mobile-nav-toggle { display: flex; }
  .game-info-grid { grid-template-columns: 1fr; }
  .stage-container.portrait { max-height: none; aspect-ratio: 9 / 16; }
}

@media (max-width: 600px) {
  .hero-section { padding: 2.5rem 0 1.5rem; }
  .games-grid { grid-template-columns: 1fr; }
  .player-action-bar { flex-direction: column; align-items: stretch; }
  .action-bar-left, .action-bar-right { justify-content: space-between; width: 100%; }
  .footer-content { flex-direction: column; text-align: center; }
}
