@media (min-width: 768px) {
        /* Reduce gap between header and .word-form only on desktop */
        body > main > section.word-form {
          margin-top: -200px !important;
        }
        /* Optionally, adjust padding if needed */
        .word-form {
          padding-top: 0 !important;
        }
        .middle-section {
           margin-top: -150px !important;
        }
      }
      .middle-section .word-list {
      display: flex;
      flex-wrap: wrap;
      gap: 18px;
      margin: 24px 0 32px 0;
      justify-content: flex-start;
    }
    .middle-section .word-item {
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      padding: 12px 18px 6px 18px; /* Less bottom padding */
      min-width: 80px;    /* Smaller min-width for short words */
      box-shadow: 0 2px 8px rgba(0,0,0,0.04);
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      cursor: pointer;
      transition: box-shadow 0.2s, border 0.2s;
    }
    .middle-section .word-item:hover {
      border: 1.5px solid #bbf7d0;
      box-shadow: 0 4px 16px rgba(56,189,248,0.10);
      background: #f6fff9;
    }
    .middle-section .word {
      font-size: 1.25rem;
      font-weight: 600;
      color: #0f172a;
      margin-bottom: 4px;
    }
    @media (max-width: 600px) {
      .middle-section .word-list {
        gap: 10px;
        margin: 16px 0 20px 0;
      }
      .middle-section .word-item {
        min-width: 60px;
        padding: 8px 10px 4px 10px; /* Less bottom padding on mobile */
      }
      .middle-section .word {
        font-size: 1.05rem;
      }
    }


.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Darker overlay for a classy look */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  
  .modal-content {
    background-color: #f9f9f9; /* Light neutral background */
    padding: 25px;
    border-radius: 12px;
    color: #2c3e50; /* Elegant dark blue text */
    text-align: center;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); /* Deeper shadow for depth */
    font-family: 'Georgia', serif; /* Classy serif font */
  }
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
  }
  
  .modal-header h2 {
    margin: 0;
    font-size: 26px;
    color: #57BD91; /* Match theme's green color */
    font-weight: bold;
  }
  
  .close-btn {
    background: none;
    border: none;
    color: #888; /* Subtle gray for close button */
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s ease;
  }
  
  .close-btn:hover {
    color: #2c3e50; /* Darker color on hover */
  }
  
  .modal-body {
    margin: 20px 0;
    font-size: 18px;
    line-height: 1.8; /* Improve readability */
    color: #333; /* Dark text color */
  }
  
  .modal-footer {
    display: flex;
    justify-content: center;
    margin-top: 20px;
  }
  
  .loading-message {
    font-style: italic;
    color: #57BD91; /* Match theme's green color */
    animation: pulse 1.5s infinite;
  }
  
  @keyframes pulse {
    0% {
      opacity: 0.5;
    }
    50% {
      opacity: 1;
    }
    100% {
      opacity: 0.5;
    }
  }
  .level-nav-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 28px;
  gap: 32px;
  padding: 0 8px;
}
 .level-nav-flex-easy {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 28px;
  gap: 15rem;
  padding: 0 8px;
}
.level-nav-prev, .level-nav-next {
  flex: 1 1 0;
  /* background: #f8fafc; */
  /* border-radius: 8px; */
  padding: 12px 18px 8px 18px;
  /* box-shadow: 0 1px 4px rgba(0,0,0,0.04); */
}
.level-nav-prev {
  text-align: left;
  /* border: 1px solid #bae6fd; */
}
.level-nav-next {
  text-align: right;
  /* border: 1px solid #bbf7d0; */
}
.level-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.level-links a {
  color: #73ba9b;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  padding: 2px 0;
  text-decoration: underline;
}
.level-links a:hover {
  color: #57BD91;
  text-decoration: underline;
}
@media (max-width: 700px) {
  .level-nav-flex {
    flex-direction: column;
    gap: 18px;
    padding: 0;
  }
  .level-nav-flex-easy {
    gap: 3rem;
    padding: 0;
  }
  .level-nav-next, .level-nav-prev {
    text-align: left;
    padding: 10px 10px 6px 10px;
  }
}

.words-container {
  background: #f7f7fa; /* very light grey */
  border: 1.5px solid #e5e7eb; /* subtle grey border */
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(60,60,80,0.06);
  padding: 28px 18px 18px 18px;
  margin: 32px 0 36px 0;
  max-width: 700px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.words-container h2 {
  font-size: 1.4rem;
  color: #444b5a; /* dark grey for heading */
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
@media (max-width: 700px) {
  .words-container {
    padding: 16px 6px 10px 6px;
    margin: 18px 0 22px 0;
    border-radius: 8px;
  }
  .words-container h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }
}

