/* =====================================================================
   GameFlix — base compartida
   ===================================================================== */
:root {
  --bg: #0b0b0f;
  --bg-2: #111116;
  --surface: #17171d;
  --surface-2: #202028;
  --surface-3: #2a2a33;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --accent: #e50914;
  --accent-2: #ff3b47;
  --accent-soft: rgba(229, 9, 20, 0.16);
  --success: #22c55e;
  --warning: #f59f00;
  --radius: 10px;
  --gutter: clamp(16px, 4vw, 60px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bebas Neue", "Impact", "Arial Narrow", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
[hidden] { display: none !important; }
svg { flex-shrink: 0; }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

::selection { background: var(--accent); color: #fff; }

* { scrollbar-width: thin; scrollbar-color: #3a3a44 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a3a44; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 2000;
  background: #fff; color: #000; padding: 10px 16px; border-radius: 6px; font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { width: 32px; height: 32px; filter: drop-shadow(0 4px 14px rgba(229, 9, 20, 0.45)); transition: transform 0.3s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-word {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 1.5px;
  line-height: 1;
  color: #fff;
  padding-top: 3px;
}
.brand-word b { font-weight: 400; color: var(--accent-2); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s, opacity 0.2s, border-color 0.2s;
}
.btn svg { width: 22px; height: 22px; }
.btn:active { transform: scale(0.97); }
.btn-play { background: #fff; color: #000; }
.btn-play:hover { background: rgba(255, 255, 255, 0.82); }
.btn-secondary { background: rgba(109, 109, 118, 0.6); color: #fff; backdrop-filter: blur(6px); }
.btn-secondary:hover { background: rgba(109, 109, 118, 0.42); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #c40812; }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--text); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.btn-danger { background: rgba(229, 9, 20, 0.12); color: #ff6b73; border: 1px solid rgba(229, 9, 20, 0.35); }
.btn-danger:hover { background: rgba(229, 9, 20, 0.22); }
.btn-sm { padding: 8px 14px; font-size: 14px; font-weight: 600; }
.btn-sm svg { width: 18px; height: 18px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- Insignias ---------- */
.badge {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px; line-height: 1.3;
}
.badge-new { background: var(--accent); color: #fff; }

/* ---------- Spinner ---------- */
.spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toasts ---------- */
.toast-container {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 3000; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  background: rgba(32, 32, 40, 0.97);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
  display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: none; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.toast-error::before { background: var(--accent-2); }
.toast-warning::before { background: var(--warning); }

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