@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;800&display=swap');

/* Reset default margins and paddings */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  color: #333;
  display: flex;
  flex-direction: column; /* make children stack vertically */
  align-items: center;    /* center horizontally */
  justify-content: flex-start; /* stack from the top downward */
  height: auto;
  min-height: 100vh;
  background-image: url("background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin: 0 !important;
  padding: 0 !important;
  overflow-y: auto;
}

.container {
  text-align: center;
  max-width: 500px;
  margin: 20px auto !important; /* Force centering with auto margins */
  padding: 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  height: auto; /* Ensure container height adjusts to content */
}

header h1 {
  font-size: 2.5em;
  color: #2c3e50;
  margin-bottom: 10px;
}

header p {
  font-size: 1.2em;
  color: #555;
}

#startGameButton {
  background-color: #108abb;
  color: #fff;
  padding: 12px 20px;
  font-size: 1.1em;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin: 20px auto; /* Center with auto margins */
  display: block; /* Ensure it's a block element for centering */
}

#startGameButton:hover {
  background-color: #1ec55e;
  transform: scale(1.05);
}

footer {
  margin-top: 20px;
}

#crossesContainer {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.cross {
  font-size: 2em;
  color: #ccc;
  transition: color 0.3s ease;
  font-weight: bold;
}

.cross.filled {
  color: #ff6347;
}

#gameArea {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#counter {
  font-size: 1.2em;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 20px;
}

.clue-box {
  background-color: #ff6347;
  color: white;
  font-size: 1em;
  padding: 15px;
  margin: 10px 0;
  text-align: center;
  cursor: pointer;
  width: 100%;
  max-width: 300px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.clue-box:hover {
  background-color: #d94d3f;
  transform: scale(1.02);
}

.input-container {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 300px; /* Maintain max width */
  margin-top: 20px;
}
#guessInput {
  flex-grow: 0; /* Prevent it from taking all available space */
  width: 180px; /* Reduce width to shorten the input box */
  padding: 10px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 12px;
  outline: none;
  background: white;
  transition: border-color 0.3s ease;
}

#guessInput:focus {
  border-color: #1ec55e;
  outline: none;
  /* Adds a soft green glow ring outside the border */
  box-shadow: 0 0 0 4px rgba(30, 197, 94, 0.2); 
}

#submitBox {
  width: 50px; /* Ensure square */
  height: 50px; /* Ensure square */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1ec55e;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  margin-left: 10px;
  background: none;
}

#submitBox::before {
  content: "✔";
  color: #1ec55e;
  font-size: 1.5em;
  font-weight: bold;
}

#submitBox:hover {
  background-color: #1ec55e;
}

#submitBox:hover::before {
  color: white;
}


/* Image container and wrapper styles */
#imageContainer {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.image-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px; /* Space between location and flag images */
  width: 100%;
  max-width: 600px; /* Limit total width */
}

.image-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 150px; /* Minimum width for each box */
}


/* Styles for location and flag images to maintain aspect ratio */
.location-img, .flag-img {
  width: 100%;
  max-width: 250px; /* Maximum width for each image */
  height: auto; /* Maintain aspect ratio */
  max-height: 200px; /* Limit height while preserving ratio */
  object-fit: contain; /* Ensure no stretching or distortion */
  border: 2px solid #108abb;
  border-radius: 12px;
}

/* Responsive design for smaller screens */
@media (max-width: 600px) {
  .container {
    padding: 15px;
  }

  header h1 {
    font-size: 2em;
  }

  header p {
    font-size: 1em;
  }

  button {
    padding: 10px 16px;
    font-size: 0.9em;
  }

  .image-wrapper {
    flex-direction: column; /* Stack images vertically on small screens */
    gap: 15px;
  }

  .location-img, .flag-img {
    max-width: 200px; /* Smaller max width on mobile */
    max-height: 150px;
  }
}

/* Popup styles */
#notInDatabasePopup {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

#notInDatabasePopup p {
  font-size: 1.5em;
  margin-bottom: 20px;
  color: #ff6347;
}

#notInDatabasePopup button {
  background-color: #108abb;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

#notInDatabasePopup button:hover {
  background-color: #1ec55e;
}

#countryListPopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  max-width: 80%;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 1001;
}

#countryList {
  columns: 3;
  column-gap: 20px;
}

.country-item {
  padding: 5px;
  cursor: pointer;
}

.country-item:hover {
  background-color: #f0f0f0;
}

#closeCountryList {
  margin-top: 15px;
  padding: 8px 15px;
  background: #108abb;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

#closeCountryList:hover {
  background: #0d6e8f;
}

#rulesBox {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 15px;
  margin: 20px 0;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

#rulesBox h3 {
  color: #2c3e50;
  margin-bottom: 10px;
  text-align: center;
}

#rulesBox ul {
  padding-left: 20px;
  text-align: left;
}

#rulesBox li {
  margin-bottom: 8px;
  color: #333;
  line-height: 1.4;
}

#attemptsContainer {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.attempt-coin {
  width: 32px;
  height: 32px;
  opacity: 1; /* Full opacity by default */
  transition: all 0.3s ease;
  filter: grayscale(0%); /* Full color by default */
}

.attempt-coin.used {
  opacity: 0.6; /* Reduced opacity when used */
  filter: grayscale(100%); /* Grey out on incorrect guess */
  transform: scale(0.9); /* Slight shrink effect for visual feedback */
}

#feedbackButton {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background-color: #ff6347;
  color: #fff;
  padding: 10px 15px;
  font-size: 1em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  z-index: 1000;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#feedbackButton:hover {
  background-color: #d94d3f; /* Darker orange on hover */
  transform: scale(1.05);
}

#feedbackPopup {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

#feedbackPopup h3 {
  color: #2c3e50;
  margin-bottom: 15px;
}

#feedbackPopup label {
  display: block;
  margin-bottom: 5px;
  text-align: left;
  color: #333;
}

#feedbackPopup select,
#feedbackPopup textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 12px;
  box-sizing: border-box;
}

#feedbackPopup textarea {
  height: 100px;
  resize: vertical;
}

#feedbackPopup button {
  background-color: #108abb;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

#feedbackPopup button:hover {
  background-color: #1ec55e;
}

/* Score Display Styling */
#scoreDisplay {
  background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white background */
  border: 1px solid #dee2e6; /* Light gray border for subtle contrast */
  border-radius: 12px; /* Rounded corners consistent with other UI elements */
  padding: 10px 15px; /* Comfortable padding for content */
  margin: 10px auto; /* Center and space from other elements */
  font-size: 1.1em; /* Slightly larger text for readability */
  font-weight: 600; /* Semi-bold for emphasis without being overly heavy */
  color: #2c3e50; /* Dark color matching other text elements */
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  display: inline-block; /* Keep it compact and centered */
  min-width: 200px; /* Ensure it doesn't collapse too much */
  text-align: center; /* Center the text */
  transition: all 0.3s ease; /* Smooth transition for any hover effects if added */
}

/* Optional: Highlight current score and top score with different colors */
#scoreDisplay span.current {
  color: #108abb; /* Blue to highlight current score */
  font-weight: 700; /* Bolder for emphasis */
}

#scoreDisplay span.top {
  color: #1ec55e; /* Green to highlight top score */
  font-weight: 700; /* Bolder for emphasis */
}

#giveUpBox {
  width: 50px; /* Ensure square */
  height: 50px; /* Ensure square */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ff6347;
  border-radius: 12px;
  cursor: pointer;
  background-image: url('giveup.png');
  background-size: cover;
  background-position: center;
  transition: transform 0.2s ease;
  margin-left: 10px;
}

#giveUpBox:hover {
  transform: scale(1.05);
}

@media (max-width: 600px) {
  #feedbackButton {
    position: relative; /* Change from fixed to relative */
    left: auto; /* Reset left positioning */
    bottom: auto; /* Reset bottom positioning */
    margin: 20px auto; /* Center it under the game box */
    padding: 8px 12px; /* Reduce padding to make button smaller */
    font-size: 0.9em; /* Slightly smaller text */
    display: block; /* Ensure it’s block for centering */
  }
  
  /* Preserve hover effect on mobile if supported */
  #feedbackButton:hover {
    background-color: #d94d3f;
    transform: scale(1.05);
  }
}

@media (max-width: 600px) {
  body {
    height: auto; /* Allow body to expand beyond viewport height */
    min-height: 100vh; /* Ensure it starts at full height but can grow */
    display: block; /* Change from flex to block to avoid centering constraints */
    overflow-y: auto; /* Explicitly allow vertical scrolling */
  }

  .container {
    margin-top: 20px; /* Add some top margin for breathing room */
    margin-bottom: 80px; /* Add bottom margin to ensure content above feedback button */
    min-height: calc(100vh - 100px); /* Ensure container takes up most of viewport initially */
    height: auto; /* Allow height to expand with content */
  }

  #gameArea {
    overflow-y: auto; /* Ensure game area can scroll if content overflows */
    height: auto; /* Allow natural height based on content */
  }
}

@media (max-width: 600px) {
  #timer {
    position: sticky; /* Stick to top of parent container while scrolling */
    top: 0;
    background-color: rgba(248, 249, 250, 0.9); /* Add background for visibility */
    padding: 5px;
    z-index: 10; /* Ensure it’s above other content */
  }
}

#leaderboardButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #108abb;
  color: #fff;
  padding: 10px 15px;
  font-size: 1em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  z-index: 1000;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#leaderboardButton:hover {
  background-color: #0d6e8f;
  transform: scale(1.05);
}

#leaderboardPopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 600px; /* Slightly wider for readability with more entries */
  width: 90%;
  max-height: 80vh; /* Increased from 70vh to accommodate more entries */
  overflow-y: auto; /* Ensure scrolling for long list */
  z-index: 1001;
}

#leaderboardList {
  margin: 15px 0;
  text-align: left;
  max-height: 60vh; /* Limit height of list content for scrolling */
  overflow-y: auto; /* Scroll if more than 60vh of content */
}

/* Optional: Style scrollbar for better UX */
#leaderboardList::-webkit-scrollbar {
  width: 8px;
}

#leaderboardList::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 12px;
}

#leaderboardList::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 12px;
}

#leaderboardList::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.leaderboard-item {
  padding: 8px; /* Slightly reduced padding to fit more items */
  border-bottom: 1px solid #eee;
  font-size: 1em; /* Slightly smaller font to fit more items visibly */
  display: flex;
  justify-content: space-between;
}

#closeLeaderboard {
  margin-top: 15px;
  padding: 8px 15px;
  background: #108abb;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

#closeLeaderboard:hover {
  background: #0d6e8f;
}

@media (max-width: 600px) {
  #leaderboardButton {
    position: relative;
    right: auto;
    bottom: auto;
    margin: 20px auto;
    display: block;
  }
}

/* Privacy Policy Link Styling */
.privacy-link {
  position: fixed;
  bottom: 20px; /* Place at the bottom of the viewport */
  left: 50%; /* Center horizontally */
  transform: translateX(-50%); /* Adjust for true centering */
  font-size: 0.9em;
  z-index: 1000; /* Ensure it's above other content if needed */
  text-align: center;
}

.privacy-link a {
  color: #161616; /* Grey color for the link */
  text-decoration: none; /* No underline by default */
  transition: color 0.3s ease;
}

.privacy-link a:hover {
  color: #000000; /* Slightly darker grey on hover */
  text-decoration: underline; /* Underline on hover for better UX */
}

@media (max-width: 600px) {
  .privacy-link {
    bottom: 70px; /* Higher on mobile to avoid overlap with other fixed elements */
  }
}

.bottom-nav {
  margin: 30px auto 20px auto; /* Add spacing above and below */
  font-size: 0.9em;
  text-align: center;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Wrap neatly on smaller screens */
}

.bottom-nav a {
  color: #161616; /* Grey color for the links */
  text-decoration: none; /* No underline by default */
  transition: color 0.3s ease;
}

.bottom-nav a:hover {
  color: #000000; /* Slightly darker grey on hover */
  text-decoration: underline; /* Underline on hover for better UX */
}

@media (max-width: 600px) {
  body {
    height: auto; /* Already set, reinforcing */
    min-height: 100vh;
    display: block; /* Keep as block for mobile to avoid flex issues */
    overflow-y: auto;
  }
  .container {
    margin-top: 20px;
    margin-bottom: 100px !important; /* Extra space for bottom nav on mobile */
    padding: 15px;
  }
  .bottom-nav {
    flex-wrap: wrap; /* Allow wrapping if links don't fit */
    gap: 10px; /* Reduce spacing on mobile */
    margin: 20px auto; /* ✅ replace bottom:70px with margin for spacing */
  }
}

/* NEWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW */

.clue-box {
  background-color: #ff6347;
  color: white;
  font-size: 1em;
  padding: 15px;
  margin: 10px 0;
  text-align: center;
  cursor: pointer;
  width: 300px;             /* 🔹 FIXED WIDTH */
  max-width: 300px;         /* Ensure it doesn’t grow more */
  min-height: 80px;         /* Keep vertical consistency */
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 400px) {
  .clue-box {
    width: 90%;   /* scale down for small devices */
    max-width: none;
  }
}

.clue-box.fade-out {
  opacity: 0;
}

.clue-box.fade-in {
  opacity: 1;
}

/* Styling for revealed years */
.year-display {
  font-size: 1.3em;
  font-weight: bold;
  color: #2c3e50;
}

.clue-text {
  display: inline-block;
  transition: opacity 0.6s ease;
}

.fade-out {
  opacity: 0;
}

.fade-in {
  opacity: 1;
}

.attempt-coin {
  width: 32px;
  height: 32px;
  opacity: 1; 
  transition: all 0.5s ease;
  filter: grayscale(0%); /* Full color by default */
}

/* When life is lost - flash red */
.attempt-coin.lost {
  filter: grayscale(0%) sepia(100%) hue-rotate(-50deg) brightness(90%);
  transform: scale(1.2);
}

/* Permanently dead/grey */
.attempt-coin.used {
  opacity: 0.6; 
  filter: grayscale(100%);
  transform: scale(1);
}

/* Correct answer styling */

.clue-box .clue-text.correct-answer {
  font-weight: 900; /* 🔹 Increased to max thickness */
  color: limegreen;
  -webkit-text-stroke: 1px black;
  font-size: 1.4em;
}

.clue-box .clue-text.incorrect-answer {
  font-weight: 900; /* 🔹 Increased to max thickness */
  color: red;
  -webkit-text-stroke: 1px black;
  font-size: 1.4em;
}

#timer {
  font-size: 1.3em;
  font-weight: bold;
  color: #2c3e50;
  margin-top: 10px;
}

body.history-game {
  background-image: url('historybackground.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

/* HOME PAGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE */
/* HOME PAGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE */
/* HOME PAGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE */
.homepage-center-wrapper {
  flex: 1; /* take up all vertical space available before bottom-nav */
  display: flex;
  justify-content: center; /* vertical centering */
  align-items: center;     /* horizontal centering */
}

/* Body no longer centers everything, just arranges column layout */
.homepage-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column; /* so nav sits at bottom naturally */
  background: url('mainbackground.png') no-repeat center center fixed;
  background-size: cover;
  font-family: Arial, sans-serif;
}

.homepage-button-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 300px;
  align-items: center;
}

.homepage-btn {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background-color: #108abb; /* consistent with site branding */
  color: white;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.homepage-btn:hover {
  background-color: #0d6e8f;
  transform: scale(1.03);
}

.homepage-disabled-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.homepage-btn-disabled {
  background-color: #888 !important;
  cursor: not-allowed;
  transform: none !important;
}

.homepage-dev-note {
  position: absolute;
  bottom: 5px;
  right: 10px;
  font-size: 10px;
  color: #fff;
  opacity: 0.85;
  pointer-events: none;
  font-style: italic;
}

/* Responsive scaling */
@media (max-width: 600px) {
  .homepage-button-container {
    width: 90%;
  }

  .homepage-btn {
    font-size: 14px;
    padding: 12px;
  }
}

/* Morning Games header image above buttons */
.morning-games-img {
  display: block;
  margin: 0 auto 20px auto; /* center image, add spacing below */
  max-width: 100%;          /* responsive scaling */
  height: auto;             /* keep original ratio */
  width: auto;
  
  /* Ensure it doesn’t exceed button container width */
  max-width: 300px; /* adjust to match ~button width group */
}

#historyLeaderboardButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  /* Keep your orange accent color */
  background-color: #ff6347; /* Tomato */
  color: #fff;
  padding: 10px 15px;
  font-size: 1em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  z-index: 1000;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#historyLeaderboardButton:hover {
  background-color: #e55337; /* Slightly darker tomato */
  transform: scale(1.05);
}

/* Popup styling (same as Country leaderboard for consistency) */
#leaderboardPopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1001;
}

/* Scrollable list container */
#leaderboardList {
  margin: 15px 0;
  text-align: left;
  max-height: 60vh;
  overflow-y: auto;
}

/* Custom scrollbar for better UX */
#leaderboardList::-webkit-scrollbar {
  width: 8px;
}
#leaderboardList::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 12px;
}
#leaderboardList::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 12px;
}
#leaderboardList::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Individual leaderboard items */
.leaderboard-item {
  padding: 8px;
  border-bottom: 1px solid #eee;
  font-size: 1em;
  display: flex;
  justify-content: space-between;
}

/* Optional: visually highlight the current user’s score */
.current-user-score {
  background-color: #fff3cd; /* light yellow highlight */
  border-left: 4px solid #ff6347; /* match brand color */
  border-radius: 12px;
}

/* Close button styling */
#closeLeaderboard {
  margin-top: 15px;
  padding: 8px 15px;
  background-color: #ff6347; /* match main accent */
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}
#closeLeaderboard:hover {
  background-color: #e55337;
}

/* Responsive for smaller screens */
@media (max-width: 600px) {
  #historyLeaderboardButton {
    position: relative;
    right: auto;
    bottom: auto;
    margin: 20px auto;
    display: block;
  }
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  display: none;
}

/* The Menu Box - Compact & Responsive */
.overlay-content {
  background-color: white;
  padding: 20px; /* Reduced from 30px */
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  text-align: center;
  
  /* Key changes for size: */
  max-width: 320px; /* Much narrower (was 500px) */
  width: 85%; /* Fits within mobile screens with margins */
  
  animation: popIn 0.3s ease-out;
}

/* Typography - Scaled down for the smaller box */
.overlay-content h2 {
  margin-top: 0;
  color: #2c3e50;
  font-size: 1.5rem; /* Reduced from 2rem */
  margin-bottom: 8px;
}

.overlay-content p {
  color: #555;
  font-size: 0.95rem; /* Reduced from 1.1rem */
  margin-bottom: 20px;
  line-height: 1.4;
}

.overlay-content #finalScoreDisplay {
  font-weight: bold;
  color: #2c3e50;
  font-size: 1.2em;
}

/* Button Container */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px; /* Slightly tighter gap */
}

/* Buttons - Compact padding */
.action-btn {
  padding: 10px 15px; /* Reduced padding */
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: white;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

/* 🟢 Start / Play Again Button (Green) */
#startGameBtn, #playAgainBtn {
  background-color: #27ae60;
}

#startGameBtn:hover, #playAgainBtn:hover {
  background-color: #219150;
  transform: scale(1.05);
}

/* 🔴 Back to Home Button (Red) */
.homeBtn {
  background-color: #e74c3c;
}

.homeBtn:hover {
  background-color: #c0392b;
  transform: scale(1.05);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================= */
/* ✨ ANIMATED FEEDBACK (Floating Text)      */
/* ========================================= */

/* The container for the floating text needs to be relative 
   so the absolute text centers correctly inside it. 
   Make sure your #gameArea has this: */
#gameArea {
  position: relative; 
}

/* The floating element base style */
.floating-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem; /* Big text */
  font-weight: 800;
  z-index: 100; /* On top of game cards */
  pointer-events: none; /* Let clicks pass through */
  text-shadow: 2px 2px 8px rgba(0,0,0,0.3); /* improved readability */
  white-space: nowrap;
  animation: jumpAndFade 1.5s ease-out forwards;
}

/* ✅ Success Style (Green Points) */
.feedback-success {
  color: #27ae60;
  font-family: 'Arial Black', sans-serif;
  -webkit-text-stroke: 1px white; /* Optional: white outline */
}

/* ❌ Error Style (Red X) */
.feedback-error {
  color: #e74c3c;
  font-size: 4rem; /* Make the X even bigger */
}

/* The Animation: Pop up large, then float up and fade out */
@keyframes jumpAndFade {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5); /* Start small */
  }
  40% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.4); /* Pop big! */
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -150%) scale(1); /* Float up and vanish */
  }
}

/* Styling for the Leaderboard button inside the Game Over menu */
#gameOverLeaderboardBtn {
  background-color: #ff6347; /* Tomato (Same as floating button) */
  color: white;
}

#gameOverLeaderboardBtn:hover {
  background-color: #e55337;
  transform: scale(1.05);
}

/* ========================================= */
/* SHARED GAME STYLES (History & Country)    */
/* ========================================= */

/* Ensure floating animations position correctly relative to the game area */
#gameArea {
  position: relative;
}

/* 🆕 OVERLAY STYLES (Matches History Game) */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  background-color: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 350px; /* Slightly wider for Country Rules */
  width: 90%;
  max-height: 90vh; /* Allow scrolling if rules are long */
  overflow-y: auto;
  animation: popIn 0.3s ease-out;
}

/* Button Group Styling */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.action-btn {
  padding: 10px 15px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: white;
  background-color: #27ae60; /* Green Start/Play Again */
  transition: transform 0.2s;
}
.action-btn:hover { transform: scale(1.05); }

.homeBtn { background-color: #e74c3c; } /* Red */
#gameOverLeaderboardBtn { background-color: #ff6347; } /* Tomato */

/* ✨ ANIMATED FEEDBACK (Floating Text) */
.floating-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  font-weight: 800;
  z-index: 100;
  pointer-events: none;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
  white-space: nowrap;
  animation: jumpAndFade 1.5s ease-out forwards;
}

.feedback-success { color: #27ae60; -webkit-text-stroke: 1px white; }
.feedback-error { color: #e74c3c; font-size: 4rem; }

@keyframes jumpAndFade {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  40% { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(1); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.container, 
#scoreDisplay, 
#leaderboardPopup, 
.overlay-content {
  /* Keep your existing background-color */
  background-color: rgba(255, 255, 255, 0.85); /* Slightly more transparent to show the blur */
  backdrop-filter: blur(12px); /* THIS is the magic line */
  -webkit-backdrop-filter: blur(12px); /* For Safari support */
}

button:active, 
#submitBox:active, 
.clue-box:active {
  transform: scale(0.96) !important; /* Physically shrinks slightly */
  transition: transform 0.05s ease;  /* Super fast transition for snap feel */
}

h1, h2, h3 {
  /* Pulls letters slightly closer together */
  letter-spacing: -0.03em; 
  /* Ensures the line height is tight and clean */
  line-height: 1.2; 
}

/* Refined Footer Links: Visible but Professional */
.privacy-link a,
.bottom-nav a {
  /* A refined slate-grey (softer than black, but high contrast) */
  color: #546e7a; 
  
  /* High visibility, but not "shouting" */
  opacity: 0.85;   
  
  font-size: 0.9em;
  font-weight: 600; /* Slightly bolder so they are easy to read */
  text-decoration: none;
  
  /* Smooth transition for color and spacing */
  transition: all 0.2s ease;
  
  /* Adds a tiny bit of spacing between letters for clarity */
  letter-spacing: 0.02em; 
}

/* Hover State: Darker and clearly interactive */
.privacy-link a:hover,
.bottom-nav a:hover {
  color: #108abb; /* Highlights with your brand blue */
  opacity: 1;
  transform: translateY(-1px); /* A tiny subtle lift */
}

