/* =========================
   Base Styles
========================= */
*,
*::before,
*::after {
  box-sizing: border-box; /* easier sizing across devices */ /* :contentReference[oaicite:6]{index=6} */
}

html {
  font-size: 62.5%; /* 1rem = 10px */ /* :contentReference[oaicite:7]{index=7} */
}

h1{
  padding: 0;
}
h2{
  font-weight:bold;
}
.main-container {
  color:#222;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: Montserrat, sans-serif;
  font-size: 1.6rem; /* 16px base */
  line-height: 1.5;
  height: 100%;
}
.main-container.dark-mode{
  color: white;
  background-color: #222;
}
a:link {
  color: lightblue; /* Unvisited link */
}

a:visited {
  color: purple; /* Visited link */
}

a:hover {
  color: red; /* When the mouse hovers over the link */
}
/* =========================
   Header
========================= */
.header-top {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  gap: 2rem;
}

.puzzle-title {
  font-weight:bold;
  padding:0px;
  font-size: 4.2rem;
  color: #222;
}
.puzzle-title.dark-mode{
  color:white;
}
.game-date {
  font-size: 2.8rem;
  font-weight: 300;
  margin-bottom: -0.5rem;
}

/* =========================
   Toolbar
========================= */
.toolbar {
  border-top: 1px solid gray;
  border-bottom: 1px solid gray;
  display: flex;
  justify-content: flex-end;
  font-size: 2em;
  padding: 1.5rem 1rem;
}

.toolbar-buttons-container {
  display: flex;
  gap: 2rem;
  width: 47.5%;
}

.toolbar-buttons {
  border: 1px solid black;
  padding: 0.6rem 1.2rem;  
  font-size: 1.6rem;
  border-radius: 4.4rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 12.5rem;
  background-color: white;
}

.toolbar-buttons:hover {
  color: white;
  background-color: #ed1c24;
}

.shake-animation{
    animation: shake 0.5s ease;
}
@keyframes shake {
    0% { transform: translate(3px, 3px) rotate(0deg); }
  10% { transform: translate(-3px, -5px) rotate(-5deg); }
  20% { transform: translate(-6px, 3px) rotate(5deg); }
  30% { transform: translate(6px, 5px) rotate(0deg); }
  40% { transform: translate(4px, -4px) rotate(5deg); }
  50% { transform: translate(-4px, 5px) rotate(-5deg); }
  60% { transform: translate(-6px, 4px) rotate(0deg); }
  70% { transform: translate(6px, 4px) rotate(-5deg); }
  80% { transform: translate(-4px, -4px) rotate(5deg); }
  90% { transform: translate(4px, 5px) rotate(0deg); }
  100% { transform: translate(4px, -5px) rotate(-5deg); }
}
/* =========================
   Content Layout
========================= */
.content {
    display: flex;
    justify-content: center;
    width: 100%;
    flex: 1 1 auto;
}

/* ===== Left Container ===== */
.left-container {
  flex: 1;
  max-width: 50rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-right: 1.5rem;
  padding-left: 1rem;
}

/* Input Bar */
.input-wrapper {
  position: relative;
  width: 47%;
}

#input-bar {
  font-size: 3rem;
  border: none;
  outline: none;
  width:100%;
  padding: 0.6rem;
  margin-bottom: 3rem;
  position: relative;
  background-color: white;
}
#input-bar.dark-mode{
  background-color: #222;
  color:white;
}
#fake-placeholder {
  position: absolute;
  left: 0.6rem;
  top: 0.1rem;
  pointer-events: none;
  font-size: 3rem;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: -0.25rem; 
}
#fake-placeholder span.space {
  display: inline-block;
  width: 0rem; /* Adjust for more space between words */
}

/* Keyboard */
.keyboard {
  display: flex;
  flex-direction: column;
  height: 30%;
  gap: 1rem;
}

.row {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.key,
.enter-key,
.delete-key {
  background-color: lightgray;
  font-size: 1.2em;
  font-weight: bold;
  padding: 0.1rem 1.2rem;
  height: 4.5rem;
  border-radius: 0.4rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease, transform 0.05s ease;
}
.key.dark-mode,
.enter-key.dark-mode,
.delete-key.dark-mode {
  background-color: darkgray;
}
.key:hover,
.enter-key:hover,
.delete-key:hover {
  color: white;
  background-color: #2f639e;
}
.key.dark-mode:hover,
.enter-key.dark-mode:hover,
.delete-key.dark-mode:hover {
  color: #222;
  background-color: #5753af;
}

.key:active,
.enter-key:active,
.delete-key:active {
  background-color: #fad810;
  transform: scale(0.9);
}
.key.dark-mode:active,
.enter-key.dark-mode:active,
.delete-key.key.dark-mode:active {
  background-color: #f26522;
  transform: scale(0.9);
}
/* ===== Right Container ===== */
.right-container {
  display: flex;
  flex-direction: column;
  margin: 0 1.5rem;
  flex: 1;
  max-width: 50rem;
}

.right-container-title {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  margin: 1rem 2rem;
}
.right-title{
  font-weight: bold;
  min-width: 10rem;
  color: #222;
}
.right-title.dark-mode{
  color: white;
}
.guess-count-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  height:auto;
  width: 17.5rem;
  letter-spacing: 0.1rem;
  font-weight: 400;
}

.inner-guess-count-container{
  display: flex;
  justify-content: center;
  align-items: center;
  gap:1rem;
}
.target-guess-container{
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
}


/* Word Area */
.word-container {
  border: 1px solid lightgray;
  flex: 1;
  border-radius: 0.7rem;
}

.inner-word-container {
  margin: 2rem;
  font-size: 2rem;
}

.guess-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1.5rem;
}

.inner-word-container-top,
.inner-word-container-bottom {
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.inner-word-container-top{
  padding-bottom:2rem;
}
.inner-word-container-bottom{
  padding-top:2rem;
}

.start-word-beginning,
.end-word-ending {
  min-width: 15rem;
  width: 33%;
}

.start-word,
.end-word {
  text-align: center;
  text-transform: uppercase;
  font-weight: bold;
  flex-grow: 1;
  letter-spacing: 2rem;
}

.guess-word {
  text-align: center;
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  margin-left: 13rem;
  font-weight: 400;
}

.guess-word span {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 2em;
  height: 2em;
  text-transform: uppercase;
  border-radius: 0.5rem;
}

/*For how to play screen*/
.yellow,
.green {
  background-color: #25969c;
  padding: 0.1rem 0.4rem;
  margin: 0;
  border-radius: 0.4rem;
  color:white;
  font-weight: 500;
}
.yellow{
  background-color: #fad810;
  color: black;
}

/* =========================
   Modal Styles
========================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(1rem);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4;
}

.modal {
  background-color: white;
  padding: 2rem 2rem;
  border-radius: 0.8rem;
  max-width: 60rem;
  width: 70%;
  position: relative;
  box-shadow: 0 0 1rem 0.3rem rgba(0,0,0,0.2);
  z-index: 5;
}
.modal.dark-mode{
  background-color: #222;
  color: white;
  box-shadow: 0 0 1rem 0.3rem rgba(255,255,255,0.8);
}
.modal.dark-mode .puzzle-modal-title{
  color: white !important;
}
.puzzle-modal-title{
  color: #222;
}
.hint-message{
  padding:0.2rem;
}
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  background: transparent;
  font-size: 1.5em;
  cursor: pointer;
  z-index: 5;
  color:black
}
.modal-close.dark-mode {
  color: white;
}
/* Modal list styling */
.puzzle-modal-content ol {
  margin-left: 2rem !important; /* Indent the entire list */
  padding-left: 1rem !important;
}

.puzzle-modal-content li {
  margin-bottom: 0.8rem !important; /* Space between items */
  list-style-position: outside !important; /* Proper bullet position */
  padding-left: 0.5rem !important;
}

/* Fix for Divi's default list styling */
.puzzle-modal-content ol,
.puzzle-modal-content ul {
  list-style-type: none !important;
}

.puzzle-modal-content ol {
  counter-reset: li-counter !important;
}

.puzzle-modal-content li:before {
  content: counter(li-counter) "." !important;
  counter-increment: li-counter !important;
  margin-right: 0.8rem !important;
}
.modal .puzzle-error-message,
.modal .puzzle-error-message:last-of-type{
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
/* =========================
   Messages
========================= */
.message-container {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  font-size: 1.6rem;
  line-height: 1.5;
  text-align: center;
  letter-spacing: 0.05rem;
}


.footer{
  padding: 0.5rem 2rem;
}
/* =========================
   Animations
========================= */
.animate {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-30px);
    }
    60% {
        transform: translateY(-15px);
    }
}

/* =========================
   Responsive Layout
========================= */
@media (max-width: 1000px) {
  /* Stack left and right containers vertically */
  .header-top{
    justify-content: flex-start;
  }
  .puzzle-title{
    font-size: 3rem;
  }
  .game-date{
    font-size: 2rem;
    margin-top: -0.3rem;
  }
  .content {
    flex-direction: column;
    align-items: center;
  }

  .left-container{
    max-width: none;
    margin: 3rem 0;
    width: 90%;
  }
  .right-container{
    margin: 4rem auto;
    width: 80%;
    max-width: none;
  }
  .word-container{
    margin: 1rem auto;
    width: 100%;
  }
  .guess-count-container{
    flex-grow: 0;
  }
  .toolbar-buttons-container {
    width: 100%;
    gap: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    margin:0;
  }

  .toolbar-buttons {
    width: auto;
  }
  .guess-word{
    margin: 0 0% 0 30%;
    padding: 0rem 1% 0rem 1%;
    flex-grow: 0;
    justify-content: center;

  }
  .guess-word span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 1.8em;
    height: 1.8em;
    text-transform: uppercase;
    border-radius: 0.5rem;
  }
  .keyboard {
    gap: 6px;
  }

  .row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .key,
  .enter-key,
  .delete-key {
    font-size: 1em;
    padding: 0.4rem 0.8rem;
    height: 4rem;
  }
  .input-wrapper {
    width: 20rem;
  }

  #input-bar {
    width:100%;
    font-size: 2.5rem;
  }

  #fake-placeholder {
    font-size: 2.6rem;
    width:100%; 
  }
  #fake-placeholder span.space {
    display: inline-block;
    width: 0.2rem; /* Adjust for more space between words */
  }
  .modal {
    width: 60%;
  }

  .modal-close {
    font-size: 1.2em;
  }

  .message-container {
    font-size: 1.4rem;
    text-align: center;
    width:50%;

    margin:0 auto;
  }
}
@media (max-width: 560px){
  .guess-word{
    margin: 0 0 0 35%;
    padding: 0rem 0% 0rem 0%;
  }
}
@media (max-width: 530px) {
  .puzzle-title {
    font-size: 2.2rem;
  }
  
  .game-date {
    font-size: 1.7rem;
    margin-top: -0.5rem;
  }
  
  .guess-count-container{
    flex-grow: 0;
  }
  #input-bar {
    font-size: 2rem;
    padding: 0.4rem;
    width: 85%;
    margin-left:0.9rem;
  }

  #fake-placeholder {
    font-size: 2.1rem;
    letter-spacing: -0.15rem;
    margin-left:0.9rem;
    width: 82%;
  }


  .toolbar-buttons {
    font-size: 1.4rem;
    padding: 0.4rem 1rem;
  }

  .right-container-title {
    gap: 0.8rem;
  }
  .right-title{
    font-size: 2rem;
  }
  .target-guess-container,
  .inner-guess-count-container{
    font-size: 1.4rem;
  }
  .start-word-beginning,
  .end-word-ending { 
    font-size: 1.6rem;
  }

  .start-word,
  .end-word {
    font-size: 1.8rem;
    letter-spacing: 1.5rem;
  }
  .guess-word {
    font-size: 1.6rem;
    margin: 0 0 0 35%;
    padding: 0rem 0% 0rem 4%;
  }

  .keyboard {
    gap: 4px;
  }

  .row {
    gap: 4px;
  }

  .key,
  .enter-key,
  .delete-key {
    font-size: 0.9em;
    padding: 0.3rem 0.6rem;
    height: 3.6rem;
  }

  .modal {
    width: 80%;
    padding: 1rem;
    font-size: 1.4rem;
  }

  .message-container {
    font-size: 1.2rem;
    width: 100%;
    padding: 0.5rem;
  }
}

