/* ========================================================================== 
   Variables
   ========================================================================== */
:root {
  /* Color palette */
  --color-bg: #03030a; /* deep near-black */
  --color-bg-elevated: #0a0a15;
  --color-text: #f5f5ff; /* soft white */
  --color-text-muted: #a3a3c2;
  --color-primary: #00e5ff; /* electric cyan */
  --color-primary-soft: rgba(0, 229, 255, 0.12);
  --color-secondary: #ff2edb; /* neon magenta */
  --color-secondary-soft: rgba(255, 46, 219, 0.12);
  --color-accent: #c0c7d1; /* metallic silver */
  --color-border-subtle: rgba(192, 199, 209, 0.24);
  --color-success: #3ddc97;
  --color-warning: #ffb800;
  --color-danger: #ff4b6e;
  --color-neutral-50: #0b0b12;
  --color-neutral-100: #171721;
  --color-neutral-200: #262637;
  --color-neutral-300: #3a3a52;
  --color-neutral-400: #595979;
  --color-neutral-500: #7a7aa0;
  --color-neutral-600: #9a9ac2;
  --color-neutral-700: #bdbde0;
  --color-neutral-800: #d9d9f5;
  --color-neutral-900: #f4f4ff;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.1;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radii */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Shadows: soft neon glows for immersive look */
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-neon-cyan: 0 0 24px rgba(0, 229, 255, 0.55);
  --shadow-neon-magenta: 0 0 24px rgba(255, 46, 219, 0.55);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 200ms ease-out;
  --transition-slow: 320ms ease-out;
}

/* Reduced motion adjustments */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
  }
}


/* ========================================================================== 
   Reset / Normalize
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
}

h1, h2, h3, h4, h5, h6,
p, figure, blockquote,
dl, dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

input, button, textarea, select {
  font: inherit;
}

button {
  border: none;
  padding: 0;
  background: none;
  color: inherit;
}

a {
  color: inherit;
}

/* Improve text rendering */
body, button, input, textarea, select {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


/* ========================================================================== 
   Base Styles
   ========================================================================== */
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image: radial-gradient(circle at top left, rgba(0, 229, 255, 0.14), transparent 55%),
                    radial-gradient(circle at bottom right, rgba(255, 46, 219, 0.12), transparent 55%);
}

main {
  display: block;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--line-height-tight);
  letter-spacing: 0.02em;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.25rem, 4vw, 3rem);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.875rem, 3vw, 2.25rem);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

h4 {
  font-size: var(--font-size-xl);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

p {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
}

p + p {
  margin-top: var(--space-3);
}

/* Links */
a {
  text-decoration: none;
  color: var(--color-primary);
  transition: color var(--transition-base), text-shadow var(--transition-base);
}

a:hover {
  color: var(--color-secondary);
  text-shadow: 0 0 8px rgba(255, 46, 219, 0.7);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Horizontal rule */
hr {
  border: 0;
  border-top: 1px solid rgba(192, 199, 209, 0.18);
  margin: var(--space-8) 0;
}

/* Selection */
::selection {
  background: rgba(0, 229, 255, 0.24);
  color: var(--color-text);
}


/* ========================================================================== 
   Accessibility & Motion
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}


/* ========================================================================== 
   Layout Utilities
   ========================================================================== */
/* Container for centered content */
.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

/* Flex helpers */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.flex-wrap {
  flex-wrap: wrap;
}

.gap-xs { gap: var(--space-1); }
.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-4); }
.gap-lg { gap: var(--space-6); }

/* Grid helpers */
.grid {
  display: grid;
}

.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

/* Spacing utilities (margin / padding) */
.m-0 { margin: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

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

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ========================================================================== 
   Components
   ========================================================================== */
/* Button: primary neon style, plus variants */
.button,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  --btn-bg: var(--color-primary);
  --btn-bg-hover: #08f3ff;
  --btn-bg-active: #00bfd6;
  --btn-color: #02020a;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 229, 255, 0.8);
  background: radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.25), transparent 55%),
              linear-gradient(135deg, var(--btn-bg), var(--color-secondary));
  color: var(--btn-color)!important;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-neon-cyan);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    background var(--transition-base),
    border-color var(--transition-fast);
}

.button:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: var(--shadow-neon-cyan), 0 0 24px rgba(255, 46, 219, 0.45);
  filter: brightness(1.05);
}

.button:active,
button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.65);
}

.button:disabled,
button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
input[type="reset"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.button--ghost {
  --btn-bg: transparent;
  --btn-bg-hover: transparent;
  --btn-color: var(--color-text);

  background: radial-gradient(circle at 10% 0, rgba(0, 229, 255, 0.16), transparent 55%);
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.16);
}

.button--ghost:hover {
  background: radial-gradient(circle at 10% 0, rgba(0, 229, 255, 0.22), transparent 60%);
}

.button--secondary {
  --btn-bg: var(--color-secondary);
  --btn-bg-hover: #ff4ee2;
  --btn-bg-active: #f218c7;

  border-color: rgba(255, 46, 219, 0.8);
  box-shadow: var(--shadow-neon-magenta);
}

/* Input fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(192, 199, 209, 0.3);
  background-color: rgba(11, 11, 22, 0.8);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  outline: none;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

input::placeholder,
textarea::placeholder {
  color: rgba(163, 163, 194, 0.8);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.4), 0 0 18px rgba(0, 229, 255, 0.35);
}

input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* Card: for sections like game overview, gallery, reviews */
.card {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(0, 229, 255, 0.12), transparent 55%),
              radial-gradient(circle at bottom right, rgba(255, 46, 219, 0.1), transparent 55%),
              linear-gradient(135deg, rgba(11, 11, 22, 0.96), rgba(6, 6, 16, 0.98));
  border: 1px solid rgba(192, 199, 209, 0.25);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top center, rgba(0, 229, 255, 0.12), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

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

.card--outline {
  background: rgba(7, 7, 18, 0.96);
  border-style: dashed;
  border-color: rgba(192, 199, 209, 0.35);
}

/* Tag / pill for categories (e.g., spinner types, difficulty) */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(192, 199, 209, 0.4);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  background: radial-gradient(circle at 0 0, rgba(0, 229, 255, 0.16), transparent 55%);
}

/* Simple badge for ratings */
.badge-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(0, 229, 255, 0.18);
  color: var(--color-text);
  font-size: var(--font-size-xs);
}

/* Neon accent border for highlighted sections (e.g., download CTA) */
.neon-frame {
  position: relative;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.18), rgba(255, 46, 219, 0.3));
  padding: 1px;
}

.neon-frame__inner {
  border-radius: inherit;
  background: radial-gradient(circle at 20% 0, rgba(0, 229, 255, 0.16), transparent 55%),
              radial-gradient(circle at 80% 100%, rgba(255, 46, 219, 0.16), transparent 55%),
              #050510;
  padding: var(--space-6);
}

/* Utility to give subtle glass effect for immersive layers */
.glass-surface {
  background: rgba(7, 7, 18, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(192, 199, 209, 0.22);
}

/* Simple chip row for platform icons or languages */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(22, 22, 40, 0.9);
  border: 1px solid rgba(192, 199, 209, 0.35);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}


/* ========================================================================== 
   Helper Animations (subtle, neon-inspired)
   ========================================================================== */
@keyframes float-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 18px rgba(0, 229, 255, 0.45); }
  50% { box-shadow: 0 0 26px rgba(255, 46, 219, 0.6); }
}

/* Apply via classes when needed (e.g., hero spinner image) */
.float-soft {
  animation: float-soft 4s ease-in-out infinite;
}

.pulse-glow {
  animation: pulse-glow 3.5s ease-in-out infinite;
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}