/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Blue/Orange palette */
:root {
  --blue-2: #023047;
  --blue-1: #219EBC;
  --blue-0: #FFFFFF;
  --orange-1: #FB8500;
  --orange-0: #FFB703;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--blue-2);
    min-height: 100vh;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #8ecae6, #219ebc, #ffb703, #fb8500);
    background-size: 400% 400%;
    animation: animated-gradient-bg 18s ease-in-out infinite;
    /* Removed background-image and repeat for SVG */
    padding-bottom: 2rem;
}

@keyframes move-svg-horizontal {
  0% {
    background-position-x: 0, 0;
    background-position-y: 720px, 0;

  }
  100% {
    background-position-x: 720px, 0;
    background-position-y: 0, 0;

  }
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    background-image:
        var(--overlay-bg-url, url('../images/background1.svg')),
        linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.5));
    background-repeat: repeat, no-repeat;
    background-size: auto, cover;
    background-blend-mode: overlay;
    opacity: 0.15;
    filter: brightness(8) grayscale(1);
    animation: move-svg-horizontal 90s linear infinite;
}

/* Ensure main content is above the overlay */
body > * {
    position: relative;
    z-index: 1;
}

@keyframes animated-gradient-bg {
  0% { background-position: 0% 50%; }
  25% { background-position: 50% 100%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 0%; }
  100% { background-position: 0% 50%; }
}

/* Dark mode styles */
.dark body {
    color: var(--blue-2);
    background: #8ecae6;
}

/* Layout */
.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.dark .header {
    background: rgba(31, 41, 55, 0.9);
    border-bottom-color: #374151;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--blue-2) !important;
}

/* Ensure all header and logo links use the darkest green */
.header a, .header a:visited, .header a:hover, .header a:active, .header a:focus,
.logo-text, .logo a, .logo a:visited, .logo a:hover, .logo a:active, .logo a:focus {
  color: var(--blue-2) !important;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    padding: 0.5rem;
    border: none;
    background: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.dark .icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Cards and containers */
.card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(2, 48, 71, 0.08);
    padding: 2rem;
    margin-bottom: 3rem;
    transition: all 0.3s ease;
}

.dark .card {
    background: #fff;
    color: var(--blue-2);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 1rem;
    background: var(--orange-0);
    color: var(--blue-2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(93, 92, 222, 0.3);
    background: var(--orange-1);
}

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

.btn-primary {
    background: var(--orange-1);
    color: var(--blue-0);
}

.btn-primary:hover {
    background: var(--orange-0);
}

.btn-secondary {
    background: var(--blue-1);
    color: var(--blue-0);
}

.btn-secondary:hover {
    background: var(--blue-0);
    color: var(--blue-2);
}

.btn-success {
    background: var(--blue-1);
    color: var(--blue-0);
}

.btn-success:hover {
    background: var(--orange-0);
    color: var(--blue-2);
}

.btn-danger {
    background: #ef4444;
    color: var(--blue-0);
}

.btn-danger:hover {
    background: #dc2626;
}

/* Grid layouts */
.grid {
    display: grid;
    gap: 1rem;
}

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

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

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

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile-first: ensure single column on mobile for game mode cards */
@media (max-width: 767px) {
    .game-mode-card {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .game-mode-card {
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* Text styles */
.text-center {
    text-align: center;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.text-4xl {
    font-size: 2.25rem;
}

.text-8xl {
    font-size: 6rem;
}

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

.font-semibold {
    font-weight: 600;
}

/* Spacing */
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* Flex utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.space-x-3 > * + * {
    margin-left: 0.75rem;
}

.space-x-4 > * + * {
    margin-left: 1rem;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

/* Flag display */
.flag-emoji {
    font-size: 6rem;
    line-height: 1;
    user-select: none;
    margin: 1rem 0;
}

/* Unified flag image style for all game modes */
.flag-img {
  max-width: 200px;
  max-height: 135px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: none !important;
  border-radius: 5px !important;
  box-shadow: 0 4px 24px 0 rgba(2,48,71,0.18);
  display: block;
  margin: 0 !important;
  padding: 0 !important;
}

/* No rounded corners for Nepal flag */
.flag-img[alt="Nepal"], .flag-img.nepal-flag {
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

/* Remove or override old flag image classes */
.flag-guess-img, .flag-battle-img {
  all: unset;
  max-width: 156px;
  max-height: 104px;
  width: 100%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 2px 8px #0001;
  border-radius: 4px;
  object-fit: contain;
}

/* Game mode cards */
.game-mode-card {
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.dark .game-mode-card {
    background: #fff;
    color: var(--blue-2);
}

.game-mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.game-mode-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.game-mode-card p {
  color: #fb8500 !important;
}

/* Answer options */
.answer-option {
    background: #f3f4f6;
    border: 0px solid transparent;
    padding: 0.6rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-weight: 600;
    margin: 0;
}

.dark .answer-option {
    background: #374151;
    color: #f9fafb;
}

.answer-option:hover {
    background: #e5e7eb;
}

.dark .answer-option:hover {
    background: #4b5563;
}

.answer-option.correct {
    background: #10b981;
    color: white;
}

.answer-option.incorrect {
    background: #ef4444;
    color: white;
}

/* Answer options grid: 2 columns on mobile, 3 on md+ */
#answerContainer > .grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 768px) {
  #answerContainer > .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Form inputs */
.input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #d1d5db;
    border-radius: 0.75rem;
    background: var(--blue-0);
    transition: all 0.2s ease;
    color: var(--blue-2);
}

.dark .input {
    background: var(--blue-2);
    border-color: var(--blue-1);
    color: var(--blue-0);
}

.input:focus {
    outline: none;
    border-color: var(--orange-1);
    box-shadow: 0 0 0 3px rgba(251, 133, 0, 0.1);
}

/* Selection buttons */
.selection-btn {
    padding: 1rem;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 600;
    background: var(--blue-0);
    color: var(--blue-2);
}

.selection-btn.selected {
    border-color: var(--orange-1);
    background: var(--orange-0);
    color: var(--blue-2);
}

/* Difficulty buttons */
.difficulty-easy {
    background: var(--blue-0);
    color: var(--blue-2);
}

.dark .difficulty-easy {
    background: var(--blue-2);
    color: var(--blue-0);
}

.difficulty-medium {
    background: var(--blue-1);
    color: var(--blue-0);
}

.dark .difficulty-medium {
    background: var(--blue-2);
    color: var(--orange-0);
}

.difficulty-hard {
    background: var(--orange-0);
    color: var(--blue-2);
}

.dark .difficulty-hard {
    background: var(--orange-1);
    color: var(--blue-0);
}

/* Stats display */
.stat-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.dark .stat-card {
    background: #fff;
    color: var(--blue-2);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #5d5cde;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.dark .stat-label {
    color: #9ca3af;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    padding-top: 3.5rem;
    max-width: 28rem;
    width: 100%;
    margin: 1rem;
}

.dark .modal-content {
    background: #fff;
    color: var(--blue-2);
}

/* Toggle switch */
.switch {
  width: 3rem;
  height: 1.5rem;
  background: #FFB703 !important;
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
  display: inline-block;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #FFB703 !important;
  transition: .4s;
  border-radius: 99px;
}
.switch input:checked + .slider {
  background-color: #FFB703 !important;
}
.switch .slider:before {
  position: absolute;
  content: "";
  height: 1.25rem;
  width: 1.25rem;
  left: 0.125rem;
  top: 0.125rem;
  background-color: #fff;
  border-radius: 50%;
  transition: .4s;
}
.switch input:checked + .slider:before {
  transform: translateX(1.5rem);
}
.switch input:not(:checked) + .slider:before {
  transform: translateX(0);
}

/* Only apply orange background to the UN selection switch in the modal */
#unOnlyToggleModal + .slider,
#unOnlyToggleModal:checked + .slider,
#unOnlyToggleModal:focus + .slider {
  background-color: #FFB703 !important;
}
#unOnlyToggleModal:checked + .slider:before,
#unOnlyToggleModal + .slider:before {
  background-color: #fff;
}
/* Restore default for other switches */
.switch {
  background: #eee;
}
.switch .slider {
  background-color: #eee;
}
.switch input:checked + .slider {
  background-color: #FFB703;
}

/* Continent switches: gray when off, orange when on */
.switch input:not(#unOnlyToggleModal):not(:checked) + .slider {
  background-color: #eee !important;
}
.switch input:not(#unOnlyToggleModal):checked + .slider {
  background-color: #FFB703 !important;
}

/* Utility classes */
.hidden {
    display: none;
}

.text-primary {
    color: var(--orange-1);
}

.text-success {
    color: var(--orange-0);
}

.text-danger {
    color: #ef4444;
}

.text-gray {
    color: var(--blue-2);
    opacity: 0.7;
}

.dark .text-gray {
    color: var(--blue-0);
    opacity: 0.7;
}

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

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

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

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-bounce-in {
    animation: bounceIn 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-8xl {
        font-size: 4rem;
    }
    
    .flag-emoji {
        font-size: 4rem;
    }
} 
/* Force all links to use the darkest blue and no underline */
a, a:visited, a:hover, a:active, a:focus,
h1, h2, h3, h4, h5, h6, .logo-text, .header a, .header a:visited, .header a:hover, .header a:active, .header a:focus,
.logo a, .logo a:visited, .logo a:hover, .logo a:active, .logo a:focus {
  color: var(--blue-2) !important;
  text-decoration: none !important;
} 

/* Next button styling */
#nextQuestion, .btn-next {
  background: #FFB703 !important;
  color: #fff !important;
  border: none;
}
#nextQuestion:hover, .btn-next:hover {
  background: #FB8500 !important;
  color: #fff !important;
}

/* Score/Streak box styling */
.score-box, .score-display {
  background: #FFEDC0 !important;
  color: #FB8500 !important;
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-block;
} 

.streak-display {
  background: #fac0ff !important;
  color: #e935fa !important;
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-block;
} 

#timerDisplay, #livesDisplay {
  padding: 0.25rem 0.5rem !important;
  border-radius: 0.5rem;
  font-size: 0.95rem;
}
.icon-btn {
  font-size: 1.3rem !important;
  padding: 0.2rem 0.4rem !important;
  min-width: unset;
  min-height: unset;
}
#playAgain {
  background: #FFB703 !important;
  color: #fff !important;
}
#playAgain:hover {
  background: #FB8500 !important;
  color: #fff !important;
}

#backToMenu {
  background: #219EBC !important;
  color: #fff !important;
}
#backToMenu:hover {
  background: #126782 !important;
  color: #fff !important;
} 

/* --- Responsive stacking for population comparison modes --- */
@media (max-width: 768px) {
  /* Stack the flag choices vertically in population-higher, population-higher-flags, and population-highest-3 */
  .card .flex.justify-center.items-center {
    flex-direction: column !important;
    gap: 1.25rem !important;
  }
  .card .flex.justify-center.items-center > span[style*="font-size:2rem"] {
    display: none !important;
  }
} 

/* Center flag buttons and content in population comparison modes */
.highest3-choice, .higher-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: none;
  box-shadow: none;
  margin: 0 auto 1rem auto;
  padding: 0.5rem 0 0.5rem 0;
}
.highest3-choice .flag-img, .higher-choice .flag-img {
  margin-left: auto !important;
  margin-right: auto !important;
  display: block;
}
.highest3-choice span.text-xl, .higher-choice span.text-xl {
  display: block;
  text-align: center;
  width: 100%;
  margin-top: 0.5rem;
}
@media (max-width: 768px) {
  .highest3-choice, .higher-choice {
    margin-bottom: 1.25rem;
  }
} 

/* Ensure survival mode hearts are always visible and styled */
#livesDisplay .fa-heart {
  color: #ef4444 !important;
  font-size: 1rem !important;
  filter: none !important;
}
#livesDisplay .fa-heart-crack {
  color: #aaa !important;
  font-size: 1rem !important;
  filter: none !important;
}

/* Make the quit/close X icon always visible and styled */
.icon-btn .fa-circle-xmark {
  color: #023047 !important;
  font-size: 2rem !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Also style the settings gear for consistency */
#openSettings .fa-gear {
  color: #023047 !important;
  font-size: 2rem !important;
} 

/* Force FontAwesome icons to always display and be visible */
.fa, .fa-solid, .fa-regular {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: inherit;
}

/* Ensure #livesDisplay is always visible and not overlapped */
#livesDisplay {
  display: inline-block !important;
  z-index: 10 !important;
  position: relative;
} 

.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  border-radius: 1rem;
  margin: 2rem 0 1.5rem 0;
  padding: 0.75rem 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.08);
  letter-spacing: 0.05em;
}
.flags-header {
  background: #023047;
  color: #fff;
}
.population-header {
  background: #FB8500;
  color: #fff;
} 

.section-container {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 4px 16px rgba(2,48,71,0.08);
  margin-bottom: 2.5rem;
  padding: 0 0 1.5rem 0;
  overflow: hidden;
}
.section-container > .grid {
  margin-left: 1rem;
  margin-right: 1rem;
}
.flags-section .section-title {
  background: #023047;
  color: #fff;
  font-size: 1.25rem;
  font-weight: bold;
  padding: 1rem 2rem;
  border-top-left-radius: 1.25rem;
  border-top-right-radius: 1.25rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
  text-align: center;
}
.population-section .section-title {
  background: #FB8500;
  color: #fff;
  font-size: 1.25rem;
  font-weight: bold;
  padding: 1rem 2rem;
  border-top-left-radius: 1.25rem;
  border-top-right-radius: 1.25rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
  text-align: center;
} 

.game-logo-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem 0 1rem 0;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 0.03em;
  z-index: 100;
}
.game-logo-icon {
  font-size: 2.2rem;
  margin-right: 0.5rem;
}
.game-logo-text {
  font-size: 1.5rem;
  color: #023047;
  font-weight: bold;
}
.game-logo-img {
  height: 3rem;
  vertical-align: middle;
  margin-left: 1.5rem;
}
.mt-game-card {
  margin-top: 1.5rem !important;
} 
.mt-game-results {
  margin-top: 1.5rem !important;
} 
.game-results-card {
  margin-left: auto;
  margin-right: auto;
  max-width: 480px;
  text-align: center;
} 
.fa-fallback {
  font-size: 4rem !important;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  text-align: center;
} 
.size-section .section-title {
  background: #2B6450;
  color: #fff;
  font-size: 1.25rem;
  font-weight: bold;
  padding: 1rem 2rem;
  border-top-left-radius: 1.25rem;
  border-top-right-radius: 1.25rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
  text-align: center;
} 
#endGameBtn {
  background: #FFB703 !important;
  color: #fff !important;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  margin-top: 0.5rem;
  transition: background 0.2s;
}
#endGameBtn:hover {
  background: #FB8500 !important;
  color: #fff !important;
} 

.homepage-logo-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  min-height: 2.2rem;
}
.homepage-logo {
  width: 434px;
  max-width: 100%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.homepage-gear-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 2rem;
  color: #023047;
  cursor: pointer;
  height: 2.2rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .homepage-logo {
    width: 80vw;
    max-width: calc(80vw - 3rem);
  }
  .homepage-gear-btn {
    padding-right: 0.5rem !important;
  }
} 

/* Game mode descriptions match icon color using href selectors */
a[href*="multiple-choice"] p,
a[href*="type-country"] p,
a[href*="time-attack"] p,
a[href*="survival"] p {
  color: #219EBC !important;
}
a[href*="population-mc"] p,
a[href*="population-higher"] p,
a[href*="population-higher-flags"] p,
a[href*="population-highest-3"] p {
  color: #FB8500 !important;
}
a[href*="size-mc"] p,
a[href*="size-higher"] p,
a[href*="size-higher-flags"] p,
a[href*="size-highest-3"] p {
  color: #608B7C !important;
} 

.game-mode-card:hover .game-mode-icon i {
  animation: fa-beat 1s infinite linear;
}

/* Animate images inside game-mode-icon similarly */
.game-mode-card:hover .game-mode-icon img {
  animation: icon-beat 1.1s infinite ease-in-out;
  will-change: transform;
}

@keyframes icon-beat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.08) rotate(-2deg); }
  50% { transform: scale(0.98) rotate(1deg); }
  75% { transform: scale(1.05) rotate(-1deg); }
}

@keyframes fa-beat {
  0%, 100% { transform: scale(1); }
  10% { transform: scale(1.1); }
  20% { transform: scale(0.95); }
  30% { transform: scale(1.05); }
  40% { transform: scale(0.97); }
  50% { transform: scale(1.03); }
  60% { transform: scale(0.99); }
  70% { transform: scale(1.01); }
  80% { transform: scale(1); }
  90% { transform: scale(1); }
} 
.icon-btn .fa-xmark, .homepage-gear-btn .fa-xmark {
  font-size: 2.2rem !important;
  color: #c50808 !important;
}
.icon-btn:hover .fa-xmark, .homepage-gear-btn:hover .fa-xmark {
  animation: fa-beat 1s infinite linear;
}
@keyframes fa-beat-fade {
  0%, 100% { transform: scale(1); opacity: 1; }
  10% { transform: scale(1.15); opacity: 0.8; }
  20% { transform: scale(0.95); opacity: 0.7; }
  30% { transform: scale(1.1); opacity: 0.9; }
  40% { transform: scale(0.97); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  60% { transform: scale(0.99); opacity: 0.9; }
  70% { transform: scale(1.01); opacity: 0.8; }
  80% { transform: scale(1); opacity: 1; }
  90% { transform: scale(1); opacity: 1; }
} 

@media (max-width: 600px) {
  #livesDisplay .fa-heart,
  #livesDisplay .fa-heart-crack {
    font-size: 1.1rem !important;
  }
  .score-box, .score-display, .streak-display {
    padding: 0.55rem 0.3rem !important;
    font-size: 0.7rem !important;
  }
  .icon-btn {
    font-size: 1rem !important;
    padding: 0.1rem 0.2rem !important;
  }
  .icon-btn .fa-xmark, .icon-btn .fa-circle-xmark {
    font-size: 1.2rem !important;
  }
} 

.autocomplete-dropdown {
  box-shadow: 0 4px 16px rgba(2,48,71,0.08);
  border-radius: 0 0 0.5rem 0.5rem;
  font-size: 1rem;
  margin-top: 2px;
  background: #fff;
  max-width: 100%;
}
.autocomplete-item {
  transition: background 0.15s;
}
.autocomplete-item:hover, .autocomplete-item.active {
  background: #f3f4f6;
}
@media (max-width: 600px) {
  .autocomplete-dropdown {
    font-size: 0.95rem;
    max-height: 120px;
  }
  .autocomplete-item {
    padding: 0.3rem 0.5rem !important;
  }
} 

.autocomplete-wrapper {
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#countryInput {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  display: block;
}
.autocomplete-dropdown {
  max-width: 400px;
  width: 100%;
  left: 0;
  right: 0;
}
@media (max-width: 600px) {
  .autocomplete-wrapper, #countryInput, .autocomplete-dropdown {
    max-width: 100%;
  }
} 
.flag-img.extreme-hidden {
  pointer-events: none;
} 

@media (max-width: 600px) {
  .modal-content {
    max-width: 98vw !important;
    padding: 1.5rem 1.5rem !important;
  }
  .modal-content h2 {
    font-size: 1.2rem !important;
    margin-bottom: 0.75rem !important;
  }
  .modal-content .flex {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.2rem !important;
    margin-bottom: 0.5rem !important;
  }
  #labelLeftModal, #labelRightModal {
    display: block;
    text-align: center;
    margin-bottom: 0.1rem;
    margin-top: 0.1rem;
  }
   .modal-content form > div {
    gap: 0.5rem !important;
  }
  .modal-content label {
    padding: 0.2rem 0 !important;
  }  
  .modal-content .flex {
    margin-top: 1.7rem !important;
  }
  .modal-content form > div {
    margin-bottom: 0.7rem !important;
  }
  #continentForm > div {
    margin-bottom: 1.7rem !important;
  }
} 
#showFlagBtn .fa-eye,
#showFlagBtn .fa-eye-slash {
  font-size: 2.5rem !important;
  line-height: 1;
} 

/* Capitals Section Color */
.capitals-section{
  margin-top:2rem;
}
/* override capitals title to full-width banner */
.capitals-section .section-title{
  background:#2563eb;
  color:#fff;
  font-size:1.25rem;
  font-weight:bold;
  padding:1rem 2rem;
  border-top-left-radius:1.25rem;
  border-top-right-radius:1.25rem;
  margin-bottom:1.25rem;
  letter-spacing:0.05em;
  text-align:center;
}
.capitals-section .game-mode-icon i{ color:#2563eb !important; } 

/* Capitals card description text */
.capitals-section .game-mode-card p{
  color:#2563eb !important;
} 

/* Map section */
.maps-section .section-title{background:#9333ea;color:#fff;font-size:1.25rem;font-weight:bold;padding:1rem 2rem;border-top-left-radius:1.25rem;border-top-right-radius:1.25rem;margin-bottom:1.25rem;letter-spacing:0.05em;text-align:center}
.maps-section .game-mode-icon i{color:#9333ea !important;}
.maps-section .game-mode-card p{color:#9333ea !important;} 