body {
  font-family: 'Roboto', sans-serif;
  background: #f4f6f8;
  margin: 0;
  padding: 0;
  color: #333;
}

.header-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  margin: 20px 0;
}

.header-container h1 {
  margin: 0;
  font-size: 3rem;
  font-weight: 600;
}

.leaderboard-selector {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  cursor: pointer;
  transition: transform 0.2s;
  user-select: none;
}

.leaderboard-selector:hover {
  transform: scale(1.2) translateY(-50%);
}

.language-selector {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.flag,
.selected-flag {
  width: 30px;
  height: auto;
  cursor: pointer;
  transition: transform 0.2s;
  pointer-events: auto;
}

/* ensure hover applies to main and dropdown flags */
.language-selector .selected-flag:hover,
.language-options li img:hover {
  transform: scale(1.1);
}

/* explicit hover for currentFlag */
#currentFlag:hover {
  transform: scale(1.1);
}

.chevron {
  font-size: 0.9rem;
  color: #555;
  pointer-events: auto;
  transition: transform 0.2s;
}

/* rotated state */
.chevron.rotated {
  transform: rotate(90deg);
}

.language-options {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  list-style: none;
  background: #fff;
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  flex-direction: column;
  gap: 4px;
  z-index: 10;
  
}

.language-options.open {
  display: flex;
}

.language-options li img {
  width: 24px;
  height: auto;
  cursor: pointer;
}
/* ensure chevron and flag are side by side */
.toggle-label, .selected-flag, .chevron {
  pointer-events: none;
}

.language-options li img:hover {
  transform: scale(1.1);
}
.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 20px;
  text-align: center;
}

h1 {
  font-size: 3rem;
  font-weight: 600;
  margin-bottom: 30px;
}

.alert {
  background: #dfe9f3;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  font-size: 1.4rem;
}

#completion-info {
  font-size: 0.9rem;       /* Smaller than the banner text */
  font-style: italic;      /* Italic font */
  margin-top: 10px;
  display: none;           /* Hidden by default */
  color: #444;             /* Optional: subdued color */
}

.button-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
  
}

.btn {
  padding: 14px 28px;
  font-size: 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #6c63ff;
  color: white;
  transition: background 0.3s;
}
.btn-green {
  padding: 14px 28px;
  font-size: 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #5bb72e;
  color: white;
  transition: background 0.3s;
}
.btn-green:active {
  transform: scale(0.95);
  transition: transform 0.1s;
}


.btn:hover {
  background: #574fd6;
}

.btn.secondary {
  background: #999;
}

.btn.secondary:hover {
  background: #777;
}

.btn.danger {
  background: #e63946;
  margin-top: 10px;
}

.btn.danger:hover {
  background: #d62828;
}

.btn:active {
  transform: scale(0.95);
  transition: transform 0.1s;
}

.resume-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px; /* Adjust gap for better spacing */
  margin-top: 15px; /* Reduced margin */
}

.btn-resume {
  background: transparent; /* Transparent background */
  border: 1px solid #6c63ff; /* Light border */
  border-radius: 20px; /* Rounded edges */
  padding: 8px 12px; /* Smaller padding */
  font-size: 0.9rem; /* Smaller font size */
  color: #6c63ff; /* Text color */
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.btn-resume:hover {
  background: #e0e0ff; /* Light background on hover */
  color: #333; /* Darker text on hover */
}


.btn-delete {
  background: transparent; /* Transparent background */
  border: none; /* No border */
  color: #e63946; /* Red color for destructive action */
  font-size: 1rem; /* Slightly larger font size for visibility */
  cursor: pointer;
  transition: color 0.3s;
  margin-left: 8px; /* Adjust spacing */
}

.btn-delete:hover {
  background: #ffe6e6; /* Light red background on hover */
  color: #d62828; /* Darker red text on hover */
}

/* override the standard .btn look */
.info-btn {
  /* same vertical padding as .btn but no horizontal padding */
  padding: 14px 0;
  
  /* force a square (height comes from padding+line-height/font-size) */
  width: 48px;           /* tweak to match total .btn height—it lands around 48px */
  
  background: transparent;
  border: none;
  color: #6c63ff;        /* use your accent color */
  font-size: 1.2rem;     /* same size as .btn text */
  
  /* center the icon perfectly */
  display: flex;
  align-items: center;
  justify-content: center;
  
  cursor: pointer;
  transition: transform 0.3s;
  animation: shake 5s ease-in-out;
}

/* optional: rotate when open */
.info-btn[aria-expanded="true"] {
  transform: rotate(180deg);
}

/* remove the .btn:hover background fallback */
.info-btn:hover {
  background: transparent;
}


@keyframes shake {
  0%, 100% {
      transform: rotate(0deg);
  }
  5%, 15%, 25%, 35%, 45%, 55%, 65%, 75%, 85%, 95% {
      transform: rotate(-10deg);
  }
  10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90% {
      transform: rotate(10deg);
  }
}

/* hidden info-panel */
.game-info {
  max-height: 0;
  overflow:scroll;
  transition: max-height 0.4s ease;
  background: #eef4ff;
  padding: 0 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  text-align: left;
  font-size: 0.95rem;
  color: #333;
}
.game-info.open {
  max-height: 500px; /* big enough for your content */
  padding-top: 1rem;
  padding-bottom: 1rem;
}



#wiki-container {
  background: white;
  padding: 0px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-top: 40px;
  min-height: 700px;
  max-width: 100%;
  padding-bottom: 80px;
  overflow: auto;
  overflow-wrap: break-word;
  position: relative;
}

#wiki-container * {
  max-width: 100%; /* Ensure child elements do not exceed the container's width */
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
}
#game-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  padding: 12px 0px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 100;
}

.panel-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.buttons-group {
  display: flex;
  justify-content: flex-start; /* Align buttons to the left */
  flex-wrap:nowrap;
  gap: 10px;
  flex: 1; /* take up as much space as needed */
  max-width: 80%; /* optional: limit width so it doesn't stretch too much */
}

.buttons-group button {
  padding: 10px 20px;
  font-size: 1rem;
}


.info-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 1rem;
  justify-content: flex-end;
  align-items: center;
  min-width: 0; /* allow shrinking nicely */
  overflow-wrap: break-word;
  word-break: break-word;
}

  
/* On small screens (mobile) */
@media (max-width: 768px) {
  .panel-content {
    flex-direction: column;
    align-items: center;
  }
  

  .buttons-group, .info-panel {
    justify-content: center;
    text-align: center;
    width: 100%;
  }
}


/* Summary card */
.summary-card {
  background: white;
  padding: 40px;
  margin-top: 80px;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.summary-card h2 {
  color: #38b000;
  font-size: 2rem;
  margin-bottom: 20px;
}

/* form container inside summary */
.summary-card .form-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 30px 0;
  gap: 15px;
}

/* label styling */
.summary-card .form-label {
  font-size: 1.1rem;
  font-weight: 500;
  color: #333;
}

/* text input styling */
.input-text {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  font-size: 1.1rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-text:focus {
  border-color: #6c63ff;
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

/* make the “Save” button line up nicely */
.summary-card .form-group .btn {
  align-self: center;
  min-width: 120px;
}



.pairs-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}


.pairs-list li {
  background: white;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Increased shadow for more depth */
  width: 300px; /* Set a fixed width for cards */
  display: flex; /* Enable flexbox */
  justify-content: space-between; /* Space between text and image */
  align-items: center; /* Vertically center content */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 2px solid #ddd; /* Make the border more visible */
}

.pairs-list li:hover {
  transform: translateY(-5px);
}


.pairs-list li .top-score {
  display: block;
  font-style: italic;
  margin-top: 10px;
  width: 100%;
  font-size: 0.9rem;   /* Add this if it's not there yet */
  text-align: center;
  color: #555;         /* Optional: softened text color */
}

.pairs-list li.completed-by-user {
  background: #97b243;
  color:white;
}

.pairs-list {
  list-style: none;
  padding: 0;
}

.pairs-list li.selected {
  background: #6c63ff;
  color: white;
  border: 2px solid #574fd6;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transform: scale(1.05);
  transition: all 0.2s;
}

.pair-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%; 
  
}
.image-container {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  min-width: 90px; /* Ensure it keeps enough space for 2 images */
}
.centered-image-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.img-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.pair-text {
  font-size: 1.2rem;
  color: #333;
  font-weight: 500;
  flex: 1;
}


/* Leaderboard wrapper */
.leaderboard {
  margin: 40px 0 20px;
}

/* Leaderboard title */
.leaderboard h3 {
  font-size: 1.5rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 20px;
}

/* List reset and centering */
.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 400px;
}

/* Each entry as a card */
.leaderboard-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: 2px solid #ddd;
  margin-bottom: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hover effect */
.leaderboard-list li:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* Highlight the current user */
.leaderboard-list li.current {
  background: #6c63ff;
  color: white;
  border-color: #574fd6;
  transform: scale(1.03);
}

/* Rank, name, score styling */
.leaderboard-list li .rank {
  font-weight: 600;
  width: 2rem;
  text-align: left;
}

.leaderboard-list li .name {
  flex: 1;
  text-align: left;
  font-weight: 500;
  padding: 0 10px;
}

.leaderboard-list li .score {
  font-weight: 600;
  color: #6c63ff;
}

/* When highlighted, use white for score too */
.leaderboard-list li.current .score {
  color: #fff;
}
.leaderboard-list li .time {
  font-style: italic;
  color: #555;          /* slightly muted so it doesn’t overpower name/score */
  margin: 0 10px;       /* space around the time */
}
.custom-alert {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.custom-alert.hidden {
  display: none;
}

.custom-alert-box {
  background: white;
  padding: 30px 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 90%;
  font-size: 1.2rem;
  color: #333;
}

.site-footer {
  background-color: #fff;
  padding: 30px 20px;
  border-top: 1px solid #ddd;
  text-align: center;
  font-size: 0.95rem;
  color: #666;
  margin-top: 40px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  color: #6c63ff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #574fd6;
}

/* Grid layout for leaderboard page */
.grid-container {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 40px 0;
}

.leaderboard-block {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.leaderboard-block h3 {
  margin-bottom: 15px;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}
