/* =========================================================
   PunterPoint Base Styles (base.css)
   Modern, clean, mobile-first, gaming-focused
   ========================================================= */

/* =========================================================
   1. Root Variables
   ========================================================= */
:root {
  /* Color Palette */
  --color-bg: #050812; /* deep gaming background */
  --color-surface: #0d1020;
  --color-surface-alt: #14182a;
  --color-text: #f5f7ff;
  --color-text-muted: #a5acc7;

  --color-primary: #6f7dff; /* neon-ish blue */
  --color-primary-soft: rgba(111, 125, 255, 0.12);
  --color-primary-strong: #8f9bff;

  --color-success: #46d69a;
  --color-warning: #f4b43a;
  --color-danger: #ff4b6a;

  --color-border-subtle: rgba(255, 255, 255, 0.06);
  --color-border-strong: rgba(111, 125, 255, 0.6);

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

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-heading: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-md: 1.0625rem; /* 17px (readable body) */
  --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-7: 1.75rem;   /* 28px */
  --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: 0.125rem; /* 2px */
  --radius-sm: 0.25rem;  /* 4px */
  --radius-md: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;  /* 12px */
  --radius-xl: 1rem;     /* 16px */
  --radius-pill: 999px;

  /* Shadows (subtle neon gaming style) */
  --shadow-xs: 0 1px 2px rgba(3, 7, 18, 0.5);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.6);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.8);
  --shadow-glow-primary: 0 0 20px rgba(111, 125, 255, 0.45);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms ease-out;
  --transition-slow: 260ms ease-out;

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

@media (min-width: 768px) {
  :root {
    --font-size-3xl: 2.25rem;
    --font-size-4xl: 2.75rem;
    --font-size-5xl: 3.5rem;
  }
}

/* =========================================================
   2. 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;
}

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

img {
  height: auto;
}

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

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

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

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

/* Remove default link underline but keep color inheritance */
a {
  color: inherit;
  text-decoration: none;
}

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

/* =========================================================
   3. Base Styles
   ========================================================= */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background:
    radial-gradient(circle at top, rgba(111, 125, 255, 0.25) 0, transparent 55%),
    radial-gradient(circle at bottom, rgba(111, 125, 255, 0.12) 0, transparent 50%),
    var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

main {
  display: block;
}

/* Headings */

h1,
 h2,
 h3,
 h4,
 h5,
 h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-snug);
  letter-spacing: 0.02em;
  color: var(--color-text);
}

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-3);
}

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

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--font-size-base);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

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

strong,
 b {
  font-weight: 600;
}

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

/* Links (gaming portal style) */

a {
  position: relative;
  cursor: pointer;
  transition: color var(--transition-base),
    text-shadow var(--transition-base);
}

a:hover {
  color: var(--color-primary-strong);
  text-shadow: 0 0 12px rgba(111, 125, 255, 0.6);
}

a:active {
  color: var(--color-primary);
}

/* Lists */

ul,
 ol {
  padding-left: 1.25rem;
  margin-bottom: var(--space-4);
}

/* =========================================================
   4. Utilities
   ========================================================= */

/* Layout container */

.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--space-4);
  max-width: calc(var(--container-max-width) + var(--space-4) * 2);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-6);
  }
}

/* Section spacing */

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

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-16);
  }
}

/* Flex helpers */

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

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

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

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

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

.gap-2 {
  gap: var(--space-2);
}

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

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

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

/* Grid helpers */

.grid {
  display: grid;
}

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

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

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

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

/* Text alignment */

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* Visibility: 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 background & surfaces for gaming cards/sections */

.surface {
  background: radial-gradient(circle at top left,
        rgba(111, 125, 255, 0.12) 0,
        transparent 55%),
      var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
}

.surface-alt {
  background: radial-gradient(circle at top right,
        rgba(111, 125, 255, 0.2) 0,
        transparent 60%),
      var(--color-surface-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
}

.muted {
  color: var(--color-text-muted);
}

/* =========================================================
   5. Components
   ========================================================= */

/* --- Buttons (primary CTAs for downloads) --- */

.btn {
  --btn-bg: var(--color-surface-alt);
  --btn-color: var(--color-text);
  --btn-border: rgba(255, 255, 255, 0.12);
  --btn-bg-hover: #1b2140;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-inline: var(--space-4);
  padding-block: 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-color);
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast),
    color var(--transition-base);
}

.btn-primary {
  --btn-bg: linear-gradient(120deg, #6f7dff, #9b6fff);
  --btn-bg-hover: linear-gradient(120deg, #8f9bff, #b57aff);
  --btn-border: transparent;
  box-shadow: var(--shadow-md), var(--shadow-glow-primary);
}

.btn-success {
  --btn-bg: linear-gradient(120deg, #46d69a, #37c07e);
  --btn-bg-hover: linear-gradient(120deg, #62e1ad, #3fd38c);
  --btn-border: transparent;
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-bg-hover: rgba(148, 163, 255, 0.08);
  --btn-border: rgba(148, 163, 255, 0.4);
  color: var(--color-primary-strong);
}

.btn-lg {
  padding-inline: var(--space-5);
  padding-block: 0.85rem;
  font-size: var(--font-size-base);
}

.btn-sm {
  padding-inline: var(--space-3);
  padding-block: 0.45rem;
  font-size: var(--font-size-xs);
}

.btn:hover {
  background: var(--btn-bg-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* --- Inputs & Forms --- */

.input,
 textarea,
 select {
  width: 100%;
  padding-inline: var(--space-3);
  padding-block: 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(7, 10, 26, 0.9);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition: border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

.input::placeholder,
 textarea::placeholder {
  color: rgba(165, 172, 199, 0.7);
}

.input:focus,
 textarea:focus,
 select:focus {
  outline: none;
  border-color: var(--color-border-strong);
  box-shadow: 0 0 0 1px rgba(111, 125, 255, 0.6), var(--shadow-xs);
  background-color: rgba(7, 10, 26, 0.98);
}

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

.field-group {
  margin-bottom: var(--space-4);
}

/* --- Card component (for guides, tips, systems, etc.) --- */

.card {
  position: relative;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top left,
        rgba(111, 125, 255, 0.2) 0,
        transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.98));
  border: 1px solid rgba(148, 163, 255, 0.2);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right,
        rgba(111, 125, 255, 0.25) 0,
        transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

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

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

.card-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  margin-bottom: 0.25rem;
}

.card-meta {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

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

/* Card variants */

.card-highlight {
  border-color: rgba(111, 125, 255, 0.6);
  box-shadow: var(--shadow-md), var(--shadow-glow-primary);
}

/* --- Tag / Badge (for difficulty, modes, etc.) --- */

.badge {
  display: inline-flex;
  align-items: center;
  padding-inline: 0.5rem;
  padding-block: 0.15rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 255, 0.4);
  color: var(--color-primary-strong);
}

.badge-warning {
  border-color: rgba(244, 180, 58, 0.7);
  color: var(--color-warning);
}

.badge-success {
  border-color: rgba(70, 214, 154, 0.7);
  color: var(--color-success);
}

/* --- Hero helper (for homepage PunBall pitch) --- */

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

@media (min-width: 768px) {
  .hero {
    padding-block: var(--space-16);
  }
}

.hero-eyebrow {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-primary-strong);
  margin-bottom: var(--space-2);
}

.hero-title {
  font-size: var(--font-size-4xl);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-3);
}

.hero-subtitle {
  max-width: 36rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* --- Media frame (for screenshot / gameplay placeholder) --- */

.media-frame {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: radial-gradient(circle at top,
        rgba(111, 125, 255, 0.4) 0,
        transparent 65%),
      #020617;
  border: 1px solid rgba(148, 163, 255, 0.4);
  box-shadow: var(--shadow-md), var(--shadow-glow-primary);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.15),
    transparent 30%,
    transparent 70%,
    rgba(15, 23, 42, 0.35)
  );
  pointer-events: none;
}

/* =========================================================
   6. Accessibility & Motion
   ========================================================= */

/* Focus-visible outlines */

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

button:focus-visible,
 .btn:focus-visible,
 a.btn:focus-visible {
  outline: 2px solid var(--color-primary-strong);
  outline-offset: 3px;
}

/* Respect prefers-reduced-motion */

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