/* ==========================================================================
   233Play.net — Design Tokens
   Indie HTML5 Game Arcade Portal
   Palette: Midnight Slate + Warm Amber-Gold + Electric Coral + Sky Cyan
   ========================================================================== */

:root {
  color-scheme: dark;

  /* --- Core Surfaces (Midnight Slate) --- */
  --bg-canvas: #080c16;
  --bg-canvas-deep: #050810;
  --bg-surface: #0f1626;
  --bg-surface-hover: #131c30;
  --bg-elevated: #162036;
  --bg-elevated-2: #1c2944;
  --bg-input: #0b111f;
  --bg-glass: rgba(15, 22, 38, 0.78);
  --bg-glass-strong: rgba(8, 12, 22, 0.88);
  --bg-overlay: rgba(4, 7, 14, 0.76);

  /* --- Ambient Canvas Gradients --- */
  --canvas-glow-gold: rgba(245, 176, 65, 0.085);
  --canvas-glow-cyan: rgba(56, 189, 248, 0.08);
  --canvas-glow-coral: rgba(255, 94, 98, 0.055);
  --canvas-grid-dot: rgba(148, 163, 184, 0.06);

  /* --- Typography Colors --- */
  --text-primary: #f1f5f9;
  --text-secondary: #a9b8cf;
  --text-muted: #7487a4;
  --text-subtle: #556682;
  --text-inverse: #080c16;

  /* --- Brand & Accents --- */
  --accent-gold: #f5b041;
  --accent-gold-bright: #ffcb6b;
  --accent-gold-deep: #d98c1c;
  --accent-gold-soft: rgba(245, 176, 65, 0.14);
  --accent-gold-border: rgba(245, 176, 65, 0.36);

  --accent-coral: #ff5e62;
  --accent-coral-bright: #ff7e82;
  --accent-coral-deep: #e03e44;
  --accent-coral-soft: rgba(255, 94, 98, 0.15);
  --accent-coral-border: rgba(255, 94, 98, 0.38);

  --accent-cyan: #38bdf8;
  --accent-cyan-bright: #7dd3fc;
  --accent-cyan-deep: #0284c7;
  --accent-cyan-soft: rgba(56, 189, 248, 0.14);
  --accent-cyan-border: rgba(56, 189, 248, 0.36);

  /* --- Primary Interactive Gradient (Amber-Gold -> Electric Coral) --- */
  --grad-primary: linear-gradient(135deg, #f5b041 0%, #ff7a45 52%, #ff5e62 100%);
  --grad-primary-hover: linear-gradient(135deg, #ffc45e 0%, #ff8a56 52%, #ff7074 100%);
  --grad-gold: linear-gradient(135deg, #ffd075 0%, #f5b041 100%);
  --grad-cyan: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  --grad-surface-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0) 48%);

  /* --- Semantic Status Colors --- */
  --status-success: #22c55e;
  --status-success-text: #4ade80;
  --status-success-soft: rgba(34, 197, 94, 0.14);
  --status-success-border: rgba(34, 197, 94, 0.34);

  --status-warning: #f5b041;
  --status-warning-text: #fbbf24;
  --status-warning-soft: rgba(245, 176, 65, 0.14);
  --status-warning-border: rgba(245, 176, 65, 0.34);

  --status-danger: #f43f5e;
  --status-danger-text: #fb7185;
  --status-danger-soft: rgba(244, 63, 94, 0.15);
  --status-danger-border: rgba(244, 63, 94, 0.36);

  --status-info: #38bdf8;
  --status-info-text: #7dd3fc;
  --status-info-soft: rgba(56, 189, 248, 0.14);
  --status-info-border: rgba(56, 189, 248, 0.34);

  /* --- Borders & Hairlines --- */
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-default: rgba(148, 163, 184, 0.2);
  --border-strong: rgba(148, 163, 184, 0.34);
  --border-glass: rgba(255, 255, 255, 0.08);
  --ring-focus: 0 0 0 3px rgba(56, 189, 248, 0.32);
  --ring-focus-gold: 0 0 0 3px rgba(245, 176, 65, 0.32);

  /* --- Typography --- */
  --font-sans: "Plus Jakarta Sans", "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Space Grotesk", "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 0.9375rem; /* 15px */
  --text-md: 1rem;        /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.375rem;    /* 22px */
  --text-2xl: 1.75rem;    /* 28px */
  --text-3xl: 2.25rem;    /* 36px */

  --leading-tight: 1.2;
  --leading-snug: 1.38;
  --leading-normal: 1.6;

  /* --- Spacing Scale --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* --- Layout Dimensions --- */
  --container-max: 1320px;
  --topbar-height: 68px;

  /* --- Border Radii --- */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-pill: 9999px;

  /* --- Elevation & Shadows --- */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.26);
  --shadow-sm: 0 4px 14px rgba(2, 6, 16, 0.34);
  --shadow-md: 0 12px 30px rgba(2, 6, 16, 0.48), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 22px 54px rgba(2, 6, 16, 0.64), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  --shadow-glow-gold: 0 8px 28px rgba(245, 176, 65, 0.24);
  --shadow-glow-coral: 0 8px 28px rgba(255, 94, 98, 0.26);
  --shadow-glow-cyan: 0 8px 28px rgba(56, 189, 248, 0.22);
  --shadow-card-hover: 0 20px 44px rgba(2, 6, 16, 0.62), 0 0 0 1px rgba(245, 176, 65, 0.32);

  /* --- Skeleton Shimmer --- */
  --skeleton-base: #131c30;
  --skeleton-shine: #1e2d4a;

  /* --- Blur --- */
  --blur-sm: 10px;
  --blur-md: 18px;
  --blur-lg: 26px;

  /* --- Motion --- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 140ms;
  --dur-normal: 220ms;
  --dur-slow: 360ms;

  /* --- Z-Index Layers --- */
  --z-base: 1;
  --z-sticky: 40;
  --z-drawer: 60;
  --z-topbar: 100;
  --z-modal: 200;
  --z-fullscreen: 900;
  --z-toast: 1000;
}

/* ==========================================================================
   Light Theme Override — Clean Editorial Alabaster & Precision Ink
   ========================================================================== */
[data-theme="light"] {
  color-scheme: light;

  --bg-canvas: #f3f5fa;
  --bg-canvas-deep: #e8edf5;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f8fafd;
  --bg-elevated: #edf1f8;
  --bg-elevated-2: #e2e8f3;
  --bg-input: #f8fafd;
  --bg-glass: rgba(255, 255, 255, 0.84);
  --bg-glass-strong: rgba(248, 250, 253, 0.94);
  --bg-overlay: rgba(15, 23, 42, 0.52);

  --canvas-glow-gold: rgba(245, 158, 11, 0.08);
  --canvas-glow-cyan: rgba(14, 165, 233, 0.08);
  --canvas-glow-coral: rgba(244, 63, 94, 0.05);
  --canvas-grid-dot: rgba(15, 23, 42, 0.055);

  --text-primary: #0f172a;
  --text-secondary: #43536b;
  --text-muted: #64748b;
  --text-subtle: #8b9bb4;
  --text-inverse: #ffffff;

  --accent-gold: #d9820b;
  --accent-gold-bright: #f59e0b;
  --accent-gold-deep: #b45309;
  --accent-gold-soft: rgba(217, 130, 11, 0.12);
  --accent-gold-border: rgba(217, 130, 11, 0.34);

  --accent-coral: #e53e4d;
  --accent-coral-bright: #f45563;
  --accent-coral-deep: #be123c;
  --accent-coral-soft: rgba(229, 62, 77, 0.1);
  --accent-coral-border: rgba(229, 62, 77, 0.3);

  --accent-cyan: #0284c7;
  --accent-cyan-bright: #0ea5e9;
  --accent-cyan-deep: #0369a1;
  --accent-cyan-soft: rgba(2, 132, 199, 0.1);
  --accent-cyan-border: rgba(2, 132, 199, 0.3);

  --grad-primary: linear-gradient(135deg, #f59e0b 0%, #f9673c 55%, #e53e4d 100%);
  --grad-primary-hover: linear-gradient(135deg, #d97706 0%, #ea580c 55%, #dc2626 100%);
  --grad-surface-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 45%);

  --status-success: #16a34a;
  --status-success-text: #15803d;
  --status-success-soft: rgba(22, 163, 74, 0.11);
  --status-success-border: rgba(22, 163, 74, 0.3);

  --status-warning: #d97706;
  --status-warning-text: #b45309;
  --status-warning-soft: rgba(217, 119, 6, 0.12);
  --status-warning-border: rgba(217, 119, 6, 0.3);

  --status-danger: #e11d48;
  --status-danger-text: #be123c;
  --status-danger-soft: rgba(225, 29, 72, 0.1);
  --status-danger-border: rgba(225, 29, 72, 0.28);

  --status-info: #0284c7;
  --status-info-text: #0369a1;
  --status-info-soft: rgba(2, 132, 199, 0.1);
  --status-info-border: rgba(2, 132, 199, 0.28);

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-default: rgba(15, 23, 42, 0.14);
  --border-strong: rgba(15, 23, 42, 0.24);
  --border-glass: rgba(15, 23, 42, 0.07);
  --ring-focus: 0 0 0 3px rgba(2, 132, 199, 0.22);
  --ring-focus-gold: 0 0 0 3px rgba(217, 130, 11, 0.24);

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.15);
  --shadow-glow-gold: 0 8px 24px rgba(217, 130, 11, 0.2);
  --shadow-glow-coral: 0 8px 24px rgba(229, 62, 77, 0.22);
  --shadow-glow-cyan: 0 8px 24px rgba(2, 132, 199, 0.18);
  --shadow-card-hover: 0 18px 36px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(217, 130, 11, 0.32);

  --skeleton-base: #e6ecf5;
  --skeleton-shine: #f4f7fc;
}

/* ==========================================================================
   Micro-Animation Keyframes
   ========================================================================== */
@keyframes p233-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes p233-slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes p233-modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes p233-toast-in {
  from {
    opacity: 0;
    transform: translateX(22px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes p233-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes p233-heat-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 94, 98, 0.34), 0 4px 14px rgba(255, 94, 98, 0.28);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(255, 94, 98, 0), 0 4px 18px rgba(245, 176, 65, 0.38);
  }
}

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