/* === Global / Layout === */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800;900&display=swap');

#wave-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  background: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Montserrat', sans-serif;
  color: #000;
  overflow-x: hidden;

  /* add left padding for fixed sidebar */
  padding-left: 16rem;
  transition: padding-left 0.3s ease;
  box-sizing: border-box;
  display: block; /* remove flex from body */
}

.container {
  max-width: 900px; /* your max width */
  margin: 0 auto;   /* center horizontally */
  padding: 0 3rem;
  box-sizing: border-box;
  text-align: center;

  /* optional if you want gap between content elements */
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* === Left Sidebar === */

.sidebar-left {
  width: 16rem;
  height: 100vh; /* full viewport height */
  padding: 2rem 1.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed; /* sticks to the left */
  top: 0;
  left: 0;
  align-items: center; /* Horizontally center all child elements */
  text-align: center;  /* Center text inside those elements */
  border-right: 1px solid #000;
}

.title-block {
  margin-bottom: 2rem;
}

.menu-title {
  font-weight: 700;
  font-size: clamp(1.2rem, 2.5vw, 2.2rem); /* Adjust values as needed */
  letter-spacing: 2px;
  margin: 0;
  color: #000;
  text-align: left;
}

/* Tagline */
.tagline {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    font-style: italic;
    text-align: center;
    color: #000;
    margin-top: 1rem; /* or whatever you need */
}

.cursor {
    display: inline-block;
    margin-left: 2px;
    color: #000;
    animation: blink 0.8s steps(1) infinite;
}

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

/* Nav */
.nav-items {
    display: flex;
    flex-direction: column;
    align-items: center;  /* centers <li> horizontally */
    gap: 0.5rem;          /* optional: space between items */
    padding: 0;
    margin: 0;
}

.nav-items li {
    list-style: none;
    width: 100%;          /* or auto if you want tighter fit */
    text-align: center;   /* center text inside li */
}

.nav-items li:hover {
    color: #777;
    transform: translateX(6px);
}

.nav-items a {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0.75rem 0;
    text-align: center;
    transition: color 0.3s, transform 0.3s;
}

.nav-items a:hover {
    color: #777;
    transform: scale(1.05); /* center-friendly hover */
}

/* Dropdown Structure */
/* Dropdown hidden by default */
.has-dropdown .dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease, opacity 0.6s ease;
    opacity: 0;
    padding: 0;
    margin: 0;
}

/* Dropdown items style */
.has-dropdown .dropdown li a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: #777; /* Slightly lighter */
    background-color: transparent;
    transition: background 0.3s;
}

.has-dropdown .dropdown li a:hover {
    background: transparent;
    color: #000;
}

/* When hovered (after class toggle) */
.has-dropdown.hover-active .dropdown {
    max-height: 500px; /* large enough to show all items */
    opacity: 1;
}

.social-icons a {
  color: #000;
  margin-right: 1rem;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.2s ease;
}

.social-icons a:hover {
  color: #777;
}

.main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Ensure vertical centering if needed */
  margin: 0 auto;
  width: 100%;
  max-width: 1000px;
  padding: 1rem;
  box-sizing: border-box;
}

/* === Main Content === */

#page-content {
  padding: 1rem 3rem 2rem 3rem; /* Top, Right, Bottom, Left */
  box-sizing: border-box;
  overflow-y: auto;
  max-width: 100vw;
  flex: 1 1 auto;
  max-width: 900px;  /* constrain max width */
  margin: 0 auto;    /* center horizontally */
  min-height: 100vh;
}

/* Animated Theme Label */
.theme {
  font-weight: 300;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #777;
  animation: wave 3s ease-in-out infinite;
}

.page-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
}

/* Makes the container fully responsive */
.container {
  width: 100%;
  padding: 0 10px;
  box-sizing: border-box;
}

.game {
  display: flex;
  flex-direction: row;
  align-items: center; /* vertical alignment */
  justify-content: center;
  flex-wrap: wrap;
  gap: 3rem;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.word-bank {
  display: flex;
  flex-direction: column;
  align-items: center;        /* center words horizontally */
  justify-content: center;    /* center words vertically */
  width: auto;
  height: auto;
  max-height: 75vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 1rem;
  margin: 0;
  background-color: #fff;
  border: 2px solid #000;
  border-radius: 8px;
  align-self: center;         /* aligns to center of puzzle */
}

@media (max-width: 768px) {
  .game {
    flex-direction: column;
    align-items: center;
  }

  .word-bank {
    width: 100%;
    max-width: 400px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .word-bank div {
    margin: 0.5rem;
  }
}

@media (max-width: 480px) {
  .word-bank {
    padding: 0.5rem;
  }

  .word-bank div {
    font-size: 12px;
  }
}

.word-bank div {
  font-weight: 500;
  font-size: clamp(12px, 2vw, 16px);
  text-align: center;
  margin: 0.25rem 0;
}

.star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  animation: twinkle 2s infinite;
  opacity: 0;
  z-index: 0;
}

@keyframes twinkle {
  0% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.5); }
}

@keyframes wave {
  0% { transform: translateY(0); }
  25% { transform: translateY(-4px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(4px); }
  100% { transform: translateY(0); }
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(20, 1fr); /* grid width = 15 columns */
  gap: 0.3rem;
  border: 2px solid #000;
  padding: 0.3rem;
  width: 100%;
  max-width: 70vmin;   /* ✅ Dynamically scales with screen size */
  aspect-ratio: 1 / 1; /* ✅ Ensures the grid is square */
  box-sizing: border-box;
  overflow: hidden;
}

/* Additional tweak for the text inside the cell if still unaligned */
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: clamp(0.6rem, 2.2vmin, 1.2rem);
  color: #000;
  user-select: none;
  transition: all 0.3s ease-out;
  overflow: hidden;
  line-height: 1;             /* ✅ Prevent vertical offset */
  text-align: center;         /* ✅ Horizontal alignment fallback */
  font-weight: 500;           /* ✅ Optional for consistency */
  box-sizing: border-box;
  text-rendering: geometricPrecision;
}


/* Instead of increasing the font-size, use scale to avoid overflow */
.cell:hover {
  background-color: #ccc;
  color: #fff;
  transform: scale(1.2); /* Grow the letter without affecting layout */
  z-index: 1;
  transition: all 0.3s ease-in-out;
}

/* For the trail effect */
.cell.trail {
  background-color: #ccc;
  color: black;
  transform: scale(1.2); /* Maintain the scale effect */
  z-index: 1;
  transition: all 0.5s ease-out;
}

.cell.selected {
  background-color: #ccc;
}

.cell.found {
  background-color: #000;
  color: #fff;
  font-weight: 600;
}

#word-bank .found-word {
  text-decoration: line-through;
  color: #ccc;
}

.cell.guide {
  background-color: #777;
}

.buttons {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.4rem, 1vmin, 0.7rem) clamp(0.7rem, 3vmin, 1.6rem);
  margin-bottom: 2rem;
}

button {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  background-color: #000;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
  background-color: #777;
  transform: scale(1.05);
}

@keyframes glow {
  0% {
    text-shadow: 0 0 5px #bbb, 0 0 10px #bbb, 0 0 15px #bbb;
    color: #fff;
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 10px #aaa, 0 0 20px #aaa, 0 0 30px #aaa;
    color: #ccc;
    transform: scale(1.15);
  }
  100% {
    text-shadow: 0 0 5px #bbb, 0 0 10px #bbb, 0 0 15px #bbb;
    color: #fff;
    transform: scale(1);
  }
}

.glow {
  animation: glow 2s ease-in-out infinite;
}

/* Sidebar mini‑footer */
.site-footer {
  width: 100%;
  padding: 0.5rem 0;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 300;
  color: #777;
}