/* ==========================================================================
   Westerosdle - Main Design System & Base Styles
   Theme: A Song of Ice and Fire / Dark Fantasy Aesthetic
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Palette - Dark Fantasy / Westeros */
  --bg-primary: #0a0c10;
  --bg-secondary: #12161f;
  --bg-surface: #181d29;
  --bg-card: #202737;
  --bg-card-hover: #293245;
  --bg-glass: rgba(24, 29, 41, 0.75);
  --bg-glass-card: rgba(32, 39, 55, 0.85);

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(212, 175, 55, 0.25);
  --border-glow: rgba(212, 175, 55, 0.5);

  /* Westeros Theme Accents */
  --gold-primary: #d4af37;
  --gold-light: #f5df88;
  --gold-dark: #997819;
  --targaryen-red: #e11d48;
  --stark-ice: #93c5fd;
  --valyrian-steel: #cbd5e1;
  --valyrian-glow: rgba(148, 163, 184, 0.4);

  /* Wordle / Game Match Feedback Colors */
  --match-green: #2e7d32;
  --match-green-glow: rgba(46, 125, 50, 0.4);
  --match-green-light: #4caf50;
  --match-yellow: #f57f17;
  --match-yellow-glow: rgba(245, 127, 23, 0.4);
  --match-yellow-light: #ffb300;
  --match-red: #c62828;
  --match-red-glow: rgba(198, 40, 40, 0.4);
  --match-red-light: #ef5350;

  /* Typography */
  --font-title: 'Cinzel', Georgia, serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #f5df88;

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.8);
  --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.25);

  /* Spacing & Layout */
  --container-max-width: 960px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] {
  /* Color Palette - Light Fantasy / Noble Parchment */
  --bg-primary: #f5f0e6;
  --bg-secondary: #eae3d2;
  --bg-surface: #ffffff;
  --bg-card: #f9f6ef;
  --bg-card-hover: #ede6d6;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-glass-card: rgba(255, 255, 255, 0.95);

  /* Borders & Dividers */
  --border-subtle: rgba(0, 0, 0, 0.1);
  --border-medium: rgba(180, 135, 30, 0.35);
  --border-glow: rgba(180, 135, 30, 0.6);

  /* Westeros Theme Accents */
  --gold-primary: #b8860b;
  --gold-light: #996515;
  --gold-dark: #7a500b;
  --targaryen-red: #be123c;
  --stark-ice: #1d4ed8;
  --valyrian-steel: #475569;
  --valyrian-glow: rgba(71, 85, 105, 0.25);

  /* Typography Colors */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-gold: #996515;

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.18);
  --shadow-gold: 0 0 15px rgba(184, 134, 11, 0.2);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(225, 29, 72, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-primary) 0%, #0d1017 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html[data-theme="light"] body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(184, 134, 11, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(190, 18, 60, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-primary) 0%, #ece4d2 100%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* Layout Containers */
.app-container {
  width: 100%;
  max-width: var(--container-max-width);
  padding: 1.25rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  min-height: 100vh;
}

/* Typography Utilities */
h1, h2, h3, h4, .title-font {
  font-family: var(--font-title);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.text-gold {
  color: var(--gold-light);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

/* Buttons Base */
button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 2px;
}
