body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background-color: #1a1b1b;
  font-family: sans-serif; /* Adding a default font for consistency */
}

.container {
  text-align: center;
  width: 90%;
  max-width: 800px; /* Restrict max width for large screens */
  min-height: 60vh; /* Allow it to grow */
  border: 2px solid black;
  background-color: #1a1b1b;
  padding: 30px;
  border-radius: 10px; /* Optional: adds a bit of polish */
  box-sizing: border-box; /* Ensure padding doesn't affect width */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.heading1 {
  color: #d4d4d4;
  font-size: 2.5rem;
}

.heading2 {
  color: #dc8f18;
  font-size: 2.5rem;
}

.search-box {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  width: 100%;
}

.search-box input {
  width: 60%;
  max-width: 300px;
  padding: 10px;
  border-radius: 5px;
  border: none;
  font-size: 1rem;
}

.search-btn {
  padding: 10px;
  cursor: pointer;
  border: none;
  background-color: #299f5d;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px; /* Fixed width for desktop */
}

.search-btn img {
  width: 20px;
  height: 20px;
}

.search-btn:hover {
  background-color: #1e7a45;
}

.stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px 0;
  width: 100%;
}

.easy-stat { color: #d4d4d4; }
.medium-stat { color: #c29520; }
.hard-stat { color: #f7375d; }
.all-stat { color: #d4d4d4; }

.circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #299f5d;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  background: conic-gradient(#299f5d var(--progress-degree, 0%), #283a2e 0%);
  text-align: center;
  white-space: normal;
  word-wrap: break-word;
  padding: 5px;
  box-sizing: border-box;
  flex-direction: column;
}

.error, .notFound {
  color: red;
  font-size: 14px;
  margin: 10px 0;
  font-weight: bold;
  animation: blink 1s infinite;
  display: none; /* Controlled by JS */
}

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

.ranking {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.rank {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #299f5d;
  background-color: #283a2e;
  color: #f6f7f7;
  width: 150px;
  height: 50px;
  padding: 5px;
  font-weight: bold;
  border-radius: 5px;
}

/* --- Media Queries --- */

/* Tablet and smaller desktops */
@media (max-width: 1024px) {
  .container {
    width: 80%;
    padding: 25px;
  }
}

/* Tablets (Portrait) */
@media (max-width: 768px) {
  .container {
    width: 90%;
    padding: 20px;
  }

  .heading1, .heading2 {
    font-size: 2rem;
  }

  .circle {
    width: 110px;
    height: 110px;
    font-size: 15px;
  }
}

/* Mobile Devices */
@media (max-width: 480px) {
  body {
    align-items: flex-start; /* Align to top on small screens to prevent cut-off */
    padding-top: 20px;
    height: auto;
  }

  .container {
    width: 95%;
    padding: 15px;
    margin-bottom: 20px;
    border-width: 1px; /* Thinner border for small screens */
  }

  .heading1, .heading2 {
    font-size: 1.8rem;
  }

  .search-box {
    flex-direction: column;
    align-items: center;
  }

  .search-box input {
    width: 100%;
  }

  .search-btn {
    width: 100%; /* Full width button for easier tapping */
  }

  .stats {
    gap: 15px;
  }

  .circle {
    width: 100px;
    height: 100px; /* Slightly smaller */
    font-size: 14px;
  }
  
  /* On very small screens, maybe stack 2x2? Flex wrap handles this if width is constrained */
}

/* Small Mobile Devices */
@media (max-width: 350px) {
  .circle {
    width: 80px;
    height: 80px;
    font-size: 12px;
    border-width: 3px;
  }
  
  .rank {
    width: 120px;
    height: 40px;
    font-size: 14px;
  }
}

