:root {
  /* Primitive Color Tokens */
  --color-white: rgba(255, 255, 255, 1);
  --color-black: rgba(0, 0, 0, 1);
  --color-cream-50: rgba(252, 252, 249, 1);
  --color-cream-100: rgba(255, 255, 253, 1);
  --color-gray-200: rgba(245, 245, 245, 1);
  --color-gray-300: rgba(167, 169, 169, 1);
  --color-gray-400: rgba(119, 124, 124, 1);
  --color-slate-500: rgba(98, 108, 113, 1);
  --color-brown-600: rgba(94, 82, 64, 1);
  --color-charcoal-700: rgba(31, 33, 33, 1);
  --color-charcoal-800: rgba(38, 40, 40, 1);
  --color-slate-900: rgba(19, 52, 59, 1);
  --color-teal-300: rgba(50, 184, 198, 1);
  --color-teal-400: rgba(45, 166, 178, 1);
  --color-teal-500: rgba(33, 128, 141, 1);
  --color-teal-600: rgba(29, 116, 128, 1);
  --color-teal-700: rgba(26, 104, 115, 1);
  --color-teal-800: rgba(41, 150, 161, 1);
  --color-red-400: rgba(255, 84, 89, 1);
  --color-red-500: rgba(192, 21, 47, 1);
  --color-orange-400: rgba(230, 129, 97, 1);
  --color-orange-500: rgba(168, 75, 47, 1);

  /* RGB versions for opacity control */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;
  --color-slate-500-rgb: 98, 108, 113;
  --color-red-500-rgb: 192, 21, 47;
  --color-red-400-rgb: 255, 84, 89;
  --color-orange-500-rgb: 168, 75, 47;
  --color-orange-400-rgb: 230, 129, 97;

  /* Background color tokens (Light Mode) */
  --color-bg-1: rgba(59, 130, 246, 0.08); /* Light blue */
  --color-bg-2: rgba(245, 158, 11, 0.08); /* Light yellow */
  --color-bg-3: rgba(34, 197, 94, 0.08); /* Light green */
  --color-bg-4: rgba(239, 68, 68, 0.08); /* Light red */
  --color-bg-5: rgba(147, 51, 234, 0.08); /* Light purple */
  --color-bg-6: rgba(249, 115, 22, 0.08); /* Light orange */
  --color-bg-7: rgba(236, 72, 153, 0.08); /* Light pink */
  --color-bg-8: rgba(6, 182, 212, 0.08); /* Light cyan */

  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);
  --color-select-caret: rgba(var(--color-slate-900-rgb), 0.8);

  /* Common style patterns */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for opacity control */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;

  /* Typography */
  --font-family-base: "FKGroteskNeue", "Geist", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 550;
  --font-weight-bold: 600;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --letter-spacing-tight: -0.01em;

  /* Spacing */
  --space-0: 0;
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    /* RGB versions for opacity control (Dark Mode) */
    --color-gray-400-rgb: 119, 124, 124;
    --color-teal-300-rgb: 50, 184, 198;
    --color-gray-300-rgb: 167, 169, 169;
    --color-gray-200-rgb: 245, 245, 245;

    /* Background color tokens (Dark Mode) */
    --color-bg-1: rgba(29, 78, 216, 0.15); /* Dark blue */
    --color-bg-2: rgba(180, 83, 9, 0.15); /* Dark yellow */
    --color-bg-3: rgba(21, 128, 61, 0.15); /* Dark green */
    --color-bg-4: rgba(185, 28, 28, 0.15); /* Dark red */
    --color-bg-5: rgba(107, 33, 168, 0.15); /* Dark purple */
    --color-bg-6: rgba(194, 65, 12, 0.15); /* Dark orange */
    --color-bg-7: rgba(190, 24, 93, 0.15); /* Dark pink */
    --color-bg-8: rgba(8, 145, 178, 0.15); /* Dark cyan */
    
    /* Semantic Color Tokens (Dark Mode) */
    --color-background: var(--color-charcoal-700);
    --color-surface: var(--color-charcoal-800);
    --color-text: var(--color-gray-200);
    --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
    --color-primary: var(--color-teal-300);
    --color-primary-hover: var(--color-teal-400);
    --color-primary-active: var(--color-teal-800);
    --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
    --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
    --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
    --color-border: rgba(var(--color-gray-400-rgb), 0.3);
    --color-error: var(--color-red-400);
    --color-success: var(--color-teal-300);
    --color-warning: var(--color-orange-400);
    --color-info: var(--color-gray-300);
    --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
    --color-btn-primary-text: var(--color-slate-900);
    --color-card-border: rgba(var(--color-gray-400-rgb), 0.2);
    --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    --button-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
    --color-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
    --color-select-caret: rgba(var(--color-gray-200-rgb), 0.8);

    /* Common style patterns - updated for dark mode */
    --focus-ring: 0 0 0 3px var(--color-focus-ring);
    --focus-outline: 2px solid var(--color-primary);
    --status-bg-opacity: 0.15;
    --status-border-opacity: 0.25;
    --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

    /* RGB versions for dark mode */
    --color-success-rgb: var(--color-teal-300-rgb);
    --color-error-rgb: var(--color-red-400-rgb);
    --color-warning-rgb: var(--color-orange-400-rgb);
    --color-info-rgb: var(--color-gray-300-rgb);
  }
}

/* Data attribute for manual theme switching */
[data-color-scheme="dark"] {
  /* RGB versions for opacity control (dark mode) */
  --color-gray-400-rgb: 119, 124, 124;
  --color-teal-300-rgb: 50, 184, 198;
  --color-gray-300-rgb: 167, 169, 169;
  --color-gray-200-rgb: 245, 245, 245;

  /* Colorful background palette - Dark Mode */
  --color-bg-1: rgba(29, 78, 216, 0.15); /* Dark blue */
  --color-bg-2: rgba(180, 83, 9, 0.15); /* Dark yellow */
  --color-bg-3: rgba(21, 128, 61, 0.15); /* Dark green */
  --color-bg-4: rgba(185, 28, 28, 0.15); /* Dark red */
  --color-bg-5: rgba(107, 33, 168, 0.15); /* Dark purple */
  --color-bg-6: rgba(194, 65, 12, 0.15); /* Dark orange */
  --color-bg-7: rgba(190, 24, 93, 0.15); /* Dark pink */
  --color-bg-8: rgba(8, 145, 178, 0.15); /* Dark cyan */
  
  /* Semantic Color Tokens (Dark Mode) */
  --color-background: var(--color-charcoal-700);
  --color-surface: var(--color-charcoal-800);
  --color-text: var(--color-gray-200);
  --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
  --color-primary: var(--color-teal-300);
  --color-primary-hover: var(--color-teal-400);
  --color-primary-active: var(--color-teal-800);
  --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
  --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
  --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
  --color-border: rgba(var(--color-gray-400-rgb), 0.3);
  --color-error: var(--color-red-400);
  --color-success: var(--color-teal-300);
  --color-warning: var(--color-orange-400);
  --color-info: var(--color-gray-300);
  --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
  --color-btn-primary-text: var(--color-slate-900);
  --color-card-border: rgba(var(--color-gray-400-rgb), 0.15);
  --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  --color-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
  --color-select-caret: rgba(var(--color-gray-200-rgb), 0.8);

  /* Common style patterns - updated for dark mode */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for dark mode */
  --color-success-rgb: var(--color-teal-300-rgb);
  --color-error-rgb: var(--color-red-400-rgb);
  --color-warning-rgb: var(--color-orange-400-rgb);
  --color-info-rgb: var(--color-gray-300-rgb);
}

[data-color-scheme="light"] {
  /* RGB versions for opacity control (light mode) */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;
  
  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);

  /* RGB versions for light mode */
  --color-success-rgb: var(--color-teal-500-rgb);
  --color-error-rgb: var(--color-red-500-rgb);
  --color-warning-rgb: var(--color-orange-500-rgb);
  --color-info-rgb: var(--color-slate-500-rgb);
}

/* Base styles */
html {
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-4xl);
}
h2 {
  font-size: var(--font-size-3xl);
}
h3 {
  font-size: var(--font-size-2xl);
}
h4 {
  font-size: var(--font-size-xl);
}
h5 {
  font-size: var(--font-size-lg);
}
h6 {
  font-size: var(--font-size-md);
}

p {
  margin: 0 0 var(--space-16) 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-primary-hover);
}

code,
pre {
  font-family: var(--font-family-mono);
  font-size: calc(var(--font-size-base) * 0.95);
  background-color: var(--color-secondary);
  border-radius: var(--radius-sm);
}

code {
  padding: var(--space-1) var(--space-4);
}

pre {
  padding: var(--space-16);
  margin: var(--space-16) 0;
  overflow: auto;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: none;
  text-decoration: none;
  position: relative;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
}

.btn--primary:active {
  background: var(--color-primary-active);
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-text);
}

.btn--secondary:hover {
  background: var(--color-secondary-hover);
}

.btn--secondary:active {
  background: var(--color-secondary-active);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-secondary);
}

.btn--sm {
  padding: var(--space-4) var(--space-12);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-10) var(--space-20);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

.btn--full-width {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form elements */
.form-control {
  display: block;
  width: 100%;
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

textarea.form-control {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
}

select.form-control {
  padding: var(--space-8) var(--space-12);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--select-caret-light);
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  background-size: 16px;
  padding-right: var(--space-32);
}

/* Add a dark mode specific caret */
@media (prefers-color-scheme: dark) {
  select.form-control {
    background-image: var(--select-caret-dark);
  }
}

/* Also handle data-color-scheme */
[data-color-scheme="dark"] select.form-control {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] select.form-control {
  background-image: var(--select-caret-light);
}

.form-control:focus {
  border-color: var(--color-primary);
  outline: var(--focus-outline);
}

.form-label {
  display: block;
  margin-bottom: var(--space-8);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.form-group {
  margin-bottom: var(--space-16);
}

/* Card component */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-standard);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card__body {
  padding: var(--space-16);
}

.card__header,
.card__footer {
  padding: var(--space-16);
  border-bottom: 1px solid var(--color-card-border-inner);
}

/* Status indicators - simplified with CSS variables */
.status {
  display: inline-flex;
  align-items: center;
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.status--success {
  background-color: rgba(
    var(--color-success-rgb, 33, 128, 141),
    var(--status-bg-opacity)
  );
  color: var(--color-success);
  border: 1px solid
    rgba(var(--color-success-rgb, 33, 128, 141), var(--status-border-opacity));
}

.status--error {
  background-color: rgba(
    var(--color-error-rgb, 192, 21, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-error);
  border: 1px solid
    rgba(var(--color-error-rgb, 192, 21, 47), var(--status-border-opacity));
}

.status--warning {
  background-color: rgba(
    var(--color-warning-rgb, 168, 75, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-warning);
  border: 1px solid
    rgba(var(--color-warning-rgb, 168, 75, 47), var(--status-border-opacity));
}

.status--info {
  background-color: rgba(
    var(--color-info-rgb, 98, 108, 113),
    var(--status-bg-opacity)
  );
  color: var(--color-info);
  border: 1px solid
    rgba(var(--color-info-rgb, 98, 108, 113), var(--status-border-opacity));
}

/* Container layout */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--space-16);
  padding-left: var(--space-16);
}

@media (min-width: 640px) {
  .container {
    max-width: var(--container-sm);
  }
}
@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
}
@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
}
@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

/* Utility classes */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-4 {
  gap: var(--space-4);
}
.gap-8 {
  gap: var(--space-8);
}
.gap-16 {
  gap: var(--space-16);
}

.m-0 {
  margin: 0;
}
.mt-8 {
  margin-top: var(--space-8);
}
.mb-8 {
  margin-bottom: var(--space-8);
}
.mx-8 {
  margin-left: var(--space-8);
  margin-right: var(--space-8);
}
.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.p-0 {
  padding: 0;
}
.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}
.px-8 {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}
.py-16 {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
.px-16 {
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

.block {
  display: block;
}
.hidden {
  display: none;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Dark mode specifics */
[data-color-scheme="dark"] .btn--outline {
  border: 1px solid var(--color-border-secondary);
}

@font-face {
  font-family: 'FKGroteskNeue';
  src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2')
    format('woff2');
}

/* END PERPLEXITY DESIGN SYSTEM */
/* Medieval Battlefield Theme - Enhanced Compass Navigation - WAR TRANSFORMATION */

:root {
  /* Medieval War Color Palette */
  --steel-dark: #3E4651;
  --steel-light: #5D6B7A;
  --steel-medium: #4A5568;
  --crimson-banner: #8B2635;
  --crimson-deep: #6B1E2F;
  --crimson-blood: #A53860;
  --earth-dark: #4A3C28;
  --earth-light: #6B5B47;
  --earth-medium: #5A4A36;
  --ember-orange: #FF6B35;
  --ember-gold: #FFB347;
  --torch-gold: #DAA520;
  --ash-grey: #A8A8A8;
  --night-sky: #1F2937;
  --storm-blue: #374151;
  --smoke-white: #F3F4F6;
  
  /* Sky and War Colors */
  --sky-dark: #111827;
  --sky-storm: #374151;
  --battlefield-brown: #6B5B47;
  --siege-metal: #6B7280;
  --fire-red: #EF4444;
  --torch-flame: #F59E0B;
  
  /* Shadow and Glow Effects */
  --glow-ember: 0 0 20px rgba(255, 107, 53, 0.6);
  --glow-torch: 0 0 20px rgba(218, 165, 32, 0.5);
  --glow-crimson: 0 0 20px rgba(139, 38, 53, 0.5);
  --shadow-war: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-siege: 0 8px 24px rgba(0, 0, 0, 0.6);
  
  /* Animation Settings */
  --flicker-duration: 1.5s;
  --ember-duration: 8s;
  --drift-duration: 20s;
  --wave-duration: 3s;
  --war-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --siege-ease: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Override design system for medieval theme */
  --color-background: var(--night-sky);
  --color-surface: var(--steel-medium);
  --color-text: var(--smoke-white);
  --color-text-secondary: var(--ash-grey);
  --color-primary: var(--ember-orange);
  --color-primary-hover: var(--ember-gold);
}

/* Performance Optimizations */
* {
  box-sizing: border-box;
  transform-style: preserve-3d;
}

/* GPU Acceleration for smooth animations */
.village-background,
.nav-items-wrapper,
.nav-item,
.center-panel,
.compass-hub,
.magic-particles,
.village-header,
.ember,
.firefly,
.arrow-tracer {
  will-change: transform;
  transform: translateZ(0);
}

/* Base Styles */
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, var(--sky-dark) 0%, var(--sky-storm) 100%);
  color: var(--smoke-white);
  font-family: var(--font-family-base);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  cursor: default;
}
/* Body state when loading */
/* Lock scroll during loading */
html.loading,
body.loading {
  overflow: hidden !important;
  height: 100%;
  position: relative;
}

/* When loading is done → normal scroll */
html:not(.loading),
body:not(.loading) {
  overflow: auto;
}
/* Loading Screen - Medieval Theme */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden; /* prevent scroll inside loader */
  background: linear-gradient(180deg, var(--sky-dark) 0%, var(--sky-storm) 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}

.loading-screen.hidden {
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.loading-content {
  position: absolute;
  transform: translate(10%, -5%);
  text-align: center;
  max-width: 400px;
  padding: 2rem;
}


.loading-logo {
  font-size: 5rem;
  color: var(--torch-gold);
  text-shadow: var(--glow-torch);
  margin-bottom: 2rem;
  animation: fortress-build 2s ease-in-out infinite;
}

@keyframes fortress-build {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
}

.loading-text {
  font-size: 1.5rem;
  color: var(--smoke-white);
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: var(--font-weight-bold);
}

.loading-progress {
  width: 100%;
  height: 8px;
  background: rgba(255, 107, 53, 0.3);
  border-radius: 4px;
  margin-bottom: 1rem;
  overflow: hidden;
  border: 2px solid var(--torch-gold);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--torch-gold) 0%, var(--ember-orange) 100%);
  width: 0;
  transition: width 0.4s ease;
  box-shadow: var(--glow-ember);
}

.loading-details {
  font-size: 1rem;
  color: var(--ash-grey);
  opacity: 0.8;
}
/* Main App Holographic Effects */
.main-app {
  background: var(--cyber-background);
  position: relative;
  min-height: 100vh;
}
/* Hide main app initially */
.main-app.hidden {
  display: none;
}
/* Medieval Battlefield Background - Layered War Scene */
.village-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* Dark Stormy Sky */
.sky-night {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, 
    var(--sky-dark) 0%, 
    var(--night-sky) 30%, 
    var(--sky-storm) 60%, 
    var(--steel-dark) 85%, 
    var(--earth-dark) 100%
  );
  
  /* Animated storm clouds */
  background-image: 
    radial-gradient(ellipse 300px 80px at 20% 20%, rgba(75, 85, 99, 0.4) 0%, transparent 70%),
    radial-gradient(ellipse 400px 100px at 70% 15%, rgba(55, 65, 81, 0.3) 0%, transparent 70%),
    radial-gradient(ellipse 250px 60px at 90% 25%, rgba(75, 85, 99, 0.5) 0%, transparent 70%);
  animation: storm-clouds var(--drift-duration) linear infinite;
}

@keyframes storm-clouds {
  0% { transform: translateX(-50px); }
  100% { transform: translateX(50px); }
}

/* Distant Castle Silhouette */
.castle-layer {
  position: absolute;
  bottom: 30%;
  left: 0;
  width: 100%;
  height: 200px;
  background: 
    /* Castle towers and walls using CSS polygons simulation */
    radial-gradient(ellipse 60px 120px at 15% 100%, var(--steel-dark) 0%, transparent 60%),
    radial-gradient(ellipse 40px 100px at 25% 100%, var(--steel-medium) 0%, transparent 60%),
    radial-gradient(ellipse 80px 140px at 45% 100%, var(--steel-dark) 0%, transparent 60%),
    radial-gradient(ellipse 50px 110px at 60% 100%, var(--steel-medium) 0%, transparent 60%),
    radial-gradient(ellipse 70px 130px at 80% 100%, var(--steel-dark) 0%, transparent 60%);
  opacity: 0.6;
  animation: castle-sway 25s ease-in-out infinite;
}

@keyframes castle-sway {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-5px); }
}

/* Battlefield Foreground */
.battlefield-layer {
  position: absolute;
  bottom: 10%;
  left: 0;
  width: 100%;
  height: 120px;
  background: 
    /* Broken siege machines and scattered shields */
    radial-gradient(ellipse 40px 30px at 10% 100%, var(--siege-metal) 0%, transparent 70%),
    radial-gradient(ellipse 25px 20px at 20% 100%, var(--earth-medium) 0%, transparent 70%),
    radial-gradient(ellipse 60px 40px at 35% 100%, var(--steel-medium) 0%, transparent 70%),
    radial-gradient(ellipse 30px 50px at 50% 100%, var(--siege-metal) 0%, transparent 70%),
    radial-gradient(ellipse 45px 35px at 70% 100%, var(--earth-dark) 0%, transparent 70%),
    radial-gradient(ellipse 35px 25px at 85% 100%, var(--steel-dark) 0%, transparent 70%);
  opacity: 0.8;
}

/* Torch Fires */
.torch-fires {
  position: absolute;
  top: 35%;
  left: 0;
  width: 100%;
  height: 150px;
  background: 
    radial-gradient(ellipse 8px 15px at 15% 60%, var(--torch-flame) 0%, transparent 70%),
    radial-gradient(ellipse 6px 12px at 30% 65%, var(--ember-orange) 0%, transparent 70%),
    radial-gradient(ellipse 10px 18px at 65% 55%, var(--torch-gold) 0%, transparent 70%),
    radial-gradient(ellipse 7px 14px at 80% 70%, var(--fire-red) 0%, transparent 70%);
  animation: torch-flicker var(--flicker-duration) ease-in-out infinite alternate;
}

@keyframes torch-flicker {
  0% { 
    filter: brightness(1) saturate(1);
    transform: scale(1);
  }
  25% { 
    filter: brightness(1.2) saturate(1.1);
    transform: scale(1.05);
  }
  50% { 
    filter: brightness(0.9) saturate(0.9);
    transform: scale(0.95);
  }
  75% { 
    filter: brightness(1.1) saturate(1.2);
    transform: scale(1.02);
  }
  100% { 
    filter: brightness(1.3) saturate(1.3);
    transform: scale(1.08);
  }
}

/* Embers Layer */
.embers-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle 2px at 20% 80%, var(--ember-orange) 0%, transparent 50%),
    radial-gradient(circle 1px at 40% 70%, var(--torch-gold) 0%, transparent 50%),
    radial-gradient(circle 3px at 60% 85%, var(--ember-gold) 0%, transparent 50%),
    radial-gradient(circle 2px at 80% 75%, var(--fire-red) 0%, transparent 50%);
  animation: embers-rise var(--ember-duration) linear infinite;
}

@keyframes embers-rise {
  0% { 
    transform: translateY(100px); 
    opacity: 0; 
  }
  10% { 
    opacity: 0.8; 
  }
  90% { 
    opacity: 0.4; 
  }
  100% { 
    transform: translateY(-200px); 
    opacity: 0; 
  }
}

/* Medieval Particles System */
.magic-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.ember {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--ember-orange);
  border-radius: 50%;
  box-shadow: var(--glow-ember);
  animation: ember-float var(--ember-duration) ease-in-out infinite;
}

.ember-1 { top: 15%; left: 10%; animation-delay: 0s; }
.ember-2 { top: 25%; left: 80%; animation-delay: 2s; background: var(--torch-gold); box-shadow: var(--glow-torch); }
.ember-3 { top: 65%; left: 20%; animation-delay: 4s; background: var(--fire-red); box-shadow: 0 0 20px rgba(239, 68, 68, 0.6); }
.ember-4 { top: 45%; left: 90%; animation-delay: 6s; }
.ember-5 { top: 80%; left: 70%; animation-delay: 1s; background: var(--ember-gold); box-shadow: 0 0 20px rgba(255, 179, 71, 0.5); }
.ember-6 { top: 35%; left: 40%; animation-delay: 3s; background: var(--torch-flame); box-shadow: 0 0 20px rgba(245, 158, 11, 0.6); }

@keyframes ember-float {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.3;
  }
  25% {
    transform: translateY(-30px) scale(1.2);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-15px) scale(0.9);
    opacity: 0.6;
  }
  75% {
    transform: translateY(-45px) scale(1.1);
    opacity: 0.9;
  }
}

.firefly {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--ember-gold);
  border-radius: 50%;
  animation: firefly-pulse 3s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(255, 179, 71, 0.8);
}

.firefly-1 { top: 30%; left: 25%; animation-delay: 0s; }
.firefly-2 { top: 60%; left: 75%; animation-delay: 1.5s; }

@keyframes firefly-pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.5);
  }
}

.arrow-tracer {
  position: absolute;
  width: 2px;
  height: 20px;
  background: linear-gradient(180deg, var(--steel-light) 0%, transparent 100%);
  animation: arrow-flight 6s linear infinite;
  opacity: 0;
}

.arrow-1 { top: 40%; left: 5%; animation-delay: 0s; }
.arrow-2 { top: 25%; left: 85%; animation-delay: 3s; }

@keyframes arrow-flight {
  0% {
    transform: translateX(0) rotate(45deg);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.4;
  }
  100% {
    transform: translateX(300px) rotate(45deg);
    opacity: 0;
  }
}

/* Medieval War Header */
.village-header {
  text-align: center;
  padding: 3rem 0;
  position: relative;
  z-index: 10;
  margin-bottom: 150px;
}

.header-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(255, 107, 53, 0.3) 0%, transparent 70%);
  filter: blur(40px);
  animation: war-glow 4s ease-in-out infinite;
}

@keyframes war-glow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.7; }
}

.village-title {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: var(--font-weight-bold);
  margin: 0;
  position: relative;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.text-primary {
  color: var(--ember-orange);
  text-shadow: 
    3px 3px 0 var(--crimson-deep),
    0 0 20px rgba(255, 107, 53, 0.6),
    0 0 30px rgba(255, 107, 53, 0.4);
  position: relative;
}

.text-primary::before {
  content: attr(data-text);
  position: absolute;
  top: 2px;
  left: 2px;
  width: 100%;
  height: 100%;
  color: var(--steel-dark);
  text-shadow: none;
  z-index: -1;
}

.text-accent {
  color: var(--torch-gold);
  text-shadow: 
    3px 3px 0 var(--earth-dark),
    0 0 20px rgba(218, 165, 32, 0.7),
    0 0 30px rgba(218, 165, 32, 0.5);
  animation: war-shimmer 3s ease-in-out infinite;
}

@keyframes war-shimmer {
  0%, 100% {
    text-shadow: 
      3px 3px 0 var(--earth-dark),
      0 0 20px rgba(218, 165, 32, 0.7),
      0 0 30px rgba(218, 165, 32, 0.5);
  }
  50% {
    text-shadow: 
      3px 3px 0 var(--earth-dark),
      0 0 30px rgba(218, 165, 32, 0.9),
      0 0 40px rgba(218, 165, 32, 0.7),
      0 0 50px rgba(255, 107, 53, 0.4);
  }
}

/* War Banners */
.war-banners {
  position: absolute;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
  pointer-events: none;
}

.war-banner {
  position: absolute;
  width: 80px;
  height: 120px;
  background: linear-gradient(180deg, var(--crimson-banner) 0%, var(--crimson-deep) 70%, var(--earth-dark) 100%);
  border-radius: 12px 12px 0 0;
  border: 3px solid var(--torch-gold);
  animation: banner-wave var(--wave-duration) ease-in-out infinite;
  box-shadow: var(--shadow-war);
}

.war-banner::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 40px solid transparent;
  border-right: 40px solid transparent;
  border-top: 30px solid var(--earth-dark);
}

.war-banner::before {
  content: '⚔️';
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 24px;
  color: var(--torch-gold);
  text-shadow: 0 0 8px rgba(218, 165, 32, 0.8);
}

.war-banner-left {
  left: 8%;
  animation-delay: 0s;
}

.war-banner-right {
  right: 8%;
  animation-delay: 1s;
}

@keyframes banner-wave {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50% { transform: rotate(3deg) scale(1.02); }
}

.battle-runes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle 6px at 20% 30%, var(--ember-orange) 0%, transparent 50%),
    radial-gradient(circle 4px at 80% 25%, var(--torch-gold) 0%, transparent 50%),
    radial-gradient(circle 5px at 15% 70%, var(--fire-red) 0%, transparent 50%),
    radial-gradient(circle 7px at 85% 75%, var(--crimson-banner) 0%, transparent 50%);
  opacity: 0.5;
  animation: runes-flicker 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes runes-flicker {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* FIXED: Welcome Panel - Medieval Theme */
.welcome-panel {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 2rem;
  position: relative;
  z-index: 15;
  opacity: 1;
  transform: scale(1);
  transition: all 0.8s var(--siege-ease);
}

.welcome-panel.hidden {
  opacity: 0;
  transform: scale(0.8) translateY(-50px);
  pointer-events: none;
  visibility: hidden;
}

.panel-frame {
  position: relative;
  background: linear-gradient(145deg, var(--steel-medium) 0%, var(--steel-dark) 100%);
  border: 4px solid var(--torch-gold);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  box-shadow: 
    var(--shadow-siege),
    inset 0 0 30px rgba(255, 107, 53, 0.1);
  backdrop-filter: blur(10px);
}

.decorative-corners {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--ember-orange);
  border-radius: 50%;
  box-shadow: var(--glow-ember);
}

.corner-tl { top: -12px; left: -12px; }
.corner-tr { top: -12px; right: -12px; }
.corner-bl { bottom: -12px; left: -12px; }
.corner-br { bottom: -12px; right: -12px; }

.panel-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.welcome-icon {
  font-size: 4rem;
  color: var(--ember-orange);
  text-shadow: var(--glow-ember);
  animation: fortress-bounce 2s ease-in-out infinite;
}

@keyframes fortress-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

.welcome-text {
  text-align: center;
}

.welcome-title {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--smoke-white);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.magical-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 107, 53, 0.3) 50%,
    transparent 100%
  );
  animation: war-shimmer-pass 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes war-shimmer-pass {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Medieval War Button */
.fantasy-btn {
  background: linear-gradient(145deg, var(--torch-gold) 0%, var(--ember-gold) 100%);
  border: 3px solid var(--ember-orange);
  color: var(--steel-dark);
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: all 0.6s var(--siege-ease);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 140px;
  justify-content: center;
  box-shadow: 
    var(--shadow-war),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.fantasy-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    var(--shadow-siege),
    var(--glow-ember),
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25);
  background: linear-gradient(145deg, var(--ember-gold) 0%, var(--torch-flame) 100%);
}

.fantasy-btn:active {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 
    var(--shadow-war),
    inset 0 2px 0 rgba(0, 0, 0, 0.1),
    inset 0 -2px 0 rgba(255, 255, 255, 0.2);
}

.btn-sparkle {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
  transition: left 0.6s ease;
}

.fantasy-btn:hover .btn-sparkle {
  left: 100%;
}

.btn-text {
  position: relative;
  z-index: 2;
}

/* CRITICAL FIX: ENHANCED COMPASS NAVIGATION SYSTEM - MAXIMUM VISIBILITY */
.nav-compass-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 4rem 0;
  position: relative;
  z-index: 2000;
}

/* FIXED: Central Compass Hub with maximum visibility */
.compass-hub {
  width: 120px;
  height: 120px;
  cursor: pointer;
  position: relative;
  z-index: 2100;
  transition: transform 0.6s var(--siege-ease);
}

.compass-hub:hover {
  transform: scale(1.1) rotate(5deg);
}

.compass-hub.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.compass-core {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--torch-gold) 0%, var(--ember-gold) 100%);
  border: 4px solid var(--ember-orange);
  box-shadow: 
    var(--shadow-siege),
    var(--glow-ember),
    inset 0 0 20px rgba(255, 107, 53, 0.3);
}

.compass-ring {
  position: absolute;
  border: 2px solid;
  border-radius: 50%;
  animation: compass-spin 15s linear infinite;
}

.compass-ring-outer {
  top: 5px; left: 5px; right: 5px; bottom: 5px;
  border-color: var(--ember-orange);
  animation-duration: 20s;
}

.compass-ring-middle {
  top: 15px; left: 15px; right: 15px; bottom: 15px;
  border-color: var(--crimson-banner);
  animation-duration: 25s;
  animation-direction: reverse;
}

.compass-ring-inner {
  top: 25px; left: 25px; right: 25px; bottom: 25px;
  border-color: var(--fire-red);
  animation-duration: 30s;
}

@keyframes compass-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.compass-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: var(--steel-dark);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: compass-pulse 2s ease-in-out infinite;
}

@keyframes compass-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

.compass-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: 3px solid var(--torch-gold);
  border-radius: 50%;
  animation: compass-glow-pulse 2s ease-out infinite;
}

@keyframes compass-glow-pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

/* CRITICAL FIX: Navigation Items Wrapper - FORCE VISIBILITY */
.nav-items-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  visibility: hidden;
  z-index: 2050;
  transition: transform 0s, opacity 0s, visibility 0s;
}

.nav-items-wrapper.nav-active {
  transform: translate(-50%, -50%) scale(1) !important;
  opacity: 1 !important;
  visibility: visible !important;
  transition: all 0.6s var(--siege-ease) !important;
}

.nav-items-wrapper.nav-hidden {
  transform: translate(-50%, -50%) scale(0) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: transform 0s, opacity 0s, visibility 0s !important;
}

/* FIXED: Village Navigation - FORCED VISIBILITY */
.village-navigation {
  width: 400px;
  height: 400px;
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle, 
    rgba(62, 70, 81, 0.95) 0%, 
    rgba(55, 65, 81, 0.9) 70%, 
    rgba(31, 41, 55, 0.8) 100%
  ) !important;
  border: 4px solid var(--torch-gold) !important;
  box-shadow: 
    var(--shadow-siege),
    var(--glow-ember),
    inset 0 0 50px rgba(255, 107, 53, 0.2) !important;
}

.nav-ring {
  position: absolute;
  border: 2px solid;
  border-radius: 50%;
  animation: nav-ring-rotate 25s linear infinite;
}

.nav-ring-outer {
  top: 10px; left: 10px; right: 10px; bottom: 10px;
  border-color: rgba(255, 107, 53, 0.6);
  animation-duration: 35s;
}

.nav-ring-middle {
  top: 30px; left: 30px; right: 30px; bottom: 30px;
  border-color: rgba(139, 38, 53, 0.6);
  animation-duration: 30s;
  animation-direction: reverse;
}

.nav-ring-inner {
  top: 50px; left: 50px; right: 50px; bottom: 50px;
  border-color: rgba(218, 165, 32, 0.6);
  animation-duration: 25s;
}

@keyframes nav-ring-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* CRITICAL FIX: Navigation Items - MAXIMUM VISIBILITY */
.nav-item {
  position: absolute;
  width: 70px;
  height: 70px;
  cursor: pointer;
  z-index: 2070;
  border-radius: 50%;
  min-width: 44px;
  min-height: 44px;
  transform-origin: center;
  transition: all 0.3s ease;
  display: block !important;
  visibility: visible !important;
}

/* FIXED: Position nav items with absolute positioning */
.nav-item[data-position="0"] { 
  top: -35px; 
  left: calc(50% - 35px);
}
.nav-item[data-position="1"] { 
  top: calc(15% - 35px); 
  right: -35px; 
}
.nav-item[data-position="2"] { 
  bottom: calc(15% - 35px); 
  right: -35px; 
}
.nav-item[data-position="3"] { 
  bottom: -35px; 
  left: calc(50% - 35px);
}
.nav-item[data-position="4"] { 
  bottom: calc(15% - 35px); 
  left: -35px; 
}
.nav-item[data-position="5"] { 
  top: calc(15% - 35px); 
  left: -35px; 
}

/* FIXED: Force nav items to be visible when nav is active */
.nav-items-wrapper.nav-active .nav-item {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  transform: scale(1) !important;
  animation: nav-item-appear 0.6s var(--war-bounce) forwards;
}

@keyframes nav-item-appear {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.2) rotate(-30deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* FIXED: Instant retraction */
.nav-items-wrapper.nav-hidden .nav-item {
  animation: none !important;
  transform: scale(0) !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.nav-item:hover {
  z-index: 2080;
  filter: brightness(1.15);
  box-shadow: 0 0 25px rgba(255, 107, 53, 0.6);
}

/* FIXED: Navigation item backgrounds - ENHANCED VISIBILITY */
.nav-item-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 
    var(--shadow-siege),
    inset 0 2px 5px rgba(255, 255, 255, 0.2),
    inset 0 -2px 5px rgba(0, 0, 0, 0.3);
}

.scroll-bg {
  background: linear-gradient(145deg, var(--steel-medium) 0%, var(--steel-dark) 100%) !important;
  border: 4px solid var(--ember-orange) !important;
}

.book-bg {
  background: linear-gradient(145deg, var(--torch-gold) 0%, var(--ember-gold) 100%) !important;
  border: 4px solid var(--ember-orange) !important;
}

.banner-bg {
  background: linear-gradient(145deg, var(--crimson-banner) 0%, var(--crimson-deep) 100%) !important;
  border: 4px solid var(--torch-gold) !important;
}

.chest-bg {
  background: linear-gradient(145deg, var(--earth-medium) 0%, var(--earth-dark) 100%) !important;
  border: 4px solid var(--ember-orange) !important;
}

.bird-bg {
  background: linear-gradient(145deg, var(--siege-metal) 0%, var(--steel-dark) 100%) !important;
  border: 4px solid var(--torch-gold) !important;
}

.gate-bg {
  background: linear-gradient(145deg, var(--steel-dark) 0%, var(--night-sky) 100%) !important;
  border: 4px solid var(--crimson-banner) !important;
}

.nav-item:hover .nav-item-bg {
  filter: brightness(1.15);
  box-shadow: 
    var(--shadow-siege),
    0 0 25px rgba(255, 107, 53, 0.7);
}

.nav-item:active .nav-item-bg {
  filter: brightness(0.95);
}

.nav-item-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  color: var(--smoke-white) !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
  z-index: 10;
  pointer-events: none;
  transition: all 0.3s ease;
}

.nav-item:hover .nav-item-icon {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 107, 53, 0.9) !important;
}

.nav-item-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.7) 0%, transparent 70%);
  border-radius: 50%;
  transition: all 0.3s ease;
  pointer-events: none;
}

.nav-item:hover .nav-item-glow {
  width: 90px;
  height: 90px;
}

/* Tooltips - ENHANCED VISIBILITY */
.nav-tooltip {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2200;
  white-space: nowrap;
}

.nav-item[data-position="0"] .nav-tooltip { 
  bottom: 100%; 
  left: 50%; 
  transform: translateX(-50%); 
  margin-bottom: 15px;
}
.nav-item[data-position="1"] .nav-tooltip { 
  right: 100%; 
  top: 50%; 
  transform: translateY(-50%); 
  margin-right: 15px;
}
.nav-item[data-position="2"] .nav-tooltip { 
  right: 100%; 
  top: 50%; 
  transform: translateY(-50%); 
  margin-right: 15px;
}
.nav-item[data-position="3"] .nav-tooltip { 
  top: 100%; 
  left: 50%; 
  transform: translateX(-50%); 
  margin-top: 15px;
}
.nav-item[data-position="4"] .nav-tooltip { 
  left: 100%; 
  top: 50%; 
  transform: translateY(-50%); 
  margin-left: 15px;
}
.nav-item[data-position="5"] .nav-tooltip { 
  left: 100%; 
  top: 50%; 
  transform: translateY(-50%); 
  margin-left: 15px;
}

.nav-item:hover .nav-tooltip {
  opacity: 1;
}

.tooltip-text {
  padding: 0.75rem 1.25rem;
  background: linear-gradient(145deg, var(--steel-medium) 0%, var(--steel-dark) 100%);
  border: 3px solid var(--torch-gold);
  border-radius: var(--radius-base);
  color: var(--smoke-white);
  font-size: 0.9rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 
    var(--shadow-siege),
    var(--glow-torch);
  backdrop-filter: blur(10px);
}

.tooltip-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

.nav-item[data-position="0"] .tooltip-arrow {
  top: 100%; left: 50%; transform: translateX(-50%);
  border-top-color: var(--torch-gold);
}

.nav-item[data-position="1"] .tooltip-arrow,
.nav-item[data-position="2"] .tooltip-arrow {
  left: 100%; top: 50%; transform: translateY(-50%);
  border-left-color: var(--torch-gold);
}

.nav-item[data-position="3"] .tooltip-arrow {
  bottom: 100%; left: 50%; transform: translateX(-50%);
  border-bottom-color: var(--torch-gold);
}

.nav-item[data-position="4"] .tooltip-arrow,
.nav-item[data-position="5"] .tooltip-arrow {
  right: 100%; top: 50%; transform: translateY(-50%);
  border-right-color: var(--torch-gold);
}

/* CRITICAL FIX: Central Dropdown Panel - MAXIMUM Z-INDEX */
.center-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  visibility: hidden;
  z-index: 3000;
  pointer-events: none;
  transition: none;
}

.center-panel.panel-visible {
  transform: translate(-50%, -50%) scale(1) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  animation: panel-bounce-in 0.4s var(--war-bounce) forwards;
}

@keyframes panel-bounce-in {
  0% {
    transform: translate(-50%, -50%) scale(0) rotateY(90deg);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1) rotateY(45deg);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotateY(0deg);
    opacity: 1;
  }
}

@keyframes panel-hide {
  0% {
    transform: translate(-50%, -50%) scale(1) rotateY(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0) rotateY(-90deg);
    opacity: 0;
  }
}

.center-panel.panel-hiding {
  animation: panel-hide 0.4s ease-in forwards;
}

/* Dropdown Menu Styles - Medieval Theme */
.dropdown-menu {
  background: linear-gradient(145deg, rgba(62, 70, 81, 0.98) 0%, rgba(31, 41, 55, 0.99) 100%);
  border: 4px solid var(--ember-orange);
  border-radius: 15px;
  min-width: 320px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.8),
    0 0 50px rgba(255, 107, 53, 0.6),
    inset 0 2px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  overflow: hidden;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 3px solid var(--ember-orange);
  background: linear-gradient(145deg, rgba(255, 107, 53, 0.3) 0%, rgba(255, 107, 53, 0.15) 100%);
  color: var(--smoke-white);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 16px;
}

.dropdown-close {
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  transition: all 0.3s var(--siege-ease);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--fire-red);
  color: var(--smoke-white);
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dropdown-close:hover {
  transform: scale(1.2) rotate(90deg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.dropdown-list {
  list-style: none;
  margin: 0;
  padding: 12px 0;
}

.dropdown-list li {
  border-bottom: 1px solid rgba(255, 107, 53, 0.2);
}

.dropdown-list li:last-child {
  border-bottom: none;
}

.dropdown-list a {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 20px;
  color: var(--smoke-white);
  text-decoration: none;
  transition: all 0.3s var(--siege-ease);
  position: relative;
  font-weight: 500;
  font-size: 15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.dropdown-list a:hover {
  background: linear-gradient(90deg, rgba(255, 107, 53, 0.4) 0%, transparent 100%);
  color: var(--ember-gold);
  padding-left: 30px;
  transform: translateX(8px);
  text-shadow: 0 0 12px rgba(255, 107, 53, 0.8);
}

.dropdown-list a i {
  color: var(--ember-orange);
  font-size: 18px;
  text-shadow: 0 0 8px rgba(255, 107, 53, 0.5);
  min-width: 24px;
}

/* Medieval Footer - COMPACT SIZE */
.village-footer {
  margin-top: 4rem;
  position: relative;
  z-index: 10;
  margin-top: 150px;
}

.footer-landscape {
  position: relative;
  height: 80px;
  background: linear-gradient(180deg, 
    transparent 0%, 
    var(--earth-medium) 50%, 
    var(--earth-dark) 100%
  );
}

.footer-hills {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: 
    radial-gradient(ellipse 400px 60px at 20% 100%, var(--battlefield-brown) 0%, transparent 70%),
    radial-gradient(ellipse 500px 70px at 70% 100%, var(--earth-dark) 0%, transparent 70%);
}

.footer-trees {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: 
    radial-gradient(ellipse 30px 50px at 15% 100%, var(--steel-dark) 0%, transparent 60%),
    radial-gradient(ellipse 25px 40px at 45% 100%, var(--siege-metal) 0%, transparent 60%),
    radial-gradient(ellipse 35px 55px at 75% 100%, var(--steel-medium) 0%, transparent 60%);
}

.footer-content {
  background: linear-gradient(180deg, 
    rgba(62, 70, 81, 0.9) 0%, 
    rgba(55, 65, 81, 0.95) 100%
  );
  border-top: 4px solid var(--torch-gold);
  backdrop-filter: blur(10px);
}

.footer-grid {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.footer-section h4 {
  color: var(--smoke-white);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.footer-section h4 i {
  color: var(--torch-gold);
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section li {
  margin-bottom: 0.6rem;
}

.footer-section a {
  color: var(--ash-grey);
  text-decoration: none;
  transition: all 0.6s ease;
  position: relative;
  padding-left: 1.5rem;
  font-weight: var(--font-weight-medium);
}

.footer-section a:hover {
  color: var(--ember-gold);
  padding-left: 2rem;
  transform: translateX(5px);
}

.footer-section a::before {
  content: '⚔️';
  position: absolute;
  left: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  font-size: 0.8rem;
}

.footer-section a:hover::before {
  opacity: 1;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
  border-top: 2px solid rgba(255, 107, 53, 0.3);
}

.footer-info p {
  margin: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--ash-grey);
}

.disclaimer {
  font-size: 0.75rem !important;
  opacity: 0.7;
}

.version-info {
  color: var(--ember-gold) !important;
  font-weight: var(--font-weight-medium);
}

.footer-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-end;
}

.social-village {
  display: flex;
  gap: 0.8rem;
}

.social-village a {
  color: var(--steel-dark);
  text-decoration: none;
  transition: all 0.6s ease;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-base);
  background: linear-gradient(145deg, var(--ember-gold) 0%, var(--torch-gold) 100%);
  border: 2px solid var(--ember-orange);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  box-shadow: var(--shadow-war);
    display: inline-block;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.social-village a:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-siege);
  background: linear-gradient(145deg, var(--torch-gold) 0%, var(--ember-gold) 100%);
}

.newsletter-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-end;
}

.newsletter-scroll form {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.scroll-input {
  background: linear-gradient(145deg, var(--steel-medium) 0%, var(--steel-dark) 100%);
  border: 3px solid var(--torch-gold);
  border-radius: var(--radius-base);
  padding: 0.8rem;
  color: var(--smoke-white);
  font-size: 0.85rem;
  min-width: 220px;
  transition: all 0.6s ease;
  box-shadow: inset var(--shadow-war);
}

.scroll-input:focus {
  outline: none;
  border-color: var(--ember-orange);
  box-shadow: var(--glow-ember), inset var(--shadow-war);
  transform: translateY(-2px);
}

.scroll-input::placeholder {
  color: var(--ash-grey);
}

.scroll-btn {
  padding: 0.8rem 1.2rem;
  font-size: 0.85rem;
  min-width: 120px;
}

.scroll-message {
  padding: 0.8rem 1.2rem;
  background: linear-gradient(145deg, var(--steel-medium) 0%, var(--steel-dark) 100%);
  border: 3px solid var(--ember-orange);
  border-radius: var(--radius-base);
  font-size: 0.85rem;
  color: var(--ember-gold);
  opacity: 0;
  transform: translateY(-10px) scale(0.9);
  transition: all 0.6s var(--siege-ease);
  text-align: center;
  box-shadow: var(--shadow-war);
  max-width: 320px;
}

.scroll-message.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.scroll-message.error {
  border-color: var(--fire-red);
  color: var(--fire-red);
}

/* Responsive Design */
@media (max-width: 768px) {
  .loading-content{
    transform: translate(1%,-10%);
  }
  .village-title {
    font-size: 2.5rem;
  }
  
  .village-navigation {
    width: 320px;
    height: 320px;
  }
  
  .nav-item {
    width: 60px;
    height: 60px;
    min-width: 44px;
    min-height: 44px;
  }
  
  .nav-item-icon {
    font-size: 1.5rem;
  }
  
  .compass-hub {
    width: 100px;
    height: 100px;
  }
  
  .compass-center {
    font-size: 2rem;
  }
  
  .welcome-panel {
    margin: 1rem;
    padding: 0 1rem;
  }
  
  .panel-frame {
    padding: 2rem 1.5rem;
  }
  
  .panel-content {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .welcome-icon {
    font-size: 3rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  
  .footer-actions {
    align-items: center;
    width: 100%;
  }
  
  .newsletter-scroll form {
    flex-direction: column;
    width: 100%;
  }
  
  .scroll-input {
    min-width: auto;
    width: 100%;
  }
  
  .dropdown-menu {
    min-width: 280px;
  }
  
  /* Reduce animations on mobile for performance */
  .ember:nth-child(odd) {
    display: none;
  }
  
  .war-banner {
    width: 50px;
    height: 80px;
  }
}

@media (max-width: 480px) {
  .village-navigation {
    width: 280px;
    height: 280px;
  }
  
  .nav-item {
    width: 50px;
    height: 50px;
  }
  
  .nav-item-icon {
    font-size: 1.2rem;
  }
  
  .compass-hub {
    width: 80px;
    height: 80px;
  }
  
  .compass-center {
    font-size: 1.5rem;
  }
  
  .welcome-title {
    font-size: 1.2rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .social-village {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .dropdown-menu {
    min-width: 260px;
  }
}

/* Performance Enhancements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.1s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.1s !important;
  }
  
  .ember,
  .firefly,
  .arrow-tracer,
  .embers-layer {
    display: none;
  }
  
  .nav-items-wrapper.nav-active .nav-item {
    animation: none;
    transform: scale(1);
    opacity: 1;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --ember-orange: #FF4500;
    --torch-gold: #FFD700;
    --crimson-banner: #DC143C;
  }
  
  .nav-item-bg,
  .panel-frame,
  .dropdown-menu {
    border-width: 4px;
  }
  
  .dropdown-menu {
    background: rgba(0, 0, 0, 0.95);
    border: 4px solid var(--ember-orange);
  }
  
  .dropdown-list a {
    color: var(--smoke-white);
  }
}

/* Utility classes */
.fade-in {
  animation: war-fade-in 1s ease-out forwards;
}

@keyframes war-fade-in {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bounce-effect {
  animation: war-bounce 0.6s var(--siege-ease);
}

@keyframes war-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.1) rotate(3deg); }
  100% { transform: scale(1); }
}

.ember-effect {
  box-shadow: var(--glow-ember), 0 0 30px rgba(255, 107, 53, 0.8) !important;
  border-color: var(--ember-orange) !important;
}


/* CRITICAL FIX: Debug mode - show nav items outline for testing */
.debug-mode .nav-item {
  outline: 3px solid red !important;
}

.debug-mode .nav-items-wrapper {
  outline: 5px solid blue !important;
}

.debug-mode .village-navigation {
  outline: 4px solid green !important;
}
html, body {
  overflow-x: hidden;
}
body {
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* Internet Explorer/Edge */
  user-select: none;         /* Standard syntax */
}