/* Base body background */
body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background-color: #FEECA4;
  background-image: url('https://www.transparenttextures.com/patterns/cubes.png');
  background-repeat: repeat;
  background-attachment: fixed;
  color: #333;
  padding: 0;
  background-size: auto;
}

/* 🔥 Only after puzzle is complete */
body.puzzle-complete {
  background-image:
    linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab),
    url('https://www.transparenttextures.com/patterns/cubes.png');
  background-size: 400% 400%, auto;
  background-repeat: no-repeat, repeat;
  animation: gradientBG 15s ease infinite;
}

/* Animation keyframes for gradient */
@keyframes gradientBG {
  0%   { background-position: 0% 50%, 0 0; }
  50%  { background-position: 100% 50%, 0 0; }
  100% { background-position: 0% 50%, 0 0; }
}

/* Typography */
h1.game-title {
  font-family: 'Gloria Hallelujah', sans-serif;
  font-size: 3.2rem;
  text-align: center;
  padding: 10px;
  margin: 0 auto 10px;
  max-width: 400px;
  background-color: #fff;
  color: rgb(49, 49, 49);
}

/* SEO-Friendly Blurb */
.seo-description {
  margin-bottom: 10px;
}

.seo-description p {
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: justify;
  color: #666;
  max-width: 500px;
  margin: 0 auto 20px;
  padding: 0 10px;
  animation: fadeIn 0.5s ease-in;
}

h3 {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 10px;
}

/* Sidebar Links - Updated (Option 2: Badge-Style Buttons) */
.sidebar a {
  display: block;
  padding: 10px 14px;
  background-color: #D6ED17;
  color: #606060;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 10px;
  transition: background-color 0.3s ease;
  text-align: center;
  width: fit-content;
}

.sidebar a:hover {
  background-color: #0056b3;
}

/* Layout */
.container {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 600px) 1fr;
  gap: 10px;
  padding: 5px;
}

.sidebar {
  padding: 10px;
  position: sticky;
  top: 20px; /* distance from the top when scrolling */
  align-self: start; /* ensures it sticks inside grid layout */
}

.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.puzzle-box {
  background: #fff;
  padding: 30px 20px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
  position: relative;
  text-align: center;
  margin-top: 0;
}

/* Score */
.puzzle-inner-box {
  background-color: #fff;
  border-radius: 20px;
  padding: 60px 20px 25px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #ddd;
  width: 100%;
  position: relative;
}

/* Puzzle Content Wrapper */
.puzzle-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 500px;
  width: 100%;
  margin: 20px auto 0;
  position: relative;
  z-index: 1;
}

/* Clue Box */
.phrasicle-clue-box {
  background-color: #6d6162;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px 16px 20px;
  margin-top: 10px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

.clue-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}

#comboInput {
  width: 100%;
  background-color: transparent;
  color: #fff;
  border: none;
  font-size: 1.5rem;
  font-weight: 500;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

#comboInput.correct-final {
  color: #a5f3a1;
  font-weight: bold;
  text-shadow: 0 0 3px #4caf50;
  border: none;
  background-color: transparent;
}

/* Grid */
.grid-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
  overflow-x: auto;
}

.grid-border-box {
  padding: 20px;
  background-color: #fff;
  display: inline-block;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.puzzle-table {
  border-collapse: separate;
  border-spacing: 10px;
  margin: 0 auto;
}

.puzzle-table td {
  text-align: center;
  vertical-align: middle;
  padding: 0;
}

.puzzle-table input {
  width: 70px;
  height: 40px;
  font-size: clamp(0.65rem, 1.8vw, 0.9rem);
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 5px;
  color: #000;
  box-sizing: border-box;
  transition: background-color 0.4s ease, box-shadow 0.4s ease, font-size 0.2s ease;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: capitalize;
}

.row-0 input:not(.first-column) { background-color: #E6F2E2; }
.row-1 input:not(.first-column) { background-color: #CCE6C5; }
.row-2 input:not(.first-column) { background-color: #BBDDB1; }
.row-3 input:not(.first-column) { background-color: #aad59e; }

input.first-column {
  background-color: #ffe0b2 !important;
}

input.correct {
  box-shadow: 0 0 6px 2px #ffeb3b80;
  border: 1px solid #ffeb3b;
  position: relative;
  z-index: 1;
}

input.autofill {
  background-color: #eee !important;
  font-weight: bold;
  color: #555;
  cursor: default;
}

input.hint {
  color: #555;
  font-style: normal;
  background-color: #f0f8ff !important;
  border-color: #add8e6;
}

input.selected {
  outline: 2px solid #007bff;
  box-shadow: 0 0 6px #007bff;
}

#wordInput {
  width: calc((70px * 5) + (10px * 4));
  height: 40px;
  font-size: 1rem;
  padding: 5px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  display: block;
  margin: 0 auto;
}

#wordInput:focus {
  border-color: #007bff;
  box-shadow: 0 0 6px rgba(0, 123, 255, 0.4);
  outline: none;
}

/* Button Row */
.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  flex-direction: row;
}

.clue-button {
  font-family: 'Roboto', sans-serif;
  width: 100px;
  height: 40px;
  font-size: 0.9rem;
  border: none;
  background-color: #4285F4;
  color: #f1e7e7;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  ;
}

.clue-button:hover {
  background-color: #0056b3;
}

#clueMessage {
  margin: 10px 0;
  font-style: italic;
  color: #aa0000;
  text-align: center;
}

#clueMessage.fade {
  animation: fadeClue 0.6s ease;
}

@keyframes fadeClue {
  0% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1); }
}

.shake {
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

.celebration {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #fffae5;
  color: #222;
  padding: 15px 25px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  font-size: 1.2rem;
  z-index: 1000;
  animation: fadeInUp 0.6s ease-out;
}

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

.info-box-sidebar {
  position: relative;
  background-color: #e0f7fa; /* or your desired background */
  color: #333;
  border: 1px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 16px 20px;
  width: 100%;           /* 🔥 This ensures it takes full sidebar width */
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

#closeInfoBox {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #666;
  padding: 0;
}




@keyframes fadeIn {
  to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 100%;
    text-align: center;
  }

  .main-content {
    width: 100%;
  }

  .clue-button {
    width: 100%;
    margin: 5px 0;
  }

  .grid-wrapper {
    width: 100%;
  }

  .puzzle-table input,
  #wordInput,
  #comboInput {
    width: 100%;
    height: 45px;
    font-size: 1rem;
  }

  .phrasicle-clue-box {
    max-width: 95%;
  }

  .info-box {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    top: 20px;
  }

  .sidebar a {
    display: inline-block;
    width: auto;
    margin: 6px 4px;
  }
}

.wrong-guess-section {
  margin-top: 30px;
  max-width: 600px;
  width: 100%;
  padding: 0 20px 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  animation: fadeIn 0.5s ease;
}

.wrong-guess-section.hidden {
  display: none;
}

.guessed-words {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  gap: 8px;
  justify-content: center;
}

.guessed-words li {
  background-color: #f9dcdc;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
  color: #900;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar-button-box {
  background-color: #ffffffee;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: sticky;
  top: 20px;
  width: fit-content;
  margin: 0 auto;
}

.corner-bubble {
  position: fixed;
  top: 0;
  left: 0;
  background-color: #4285F4;
  border-bottom-right-radius: 100px;
  padding: 20px 20px 40px 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.corner-bubble a {
  color: #fff;
  background-color: transparent;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 20px 30px;
  border-radius: 12px;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.corner-bubble a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}
.corner-button {
  background-color: transparent;
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 20px 30px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap;
  text-align: left;
}

.corner-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}




.completion-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.completion-modal.hidden {
  display: none;
}

.modal-content {
  position: relative; /* This makes the close button position inside this box */
  background: white;
  padding: 30px 40px;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
  width: 90%;
  animation: fadeInCenter 0.4s ease-out;
}

.modal-content h2 {
  margin-top: 0;
  font-size: 1.4rem;
}

.modal-content p {
  font-size: 1.1rem;
  color: #333;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.2rem;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #000;
}

.modal-link {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #4285f4;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.modal-link:hover {
  background-color: #2c6de4;
}

@keyframes fadeInCenter {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Star Display Area */
.star-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  margin-top: -30px; /* pull it up closer to the top */
  padding: 10px 0;
  position: relative;
  z-index: 1;
}

/* Individual Stars */
.star {
  font-size: 2.1rem;
  color: #ccc;
  transition: color 0.3s ease, transform 0.3s ease;
}

/* Filled (Earned) Stars */
.star.filled {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  animation: starPop 0.4s ease;
}

/* Pop Animation */
@keyframes starPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.6); }
  100% { transform: scale(1); }
}

.modal-stars {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: -10px;
  margin-bottom: 10px;
  font-size: 2.2rem;
}

.modal-stars .star {
  color: #ccc;
  transition: color 0.3s ease, transform 0.3s ease;
}

.modal-stars .star.filled {
  color: #ffd700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
  animation: starPop 0.4s ease;
}


.puzzle-content-wrapper {
  position: relative;
}

.hidden {
  display: none !important;
}

.about-container, .policy-container, .terms-container {
  max-width: 700px;
  margin: 60px auto;
  background: #fff;
  padding: 40px 30px;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.contact-info a,
.legal-links a,
.back-link {
  color: #4285F4;
  font-weight: 500;
  text-decoration: none;
}

.back-link:hover,
.contact-info a:hover,
.legal-links a:hover {
  text-decoration: none;
}


.archive-list {
  padding: 1rem;
  background: #f9f9f9;
  border: 1px solid #ccc;
  margin: 1rem;
  max-width: 300px;
}

.archive-button {
  display: block;
  margin: 0.4em 0;
  padding: 0.5em 0.8em;
  background-color: #FEECA4;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.archive-button:hover {
  background: #FEECA4;
}

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

.archive-ul li {
  margin: 8px 0;
}

.archive-ul a {
  text-decoration: none;
  font-weight: bold;
  color: #333;
}

.archive-ul a:hover {
  color: #0077cc;
  text-decoration: none;
}