.top-header {
  width: 100%;
  background: linear-gradient(90deg, #ffd54f, #ffa726);
  color: #000;
  padding: 0px 12px;
  min-height: 80px;
  text-align: center;
  font-size: 80%;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-weight: bold;
  font-family: sans-serif;
  font-size: 35px;
}

#logo-image {
  max-height: 45px;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.4));
}

.hamburger-btn {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  margin-right: 10px;
}

.hamburger-box {
  display: inline-block;
  width: 28px;
  height: 18px;
  position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  content: "";
  display: block;
  height: 2px;
  width: 100%;
  background: #000;
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger-inner {
  top: 50%;
  transform: translateY(-50%);
}
.hamburger-inner::before { top: -8px; }
.hamburger-inner::after  { bottom: -8px; }

.hamburger-btn[aria-expanded="true"] .hamburger-inner {
  transform: rotate(45deg);
}
.hamburger-btn[aria-expanded="true"] .hamburger-inner::before {
  transform: rotate(90deg) translateX(0);
  top: 0;
}
.hamburger-btn[aria-expanded="true"] .hamburger-inner::after {
  opacity: 0;
}

.header-menu {
  position: absolute;
  right: 12px;
  top: 56px; 
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  padding: 8px 0;
  min-width: 250px;
  z-index: 115;
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.18s ease;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

.header-menu.show {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.header-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.header-menu li {
  margin: 0;
}
.header-menu a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: #111;
  font-weight: 600;
  font-size: 14px;
}
.header-menu a:hover,
.header-menu a:focus {
  background: #ffeb3b;
  outline: none;
}

.hamburger-menu {
  display: none;
}

@media (max-height: 600px) {
  body {
    overflow-y: visible !important;
  }
}

@media (max-width: 800px) {

  .hamburger-menu {
    display: block;
  }

  .hamburger-btn { right: 12px; top: 14px; transform: none; } 
  .header-menu { top: 52px; right: 8px; }

  html,
  body {
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
    padding-top: 5% !important;
  }

  .game-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 20px;
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px 12px;
    box-sizing: border-box;
  }

  .letters-container,
  .scoreboard-container,
  #user-warning {
    width: 100% !important;
    max-width: 420px;
    box-sizing: border-box;
    margin: 0 auto;
  }

  .letters-container {
    order: 1;
    display: flex;
    justify-content: center;
  }

  #user-warning {
    order: 2;
    margin-top: 10px;
  }

  .scoreboard-container {
    order: 3;
  }

  .hive {
    width: min(90vw, 350px) !important;
    height: auto;
  }

  .hex-grid {
    width: min(80vw, 260px) !important;
    height: auto;
  }

  .hex {
    width: calc(min(80vw, 260px) / 3.2) !important;
    height: calc(min(80vw, 260px) / 3.2) !important;
    font-size: calc(min(80vw, 260px) / 12) !important;
  }

  .site-footer {
    display: none;
  }
}

body {
  margin: 0;
  font-family: sans-serif;
  background: #f7f7f7;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
  min-height: 100vh;
  overflow-y: hidden;
}

.game-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
  padding-top: 10vh;
}

.letters-container {
  flex: 0 0 auto;
}

.hive {
  position: relative;
  width: 380px;
  height: 380px;
  overflow: visible;
}

#stem {
  position: relative;
  top: 50%;
  left: -2%;
  opacity: 50%;
  z-index: -1;
  pointer-events: none;
  user-select: none;
}

.hex-grid {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  height: 260px;
  transform: translate(-50%, -50%);
}

.lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.hex {
  width: 90px;
  height: 90px;
  background: #fdcd0a;
  border-radius: 50% 50% 50% 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  font-weight: bold;
  color: #000000;
  position: absolute;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 10px rgba(59, 53, 0, 0.25);
  transition: transform 0.2s, background 0.2s;
  z-index: 3;
}
.hex.selected {
  box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.5);
  transform: scale(1.05);
  background: #fdcd0a !important;
}

.hex.selected.center {
  background: #9f3305 !important;
}

.hex:hover {
  background: #fcb006;
  transform: scale(1.1);
}

.center {
  left: 90px;
  top: 90px;
  background: #9f3305;
  color: #ffffff;
}
.center:hover {
  background: #bd4918;
}

/* Center */
#letter-0 {
  left: 85px;
  top: 85px;
}

/* Top */
#letter-1 {
  left: 85px;
  top: -40px;
}

/* Top-left */
#letter-2 {
  left: -10px;
  top: 15px;
}

/* Top-right */
#letter-3 {
  left: 180px;
  top: 15px;
}

/* Bottom-left */
#letter-4 {
  left: -10px;
  top: 150px;
}

/* Bottom-right */
#letter-5 {
  left: 180px;
  top: 150px;
}

/* Bottom */
#letter-6 {
  left: 85px;
  top: 220px;
}

.scoreboard-container {
  flex: 0 0 auto;
  width: 100%;
  max-width: 300px;
  overflow: visible;
  z-index: 1;
}

.scoreboard {
  background: rgba(255, 255, 255, 0.952);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.scoreboard h3 {
  margin: 0 0 15px 0;
  color: #333;
  text-align: center;
  font-size: 18px;
}

.found-words-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 15px;
}

.word-list {
  max-height: 300px;
  overflow-y: auto;
  width: 100%;
}

.word-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.word-list li {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.word-list li:last-child {
  border-bottom: none;
}

.score-indicator {
  color: #4caf50;
  font-weight: bold;
  font-size: 14px;
  animation: scorePop 0.6s ease-out;
  transform-origin: center;
}

@keyframes scorePop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.duplicate-highlight {
  animation: duplicateFlash 1s ease-out;
}

@keyframes duplicateFlash {
  0% {
    background-color: #ffeb3b;
  }

  100% {
    background-color: transparent;
  }
}
.user-warning {
  position: relative;
  background-color: #ffcdd2;
  color: #b71c1c;
  padding: 10px 15px;
  border: 1px solid #f44336;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  width: 100%;
  max-width: 300px;
  transition: opacity 0.3s ease-in-out;
  margin-top: 15px;
  width: auto;
  max-width: 300px;
  margin: 15px auto 0;
  margin-bottom: 10px;
  z-index: 50;
}

.user-warning.show {
  display: block;
  animation: fadeOut 3s ease-in-out forwards;
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
  z-index: 10;
  background: none;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

.hive.loading::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f7f7f7c4;
  z-index: 4;
}

.hex {
  touch-action: none;
}

.suggestion-window-overlay {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.suggestion-window {
  position: fixed;
  top: 80px; 
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  max-width: 400px;

  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  padding: 20px;

  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;

  font-family: sans-serif;
  z-index: 200;
  animation: dropFade 0.3s ease-out;
}

#suggestion-header {
  text-align: center;
  font-size: 1.4em;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.suggestion-form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
}

#suggestion-input {
  flex: 1;
  padding: 12px 14px;
  font-size: 1em;
  border: 1px solid #ddd;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#suggestion-input:focus {
  border-color: #fbc02d;
  box-shadow: 0 0 0 3px rgba(251,192,45,0.3);
  outline: none;
}

#suggestion-submit {
  padding: 12px 18px;
  font-size: 1em;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background-color: #fbc02d;
  color: #000;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#suggestion-submit:hover {
  background-color: #fdd835;
}

@keyframes dropFade {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.suggestion-window.hidden {
  display: none !important; /* force it to hide */
  opacity: 0;
}

.how-to-play-overlay {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.how-to-play-popup {
  background: #fffbea;
  color: #333;
  max-width: 420px;
  width: 90%;
  padding: 24px 28px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  font-family: "Inter", sans-serif;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 24px;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  transition: color 0.2s;
}
.close-btn:hover {
  color: #000;
}

.how-to-play-popup h2 {
  text-align: center;
  margin-top: 0;
  color: #e5b908;
}
.how-to-play-popup h3 {
  margin-bottom: 6px;
  color: #c17a00;
}

.how-to-play-popup ul {
  margin: 6px 0 12px 20px;
  padding: 0;
}
.how-to-play-popup li {
  margin-bottom: 6px;
}

.footer {
  text-align: center;
  font-weight: 600;
  color: #c17a00;
  margin-top: 16px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}


.site-footer {
  background-color: #492201;
  color: #cccccc;
  font-weight: bold;
  text-align: center;
  position: fixed;
  bottom: 0;
  width: 100%;
  padding: 1em 0.5em;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
  z-index: 5;
}

.footer-container {
  display: flex;
  justify-content: center;
  gap: 1.5em;
  flex-wrap: wrap;
  margin-bottom: 0.5em;
}

.footer-option {
  background: transparent;
  border: none;
  color: #cccccc;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0.5em 1em;
  transition: text-decoration 0.2s;
}

.footer-option:hover {
  text-decoration: underline;
}

.suggestion-submited {
  position: fixed;
  background-color: #c8e6c9;
  color: #1b5e20; 
  padding: 10px 15px;
  border: 1px solid #4caf50;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  width: 100%;
  max-width: 300px;
  transition: opacity 0.3s ease-in-out;
  margin-top: 15px;
  width: auto;
  max-width: 300px;
  margin: 15px auto 0;
  margin-bottom: 10px;
  z-index: 101;
}

.suggestion-submited.show {
  display: block;
  animation: fadeOut 3s ease-in-out forwards;
}

.change-language-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.change-language-overlay.hidden {
  display: none;
}

.change-language-window {
  background-color: #fff;
  padding: 20px 30px;
  border-radius: 12px;
  text-align: center;
  max-width: 300px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  position: relative;
}

.change-language-window header {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 15px;
}

.language-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lang-option {
  padding: 10px;
  border: none;
  border-radius: 8px;
  background-color: #f4f4f4;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.lang-option:hover {
  background-color: #ffe082;
}

.change-language-window .close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.5rem;
  border: none;
  background: none;
  cursor: pointer;
}

/* Contact Us Popup */
.contact-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.contact-overlay.hidden {
  display: none;
}

.contact-window {
  background: #fffbea;
  color: #333;
  max-width: 380px;
  width: 90%;
  padding: 24px 28px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  text-align: center;
  font-family: "Inter", sans-serif;
  animation: fadeIn 0.3s ease;
}

.contact-window h2 {
  margin-top: 0;
  color: #e5b908;
}

.contact-window p {
  font-size: 1rem;
  color: #444;
}

.contact-email {
  display: inline-block;
  margin-top: 10px;
  font-weight: bold;
  color: #9f3305;
  text-decoration: none;
  font-size: 1.1rem;
}

.contact-email:hover {
  text-decoration: underline;
  color: #bd4918;
}
