/* ========================================================================== 
   SEA - Base Styles
   --------------------------------------------------------------------------
   Sections:
   1) CSS Variables
   2) Reset & Normalize
   3) Base Elements
   4) Layout & Utilities
   5) Components
   6) Accessibility & Motion
   ========================================================================== */

/* ========================================================================== 
   1) CSS Variables
   ========================================================================== */

:root {
  /* Color system - dark, sci-fi, neon-accented */
  --color-background: #050914;          /* Main page background */
  --color-surface: #0b1020;             /* Panels, cards */
  --color-surface-alt: #141a33;         /* Alternate surfaces */
  --color-text: #f5f7ff;                /* Primary text */
  --color-text-muted: #a5b0d1;          /* Secondary text */

  --color-primary: #6cf0ff;             /* Neon cyan accent */
  --color-primary-soft: rgba(108, 240, 255, 0.12);
  --color-primary-strong: #40d3ea;

  --color-success: #4ade80;             /* Emerald */
  --color-warning: #facc15;             /* Yellow */
  --color-danger: #fb7185;              /* Coral red */

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

  /* Status backgrounds for badges/labels */
  --color-success-soft: rgba(74, 222, 128, 0.12);
  --color-warning-soft: rgba(250, 204, 21, 0.12);
  --color-danger-soft: rgba(251, 113, 133, 0.12);

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Orbitron", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Base font sizing tuned for Polish content-heavy pages */
  --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 heights */
  --line-height-xs: 1.2;
  --line-height-sm: 1.35;
  --line-height-base: 1.6;
  --line-height-relaxed: 1.8;

  /* 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: 12px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows (subtle to strong, sci-fi glow) */
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.75);
  --shadow-glow-primary: 0 0 25px rgba(108, 240, 255, 0.5);

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

  /* Layout */
  --container-max-width: 1120px;
  --container-padding-x: var(--space-4);

  /* Z-index scale */
  --z-header: 50;
  --z-overlay: 100;
  --z-modal: 200;
}

/* ========================================================================== 
   2) Reset & Normalize
   ========================================================================== */

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

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

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

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

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

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

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

a {
  color: inherit;
  text-decoration: none;
}

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

/* ========================================================================== 
   3) Base Elements
   ========================================================================== */

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  background: radial-gradient(circle at top, #101635 0, #050914 55%, #02030a 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  display: block;
}

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

p:last-child {
  margin-bottom: 0;
}

h1,
 h2,
 h3,
 h4,
 h5,
 h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--line-height-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
}

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

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

h3 {
  font-size: clamp(1.4rem, 2vw, 1.875rem);
  margin-bottom: var(--space-3);
}

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

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

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

strong,
 b {
  font-weight: 600;
}

code,
 pre {
  font-family: var(--font-mono);
}

hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: var(--space-6) 0;
}

::selection {
  background-color: rgba(108, 240, 255, 0.35);
  color: #020617;
}

/* Links - base style */

a {
  position: relative;
  transition: color var(--transition-base);
}

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

a[data-underline="true"],
 .link-underline {
  text-decoration: none;
}

a[data-underline="true"]::after,
 .link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15em;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-strong));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

a[data-underline="true"]:hover::after,
 .link-underline:hover::after {
  transform: scaleX(1);
}

/* Lists */

ul,
 ol {
  list-style: none;
}

ul.list-disc,
 ol.list-decimal {
  margin-left: 1.25rem;
}

ul.list-disc {
  list-style: disc;
}

ol.list-decimal {
  list-style: decimal;
}

/* ========================================================================== 
   4) Layout & Utilities
   ========================================================================== */

/* Container */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding-x);
  padding-right: var(--container-padding-x);
}

/* Flex helpers */

.flex {
  display: flex;
}

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

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

.flex-row {
  flex-direction: row;
}

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

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

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.justify-end {
  justify-content: flex-end;
}

.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(2, minmax(0, 1fr));
}

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

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

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

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

/* Spacing utilities (margin + padding, minimal set for layout) */

.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-6 { padding-top: var(--space-6); }
.pt-8 { padding-top: var(--space-8); }
.pb-6 { padding-bottom: var(--space-6); }
.pb-8 { padding-bottom: var(--space-8); }

.section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.section--dense {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

/* Alignment & text */

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

/* Width helpers */

.w-full { width: 100%; }

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

/* ========================================================================== 
   5) Components
   ========================================================================== */

/* Buttons - primary CTA (e.g., Google Play link) */

.btn {
  --btn-bg: var(--color-surface-alt);
  --btn-bg-hover: #1f2945;
  --btn-color: var(--color-text);
  --btn-border: transparent;

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

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

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

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

/* Primary neon CTA - highlight for Google Play */

.btn-primary {
  --btn-bg: linear-gradient(135deg, #40d3ea, #6cf0ff);
  --btn-bg-hover: linear-gradient(135deg, #34c0d7, #54e8ff);
  --btn-color: #020617;
  --btn-border: rgba(108, 240, 255, 0.85);
  box-shadow: var(--shadow-glow-primary);
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(108, 240, 255, 0.7);
}

/* Secondary outline button (e.g., navigation actions) */

.btn-outline {
  --btn-bg: transparent;
  --btn-bg-hover: rgba(148, 163, 184, 0.05);
  --btn-color: var(--color-text);
  --btn-border: rgba(148, 163, 184, 0.6);
}

/* Icon-only / small button */

.btn-icon {
  padding: 0.4rem;
  border-radius: var(--radius-full);
}

/* Inputs & form controls */

.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-color: rgba(15, 23, 42, 0.86);
  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(148, 163, 184, 0.7);
}

.input:focus,
 textarea:focus,
 select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(108, 240, 255, 0.35);
  background-color: rgba(15, 23, 42, 0.98);
}

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

label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Cards - used for sections like builds, enemies, updates, blog posts */

.card {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(108, 240, 255, 0.08) 0, rgba(15, 23, 42, 0.85) 38%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

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

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

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

.card__title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-1);
}

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

.card__meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.card--compact {
  padding: var(--space-4);
}

/* Tag / pill - for difficulty, wave tier, update label */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--color-text-muted);
}

.badge--primary {
  border-color: rgba(108, 240, 255, 0.9);
  background-color: var(--color-primary-soft);
  color: var(--color-primary);
}

.badge--success {
  border-color: rgba(74, 222, 128, 0.9);
  background-color: var(--color-success-soft);
  color: var(--color-success);
}

.badge--warning {
  border-color: rgba(250, 204, 21, 0.9);
  background-color: var(--color-warning-soft);
  color: var(--color-warning);
}

.badge--danger {
  border-color: rgba(251, 113, 133, 0.9);
  background-color: var(--color-danger-soft);
  color: var(--color-danger);
}

/* Hero CTA zone (for Strona główna) */

.hero {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

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

.hero__title {
  font-size: clamp(2.6rem, 4vw, 3.4rem);
  line-height: 1.1;
  margin-bottom: var(--space-4);
}

.hero__subtitle {
  max-width: 36rem;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Placeholder blocks for gameplay visuals */

.placeholder-media {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius-lg);
  background: repeating-linear-gradient(
      -45deg,
      rgba(15, 23, 42, 0.9),
      rgba(15, 23, 42, 0.9) 10px,
      rgba(30, 64, 175, 0.8) 10px,
      rgba(30, 64, 175, 0.8) 20px
    );
  border: 1px solid rgba(148, 163, 184, 0.6);
  overflow: hidden;
}

.placeholder-media::after {
  content: "Wideo rozgrywki / zrzut ekranu";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.8);
  backdrop-filter: blur(2px);
  background: linear-gradient(
      120deg,
      rgba(15, 23, 42, 0.9),
      rgba(15, 23, 42, 0.7)
    );
}

/* Navigation shell (basic, can be expanded per page) */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  backdrop-filter: blur(18px);
  background: linear-gradient(
      to bottom,
      rgba(2, 6, 23, 0.94),
      rgba(2, 6, 23, 0.75),
      rgba(2, 6, 23, 0)
    );
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.site-nav a {
  position: relative;
  padding: 0.3rem 0;
  color: var(--color-text-muted);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  background: linear-gradient(90deg, #40d3ea, #6cf0ff);
  transition: transform var(--transition-base), opacity var(--transition-base);
  opacity: 0.4;
}

.site-nav a:hover {
  color: var(--color-primary);
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
  opacity: 1;
}

.site-nav a[aria-current="page"] {
  color: var(--color-primary);
}

/* Footer */

.site-footer {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), #020617 65%);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* ========================================================================== 
   6) Accessibility & Motion
   ========================================================================== */

/* Focus styles - use :focus-visible for keyboard users */

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

/* Remove default outline when using custom focus-visible */

:focus {
  outline: none;
}

/* Prefer reduced motion */

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

/* Helper class to visually indicate keyboard navigation when needed */

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

/* End of base.css */
