  body {
    margin: 0;
    font-family: "Ubuntu", sans-serif;;
    background-color: #141414;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* move content toward top */
    min-height: 100vh;
    padding: 20px 10px 40px;
  }

  #landing-page {
    font-family: "Ubuntu", sans-serif;;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
  }

  #stats-page {
    font-family: "Ubuntu", sans-serif;;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
  }

  h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
  }

  p {
    opacity: 0.8;
    margin-bottom: 2rem;
  }

  .ad-container {
    position: absolute;
    bottom: 50px;
    text-align: center;
  }

  .landing-btn {
    background: linear-gradient(180deg, #742bb8, #8b58ba);
    color: white;
    border: none;
    border-radius: 2px;
    padding: 0.8rem 5rem;
    font-size: 1rem;
    font-weight: bold;
    margin: 0.5rem;
    cursor: pointer;
    /* transition: all 0.2s ease; */
  }

  .landing-btn:hover {
    background: #8c58bc;
    cursor: pointer;
  }

  .secondary {
    background: transparent;
    border: 1px solid #22c55e;
    color: #fff;
    border-radius: 10px;
    padding: 0.8rem 5rem;
    font-size: 1rem;
    font-weight: bold;
    margin: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .secondary:hover {
    background: #22c55e45;
  }

  @media (max-width: 600px) {
    h1 { font-size: 2.5rem; }

    .landing-btn {
      width: 80%;
    }

    .secondary {
      width: 80%;
    }

  }


  .key.pressed {
    transform: scale(0.9);
    background: #555;
    transition: transform 0.1s, background 0.1s;
  }
  
  
  #app {
    width: 100%;
    max-width: 700px;
    text-align: center;
  }
  
  header {
    margin-bottom: 20px;
  }

  #dmq {
    font-size: 40px;
  }

  
  #game {
    background: #141414;
    padding: 15px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .lives-counter {
    text-align: center;
    font-size: 1.2em;
    color: #cecece;
    margin-bottom: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
  }
  
  #lives-count {
    font-family: "Ubuntu", sans-serif;
    font-weight: 700;
    color: #fff;
    font-weight: bold;
  }
  
  #word-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px; /* spacing between words */
    margin-bottom: 60px;
  }
  
  .word-group {
    display: flex;
    gap: 4px; /* spacing between letters in a word */
    white-space: nowrap; /* keeps word together */
  }
  

  .letter-box {
    width: 45px;
    height: 55px;
    border: 2px solid #525151;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    background: #141414;
    white-space: nowrap;
  }
  
  .space {
    width: 20px;
    border: none;
    background: none;
  }

  #keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 50px;
  }
  
  .key-row {
    display: flex;
    justify-content: center;
    gap: 5px;
  }
  
  .key {
    width: 52px;
    height: 55px;
    background: #333;
    border: none;
    color: white;
    font-size: 1.1em;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.2s;
  }
  
  .key:hover {
    background: #444;
  }
  
  .key.correct {
    background: #22c55e;


  }
  
  .key.wrong {
    background: #e50914;

  }
  
  #hints {
    margin-top: 20px;
    text-align: center;
  }
  


  #poster-container img.blurred {
    filter: blur(6px);
    transition: filter 0.5s ease;
  }
  
  .hint {
    margin-top: 8px;
  }
  
  footer {
    position: absolute;
    bottom: 10px;
    font-size: 0.8rem;
    opacity: 0.6;
    
  }

  /* === Animations === */
@keyframes flipIn {
    0% {
      transform: rotateX(90deg);
      opacity: 0;
    }
    100% {
      transform: rotateX(0deg);
      opacity: 1;
    }
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
  }
  
  @keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
  }
  
  .reveal {
    animation: flipIn 0.3s ease forwards;
  }
  
  #message {
    font-size: 1.2em;
    min-height: 1.4em;
  }
  
  #message.win {
    color: #22c55e;
    animation: bounce 1s ease;
  }
  
  #message.lose {
    color: #e50914;
    animation: fadeIn 0.5s ease;
  }


  /* === Modal === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #141414;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.hidden {
  display: none;
}


.modal-content {
  position: relative;
  background: #141414;
  padding: 10px;
  border: 0.2px solid #141414;
  border-radius: 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* max-width: 250px; */
  width: 60%;
  height: auto;

  /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.64); */
  animation: fadeIn 0.3s ease;
}

.modal-content img {
  width: 75%;
  height: auto;
  max-height: 70vh;
  border-radius: 2px;
  object-fit: contain;
}

#modal-title {
  font-size: 2em;
  margin-bottom: 10px;
}

#modal-message {
  font-size: 1.3em;
  margin-bottom: 20px;
  color: #ccc;
}



#button-house {
  margin-top: 30px;
}

.share-btn{
  font-family: "Ubuntu", sans-serif;
  background: linear-gradient(180deg, #742bb8, #8b58ba);
  border: 1px solid #742bb8;
  color: white;
  border-radius: 2px;
  padding: 0.7rem 3rem;
  font-size: 1.2rem;
  font-weight: bold;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  margin-left: 10px;
  margin-right: 10px;
  width: 14em;
  cursor: pointer;
  /* transition: all 0.2s ease; */
}



.close-button {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 2.5em;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  transition: color 0.5s ease;
  z-index: 10;
}



/* .close-button:hover {
  color: #1b9c4a;
} */

.share-btn:hover{
  background: #8c58bc;
}

#streak-info {
  color: #f9dc00;
  line-height: 1.75;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Top Bar */
.top-bar {
  display: flex;
  flex-direction: column; /* stack vertically */
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto;
  padding: 0 1rem;
  text-align: center;
}

.top-bar h1 {
  color: white;
  font-size: 1.8em;
  margin-bottom: 0.3em;
}

.top-bar p {
  color: #bbb;
  font-size: 1.1em;
  margin-bottom: 0.8em;
}



/* .top-btns {
  background: none;
  color: white;
  border-width: 1px;
  border: white;
  border-radius: 100px;
  padding: 8px 30px;
  margin-left: 10px;
  margin-right: 10px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 1em;
} */

/* .top-btns:hover {
  background: #199045;
} */


#hint-button {
  font-family: "Ubuntu", sans-serif;
  background: linear-gradient(180deg, #742bb8, #8b58ba);
  border: 1px solid #742bb8;
  color: white;
  border-radius: 2px;
  padding: 0.7rem 3rem;
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 2.5rem;
  margin-left: 10px;
  margin-right: 10px;
  width: 10em;
  cursor: pointer;
}

#hint-button:hover {
  background: #8c58bc;
}


/* Stats Modal */
#stats-body {
  text-align: center;
  color: #ccc;
  font-size: 1.1em;
}

#guess-graph {
  margin-bottom: 15px;
  margin-top: 15px;
}

.bar-row {
  display: flex;
  align-items: left;
  margin: 4px 0;
  gap: 8px;
}

.bar-row span:first-child {
  width: 20px;
  text-align: left;
  color: #aaa;
}



.bar-count {
  min-width: 20px;
  text-align: left;
  color: #ccc;
  font-size: 0.9em;
}

.bar {
  height: 16px;
  justify-content: left;
  background: linear-gradient(90deg, #742bb8, #742bb8);
  border-radius: 2px;
  width: 0%;
  transition: width 0.8s ease;
}

.empty-stats {
  color: #888;
  font-style: italic;
  text-align: center;
  margin-top: 10px;
}

.btn {
  font-family: "Ubuntu", sans-serif;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 10px;
  background: transparent;
  border: 1px solid #22c55e;
  color: white;
  border-radius: 10px;
  padding: 8px 107px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn:hover {
  background: #22c55e;

}

#reset-stats {
  display: none;
}

/* Fullscreen dark overlay */
#poster-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: none;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* When active */
#poster-modal:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.poster-modal-content {
  position: relative;
  background: none;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  /* Keep portrait shape and responsive sizing */
  width: auto;
  height: auto;
  max-height: 90vh;
  max-width: calc(90vh * 2 / 3); /* maintain 2:3 ratio dynamically */
}


/* Poster image fills modal */
#poster-full img {
  width: 75%;
  height: auto;
  max-height: 70vh;
  border-radius: 2px;
  object-fit: contain;
}


/* Close button (top-right corner) */
/* #close-poster {
  position: absolute;
  right: 2px;
  font-size: 2em;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  text-shadow: 0 0 8px rgba(0,0,0,0.8);
  transition: transform 0.2s ease, color 0.2s ease;
  top: 1px;
  font-size: 2.5em;
} */




@media (max-height: 700px) {
  .keyboard { transform: scale(0.85); }
  .game-area { padding-bottom: 0.5rem; }
}


@media (max-height: 640px) {
  .keyboard { transform: scale(0.75); }
}

:root {
  --vh: 1vh;
}


/* === Mobile Optimization === */
@media (max-width: 600px) {
  body {
    padding: 10px;
  }

  #dmq {
    font-size: 40px;
  }

  #app {
    max-width: 100%;
    margin-top: 10px;
  }

  header {
    margin-bottom: 20px;
  }

  .top-bar h1 {
    font-size: 1.3em;
  }

  .top-bar p {
    font-size: 0.9em;
  }



  #game {
    padding: 12px;
    gap: 16px;
    min-height: 55vh; /* slightly shorter so footer fits */
  }



  #word-container {
    margin-bottom: 60px;
    gap: 15px;
  }

  #keyboard {
    margin-top: 4px; /* small, consistent spacing */
    gap: 4px;
  }

  .key-row {
    gap: 4px;
  }

  .letter-box {
    width: 28px;
    height: 36px;
    font-size: 1.2em;
  }
  /* Reduce space between words in the movie title */
  .letter-box.space {
    width: 5px; /* smaller gap for mobile */
  }
  

  .key {
    width: 37px;
    height: 40px;
    font-size: 0.9em;
  }

  .lives-counter {
    font-size: 1.1em;
    margin: 10px;
  }

  .modal-content {
    width: 75%;
    height: 75%;
    padding: 20px;
  }

  #modal-title {
    font-size: 2em;
  }

  #modal-message {
    font-size: 1em;
  }

  .share-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1.1em;
    text-align: center;
    align-content: center;
    width: 20em;
  }

  .close-button {
    top: 1px;
    right: 2px;
    font-size: 2.5em;

  }

  #hint-button {
    font-size: 1rem;
  }



  #poster-name {
    margin-top: 20px;
    margin-bottom: 2px;
  }

  .btn {
    padding: 8px 98px;

  }
}

@media (max-width: 360px) {
  /* Ultra-small phones */
  .keyboard { transform: scale(0.9); }
  /* reduce padding/margins in the game area */
}



.full-height {
  height: calc(var(--vh, 1vh) * 100);
}

@supports(padding: max(0px)) {
  body {
    padding-bottom: max(env(safe-area-inset-bottom), 10px);
  }
}
