:root {
  /* --- The VIVELE Palette (Pearl Purple) --- */
  --vivele-deep: #B869B5;
  --vivele-mid: #CC72C4;
  --vivele-bright: #E182E4;
  --vivele-light: #F191FF;
  --vivele-pale: #F1A7FF;

  /* Mappings to existing system (Gradual Migration) */
  --primary-color: var(--vivele-bright);
  --secondary-color: var(--vivele-deep);
  --accent-color: var(--vivele-light);
  --success-color: #98d8c8;
  --background-color: #fef7ff;
  --card-color: #ffffff;
  
  /* Legacy Rose Gold (Retained for warm accents, but subordinate) */
  --rose-gold: #b76e79;
  --rose-gold-light: #c98b94;
  --rose-gold-dark: #a15864;

  /* Updated Gradients: Electric Romance */
  --gradient-primary: linear-gradient(135deg, var(--vivele-deep), var(--vivele-bright), var(--vivele-pale));
  --gradient-secondary: linear-gradient(135deg, var(--vivele-mid), var(--vivele-light));
  --gradient-elegant: linear-gradient(
    135deg,
    var(--vivele-deep) 0%,
    var(--vivele-bright) 50%,
    var(--vivele-pale) 100%
  );
  
  /* Background: Subtle Pearl Wash */
  --gradient-background: radial-gradient(
    circle at 30% 20%,
    rgba(241, 145, 255, 0.15) 0%, /* vivele-light */
    rgba(204, 114, 196, 0.1) 50%, /* vivele-mid */
    rgba(255, 250, 255, 0.9) 100%
  );

  /* Shadows: Tinted with Deep Purple */
  --shadow-elegant:
    0 8px 32px rgba(184, 105, 181, 0.15),
    0 2px 8px rgba(184, 105, 181, 0.1);
  --shadow-hover:
    0 12px 40px rgba(184, 105, 181, 0.25),
    0 4px 12px rgba(184, 105, 181, 0.15);
  --shadow-subtle: 0 4px 16px rgba(184, 105, 181, 0.1);
  --glow-text: 0 2px 8px rgba(184, 105, 181, 0.3);
  --glow-soft: 0 0 20px rgba(225, 130, 228, 0.4);

  --border-radius-sm: 15px;
  --border-radius-md: 20px;
  --border-radius-lg: 25px;
  --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --sparkle-animation: elegantSparkle 3s ease-in-out infinite;
}

/* Bulma Overrides - Ensure VIVELE Design System Takes Precedence */
* {
  box-sizing: border-box;
}

/* Reset margins/padding only for our custom components */
#game-controls,
#map-container,
.player-card,
.control-group {
  margin: 0;
  padding: 0;
}

/* Override Bulma button styles with VIVELE */
.button.vivele-button,
button.vivele-button {
  /* VIVELE button styles will override Bulma */
  background: linear-gradient(
    135deg,
    rgba(227, 230, 243, 0.9),
    rgba(248, 225, 244, 0.9)
  ) !important;
  color: var(--rose-gold) !important;
  border: 1.5px solid var(--rose-gold) !important;
  border-radius: var(--border-radius-sm) !important;
  font-family: "Quicksand", sans-serif !important;
  font-weight: 500 !important;
  box-shadow: var(--shadow-subtle) !important;
}

/* Override Bulma input styles with VIVELE */
.input.vivele-input,
input.vivele-input {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 2px solid rgba(183, 110, 121, 0.4) !important;
  border-radius: var(--border-radius-sm) !important;
  font-family: "Quicksand", sans-serif !important;
  backdrop-filter: blur(5px) !important;
}

/* Override Bulma label styles */
.label {
  font-family: "Quicksand", sans-serif !important;
  color: var(--secondary-color) !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
}

/* Ensure Bulma columns work with VIVELE cards */
.columns .column .player-card {
  height: 100%;
}

/* Override Bulma content styles */
.content.vivele-content {
  color: inherit;
}

.vivele-section {
  margin: 1rem 0;
}

/* Bulma slider override - moved to bulma-overrides.css */

body {
  background: var(--gradient-background);
  color: #3d2c4e;
  font-family: "Quicksand", "Lato", Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Performance optimizations */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: scroll-position;
}

h1,
h2,
h3 {
  font-family: "Playfair Display", "Cormorant Garamond", serif;
  color: var(--rose-gold);
  letter-spacing: 1.5px;
  margin-bottom: 0.5em;
  text-shadow: var(--glow-text);
}

#map {
  border: 4px solid var(--vivele-deep); /* Framing the world */
  border-radius: var(--border-radius-md);
  box-shadow:
    inset 0 0 20px rgba(184, 105, 181, 0.2); /* Inner depth */
    
  margin: 0 auto;
  width: 100%; /* Fill container */
  height: 60vh;
  min-height: 500px;
  position: relative;
  z-index: 1;
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-tap-highlight-color: transparent;
  /* Performance optimizations */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
  contain: layout style paint;
}

#map::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(
    135deg,
    var(--rose-gold-light),
    var(--rose-gold-dark)
  );
  border-radius: var(--border-radius-md);
  z-index: -1;
  opacity: 0.1;
}

button,
.btn {
  background: linear-gradient(
    135deg,
    rgba(227, 230, 243, 0.9),
    rgba(248, 225, 244, 0.9)
  );
  color: var(--rose-gold);
  border: 1.5px solid var(--rose-gold);
  border-radius: var(--border-radius-sm);
  padding: 0.875em 2em;
  min-height: 44px;
  min-width: 120px;
  font-size: 1.1em;
  font-family: "Quicksand", sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: rgba(183, 110, 121, 0.2);
  touch-action: manipulation;
}

button::before,
.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(
    circle,
    rgba(183, 110, 121, 0.1) 0%,
    transparent 70%
  );
  transition: all 0.6s ease;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

button:hover::before,
.btn:hover::before {
  width: 300px;
  height: 300px;
}

button:hover,
.btn:hover,
button:focus-visible,
.btn:focus-visible {
  background: var(--rose-gold);
  color: #fff;
  box-shadow: var(--shadow-hover);
  transform: translate3d(0, -2px, 0) scale(1.02);
  outline: 3px solid rgba(183, 110, 121, 0.4);
  outline-offset: 2px;
}

button:active,
.btn:active {
  transform: translate3d(0, 0, 0) scale(0.98);
}

.info-panel,
.status,
.quiz,
.fact,
.address,
.flag {
  /* High Contrast Card Style */
  background: #ffffff;
  border: 4px solid #ffffff; /* Inner white border */
  outline: 1px solid var(--vivele-mid);
  
  border-radius: 18px;
  padding: 1.5rem 2rem;
  margin: 1rem auto;
  max-width: 600px;
  
  /* 3D Lift */
  box-shadow: 
    0 10px 30px rgba(184, 105, 181, 0.15),
    0 0 0 1px rgba(184, 105, 181, 0.1);
    
  color: #1a0520; /* High contrast reading text */
}

/* --- QUIZ & FUN FACT UI (VIVELE 3D) --- */
.quiz h3, 
.fact h3 {
  color: var(--vivele-deep);
  font-family: 'Playfair Display', serif;
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

/* Quiz button styles moved to bulma-overrides.css for Bulma compatibility */

/* Feedback Text */
.success-text {
  color: #00b09b;
  font-weight: 800;
  display: block;
  margin-top: 1rem;
  font-size: 1.2rem;
}

.error-text {
  color: #ff5f6d;
  font-weight: 800;
  display: block;
  margin-top: 1rem;
  font-size: 1.2rem;
}

/* Fun Fact Specifics */
.fun-fact p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #333;
}

input,
select {
  border: 2px solid rgba(183, 110, 121, 0.4);
  border-radius: var(--border-radius-sm);
  padding: 0.875em 1.25em;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.95);
  color: #3d2c4e;
  font-size: 1em;
  transition: var(--transition);
  backdrop-filter: blur(5px);
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

input:focus,
select:focus,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(183, 110, 121, 0.3);
  outline-offset: 2px;
  border-color: var(--rose-gold);
  box-shadow:
    0 0 0 4px rgba(183, 110, 121, 0.15),
    var(--glow-soft);
  transform: translate3d(0, -1px, 0);
  background: rgba(255, 255, 255, 1);
}

::-webkit-scrollbar {
  width: 10px;
  background: linear-gradient(to bottom, #f8e1f4, #e3e6f3);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    to bottom,
    var(--rose-gold-light),
    var(--rose-gold-dark)
  );
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

a {
  color: var(--rose-gold);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 0;
  background: var(--rose-gold);
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

a:hover {
  color: var(--rose-gold-dark);
  text-shadow: var(--glow-text);
}

/* Refined sparkle animation */
@keyframes elegantSparkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.8) rotate(0deg);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1) rotate(12deg);
  }
}

body::before {
  content: "✨";
  position: fixed;
  top: 15%;
  right: 12%;
  font-size: 1.2rem;
  animation: var(--sparkle-animation);
  z-index: 1;
  animation-delay: 0s;
  filter: drop-shadow(0 2px 4px rgba(183, 110, 121, 0.3));
}

body::after {
  content: "🌸";
  position: fixed;
  bottom: 20%;
  left: 10%;
  font-size: 1rem;
  animation: var(--sparkle-animation);
  z-index: 1;
  animation-delay: 2s;
  filter: drop-shadow(0 2px 4px rgba(183, 110, 121, 0.3));
}

/* --- THE GLASS COCKPIT: COMMAND DECK --- */
#game-controls {
  /* Glass Base */
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 
    0 8px 32px rgba(183, 110, 121, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  
  padding: 2.5rem 3rem;
  border-radius: var(--border-radius-lg);
  margin: 1rem auto;
  max-width: 1400px;
  width: 95%;
  z-index: 10;
  position: relative;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  /* Performance optimizations */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  contain: layout style paint;
  will-change: transform, opacity;

  /* Top Accent Line */
  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--rose-gold), transparent);
    opacity: 0.6;
  }

  /* Title Styling */
  & h1 {
    margin: 0 0 2rem;
    text-align: center;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--rose-gold-dark);
    text-shadow: 0 2px 10px rgba(183, 110, 121, 0.1);
    
    /* Decorative Sparkles (Refactored) */
    &::after {
      content: "✨";
      position: absolute;
      font-size: 1.2rem;
      animation: var(--sparkle-animation);
      filter: drop-shadow(0 0 5px rgba(255,255,255,0.8));
    }

    /* Scattered sparkles using nth-of-type selector logic if possible, 
       but for pure CSS replacement we'll keep it simple or use multiple box-shadows/pseudo-elements if we wanted to be fancy.
       For now, we will simplify the multiple pseudo-elements from the old code into a cleaner single decoration 
       or assume adjacent sibling usage for the chaotic sparkles if we want to preserve them exactly. 
       Let's stick to a cleaner, more elegant single sparkle for the title to reduce visual noise. */
  }

  /* Interactive States */
  &:hover {
    box-shadow: 
      0 12px 48px rgba(183, 110, 121, 0.2),
      inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.75);
    transform: translate3d(0, -2px, 0);
  }
}

.control-group {
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Bulma field compatibility */
.control-group.field {
  display: block; /* Use Bulma's field structure */
}

.control-group .control {
  margin-bottom: 1rem;
}

.control-group .control:last-child {
  margin-bottom: 0;
}

.control-group label {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--secondary-color);
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: "Quicksand", sans-serif;
}

.control-group input[type="text"] {
  padding: 1rem 1.5rem;
  min-height: 48px;
  border: 2px solid rgba(255, 182, 193, 0.5);
  border-radius: var(--border-radius-sm);
  font-size: 1.1rem;
  transition: var(--transition);
  background: linear-gradient(135deg, #fff0f5, #ffeef8);
  font-family: "Quicksand", sans-serif;
  box-shadow: inset 0 2px 4px rgba(183, 110, 121, 0.05);
  width: 100%;
}

.control-group input[type="text"]:focus {
  border-color: var(--rose-gold);
  box-shadow:
    0 0 0 4px rgba(183, 110, 121, 0.15),
    inset 0 2px 4px rgba(183, 110, 121, 0.05);
  transform: translate3d(0, -2px, 0);
}

.control-group input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 182, 193, 0.3),
    rgba(183, 110, 121, 0.6)
  );
  outline: none;
  margin: 1.5rem 0;
  cursor: pointer;
  touch-action: pan-x;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background: var(--gradient-elegant);
  cursor: pointer;
  box-shadow:
    0 4px 12px rgba(183, 110, 121, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.8);
  transition: var(--transition);
  touch-action: none;
}

.control-group input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background: var(--gradient-elegant);
  cursor: pointer;
  box-shadow:
    0 4px 12px rgba(183, 110, 121, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.8);
  transition: var(--transition);
}

.control-group input[type="range"]::-webkit-slider-thumb:hover,
.control-group input[type="range"]::-webkit-slider-thumb:focus-visible,
.control-group input[type="range"]::-moz-range-thumb:hover,
.control-group input[type="range"]::-moz-range-thumb:focus-visible {
  transform: scale(1.3);
  box-shadow: 0 6px 20px rgba(183, 110, 121, 0.5);
  outline: 3px solid rgba(183, 110, 121, 0.3);
  outline-offset: 2px;
}

.control-group button {
  padding: 1rem 2rem;
  min-height: 48px;
  background: var(--gradient-elegant);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
  margin-top: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
  font-family: "Quicksand", sans-serif;
  width: 100%;
  -webkit-tap-highlight-color: rgba(183, 110, 121, 0.2);
  touch-action: manipulation;
}

.control-group button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.8s ease;
}

.control-group button:hover::before {
  left: 100%;
}

.control-group button:hover,
.control-group button:focus-visible {
  transform: translate3d(0, -2px, 0) scale(1.01);
  box-shadow: var(--shadow-hover);
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.control-group button:active {
  transform: translate3d(0, 0, 0) scale(0.99);
}

/* Hidden class - Compatible with Bulma */
.hidden,
.is-hidden {
  display: none !important;
  visibility: hidden;
}

/* Bulma is-hidden utility compatibility */
.is-hidden-mobile {
  display: none !important;
}

@media screen and (min-width: 769px) {
  .is-hidden-mobile {
    display: block !important;
  }
}

/* --- STORY GUIDE UI Moved to story-guide.css --- */

@keyframes slideUpFade {
  from { opacity: 0; transform: translate3d(0, 20px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Screen reader only class */
.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;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--rose-gold);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 1000;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

#player-info {
  /* Use Bulma grid, but maintain VIVELE spacing */
  margin: 2.5rem 0;
}

/* Override Bulma column padding for player cards */
#player-info .column {
  padding: 0.75rem; /* Reduced from Bulma default 0.75rem to match VIVELE gap */
}

/* Ensure player cards fill their columns */
#player-info .column .player-card {
  height: 100%;
  margin: 0;
}

/* --- THE GLASS COCKPIT: AVATARS --- */
.player-card {
  /* Prism Base */
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--border-radius-md);
  padding: 2.5rem;
  text-align: center;
  position: relative;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 0;
  transform: translate3d(0, 30px, 0) scale(0.98);
  animation: elegantFadeIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  /* Performance optimizations */
  will-change: transform, opacity;
  contain: layout style paint;
  
  /* Inner Info Text */
  & div {
    font-size: 1.1rem;
    margin: 0.8rem 0;
    color: var(--secondary-color);
    font-weight: 600;
  }

  /* Crown Icon */
  &::before {
    content: "👑";
    position: absolute;
    top: -12px;
    right: 20px;
    font-size: 1.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 4px 6px rgba(183, 110, 121, 0.3));
  }

  /* Hover State: Specular Highlight */
  &:hover {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 
      0 10px 30px rgba(183, 110, 121, 0.2),
      inset 0 0 20px rgba(255, 255, 255, 0.5);
    transform: translate3d(0, -4px, 0) scale(1.02);
    border-color: rgba(255, 182, 193, 0.8);
  }

  /* Active/Setter State */
  &.active {
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,245,248,0.9));
    border: 2px solid var(--rose-gold);
    box-shadow: 0 0 25px rgba(183, 110, 121, 0.3);
    
    &::before {
      opacity: 1;
      transform: translateY(0);
      animation: var(--sparkle-animation);
    }
  }
}

.player-card div {
  font-size: 1.1rem;
  margin: 0.8rem 0;
  color: var(--secondary-color);
  font-weight: 500;
}

/* Improve player card accessibility */
.player-card.active {
  border: 3px solid var(--rose-gold);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px) scale(1.02);
}

.player-card.active::before {
  content: "👑";
  font-size: 1.5rem;
  animation: var(--sparkle-animation);
}

/* --- THE VIVELE MAINFRAME: MAP CONTAINER --- */
#map-container {
  width: 100%;
  min-height: 550px;
  
  /* Strong Base */
  background: #ffffff;
  padding: 1.5rem;
  margin: 0 auto 2rem;
  
  /* The 3D Pop-out Effect */
  border-radius: 30px;
  border: 8px solid #ffffff; 
  outline: 2px solid var(--vivele-mid);
  box-shadow: 
    0 25px 60px rgba(0,0,0,0.25),         /* Deep Depth */
    0 0 0 10px rgba(184, 105, 181, 0.2);  /* VIVELE Glow Ring */
    
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#map-container:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: 
    0 30px 70px rgba(0,0,0,0.3),
    0 0 0 12px rgba(184, 105, 181, 0.3);
}

#map-container::before {
  content: "🗺️";
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 4.1rem;
  z-index: 100;
  animation: var(--sparkle-animation);
  animation-delay: 3s;
  filter: drop-shadow(0 2px 4px rgba(183, 110, 121, 0.3));
  pointer-events: none;
}

/* Map interaction improvements */
#map .leaflet-container {
  cursor: crosshair;
  background-color: #f0f0f0;
}

/* THE GLASS COCKPIT: MAP TINT */
.leaflet-tile-pane { 
    filter: sepia(0.2) hue-rotate(320deg) contrast(0.95); 
}

#map .leaflet-container:active {
  cursor: grabbing;
}

/* Improve map marker visibility */
#map .leaflet-marker-icon {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  z-index: 1000 !important;
}

/* Map controls accessibility */
#map .leaflet-control {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--rose-gold);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-subtle);
}

#map .leaflet-control a {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rose-gold);
  font-size: 1.2rem;
}

#map .leaflet-control a:hover,
#map .leaflet-control a:focus-visible {
  background: var(--rose-gold);
  color: white;
  outline: 3px solid rgba(183, 110, 121, 0.3);
  outline-offset: 2px;
}

#fun-fact {
  background: linear-gradient(
    135deg,
    rgba(248, 249, 255, 0.95),
    rgba(255, 240, 248, 0.95)
  );
  border-left: 4px solid var(--secondary-color);
  border-radius: var(--border-radius-sm);
  padding: 2rem 2.5rem;
  margin-top: 1.5rem;
  font-style: italic;
  color: #444;
  box-shadow: var(--shadow-subtle);
  position: relative;
  backdrop-filter: blur(10px);
}

#fun-fact::before {
  content: "💡";
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 1.1rem;
  animation: var(--sparkle-animation);
  animation-delay: 2s;
}

#quiz {
  background: linear-gradient(
    135deg,
    rgba(255, 247, 230, 0.95),
    rgba(255, 238, 248, 0.95)
  );
  border-left: 4px solid var(--accent-color);
  border-radius: var(--border-radius-sm);
  padding: 2rem 2.5rem;
  margin-top: 1.5rem;
  color: #7b341e;
  font-weight: 500;
  box-shadow: var(--shadow-subtle);
  position: relative;
  backdrop-filter: blur(10px);
}

#quiz::before {
  content: "🎯";
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 1.1rem;
  animation: var(--sparkle-animation);
  animation-delay: 1s;
}

/* Quiz button styles consolidated in bulma-overrides.css */

#prompt {
  text-align: center;
  font-size: 1.15rem;
  color: var(--secondary-color);
  margin-top: 1.5rem;
  font-weight: 500;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, 
              rgba(255, 182, 193, 0.12), 
              rgba(221, 160, 221, 0.12));
  border-radius: var(--border-radius-sm);
  border: 2px solid rgba(255, 182, 193, 0.3);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  line-height: 1.6;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#prompt.error {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  color: #d63031;
}

#prompt.success {
  border-color: #55efc4;
  background: rgba(85, 239, 196, 0.1);
  color: #00b894;
}

#prompt.loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 10px;
  border: 2px solid var(--rose-gold);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.round-progress {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 1rem;
}

.round-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(183, 110, 121, 0.3);
  transition: all 0.3s ease;
}

.round-dot.active {
  background: var(--rose-gold);
  transform: scale(1.2);
}

.round-dot.completed {
  background: var(--success-color);
}

/* Loading states and feedback */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid var(--rose-gold);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Focus visible improvements for keyboard navigation */
*:focus-visible {
  outline: 3px solid rgba(183, 110, 121, 0.5);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Improve contrast for better readability */
h1, h2, h3 {
  color: var(--rose-gold-dark);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Better spacing for game info */
#game-info h2,
#game-info h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

#game-info h3 {
  font-size: 1.25rem;
}

/* Tablet and smaller desktop */
@media (max-width: 1024px) and (min-width: 769px) {
  #map {
    width: 96vw;
    max-width: 1000px;
    height: 65vh;
    min-height: 450px;
  }

  #map-container {
    min-height: 500px;
    padding: 0.75rem;
  }

  #game-controls {
    padding: 2rem 2.5rem;
    width: 96%;
  }
}

/* Mobile devices */
@media (max-width: 768px) {
  #player-info {
    /* Bulma columns handle responsive layout */
  }
  
  #player-info .column {
    padding: 0.5rem; /* Tighter spacing on mobile */
  }

  #game-controls {
    padding: 1.5rem;
    margin: 0.75rem auto;
    width: 98%;
    border-radius: var(--border-radius-md);
  }

  #game-controls h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }

  #map-container {
    min-height: 400px;
    border-radius: var(--border-radius-md);
    margin: 0.5rem auto;
    width: 98%;
    padding: 0.5rem;
  }

  #map {
    border-radius: var(--border-radius-sm);
    height: 60vh;
    min-height: 350px;
    width: 100%;
    margin: 0;
    border-width: 2px;
  }

  .control-group {
    margin-bottom: 1.5rem;
  }

  .control-group label {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }

  .control-group input[type="text"] {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    min-height: 48px;
  }

  .control-group button {
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    min-height: 48px;
  }

  .control-group input[type="range"] {
    height: 10px;
    margin: 1.25rem 0;
  }

  .control-group input[type="range"]::-webkit-slider-thumb {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }

  .control-group input[type="range"]::-moz-range-thumb {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }

  .player-card {
    padding: 1.5rem;
  }

  .info-panel,
  .status,
  .quiz,
  .fact,
  .address,
  .flag {
    padding: 1.25rem 1.5rem;
    margin: 0.75rem auto;
    max-width: 100%;
  }

  #prompt {
    font-size: 1rem;
    padding: 1rem;
    margin-top: 1rem;
  }

  body::before,
  body::after {
    display: none;
  }

  #map-container::before {
    font-size: 2.5rem;
    top: 10px;
    right: 15px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  #map {
    height: 55vh;
    min-height: 300px;
  }

  #map-container {
    min-height: 350px;
    padding: 0.5rem;
  }

  #game-controls {
    padding: 1.25rem;
  }

  #game-controls h1 {
    font-size: 1.5rem;
  }

  .control-group input[type="text"],
  .control-group button {
    font-size: 0.95rem;
  }

  .player-card {
    padding: 1.25rem;
  }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
  #map {
    height: 70vh;
    min-height: 400px;
  }

  #map-container {
    min-height: 450px;
  }

  #game-controls {
    padding: 1rem 1.5rem;
  }

  #game-controls h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  #map {
    border-width: 2.5px;
  }

  button,
  .btn,
  .control-group button {
    border-width: 2px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  #map {
    border-width: 4px;
    border-color: #000;
  }

  button,
  .btn {
    border-width: 2.5px;
  }

  .control-group input[type="text"],
  input,
  select {
    border-width: 2.5px;
  }
}
