/*
 * RuniverseHub UI V2 · Tokens
 * Fuente visual obligatoria: Runiverse Hub Unified (16).zip
 * F1: valores globales. No contiene composición de páginas.
 */

:root {
  /* Tipografía */
  --rh-v2-font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --rh-v2-font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --rh-v2-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --rh-v2-text-2xs: 0.625rem;
  --rh-v2-text-xs-alt: 0.6875rem;
  --rh-v2-text-xs: 0.75rem;
  --rh-v2-text-sm: 0.875rem;
  --rh-v2-text-base: 1rem;
  --rh-v2-text-lg: 1.125rem;
  --rh-v2-text-xl: 1.25rem;
  --rh-v2-text-2xl: 1.5rem;
  --rh-v2-text-3xl: 1.875rem;
  --rh-v2-text-4xl: 2.25rem;
  --rh-v2-text-5xl: 3rem;
  --rh-v2-text-6xl: 3.75rem;

  --rh-v2-leading-none: 1;
  --rh-v2-leading-tight: 1.1;
  --rh-v2-leading-snug: 1.25;
  --rh-v2-leading-normal: 1.5;
  --rh-v2-leading-relaxed: 1.625;

  --rh-v2-weight-regular: 400;
  --rh-v2-weight-medium: 500;
  --rh-v2-weight-semibold: 600;
  --rh-v2-weight-bold: 700;

  /* Base oscura premium congelada desde Lovable */
  --rh-v2-color-background: oklch(0.16 0.02 240);
  --rh-v2-color-foreground: oklch(0.97 0.005 240);
  --rh-v2-color-surface: oklch(0.2 0.02 240);
  --rh-v2-color-surface-2: oklch(0.235 0.022 240);
  --rh-v2-color-surface-3: oklch(0.28 0.025 240);
  --rh-v2-color-card: var(--rh-v2-color-surface);
  --rh-v2-color-card-foreground: var(--rh-v2-color-foreground);
  --rh-v2-color-popover: var(--rh-v2-color-surface-2);
  --rh-v2-color-popover-foreground: var(--rh-v2-color-foreground);

  --rh-v2-color-primary: oklch(0.82 0.15 190);
  --rh-v2-color-primary-foreground: oklch(0.18 0.03 220);
  --rh-v2-color-secondary: var(--rh-v2-color-surface-2);
  --rh-v2-color-secondary-foreground: var(--rh-v2-color-foreground);
  --rh-v2-color-muted: var(--rh-v2-color-surface-2);
  --rh-v2-color-muted-foreground: oklch(0.68 0.02 240);
  --rh-v2-color-accent: oklch(0.35 0.06 200);
  --rh-v2-color-accent-foreground: oklch(0.97 0.01 200);

  --rh-v2-color-success: oklch(0.78 0.16 155);
  --rh-v2-color-warning: oklch(0.82 0.16 75);
  --rh-v2-color-danger: oklch(0.68 0.2 25);
  --rh-v2-color-info: oklch(0.75 0.12 240);
  --rh-v2-color-destructive: var(--rh-v2-color-danger);
  --rh-v2-color-destructive-foreground: oklch(0.98 0 0);

  --rh-v2-color-border: oklch(1 0 0 / 8%);
  --rh-v2-color-border-strong: oklch(1 0 0 / 14%);
  --rh-v2-color-input: oklch(1 0 0 / 12%);
  --rh-v2-color-ring: oklch(0.82 0.15 190 / 60%);
  --rh-v2-color-overlay: oklch(0.08 0.02 240 / 78%);

  /* Identidad contextual */
  --rh-v2-role-public: oklch(0.82 0.15 190);
  --rh-v2-role-athlete: oklch(0.8 0.17 145);
  --rh-v2-role-organizer: oklch(0.78 0.15 65);
  --rh-v2-role-team: oklch(0.78 0.16 300);
  --rh-v2-role-admin: oklch(0.75 0.12 240);
  --rh-v2-context-accent: var(--rh-v2-role-public);

  /* Espaciado: escala única de 4 px */
  --rh-v2-space-0: 0;
  --rh-v2-space-1: 0.25rem;
  --rh-v2-space-2: 0.5rem;
  --rh-v2-space-3: 0.75rem;
  --rh-v2-space-4: 1rem;
  --rh-v2-space-5: 1.25rem;
  --rh-v2-space-6: 1.5rem;
  --rh-v2-space-7: 1.75rem;
  --rh-v2-space-8: 2rem;
  --rh-v2-space-10: 2.5rem;
  --rh-v2-space-12: 3rem;
  --rh-v2-space-14: 3.5rem;
  --rh-v2-space-16: 4rem;
  --rh-v2-space-20: 5rem;
  --rh-v2-space-24: 6rem;

  /* Radios derivados del valor base .75rem de Lovable */
  --rh-v2-radius-sm: 0.5rem;
  --rh-v2-radius-md: 0.625rem;
  --rh-v2-radius-lg: 0.75rem;
  --rh-v2-radius-xl: 1rem;
  --rh-v2-radius-2xl: 1.25rem;
  --rh-v2-radius-3xl: 1.5rem;
  --rh-v2-radius-full: 999px;

  /* Elevación */
  --rh-v2-shadow-sm: 0 1px 2px oklch(0 0 0 / 24%);
  --rh-v2-shadow-md: 0 10px 28px oklch(0 0 0 / 22%);
  --rh-v2-shadow-lg: 0 18px 48px oklch(0 0 0 / 28%);
  --rh-v2-shadow-panel: 0 24px 72px oklch(0 0 0 / 34%);
  --rh-v2-shadow-context: 0 16px 44px color-mix(in oklab, var(--rh-v2-context-accent) 13%, transparent);
  --rh-v2-shadow-focus: 0 0 0 3px color-mix(in oklab, var(--rh-v2-color-ring) 72%, transparent);
  --rh-v2-shadow-inset-context: inset 0 0 0 1px color-mix(in oklab, var(--rh-v2-context-accent) 30%, transparent);

  /* Contenedores */
  --rh-v2-container-sm: 40rem;
  --rh-v2-container-md: 48rem;
  --rh-v2-container-lg: 64rem;
  --rh-v2-container-xl: 72rem;
  --rh-v2-container-2xl: 80rem;
  --rh-v2-gutter: clamp(0.875rem, 3vw, 2rem);

  /* Motion portable */
  --rh-v2-motion-fast: 160ms;
  --rh-v2-motion-base: 240ms;
  --rh-v2-motion-panel: 280ms;
  --rh-v2-motion-slow: 360ms;
  --rh-v2-ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --rh-v2-ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --rh-v2-ease-exit: cubic-bezier(0.7, 0, 0.84, 0);
  --rh-v2-stagger-step: 60ms;
  --rh-v2-stagger-fast-step: 40ms;

  /* Capas */
  --rh-v2-z-base: 0;
  --rh-v2-z-sticky: 20;
  --rh-v2-z-dropdown: 40;
  --rh-v2-z-overlay: 60;
  --rh-v2-z-modal: 70;
  --rh-v2-z-toast: 80;

  /* Breakpoints documentados: 360, 393, 412, 768, 1366, 1440, 1920 */
  --rh-v2-breakpoint-sm: 40rem;
  --rh-v2-breakpoint-md: 48rem;
  --rh-v2-breakpoint-lg: 64rem;
  --rh-v2-breakpoint-xl: 80rem;
  --rh-v2-breakpoint-2xl: 96rem;

  /* Targets táctiles y densidad */
  --rh-v2-control-height-sm: 2rem;
  --rh-v2-control-height: 2.25rem;
  --rh-v2-control-height-lg: 2.5rem;
  --rh-v2-touch-target: 2.75rem;

  /* Aliases semánticos compartidos para shells privados y dominios V2.
     Todos derivan de los tokens congelados de Unified V16. */
  --rh-v2-bg-page: var(--rh-v2-color-background);
  --rh-v2-bg-surface: var(--rh-v2-color-surface);
  --rh-v2-bg-surface-soft: var(--rh-v2-color-surface-2);
  --rh-v2-bg-surface-strong: var(--rh-v2-color-surface-3);
  --rh-v2-text-primary: var(--rh-v2-color-foreground);
  --rh-v2-text-muted: var(--rh-v2-color-muted-foreground);
  --rh-v2-text-subtle: oklch(0.58 0.02 240);
  --rh-v2-border-subtle: var(--rh-v2-color-border);
  --rh-v2-border-strong: var(--rh-v2-color-border-strong);
  --rh-v2-context-soft: color-mix(in oklab, var(--rh-v2-context-accent) 12%, transparent);
  --rh-v2-shadow-card: var(--rh-v2-shadow-md);
  --rh-v2-shadow-elevated: var(--rh-v2-shadow-lg);
  --rh-v2-text-md: 0.9375rem;
}

.rh-v2-context-public { --rh-v2-context-accent: var(--rh-v2-role-public); }
.rh-v2-context-athlete { --rh-v2-context-accent: var(--rh-v2-role-athlete); }
.rh-v2-context-organizer { --rh-v2-context-accent: var(--rh-v2-role-organizer); }
.rh-v2-context-team { --rh-v2-context-accent: var(--rh-v2-role-team); }
.rh-v2-context-admin { --rh-v2-context-accent: var(--rh-v2-role-admin); }
