@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  /* Colors - Dark Theme (Scarlet Witch — Story Mode: Maroon & Red) */
  --bg-primary: #16080b;
  --bg-secondary: #220f13;
  --bg-tertiary: #2d1519;
  --bg-elevated: #381c20;
  
  --accent-primary: #e53b50;
  --accent-secondary: #b81d30;
  --accent-hover: #ff5c70;
  --accent-glow: rgba(229, 59, 80, 0.15);
  
  --text-primary: #faeaec;
  --text-secondary: #d6b6ba;
  --text-muted: #a68387;
  --text-accent: #e53b50;
  
  --border-primary: rgba(229, 59, 80, 0.16);
  --border-secondary: rgba(229, 59, 80, 0.08);
  
  --danger: #ff4d4d;
  --danger-hover: #ff6666;
  --success: #4eb060;
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  
  --glass: rgba(34, 15, 19, 0.85);
  --glass-border: rgba(229, 59, 80, 0.12);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Typography */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-prose: 'Lora', Georgia, 'Times New Roman', serif;
  
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-prose: 1.125rem; /* 18px */
  
  --line-height-tight: 1.3;
  --line-height-base: 1.6;
  --line-height-prose: 1.85;

  /* Borders & Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 24px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  --transition-page: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='light'] {
  /* Colors - Light Theme (Scarlet Witch — Story Mode: Maroon & Red) */
  --bg-primary: #fcf8f8;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5e6e8;
  --bg-elevated: #ffffff;
  
  --accent-primary: #c92237;
  --accent-secondary: #9e1626;
  --accent-hover: #e03b50;
  --accent-glow: rgba(201, 34, 55, 0.1);
  
  --text-primary: #331a1d;
  --text-secondary: #664448;
  --text-muted: #997579;
  --text-accent: #c92237;
  
  --border-primary: rgba(201, 34, 55, 0.16);
  --border-secondary: rgba(201, 34, 55, 0.08);
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  
  --glass: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(201, 34, 55, 0.12);
}

/* ═══════════════════════════════════════════════════════════════════
   D&D Mode — Green Color Override
   Applied via .dnd-mode class on the html/documentElement root
   ═══════════════════════════════════════════════════════════════════ */
.dnd-mode {
  --bg-primary: #0c140e;
  --bg-secondary: #121e15;
  --bg-tertiary: #18291c;
  --bg-elevated: #203525;

  --accent-primary: #4eb060;
  --accent-secondary: #388c49;
  --accent-hover: #6ec77f;
  --accent-glow: rgba(78, 176, 96, 0.15);
  --text-accent: #4eb060;

  --text-primary: #ebfaed;
  --text-secondary: #b4cca8;
  --text-muted: #7f997c;

  --border-primary: rgba(78, 176, 96, 0.16);
  --border-secondary: rgba(78, 176, 96, 0.08);

  --glass: rgba(18, 30, 21, 0.85);
  --glass-border: rgba(78, 176, 96, 0.12);
}

[data-theme='light'] .dnd-mode {
  --bg-primary: #f2faf4;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e4f2e7;
  --bg-elevated: #ffffff;

  --accent-primary: #2e8a45;
  --accent-secondary: #1f612f;
  --accent-hover: #3fa857;
  --accent-glow: rgba(46, 138, 69, 0.1);
  --text-accent: #2e8a45;

  --text-primary: #122417;
  --text-secondary: #3a5c43;
  --text-muted: #62856c;

  --border-primary: rgba(46, 138, 69, 0.16);
  --border-secondary: rgba(46, 138, 69, 0.08);

  --glass: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(46, 138, 69, 0.12);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: var(--line-height-base);
}

/* Scrollbar styling (webkit) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

/* Selection colors */
::selection {
  background: var(--accent-primary);
  color: #16080b;
}

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

/* Links */
a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

/* Buttons */
button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: transparent;
  color: inherit;
}

/* Inputs and Textareas */
input, textarea {
  font-family: inherit;
  color: inherit;
  background: transparent;
}

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