html,
body {
  touch-action: manipulation;
}

body {
  background: #121213;
  color: #ffffff;
  font-family: Arial, sans-serif;
  margin-top: 2%;
  /* padding: 0; */
  /* min-height: 100vh; */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.game-wrapper {
  width: 100%;
  max-width: 500px;
  /* padding: 20px; */
  /* padding-bottom: 20px; */
  /* padding-left: 20px; */
  /* padding-right: 20px; */
}

#board {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 10px;
  width: 80%;
  max-width: 80%;
}

.row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.cell {
  width: 100%;
  padding-top: 100%;
  position: relative;
  border: 2px solid #3a3a3c;
  text-transform: uppercase;
  font-size: 2rem;
  background: #121213;
  color: #fff;
  transition: transform 0.2s ease, background 0.2s ease;
}

#title {
  cursor: pointer;
}

.cell span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
}

.cell.flip {
  transform: rotateX(90deg);
}

.cell.correct {
  background: #538d4e;
  border-color: #538d4e;
}

.cell.present {
  background: #b59f3b;
  border-color: #b59f3b;
}

.cell.absent {
  background: #3a3a3c;
  border-color: #3a3a3c;
}

#keyboard {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  /* padding: 10px; */
  background: #121213;
  border-radius: 8px;
  /* box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); */
  /* border: 1px solid #3a3a3c; */
}

.keyboard-row {
  display: flex;
  justify-content: center;
  /* flex-wrap: wrap; */
  padding-top: 1%;
  padding-bottom: 1%;
  gap: 5px;
}

.key {
  padding: 10px;
  background: #818384;
  border: none;
  color: white;
  font-weight: bold;
  border-radius: 4px;
  flex: 1 0 auto;
  min-width: 9%;
  max-width: 14%;
  user-select: none;
  transition: transform 0.1s ease, background 0.1s ease;
}

.key:active,
.key.pressed {
  transform: scale(0.95);
  background: #666;
}

.key.wide {
  min-width: 12%;
  /* max-width: 14%; */
}

#dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #222;
  color: #fff;
  padding: 20px 30px;
  border-radius: 8px;
  box-shadow: 0 0 10px #000;
  display: none;
  text-align: center;
  max-width: 90%;
}

#dialog button {
  margin-top: 15px;
  padding: 8px 16px;
  background: #538d4e;
  border: none;
  color: white;
  border-radius: 4px;
}

h2 {
  font-weight: 600;
  letter-spacing: 2px;
}

#skull-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.skull {
  position: absolute;
  top: -50px;
  font-size: 2rem;
  opacity: 1;
  animation: fall linear forwards;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.key-correct {
  background: #538d4e !important;
}

.key-present {
  background: #b59f3b !important;
}

.key-absent {
  background: #3a3a3c !important;
}

.notification {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 1rem;
  opacity: 0.95;
  z-index: 9999;
}
