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

:root {
  --bg: #09090b;
  --bg-gradient: radial-gradient(circle at 50% -20%, #1a1528, #09090b 70%);
  --accent: #8b6cff;
  --accent-glow: rgba(139, 108, 255, 0.2);
  --featured-card-glow: rgba(139, 108, 255, 0.25); /* INSTÄLLNING - Ändra hur stark glow den spelbara Pulseframe-kortet får. */
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --card-bg: rgba(24, 24, 27, 0.6);
  --card-hover: rgba(39, 39, 42, 0.8);
  --border: #27272a;
  --border-hover: rgba(139, 108, 255, 0.5);
  
  --spacing-1: 8px;
  --spacing-2: 16px;
  --spacing-3: 24px;
  --spacing-4: 32px;
  --spacing-5: 48px;
  --spacing-6: 64px;
  --spacing-8: 128px;
  
  --radius-md: 14px;
  --radius-lg: 16px;
  
  /* Atmospherics */
  --ambient-glow-speed: 24s; /* INSTÄLLNING - Ändra hur snabbt bakgrundens glow rör sig. */
  --ambient-noise-opacity: 0.04; /* INSTÄLLNING - Ändra hur stark bruset (grain) är i bakgrunden. */
  --ambient-canvas-opacity: 1; /* INSTÄLLNING - Ändra hur tydliga de subtila partiklarna på startsidan är. */
  --transition-speed: 0.6s; /* INSTÄLLNING - Ändra hur snabbt kort och sidor övergår. */
  --hover-ease: cubic-bezier(0.2, 0.8, 0.2, 1); /* INSTÄLLNING - Ändra känslan för hovers (snabb in, långsam ut). */
  
  /* Homepage Layout */
  --home-hero-offset: -5vh; /* INSTÄLLNING - Ändra om startsidans innehåll ska flyttas upp/ner. Negativt värde = uppåt. */
  --home-content-gap: 24px; /* INSTÄLLNING - Ändra avståndet mellan titel, text och knapp på startsidan. */

  /* Build Badge */
  --build-badge-top: 14px; /* INSTÄLLNING - Ändra avståndet från toppen för build-rutan. */
  --build-badge-right: 14px; /* INSTÄLLNING - Ändra avståndet från högerkanten för build-rutan. */
  --build-badge-opacity: 0.78; /* INSTÄLLNING - Ändra hur tydlig build-rutan ska vara. */
}

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

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  background-size: 150% 150%;
  animation: bgDrift var(--ambient-glow-speed) ease-in-out infinite alternate;
  position: relative;
  display: flex;
  flex-direction: column;
}

@keyframes bgDrift {
  0% { background-position: 50% 0%; }
  100% { background-position: 50% 100%; }
}

/* Subtle noise texture */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: var(--ambient-noise-opacity);
  pointer-events: none;
  z-index: 0;
}

/* Ambient Canvas Layer */
.ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: var(--ambient-canvas-opacity);
  display: block;
}

main {
  flex: 1;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 var(--spacing-3);
  width: 100%;
}

/* Typography */
h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

h1 {
  font-size: clamp(3rem, 6vw, 4.5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

p {
  color: var(--text-muted);
  font-size: 1.125rem;
}

/* Navigation */
.navbar {
  padding: var(--spacing-4) 0;
  position: relative;
  z-index: 10;
}

.nav-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-5);
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  text-shadow: 0 0 10px var(--accent-glow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent);
  color: #fff;
  padding: var(--spacing-2) var(--spacing-5);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, background-color 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  background-color: #9d82ff;
  box-shadow: 0 10px 20px -10px var(--accent);
}

.btn-disabled {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: not-allowed;
  font-size: 0.875rem;
  padding: 8px 16px;
}

.btn-disabled:hover {
  transform: none;
  background-color: transparent;
  box-shadow: none;
}

/* Layout utilities */
.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 100px); /* minus approx nav height */
  transform: translateY(var(--home-hero-offset));
  gap: var(--home-content-gap);
}

.center-content > * {
  margin-bottom: 0 !important; /* Åsidosätt utility-klasser för att låta gap styra avståndet */
}

.mb-2 { margin-bottom: var(--spacing-2); }
.mb-4 { margin-bottom: var(--spacing-4); }
.mb-6 { margin-bottom: var(--spacing-6); }

.pt-8 { padding-top: var(--spacing-8); }
.pb-8 { padding-bottom: var(--spacing-8); }

/* Grid */
.grid {
  display: grid;
  gap: var(--spacing-4);
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Game Card */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-speed) var(--hover-ease);
  position: relative;
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: 0 15px 40px -10px rgba(0, 0, 0, 0.6), 0 0 25px -5px var(--accent-glow);
}

.card-visual {
  height: 240px;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: var(--border);
}

.card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--card-bg) 0%, transparent 40%);
}

.card-visual-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  /* Placeholders will use individual inline styles or JS to look unique */
}

.card:hover .card-visual-inner {
  transform: scale(1.05);
}

.card-content {
  padding: var(--spacing-3);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-3);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.tag {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.card-footer {
  margin-top: auto;
  display: flex;
}

/* Animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeInUp 1.2s var(--hover-ease) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

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

/* Featured / Playable Game Cards */
.card-featured {
  border-color: var(--border-hover);
  box-shadow: 0 0 20px -5px var(--featured-card-glow);
}

.card-featured:hover {
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 30px -5px var(--featured-card-glow);
}

.badge-playable {
  background-color: var(--accent);
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Build Badge */
.build-badge {
  position: fixed;
  top: var(--build-badge-top);
  right: var(--build-badge-right);
  background-color: rgba(5, 5, 7, 0.6);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(139, 108, 255, 0.3);
  box-shadow: 0 0 10px rgba(139, 108, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 9999;
  opacity: var(--build-badge-opacity);
  pointer-events: none;
}
