:root,
[data-theme="dark"] {
  /* --- Lustomotive Racing Palette --- */
  /* Common */
  --ignition: #ff2a4d;
  --ignition-dim: #c91a35;
  --signal-green: #10b981;
  --signal-red: #ef4444;
  --signal-yellow: #f59e0b;

  --font-display: "Orbitron", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;

  /* Dark Theme (Default) */
  --bg-body: #040506;
  --bg-surface: linear-gradient(145deg, #0a0c0f, #12151a);
  --bg-surface-solid: #0a0c0f;
  --bg-surface-hover: rgba(255, 255, 255, 0.03);
  --bg-input: #1a1e24;
  --bg-glass: rgba(10, 12, 15, 0.75);

  --border-line: #2e353f;
  --border-focus: var(--ignition);

  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5);

  --btn-ghost-hover: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] {
  --bg-body: #e2e8f0;
  --bg-surface: linear-gradient(145deg, #f8fafc, #f1f5f9);
  --bg-surface-solid: #f8fafc;
  --bg-surface-hover: rgba(0, 0, 0, 0.05);
  --bg-input: #ffffff;
  --bg-glass: rgba(248, 250, 252, 0.85);

  --border-line: #cbd5e1;
  --border-focus: var(--ignition);

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);

  --btn-ghost-hover: rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

::selection {
  background: var(--ignition);
  color: #ffffff;
}

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

/* Flash messages */
.flash-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-line);
  box-shadow: var(--shadow-md);
  animation: flash-in 0.25s ease;
}

@keyframes flash-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flash-success {
  border-left: 4px solid var(--signal-green);
}

.flash-danger {
  border-left: 4px solid var(--signal-red);
}

.flash-warning {
  border-left: 4px solid var(--ignition);
}

.flash-info {
  border-left: 4px solid var(--text-secondary);
}

.flash-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
}

.flash-close:hover {
  color: var(--text-primary);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}