/* Design System - CSS Custom Properties */
:root {
  /* Typography Scale (1.25 ratio - Major Third) */
  --font-size-xs: 0.75rem; /* 12px - WCAG compliant minimum */
  --font-size-sm: 0.8rem; /* 12.8px */
  --font-size-base: 1rem; /* 16px */
  --font-size-md: 1.25rem; /* 20px */
  --font-size-lg: 1.563rem; /* 25px */
  --font-size-xl: 1.953rem; /* 31.25px */
  --font-size-2xl: 2.441rem; /* 39.06px */
  --font-size-3xl: 3.052rem; /* 48.83px */

  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-base: 1.5;
  --line-height-loose: 1.75;

  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing Scale (8pt grid system) */
  --space-0: 0;
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem; /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem; /* 24px */
  --space-8: 2rem; /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem; /* 48px */
  --space-16: 4rem; /* 64px */
  --space-20: 5rem; /* 80px */

  /* Accessible Color Palette */
  --color-primary-50: #fef7f0;
  --color-primary-100: #fde8d7;
  --color-primary-200: #fbd4ae;
  --color-primary-300: #f8b87a;
  --color-primary-400: #f59344;
  --color-primary-500: #f3762f; /* Main primary */
  --color-primary-600: #e4581c;
  --color-primary-700: #bd4318;
  --color-primary-800: #96391a;
  --color-primary-900: #7a3118;

  --color-neutral-50: #f8fafc;
  --color-neutral-100: #f1f5f9;
  --color-neutral-200: #e2e8f0;
  --color-neutral-300: #cbd5e1;
  --color-neutral-400: #94a3b8;
  --color-neutral-500: #64748b;
  --color-neutral-600: #475569;
  --color-neutral-700: #334155; /* Main text */
  --color-neutral-800: #1e293b;
  --color-neutral-900: #0f172a;

  --color-success-500: #22c55e;
  --color-success-700: #15803d;
  --color-danger-500: #ef4444;
  --color-danger-700: #b91c1c;
  --color-warning-500: #f59e0b;
  --color-warning-700: #a16207;
  --color-warning-100: #fff3cd; /* Light warning background */
  --color-warning-800: #856404; /* Dark warning text */
  --color-info-500: #3b82f6;
  --color-info-700: #1d4ed8;

  /* Semantic Colors */
  --color-text-primary: var(--color-neutral-900);
  --color-text-secondary: var(--color-neutral-700);
  --color-text-muted: var(--color-neutral-500);
  --color-text-inverse: var(--color-neutral-50);

  --color-bg-primary: var(--color-neutral-50);
  --color-bg-secondary: var(--color-neutral-100);
  --color-bg-muted: var(--color-neutral-200);

  /* Border Radius */
  --radius-sm: 0.25rem; /* 4px */
  --radius-base: 0.5rem; /* 8px */
  --radius-md: 0.75rem; /* 12px */
  --radius-lg: 1rem; /* 16px */
  --radius-xl: 1.5rem; /* 24px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  font-weight: var(--font-weight-normal);
  background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-neutral-800) 100%);
  color: var(--color-text-primary);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-5); /* 20px */
}

/* Navigation */
.navbar {
  background: rgba(248, 250, 252, 0.95); /* --color-neutral-50 with opacity */
  padding: var(--space-5); /* 20px */
  border-radius: var(--radius-lg); /* 15px → 16px */
  margin-bottom: var(--space-8); /* 30px → 32px */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.logo {
  text-align: center;
  color: var(--color-primary-600);
  margin-bottom: var(--space-4);
  font-size: var(--font-size-2xl);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-weight: var(--font-weight-bold);
}

.nav-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-4); /* 15px → 16px */
  list-style: none;
}

.nav-link {
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary-600);
  color: var(--color-text-inverse);
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: var(--transition-base);
  font-weight: var(--font-weight-bold);
  border: 2px solid transparent;
  /* Touch-friendly improvements */
  -webkit-tap-highlight-color: rgba(255, 107, 53, 0.3);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.nav-link:hover,
.nav-link.active {
  background: var(--color-primary-700);
  border-color: var(--color-neutral-700);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.nav-link:focus {
  outline: 3px solid var(--color-primary-600);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(243, 118, 47, 0.2);
}

/* Sections */
.section {
  display: none;
  background: var(--color-bg-primary);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-xl);
  animation: fadeIn 0.5s ease;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section h2 {
  color: var(--color-primary-600);
  margin-bottom: var(--space-6);
  font-size: var(--font-size-2xl);
  text-align: center;
  font-weight: var(--font-weight-bold);
}

.section h3 {
  color: var(--color-neutral-700);
  margin-bottom: var(--space-4);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

/* Home Section */
.hero {
  text-align: center;
}

.bio-container,
.interests-container {
  margin: var(--space-8) 0; /* 30px → 32px */
  padding: var(--space-5); /* 20px */
  background: var(--color-neutral-100);
  border-radius: var(--radius-lg); /* 15px → 16px */
  border: 2px solid var(--color-primary-600);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.bio-display {
  font-size: 1.1em;
  line-height: 1.8;
  color: #333; /* Changed from #555 for WCAG AA contrast (7.5:1) */
}

.interests-display {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4); /* 15px → 16px */
  justify-content: center;
  margin-top: var(--space-4); /* 15px → 16px */
}

.interest-tag {
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-700) 100%);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-bold);
  box-shadow: var(--shadow-md);
  border: 2px solid var(--color-neutral-700);
}

/* Gallery Section */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-5); /* 20px */
  margin-top: var(--space-5); /* 20px */
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md); /* 10px → 12px */
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.05);
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(51, 65, 85, 0.9); /* --color-neutral-700 with opacity */
  color: var(--color-text-inverse);
  padding: var(--space-3); /* 10px → 12px */
  text-align: center;
  font-weight: bold;
}

.gallery-item .delete-btn {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--color-danger-700);
  color: var(--color-text-inverse);
  border: 2px solid var(--color-neutral-700);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-base);
  cursor: pointer;
  font-weight: var(--font-weight-bold);
}

.gallery-item .delete-btn:hover {
  background: var(--color-danger-500);
  transform: scale(1.1);
}

/* Stories Section */
.stories-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5); /* 20px */
}

.story-item {
  padding: var(--space-5); /* 20px */
  background: var(--color-neutral-100);
  border-radius: var(--radius-md); /* 10px → 12px */
  border-left: 5px solid var(--color-primary-600);
  position: relative;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.story-item h3 {
  color: var(--color-primary-600);
  margin-bottom: var(--space-3); /* 10px → 12px */
  font-weight: bold;
}

.story-item p {
  line-height: 1.6;
  color: #333; /* Changed from #555 for WCAG AA contrast (7.5:1) */
}

.story-item .delete-btn {
  position: absolute;
  top: var(--space-5); /* 20px */
  right: var(--space-5); /* 20px */
  background: var(--color-danger-700);
  color: var(--color-text-inverse);
  border: 2px solid var(--color-neutral-700);
  padding: var(--space-1) var(--space-4); /* 5px → 4px, 15px → 16px */
  border-radius: var(--radius-base); /* 8px */
  cursor: pointer;
  font-weight: bold;
}

.story-item .delete-btn:hover {
  background: #c0392b;
  transform: scale(1.05);
}

/* Game Section */
.game-container {
  background: linear-gradient(135deg, var(--color-neutral-700) 0%, var(--color-neutral-800) 100%);
  padding: var(--space-8); /* 30px → 32px */
  border-radius: var(--radius-lg); /* 15px → 16px */
  border: 3px solid var(--color-primary-600);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.game-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-5); /* 20px */
  margin-bottom: var(--space-6); /* 25px → 24px */
}

.stat-group {
  display: grid;
  gap: var(--space-3); /* 12px */
  padding: var(--space-4); /* 15px → 16px */
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-md); /* 12px */
  border: 2px solid var(--color-primary-600);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.primary-stats {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-700) 100%);
  color: var(--color-text-inverse);
}

.secondary-stats {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-item {
  display: flex;
  align-items: center;
  padding: var(--space-3); /* 12px */
  border-radius: var(--radius-base); /* 8px */
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.stat-item.hero-identity {
  grid-column: span 2;
  background: rgba(255, 255, 255, 0.2);
}

.stat-item.compact {
  padding: var(--space-2) var(--space-3); /* 8px 12px */
  background: var(--color-neutral-100);
  border: 1px solid var(--color-neutral-300);
}

.stat-item.compact .stat-icon {
  font-size: 1.2em;
  margin-right: 8px;
}

.stat-icon {
  font-size: 1.5em;
  margin-right: var(--space-3); /* 12px */
  min-width: 30px;
  text-align: center;
}

.stat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-label {
  font-weight: bold;
  font-size: 0.9em;
  opacity: 1.0; /* Changed from 0.9 for better contrast on colored backgrounds */
  margin-bottom: 4px;
}

.stat-value {
  font-weight: bold;
  font-size: 1.1em;
}

.stat-sublabel {
  display: flex;
  align-items: center;
  gap: var(--space-3); /* 10px → 12px */
  margin-top: 4px;
  font-size: 0.85em;
}

.level-badge {
  background: rgba(255, 255, 255, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-md); /* 12px */
  font-weight: bold;
}

.hero-class {
  font-weight: bold;
}

/* Progress Bars */
.stat-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.stat-bar {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  transition: width 0.5s ease;
  border-radius: 4px;
}

.health-bar .stat-bar-fill {
  background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
}

.xp-bar .stat-bar-fill {
  background: linear-gradient(90deg, #f1c40f 0%, #f39c12 100%);
}

.mana-bar .stat-bar-fill {
  background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
}

.stat-values {
  font-size: 0.8em;
  font-weight: bold;
  min-width: 60px;
  text-align: right;
}

.game-display {
  background: var(--color-neutral-100);
  padding: var(--space-8); /* 30px → 32px */
  border-radius: var(--radius-md); /* 10px → 12px */
  margin-bottom: var(--space-6); /* 25px → 24px */
  min-height: 200px;
  text-align: center;
  border: 2px solid var(--color-primary-600);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.game-message {
  font-size: 1.2em;
  line-height: 1.6;
  color: var(--color-neutral-800);
  margin-bottom: var(--space-5); /* 20px */
  font-weight: 500;
}

.game-image {
  font-size: 5em;
  margin: var(--space-5) 0; /* 20px */
}

.game-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-5); /* 20px */
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4); /* 15px → 16px */
  justify-content: center;
}

.primary-actions {
  order: 1;
}

.management-actions {
  order: 2;
}

.character-actions {
  order: 3;
  justify-content: space-between;
  margin-top: var(--space-3); /* 10px → 12px */
}

/* Game Button System - Base styles for adventure game UI
 * Variants: .primary (main actions), .secondary (info/utility),
 *           .tertiary (special), .danger (destructive), .battle (combat)
 */
.game-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-4) var(--space-5); /* 15px → 16px, 20px */
  border: 2px solid transparent;
  border-radius: var(--radius-md); /* 12px */
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
  /* Touch-friendly improvements */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.game-btn .btn-icon {
  font-size: 2em;
  margin-bottom: 5px;
  transition: transform 0.3s ease;
}

.game-btn .btn-text {
  font-size: 1em;
  font-weight: bold;
  margin-bottom: 2px;
}

.game-btn .btn-hint {
  font-size: 0.7em;
  opacity: 0.8;
  font-weight: normal;
}

/* Button Variants */
.game-btn.primary {
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-700) 100%);
  color: var(--color-text-inverse);
  border-color: var(--color-primary-700);
  box-shadow: var(--shadow-lg);
  min-width: 140px;
}

.game-btn.primary:hover {
  background: linear-gradient(135deg, var(--color-primary-700) 0%, var(--color-primary-800) 100%);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.game-btn.primary .btn-icon {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.game-btn.secondary {
  background: linear-gradient(135deg, var(--color-info-500) 0%, var(--color-info-700) 100%);
  color: var(--color-text-inverse);
  border-color: var(--color-info-700);
  box-shadow: var(--shadow-md);
}

.game-btn.secondary:hover {
  background: linear-gradient(135deg, #2980b9 0%, #2471a3 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.game-btn.tertiary {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: var(--color-text-inverse);
  border-color: #6d28d9;
  box-shadow: var(--shadow-md);
}

.game-btn.tertiary:hover {
  background: linear-gradient(135deg, #8e44ad 0%, #7d3c98 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}

.game-btn.danger {
  background: linear-gradient(135deg, var(--color-danger-500) 0%, var(--color-danger-700) 100%);
  color: var(--color-text-inverse);
  border-color: var(--color-danger-700);
  box-shadow: var(--shadow-md);
}

.game-btn.danger:hover {
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.game-btn:active {
  transform: scale(0.95);
}

.game-btn:hover .btn-icon {
  transform: scale(1.1) rotate(5deg);
}

.game-btn:focus {
  outline: 3px solid var(--color-primary-600);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(243, 118, 47, 0.2);
}

/* Loading State */
.game-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.game-btn.loading .btn-icon {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.94);
    opacity: 0.6;
  }
}

/* Codex Section */
.codex-description {
  margin: var(--space-4) 0 var(--space-6);
  color: var(--color-neutral-600);
  max-width: 60ch;
  font-size: var(--font-size-base);
}

.codex-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: var(--space-6);
}

.codex-panel {
  background: linear-gradient(145deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.85));
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  padding: var(--space-5);
  box-shadow: 0 18px 36px -24px rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(10px);
}

.codex-panel h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-3);
  color: var(--color-neutral-700);
}

.codex-list {
  display: grid;
  gap: var(--space-4);
}

.codex-list.bestiary {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.codex-card {
  background: #ffffff;
  border-radius: 14px;
  padding: var(--space-4);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 14px 32px -24px rgba(15, 23, 42, 0.55);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.codex-card h4 {
  font-size: var(--font-size-md);
  color: var(--color-neutral-800);
}

.codex-card p {
  margin: 0;
  color: var(--color-neutral-600);
  line-height: var(--line-height-base);
}

.codex-meta {
  font-size: var(--font-size-sm);
  color: var(--color-neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.codex-log-panel {
  margin-top: var(--space-6);
}

.codex-log {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 420px;
  overflow-y: auto;
  padding-right: var(--space-2);
}

.codex-log-entry {
  background: #ffffff;
  border-radius: var(--radius-md); /* 12px */
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: var(--space-4);
  box-shadow: 0 12px 24px -20px rgba(15, 23, 42, 0.5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.codex-log-time {
  font-size: var(--font-size-sm);
  color: var(--color-neutral-500);
}

.bestiary-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.bestiary-icon {
  font-size: 2.25rem;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.25));
}

.codex-card.bestiary p {
  color: var(--color-neutral-600);
}

/* Touch device specific styles */
@media (pointer: coarse) {
  .game-btn:hover {
    transform: none;
    background: linear-gradient(135deg, #ff6b35 0%, #e55a2b 100%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }

  .game-btn:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
  }
}

/* Battle UI */
.battle-ui {
  background: linear-gradient(135deg, var(--color-danger-500) 0%, var(--color-danger-700) 100%);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  border: 3px solid var(--color-primary-600);
  box-shadow: var(--shadow-xl);
  color: var(--color-text-inverse);
  display: none;
}

.battle-ui h3 {
  text-align: center;
  margin-bottom: var(--space-4); /* 15px → 16px */
  font-size: 1.5em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.enemy-stats {
  display: flex;
  justify-content: center;
  align-items: center;
}

.enemy-info {
  display: flex;
  align-items: center;
  gap: var(--space-4); /* 15px → 16px */
  background: rgba(255, 255, 255, 0.1);
  padding: var(--space-4); /* 15px → 16px */
  border-radius: var(--radius-md); /* 10px → 12px */
  border: 2px solid var(--color-primary-600);
}

.enemy-image {
  font-size: 3em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.enemy-details {
  text-align: left;
}

.enemy-name {
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 5px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.enemy-hp {
  font-size: 1.1em;
  font-weight: bold;
}

/* Battle Actions */
.battle-actions {
  display: none;
  flex-wrap: wrap;
  gap: var(--space-4); /* 15px → 16px */
  justify-content: center;
  margin-top: var(--space-5); /* 20px */
}

/* Battle buttons use .game-btn.danger with enhanced styling */
.game-btn.battle {
  border: 3px solid var(--color-primary-600);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  font-size: 1em;
}

/* Login Section */
.login-container {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.login-form {
  margin: var(--space-8) 0; /* 30px → 32px */
}

.login-error {
  color: #ff4444;
  margin-top: var(--space-3); /* 10px → 12px */
  font-weight: bold;
}

.password-hint {
  margin-top: var(--space-5); /* 20px */
  padding: var(--space-4); /* 15px → 16px */
  background: var(--color-warning-100);
  border: 2px solid var(--color-warning-500);
  border-radius: var(--radius-base); /* 8px */
}

.password-hint small {
  color: var(--color-warning-800);
}

/* Admin Section */
.admin-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-5); /* 20px */
}

.admin-panel {
  margin-bottom: var(--space-8); /* 30px → 32px */
  padding: var(--space-5); /* 20px */
  background: var(--color-neutral-100);
  border-radius: var(--radius-lg); /* 15px → 16px */
  border: 2px solid var(--color-primary-600);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.editor,
.input {
  width: 100%;
  padding: var(--space-3); /* 12px */
  margin-bottom: var(--space-4); /* 15px → 16px */
  border: 2px solid var(--color-neutral-300);
  border-radius: var(--radius-base); /* 8px */
  font-size: 1em;
  font-family: inherit;
}

.editor:focus,
.input:focus {
  outline: 3px solid var(--color-primary-600);
  outline-offset: 2px;
  border-color: var(--color-primary-600);
  box-shadow: 0 0 0 4px rgba(243, 118, 47, 0.2);
}

/* Standard Button System - Used for forms, admin actions, and general UI
 * Base: .btn (primary style)
 * Variants: .btn-secondary (neutral), .btn.danger (destructive actions)
 */
.btn {
  padding: var(--space-3) var(--space-6); /* 12px 24px */
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-700) 100%);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-base);
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.btn:hover {
  background: linear-gradient(135deg, var(--color-primary-700) 0%, var(--color-primary-800) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:focus {
  outline: 3px solid var(--color-primary-600);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(243, 118, 47, 0.2);
}

.btn:active {
  transform: translateY(0);
}

/* Button variant - Danger */
.btn.danger {
  background: linear-gradient(135deg, var(--color-danger-500) 0%, var(--color-danger-700) 100%);
}

.btn.danger:hover {
  background: linear-gradient(135deg, var(--color-danger-600) 0%, var(--color-danger-800) 100%);
}

.interests-editor {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3); /* 10px → 12px */
  margin-bottom: var(--space-4); /* 15px → 16px */
}

.interest-tag-editable {
  padding: 8px var(--space-4); /* 15px → 16px */
  background: var(--color-primary-600);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full); /* 20px → 9999px for pill shape */
  display: flex;
  align-items: center;
  gap: var(--space-3); /* 10px → 12px */
  border: 2px solid var(--color-neutral-700);
}

.interest-tag-editable button {
  background: var(--color-danger-500);
  color: var(--color-text-inverse);
  border: 1px solid var(--color-neutral-700);
  padding: 2px 8px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
}

.interest-tag-editable button:hover {
  background: var(--color-danger-700);
  transform: scale(1.1);
}

.add-interest {
  display: flex;
  gap: var(--space-3); /* 10px → 12px */
}

.add-interest input {
  flex: 1;
}

/* Empty States */
.empty-message {
  text-align: center;
  color: var(--color-neutral-400);
  font-style: italic;
  padding: var(--space-10); /* 40px */
}

/* Game Modals */
.game-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, var(--color-neutral-50) 0%, var(--color-neutral-100) 100%);
  border-radius: var(--radius-lg); /* 15px → 16px */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5) var(--space-6) var(--space-4); /* 20px 25px→24px 15px→16px */
  border-bottom: 2px solid var(--color-primary-600);
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-700) 100%);
  color: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; /* 15px → 16px for top corners */
}

.modal-header h3 {
  margin: 0;
  font-size: 1.4em;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2em;
  color: white;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-body {
  padding: var(--space-6); /* 25px → 24px */
  line-height: 1.6;
  color: #2c3e50;
}

.modal-actions {
  display: flex;
  gap: var(--space-4); /* 15px → 16px */
  padding: var(--space-5) var(--space-6); /* 20px 25px→24px */
  justify-content: flex-end;
  border-top: 1px solid var(--color-neutral-100);
}

/* Button variant - Secondary */
.btn-secondary {
  background: var(--color-neutral-100);
  color: var(--color-neutral-800);
  border: 1px solid var(--color-neutral-300);
  padding: var(--space-3) var(--space-6); /* 12px 24px */
  border-radius: var(--radius-base);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--color-neutral-200);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-secondary:focus {
  outline: 3px solid var(--color-primary-600);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(243, 118, 47, 0.2);
}

/* Loading Overlay */
.game-loading {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1001;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--color-neutral-100);
  border-top: 4px solid var(--color-primary-600);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  color: white;
  font-size: 1.2em;
  font-weight: bold;
  animation: pulse 1.5s infinite;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Shop Interface Styles */
.shop-interface {
  font-family: inherit;
}

.shop-header {
  text-align: center;
  margin-bottom: 20px;
  padding: var(--space-4); /* 15px → 16px */
  background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
  border-radius: var(--radius-base); /* 8px */
  color: #2c3e50;
}

.shop-gold .gold-amount {
  font-weight: bold;
  font-size: 1.2em;
}

.shop-category {
  margin-bottom: 25px;
}

.shop-category h4 {
  color: var(--color-primary-600);
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary-600);
}

.shop-items {
  display: grid;
  gap: var(--space-3); /* 10px → 12px */
}

.shop-item {
  display: flex;
  align-items: center;
  padding: var(--space-4); /* 15px → 16px */
  background: var(--color-neutral-100);
  border: 2px solid transparent;
  border-radius: var(--radius-base); /* 8px */
  cursor: pointer;
  transition: all 0.3s ease;
}

.shop-item:hover {
  background: var(--color-neutral-200);
  border-color: var(--color-primary-600);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(243, 118, 47, 0.2);
}

.shop-item.selected {
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-700) 100%);
  color: white;
  border-color: var(--color-primary-800);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(243, 118, 47, 0.3);
}

.shop-item .item-icon {
  font-size: 2em;
  margin-right: 15px;
  min-width: 50px;
  text-align: center;
}

.shop-item .item-details {
  flex: 1;
}

.shop-item .item-name {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 4px;
}

.shop-item .item-description {
  font-size: 0.9em;
  opacity: 0.8;
}

.shop-item.selected .item-description {
  opacity: 0.9;
}

.shop-item .item-cost {
  font-weight: bold;
  font-size: 1.1em;
  color: var(--color-warning-500);
  padding: 8px 15px;
  background: rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-lg); /* 15px → 16px */
  min-width: 60px;
  text-align: center;
}

.shop-item.selected .item-cost {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.shop-item:focus {
  outline: 3px solid var(--color-primary-600);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(243, 118, 47, 0.2);
}

/* Footer */
footer {
  text-align: center;
  color: white;
  padding: var(--space-5); /* 20px */
  margin-top: var(--space-8); /* 30px → 32px */
}

/* Enhanced Responsive Design */
/* Large Tablets and Small Desktops (1024px and down) */
@media (max-width: 1024px) {
  .container {
    padding: var(--space-4); /* 15px → 16px */
  }

  .section {
    padding: var(--space-5); /* 20px */
  }

  .game-stats {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
  }

  .stat-item {
    padding: 8px;
    font-size: 0.8em;
  }
}

/* Tablets (768px and down) */
@media (max-width: 768px) {
  .container {
    padding: var(--space-3); /* 10px → 12px */
  }

  .logo {
    font-size: 1.4em;
    margin-bottom: var(--space-3); /* 10px → 12px */
  }

  .nav-links {
    flex-direction: column;
    gap: 8px;
  }

  .nav-link {
    padding: 8px 16px;
    font-size: 0.9em;
  }

  .section {
    padding: var(--space-4); /* 15px → 16px */
    margin-bottom: var(--space-4); /* 15px → 16px */
  }

  .section h2 {
    font-size: 1.6em;
    margin-bottom: var(--space-4); /* 15px → 16px */
  }

  .game-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .location-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3); /* 10px → 12px */
  }

  .location-card {
    padding: var(--space-3); /* 12px */
  }

  .location-card .location-emoji {
    font-size: 2em;
  }

  .game-display {
    padding: var(--space-5); /* 20px */
    min-height: 150px;
  }

  .game-message {
    font-size: 1em;
  }

  .game-image {
    font-size: 4em;
  }

  .game-controls {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .game-btn {
    min-width: 100px;
    padding: var(--space-3) var(--space-2); /* 12px 8px */
  }

  .game-btn .btn-text {
    font-size: 0.9em;
  }

  .game-btn .btn-hint {
    display: none;
  }

  .action-group {
    gap: var(--space-3); /* 10px → 12px */
  }

  .primary-actions .game-btn {
    min-width: 110px;
  }

  .stat-group {
    padding: var(--space-3); /* 10px → 12px */
  }

  .primary-stats {
    grid-template-columns: 1fr;
  }

  .secondary-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-item.hero-identity {
    grid-column: span 1;
  }

  .modal-content {
    width: 95%;
    margin: var(--space-3); /* 10px → 12px */
  }

  .modal-header {
    padding: var(--space-4) var(--space-5) var(--space-3); /* 15px→16px 20px 10px→12px */
  }

  .modal-body {
    padding: var(--space-5); /* 20px */
  }

  .modal-actions {
    padding: var(--space-4) var(--space-5); /* 15px→16px 20px */
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
    margin: 5px 0;
  }
}

/* Mobile Phones (480px and down) */
@media (max-width: 480px) {
  .container {
    padding: 5px;
  }

  .navbar {
    padding: var(--space-4); /* 15px → 16px */
    margin-bottom: var(--space-4); /* 15px → 16px */
  }

  .logo {
    font-size: 1.2em;
    margin-bottom: 8px;
  }

  .nav-links {
    gap: 5px;
  }

  .nav-link {
    padding: 6px 12px;
    font-size: 0.8em;
    border-radius: var(--radius-full); /* 20px → 9999px for pill shape */
  }

  .section {
    padding: var(--space-3); /* 12px */
    margin-bottom: var(--space-3); /* 10px → 12px */
  }

  .section h2 {
    font-size: 1.4em;
    margin-bottom: var(--space-3); /* 12px */
  }

  .section h3 {
    font-size: 1.1em;
    margin-bottom: 8px;
  }

  .game-stats {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .stat-item {
    padding: 6px;
    font-size: 0.75em;
  }

  .location-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .location-card {
    padding: var(--space-3); /* 10px → 12px */
  }

  .location-card .location-emoji {
    font-size: 1.8em;
    margin-bottom: 5px;
  }

  .location-card .location-name {
    font-size: 1em;
  }

  .game-display {
    padding: var(--space-4); /* 15px → 16px */
    min-height: 120px;
  }

  .game-message {
    font-size: 0.9em;
    line-height: 1.4;
  }

  .game-image {
    font-size: 3em;
  }

  .game-btn {
    padding: var(--space-3); /* 10px → 12px */
    font-size: 0.8em;
  }

  .interests-display {
    gap: 5px;
  }

  .interest-tag {
    padding: 5px 10px;
    font-size: 0.8em;
  }

  .gallery-grid {
    gap: var(--space-3); /* 10px → 12px */
  }

  .gallery-item {
    border-radius: var(--radius-base); /* 8px */
  }

  .story-item {
    padding: var(--space-4); /* 15px → 16px */
  }

  .story-item .delete-btn {
    padding: 4px 8px;
    font-size: 0.7em;
    top: 15px;
    right: 15px;
  }
}

/* Very Small Screens (360px and down) */
@media (max-width: 360px) {
  .container {
    padding: 3px;
  }

  .navbar {
    padding: var(--space-3); /* 10px → 12px */
  }

  .logo {
    font-size: 1.1em;
  }

  .nav-link {
    padding: 5px 8px;
    font-size: 0.75em;
  }

  .section {
    padding: var(--space-3); /* 10px → 12px */
  }

  .section h2 {
    font-size: 1.2em;
  }

  .game-display {
    padding: var(--space-3); /* 10px → 12px */
    min-height: 100px;
  }

  .game-message {
    font-size: 0.8em;
  }

  .game-image {
    font-size: 2.5em;
  }

  .location-card .location-emoji {
    font-size: 1.5em;
  }
}

/* Touch-Friendly Enhancements */
@media (pointer: coarse) {
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .game-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .location-card {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .delete-btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Landscape Orientation on Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .logo {
    font-size: 1.1em;
    margin-bottom: 5px;
  }

  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .section {
    padding: var(--space-3); /* 10px → 12px */
  }

  .game-display {
    min-height: 100px;
    padding: var(--space-4); /* 15px → 16px */
  }

  .location-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* PWA and Mobile-Specific Styles */
/* PWA install button - uses success color variant */
.install-btn {
  background: linear-gradient(135deg, var(--color-success-500) 0%, var(--color-success-700) 100%);
  color: var(--color-text-inverse);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.9em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: var(--space-3);
  box-shadow: var(--shadow-sm);
  touch-action: manipulation;
  user-select: none;
}

.install-btn:hover {
  background: linear-gradient(135deg, var(--color-success-600) 0%, var(--color-success-800) 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.install-btn:active {
  transform: scale(0.95);
}

.update-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  padding: var(--space-4); /* 15px → 16px */
  border-radius: var(--radius-md); /* 10px → 12px */
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  animation: slideInRight 0.5s ease;
  max-width: 300px;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: var(--space-3); /* 10px → 12px */
  flex-wrap: wrap;
}

.update-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: var(--space-1) var(--space-3); /* 4px 12px */
  border-radius: var(--radius-sm);
  font-size: 0.8em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.update-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.dismiss-btn {
  background: none;
  color: white;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  padding: 0 5px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.dismiss-btn:hover {
  opacity: 1;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Offline Status Styles */
body.offline .nav-link {
  opacity: 0.7;
}

body.offline::before {
  content: '📱 Offline Mode';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #e74c3c;
  color: white;
  text-align: center;
  padding: 5px;
  font-size: 0.8em;
  z-index: 1000;
}

body.offline .container {
  margin-top: 30px;
}

/* Loading States for Better Mobile UX */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '⌛';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2em;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .nav-link {
    border: 3px solid #000;
    color: #000;
    background: #fff;
  }

  .game-btn {
    border: 3px solid #000;
    color: #000;
    background: #fff;
  }

  .section {
    border: 2px solid #000;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .game-btn:hover,
  .nav-link:hover {
    transform: none;
  }
} /* Location Selector */
.location-selector {
  background: rgba(255, 255, 255, 0.1);
  padding: var(--space-5); /* 20px */
  border-radius: var(--radius-lg); /* 15px → 16px */
  margin-bottom: var(--space-5); /* 20px */
  border: 2px solid var(--color-primary-600);
}

.location-selector h3 {
  color: var(--color-text-inverse);
  text-align: center;
  margin-bottom: var(--space-4); /* 15px → 16px */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4); /* 15px → 16px */
}

.location-card {
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-700) 100%);
  padding: var(--space-4); /* 15px → 16px */
  border-radius: var(--radius-md); /* 12px */
  border: 3px solid var(--color-neutral-700);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  color: white;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.location-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.location-card.active {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
  border-color: #ffffff;
}

.location-card.locked {
  background: var(--color-neutral-400);
  cursor: not-allowed;
  opacity: 0.6;
}

.location-card:focus {
  outline: 3px solid var(--color-primary-600);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(243, 118, 47, 0.2);
}

.location-card .location-emoji {
  font-size: 2.5em;
  margin-bottom: 10px;
  display: block;
}

.location-card .location-name {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 5px;
}

.location-card .location-level {
  font-size: 0.9em;
  opacity: 1.0; /* Changed from 0.8 for better contrast on colored backgrounds */
}

/* Quest Panels */
.quests-panel {
  background: rgba(255, 255, 255, 0.1);
  padding: var(--space-5); /* 20px */
  border-radius: var(--radius-lg); /* 15px → 16px */
  margin-bottom: var(--space-5); /* 20px */
  border: 2px solid var(--color-primary-600);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5); /* 20px */
}

.quest-section h4 {
  color: var(--color-text-inverse);
  text-align: center;
  margin-bottom: var(--space-4); /* 15px → 16px */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.quest-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3); /* 10px → 12px */
  max-height: 300px;
  overflow-y: auto;
}

.quest-item {
  background: linear-gradient(135deg, var(--color-neutral-700) 0%, var(--color-neutral-800) 100%);
  padding: var(--space-4); /* 15px → 16px */
  border-radius: var(--radius-md); /* 10px → 12px */
  border: 2px solid var(--color-primary-600);
  color: white;
  transition: all 0.3s ease;
}

.quest-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.quest-item.available {
  border-color: var(--color-success-500);
  cursor: pointer;
}

.quest-item.available:hover {
  background: linear-gradient(135deg, var(--color-success-500) 0%, var(--color-success-700) 100%);
}

.quest-name {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quest-giver {
  font-size: 0.8em;
  opacity: 0.9; /* Increased from 0.8 for better contrast */
  margin-bottom: 5px;
}

.quest-description {
  font-size: 0.9em;
  line-height: 1.4;
  margin-bottom: 10px;
}

.quest-progress {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: var(--radius-sm); /* 5px → 4px */
  font-size: 0.85em;
  margin-top: 10px;
}

.quest-rewards {
  font-size: 0.8em;
  color: var(--color-warning-500);
  margin-top: 5px;
}

.accept-quest-btn {
  background: var(--color-success-500);
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm); /* 5px → 4px */
  cursor: pointer;
  font-size: 0.8em;
  font-weight: bold;
  transition: all 0.3s ease;
}

.accept-quest-btn:hover {
  background: var(--color-success-700);
  transform: scale(1.05);
}

.accept-quest-btn:focus,
.quest-item:focus {
  outline: 3px solid var(--color-primary-600);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(243, 118, 47, 0.2);
}

/* Success/Error Messages */
.message {
  padding: var(--space-4); /* 15px → 16px */
  border-radius: var(--radius-base); /* 8px */
  margin-bottom: var(--space-4); /* 15px → 16px */
  text-align: center;
  font-weight: bold;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border: 2px solid #c3e6cb;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border: 2px solid #f5c6cb;
}

/* Responsive Design for Quest Panels */
@media (max-width: 768px) {
  .quests-panel {
    grid-template-columns: 1fr;
  }

  .location-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}
