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

:root {
  /* Colors */
  --color-bg: #050816; /* dark arcade backdrop */
  --color-surface: #0b1020;
  --color-text: #f5f7ff;
  --color-muted: #b3b8d0;

  --color-primary: #ff6bcb; /* neon pink */
  --color-primary-soft: rgba(255, 107, 203, 0.14);
  --color-success: #4ade80;
  --color-warning: #fbbf24;
  --color-danger: #fb7185;

  /* Neutral grays */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2933;
  --gray-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Press Start 2P", "Segoe UI", system-ui, 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 */

  --line-height-tight: 1.2;
  --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: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadows (subtle neon arcade feel) */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.6);
  --shadow-neon: 0 0 12px rgba(255, 107, 203, 0.5), 0 0 32px rgba(56, 189, 248, 0.35);

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

  /* Layout */
  --container-max-width: 1120px;
}

/* Accessible focus adjustments for users who prefer reduced motion are in the 
   Reduced Motion section below. */

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

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

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

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

body {
  min-height: 100vh;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
}

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

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

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

textarea {
  resize: vertical;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  background: radial-gradient(circle at top, #141b3f 0, #050816 60%, #02010a 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 100vh;
}

h1,
 h2,
 h3,
 h4,
 h5,
 h6 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: var(--line-height-tight);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

h2 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

h4 {
  font-size: var(--font-size-lg);
}

h5 {
  font-size: var(--font-size-base);
}

h6 {
  font-size: var(--font-size-sm);
}

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

strong {
  font-weight: 600;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  text-underline-offset: 0.2em;
  transition: color var(--transition-normal), text-shadow var(--transition-normal);
}

a:hover {
  color: #ffd1f0;
  text-shadow: 0 0 8px rgba(255, 107, 203, 0.6);
}

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

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

pre {
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.9);
  overflow: auto;
}

hr {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  margin: var(--space-8) 0;
}

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

:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 3px;
}

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

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

/* Layout container */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  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;
}

.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-col {
  flex-direction: column;
}

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

/* Grid helpers */

.grid {
  display: grid;
}

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

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

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Visually hidden but accessible */

.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;
}

/* Spacing utilities (common) */

.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-8 { margin-top: var(--space-8) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }

/*********************** Components ***********************/

/* ========================================================================== 
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: #050816;
  background: linear-gradient(135deg, var(--color-primary), #38bdf8);
  box-shadow: var(--shadow-sm), var(--shadow-neon);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    background var(--transition-normal);
}

.btn:hover {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.05);
  box-shadow: var(--shadow-md), var(--shadow-neon);
}

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

.btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 3px;
}

.btn--ghost {
  background: rgba(15, 23, 42, 0.8);
  color: var(--color-text);
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: var(--shadow-xs);
}

.btn--ghost:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--color-primary);
}

.btn--secondary {
  background: linear-gradient(135deg, #22c55e, #4ade80);
}

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

/* ========================================================================== 
   Forms: Inputs & Textareas
   ========================================================================== */

.input,
.textarea,
select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.85);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    background var(--transition-normal),
    transform var(--transition-fast);
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(148, 163, 184, 0.75);
}

.input:focus-visible,
.textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(255, 107, 203, 0.8), var(--shadow-md);
  background: rgba(15, 23, 42, 1);
  transform: translateY(-1px);
}

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

label {
  display: inline-block;
  margin-bottom: 0.3rem;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-muted);
}

/* ========================================================================== 
   Card Component
   ========================================================================== */

.card {
  position: relative;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.2), transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(244, 114, 182, 0.26), transparent 55%);
  opacity: 0.9;
  mix-blend-mode: screen;
}

.card__content {
  position: relative;
  z-index: 1;
}

.card--soft {
  background: rgba(15, 23, 42, 0.85);
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: var(--space-4);
}

/* Utility arcade accent for small highlight labels/badges */

.badge-arcade {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.35), transparent 60%);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-50);
}

/* ========================================================================== 
   Arcade-specific helpers (for game vibe)
   ========================================================================== */

.arcade-heading {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  text-shadow:
    0 0 8px rgba(255, 107, 203, 0.8),
    0 0 16px rgba(56, 189, 248, 0.7);
}

.arcade-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.arcade-chip {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.6);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e0f2fe;
  background: rgba(15, 23, 42, 0.9);
}

/*********************** End Components ***********************/
