/*
 * Copyright (c) 2025-2026 Evolution Creek Software. All rights reserved.
 *
 * Unauthorized copying, linking, or other unintended use of this file
 * (in part or in whole) is strictly prohibited.
 */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.wrongLetters{
  width: 20px;
  aspect-ratio: 1/4;
  position: relative;
  font-family: 'Salsa', cursive;
  font-size: 1.8rem;
  line-height: 2;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.mainContainer{
  display: flex;
  gap: 20px;
  margin-top: 2.5rem;
}


#hangmanContainer {
  position: relative;
  width: min(200px, 90vw);
  aspect-ratio: 2/2.5;
}

.gallow {
  position: absolute;
  background-color: saddlebrown;
  border-radius: 5px;
}

.gallow.base {
  width: 200px;
  height: 7px;
  bottom: 0;
  left: 0;
}

.gallow.pole {
  width: 7px;
  height: 100%;
  bottom: 0;
  left: 30px;
}

.gallow.beam {
  width: 100px;
  height: 7px;
  top: 0;
  left: 30px;
}

.gallow.support {
  width: 7px;
  height: 70px;
  top: 0;
  left: 80px;
  transform-origin: top left;
  transform: rotate(45deg);
}

.gallow.rope {
  width: 5px;
  height: 30px;
  top: 3px;
  left: 125px;
}

.hangman {
  position: absolute;
  opacity: 0;
  background-color: black;
  transition: opacity 0.3s ease;
}

.hangman.head {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  top: 30px;
  left: 109px;
  background-color: transparent;
  border: 3px solid black;
}

.hangman.body {
  width: 4px;
  height: 60px;
  top: 65px;
  left: 125px;
}

.hangman.arm.left {
  width: 40px;
  height: 4px;
  top: 80px;
  left: 87px;
  border-radius: 5px;
  transform: rotate(-30deg);
  transform-origin: right center;
}

.hangman.arm.right {
  width: 40px;
  height: 4px;
  top: 80px;
  left: 127px;
  transform: rotate(30deg);
  border-radius: 5px;
  transform-origin: left center;
}

.hangman.leg.left {
  width: 40px;
  height: 4px;
  top: 122px;
  left: 87px;
  transform: rotate(-45deg);
  border-radius: 5px;
  transform-origin: right center;
}

.hangman.leg.right {
  width: 40px;
  height: 4px;
  top: 122px;
  left: 127px;
  border-radius: 5px;
  transform: rotate(45deg);
  transform-origin: left center;
}

#definition{
  font-family: 'Salsa', cursive;
  font-size: 25px;
  width: min(700px, 90vw);
  display: flex;
  position: relative;
  margin-top: 1rem;
  text-align: center;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#grid {
  width: min(800px, 95vw);
  display: flex;
  flex-wrap: wrap;           /* allows rows to wrap */
  justify-content: center;
  align-items: flex-start;
  gap: 10px 16px;            /* row-gap column-gap between word groups */
  position: relative;
  margin-top: 1rem;
}

.word-group {
  display: flex;
  flex-wrap: nowrap;          /* keep each word on one line */
}

.cell {
  width: 100%;
  aspect-ratio: 1/1;
  max-width: 55px;
  min-height: 55px;
  overflow: hidden;
  border-top: 3px solid;
  border-bottom: 3px solid;
  border-left: 0;
  border-right: 0;
  border-image: linear-gradient(90deg, #ffebcd 10%, #8b4513 10%, #8b4513 90%, #ffebcd 90%) 1;
  background-color: blanchedalmond;
  font-family: "Salsa", cursive;
  font-weight: 400;
  font-style: normal;
  font-size: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s, transform 0.2s ease, border-image 0.2s ease, border-color 0.2s ease;
}

.thick-left {
  border-image: linear-gradient(90deg, #8b4513 90%, #ffebcd 90%) 1;
  border-left: 3px solid;
  border-top: 3px solid;
  border-bottom: 3px solid;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.thick-right {
  border-image: linear-gradient(90deg, #ffebcd 10%, #8b4513 10%) 1;
  border-right: 3px solid #8b4513;
  border-top: 3px solid #8b4513;
  border-bottom: 3px solid #8b4513;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.thick-everywhere {
  border: 3px solid #8b4513;
  border-radius: 0;
}

.hidden {
  display: none;
}

#categoryScreen {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 95vw;
}

#categoryGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.category-btn {
  padding: 20px 30px;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 12px;
  /* match your existing .button styling */
}

#keyboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 1.4rem;
  width: min(600px, 95vw);
  box-sizing: border-box;
}

.key-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 1rem;
}

.row-1{
  width: 100%;
}

.row-2{
  width: 90%;
}

.row-3{
  width: 70%;
}

.key {
  font-family: 'Salsa', cursive;
  font-size: 1.5rem;
  width: 100%;
  aspect-ratio: 4/5;
  border: 2px solid saddlebrown;
  border-radius: 8px;
  background-color: wheat;
  color: black;
  cursor: pointer;
  text-transform: lowercase;
  box-shadow: 0 3px 0 peru;
  transition: background-color 0.2s ease, box-shadow 0.1s ease,
              transform 0.1s ease, color 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.key:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 peru;
}

.key.key-correct {
  background-color: #7bbf72;
  border-color: #4a8c42;
  box-shadow: 0 3px 0 #3a6e32;
  color: white;
  cursor: default;
}

.key.key-wrong {
  background-color: #c97b6a;
  border-color: #8b3a2a;
  box-shadow: 0 3px 0 #6b2a1a;
  color: white;
  cursor: default;
}

.key.key-used {
  opacity: 0.75;
}

@keyframes zoomAnimation {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.zoom{
  animation: zoomAnimation 0.4s ease;
}

@media (hover: hover) and (pointer: fine){
  .key:not(.key-used):not(:disabled):hover {
    background-color: burlywood;
  }

  .button:hover{
    background-color: peru;
  }
}

.score {
  min-width: 80px;
}

#lifetimeStats {
  display: flex;
  gap: 1.5rem;
  font-family: 'Caveat', cursive;
  font-size: clamp(18px, 2.5vw, 26px);
  justify-content: center;
  text-align: center;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

#hangmanPoints {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

#buttons{
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.3rem;
  margin-bottom: 2rem;
}

.button {
  margin-top: 20px;
  width: min(200px, 30vw);
  display: flex;
  color: black;
  font-family: 'Caveat', cursive;
  white-space: nowrap;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  padding: 0.5em 1em;
  border: 2px solid black;
  border-radius: 10px;
  cursor: pointer;
  background-color: moccasin;
  color: black;
  transition: background-color 0.4s ease, border-color, 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, transform 0.2s ease;
}

.button:active{
  transform: scale(0.95);
}

#newGameButton{
  display: none;
}

@media (max-width: 600px) {
  #definition{
    font-family: 'Salsa', cursive;
    font-size: 22px;
    max-width: 95vw;
  }


  #grid {
    max-width: 95vw;
  }

  .cell {
    font-size: 1.5rem;
    line-height: 1;
    max-width: 40px;
    min-height: 40px;
  }

  .key-row {
    gap: 3px;
    margin-bottom: 0.5rem;
  }

  .key{
    font-size: 1.2rem;
    aspect-ratio: 3/4;
  }

  #buttons{
    max-width: 90vw;
  }

  .button{
    width: 40vw;
    font-size: 25px;
    padding: 0.5em 0.5em;
    border-radius: 10px;
  }

  .button:hover{
    width: 40vw;
  }
}
