/* ========================================================================== 
   Variables
   ========================================================================== */

:root {
  /* Colors */
  --color-background: #050712; /* deep charcoal with a hint of blue */
  --color-surface: #0b0f1f;
  --color-surface-alt: #11162a;

  --color-text: #f5f7ff;
  --color-text-muted: #a2a7c5;

  --color-primary: #2ee7ff; /* neon blue */
  --color-primary-soft: rgba(46, 231, 255, 0.12);

  --color-accent: #ff2fd6; /* bright magenta */
  --color-accent-soft: rgba(255, 47, 214, 0.16);

  --color-success: #2ef78a; /* electric green */
  --color-success-soft: rgba(46, 247, 138, 0.12);

  --color-warning: #ffc857;
  --color-warning-soft: rgba(255, 200, 87, 0.14);

  --color-danger: #ff3455;
  --color-danger-soft: rgba(255, 52, 85, 0.16);

  /* Neutrals / Grays (cool, for gaming UI) */
  --gray-50: #f9f9ff;
  --gray-100: #eceefe;
  --gray-200: #d3d7f5;
  --gray-300: #b3b8e1;
  --gray-400: #8c91bd;
  --gray-500: #666a96;
  --gray-600: #4a4f79;
  --gray-700: #34375a;
  --gray-800: #20223b;
  --gray-900: #121325;

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

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-md: 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.25;
  --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 */

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows (neon, subtle to bold) */
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-medium: 0 18px 45px rgba(4, 7, 32, 0.85);
  --shadow-neon-primary: 0 0 20px rgba(46, 231, 255, 0.6);
  --shadow-neon-accent: 0 0 20px rgba(255, 47, 214, 0.6);

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

  /* Layout */
  --page-max-width: 1200px;
  --page-gutter: var(--space-4);
}

/* Larger screens adjustments */
@media (min-width: 768px) {
  :root {
    --page-gutter: var(--space-6);
  }
}

/* ========================================================================== 
   Reset / Normalize
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
}

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

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

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* Remove default link outlines handled later with :focus-visible */
a {
  color: inherit;
  text-decoration: none;
}

/* ========================================================================== 
   Base Styles
   ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background-color: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  display: block;
}

/* Headings (bold, energetic, display font) */

h1,
 h2,
 h3,
 h4,
 h5,
 h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--line-height-tight);
  letter-spacing: 0.02em;
  color: var(--gray-50);
}

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

h2 {
  font-size: clamp(1.75rem, 2.4vw + 0.5rem, 2.25rem);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-2);
}

h4 {
  font-size: 1.25rem;
  margin-bottom: var(--space-2);
}

h5 {
  font-size: 1.125rem;
  margin-bottom: var(--space-1);
}

h6 {
  font-size: 1rem;
  margin-bottom: var(--space-1);
}

p {
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
}

strong {
  font-weight: 600;
}

/* Links: neon accent hover, no underline by default */

a {
  position: relative;
  color: var(--color-primary);
  transition: color var(--transition-medium),
    text-shadow var(--transition-medium);
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-pill);
  transition: width var(--transition-medium);
}

a:hover {
  color: var(--color-accent);
  text-shadow: 0 0 8px rgba(255, 47, 214, 0.7);
}

a:hover::after {
  width: 100%;
}

/* Code / pre */

code,
 pre {
  font-family: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

pre {
  white-space: pre-wrap;
}

/* ========================================================================== 
   Utilities
   ========================================================================== */

/* Layout container */

.container {
  width: 100%;
  max-width: var(--page-max-width);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

/* Simple flex utilities */

.flex {
  display: flex;
}

.inline-flex {
  display: inline-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-2);
}

.gap-sm {
  gap: var(--space-3);
}

.gap-md {
  gap: var(--space-4);
}

.gap-lg {
  gap: var(--space-6);
}

/* Grid helpers */

.grid {
  display: grid;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

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

/* Visually hidden (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;
}

/* Utility: text truncation */

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Utility: chip-style pill */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ========================================================================== 
   Components
   ========================================================================== */

/* Buttons */

.button,
 button.button,
 input[type="button"].button,
 input[type="submit"].button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border-radius: var(--radius-pill);
  color: #050712!important;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow: var(--shadow-soft);
  border: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast);
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.2), transparent 55%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.button:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--shadow-medium), var(--shadow-neon-primary);
  filter: brightness(1.08);
}

.button:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--shadow-soft);
}

.button--outline {
  background: transparent;
  color: var(--color-primary)!important;
  border: 1px solid rgba(46, 231, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(46, 231, 255, 0.2);
}

.button--outline:hover {
  background: var(--color-primary-soft);
  box-shadow: var(--shadow-soft), var(--shadow-neon-primary);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--gray-50)!important;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.button--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.button[disabled],
.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Inputs / Form elements */

.input,
 textarea,
 select,
 input[type="text"],
 input[type="email"],
 input[type="search"],
 input[type="password"],
 input[type="number"] {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(10, 12, 25, 0.9);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  outline: none;
  transition: border-color var(--transition-medium),
    box-shadow var(--transition-medium),
    background-color var(--transition-medium);
}

.input::placeholder,
 textarea::placeholder,
 input::placeholder {
  color: rgba(163, 170, 210, 0.8);
}

.input:focus,
 textarea:focus,
 select:focus,
 input[type="text"]:focus,
 input[type="email"]:focus,
 input[type="search"]:focus,
 input[type="password"]:focus,
 input[type="number"]:focus {
  border-color: var(--color-primary);
  background-color: rgba(11, 16, 36, 0.95);
  box-shadow: 0 0 0 1px rgba(46, 231, 255, 0.5), var(--shadow-neon-primary);
}

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

/* Cards: for game tiles, previews, sections */

.card {
  position: relative;
  background: radial-gradient(circle at 0 0, rgba(46, 231, 255, 0.1), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(255, 47, 214, 0.08), transparent 50%),
    var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform var(--transition-medium),
    box-shadow var(--transition-medium),
    border-color var(--transition-medium),
    background var(--transition-medium);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(46, 231, 255, 0.7);
  box-shadow: var(--shadow-medium), var(--shadow-neon-primary);
}

.card--flat {
  border-radius: var(--radius-md);
  box-shadow: none;
  background: var(--color-surface-alt);
}

.card-header {
  margin-bottom: var(--space-3);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-snug);
}

.card-meta {
  margin-top: var(--space-2);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
}

.card-body {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ========================================================================== 
   Accessibility & Motion
   ========================================================================== */

/* Focus-visible outlines: clear neon ring */

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

a:focus-visible,
 button:focus-visible,
 .button:focus-visible,
 input:focus-visible,
 textarea:focus-visible,
 select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Reduced motion preference */

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

/* ========================================================================== 
   Helpful Structural Utilities (optional usage)
   ========================================================================== */

.section {
  padding-block: var(--space-8);
}

.section--hero {
  padding-block: var(--space-12);
}

.section-header {
  margin-bottom: var(--space-6);
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-pill);
  background: var(--color-danger-soft);
  color: #ffeaf0;
}

.badge-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--color-danger);
  box-shadow: 0 0 8px rgba(255, 52, 85, 0.9);
}
