/* ============================================================
   STELLAR EMPIRES - BASE CSS
   Reset, tipografia global y estilos base
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700;900&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- RESET ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-darkest);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- SCROLLBAR CUSTOM ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-darkest);
}
::-webkit-scrollbar-thumb {
  background: var(--color-accent-blue);
  border-radius: var(--radius-full);
  opacity: 0.6;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-cyan);
}

/* ---- SELECCION DE TEXTO ---- */
::selection {
  background: rgba(59, 130, 246, 0.35);
  color: #fff;
}

/* ---- TIPOGRAFIA BASE ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-md); }

p {
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
}

a {
  color: var(--color-accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--color-text-primary);
}

ul, ol { list-style: none; }

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

input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

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

/* ---- CLASES UTILITARIAS ---- */
.text-primary   { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted     { color: var(--color-text-muted); }
.text-accent    { color: var(--color-text-accent); }
.text-gold      { color: var(--color-text-gold); }
.text-cyan      { color: var(--color-accent-cyan); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-danger    { color: var(--color-danger); }

.text-titanio   { color: var(--color-titanio); }
.text-cristal   { color: var(--color-cristal); }
.text-plasma    { color: var(--color-plasma); }
.text-energia   { color: var(--color-energia); }
.text-dm        { color: var(--color-dark-matter); }

.text-xs   { font-size: var(--font-size-xs); }
.text-sm   { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-md   { font-size: var(--font-size-md); }
.text-lg   { font-size: var(--font-size-lg); }
.text-xl   { font-size: var(--font-size-xl); }
.text-2xl  { font-size: var(--font-size-2xl); }

.font-normal   { font-weight: var(--font-weight-normal); }
.font-medium   { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold     { font-weight: var(--font-weight-bold); }

.font-display { font-family: var(--font-display); }
.font-mono    { font-family: var(--font-mono); }

.uppercase { text-transform: uppercase; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.d-flex      { display: flex; }
.d-grid      { display: grid; }
.d-none      { display: none; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-col    { flex-direction: column; }
.gap-1       { gap: var(--space-1); }
.gap-2       { gap: var(--space-2); }
.gap-3       { gap: var(--space-3); }
.gap-4       { gap: var(--space-4); }
.gap-6       { gap: var(--space-6); }
.gap-8       { gap: var(--space-8); }

.w-full  { width: 100%; }
.h-full  { height: 100%; }

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

.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

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

/* ---- FONDO ESPACIAL GLOBAL ---- */
.starfield-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(59,130,246,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(139,92,246,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 0%,  rgba(6,182,212,0.04) 0%, transparent 50%),
    linear-gradient(180deg, #03040a 0%, #070b18 50%, #03040a 100%);
  z-index: -1;
  pointer-events: none;
}
