body {
  font-family: Arial, sans-serif;
  text-align: center;
  background: linear-gradient(to right, #f0f8ff, #e6f0ff);
  color: #333;
}

/* Title */
h1 {
  font-size: 2rem;
  color: #007bff;
  text-transform: uppercase;
  margin-top: 40px;
  letter-spacing: 2px;
}

/* Game Board */
#board {
  display: grid;
  gap: 5px;
  justify-content: center;
  margin-top: 10%;
  width: 100%;
}

.row {
  display: grid;
  grid-template-columns: repeat(5, 60px);
  gap: 5px;
  justify-content: center;
}

.tile-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: inline-block;
  position: relative;
}

.tile {
  background-color: #ffffff;
  border: 2px solid #007bff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  color: #333;

  width: 100%;
  height: 100%;
  border-radius: 8px;
  font-size: 2rem;
  font-weight: bold;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  /*transition: background-color 0.2s ease, transform 0.1s ease;*/
}

/* Message */
#message {
  font-size: 1.2rem;
  color: #007bff; 
}

/* Keyboard */
#keyboard {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  align-items: center;
  margin: auto;
}

.keyboard-row {
  margin-top: 5px;
  display: flex;
  aspect-ratio: 9 / 1; 
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.key {
  background-color: #007bff;
  color: white; 
  box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3); 

  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  height: 100%;
  width: 9%; 
  /*transition: transform 0.05s ease, box-shadow 0.05s ease;   Smooth transition for the press effect */
}

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

.key:active { 
  background-color: #004494;
  transform: translateY(2px);   
  box-shadow: 0 0px 2px rgba(0, 0, 0, 0.4); 
}

.wide-key {
  width: 18%; 
}

/* Tile feedback colors */
.correct {
  background-color: #28a745 !important;
  border-color: #28a745 !important;
  color: white !important;
}

.present {
  background-color: #ffc107 !important;
  border-color: #ffc107 !important;
  color: white !important;
}

.absent {
  background-color: #6c757d;
  border-color: #6c757d;
  color: white;
}
 
.result-message {
  margin-top: 20px;
  font-weight: bold;
  font-size: 1rem;
  color: #007bff;
}
 

.message-label { 
  position: absolute; 
  top: 12%;
  left: 60%;
  transform: rotate(7deg); /* center + slight rotation */
  background-color: rgba(255, 255, 255, 1); 
  border: 2px solid #ccc;
  border-radius: 8px;
  font-size: 0.8rem; 
  z-index: 100000;
  padding: 4px;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
  pointer-events: none; /* makes sure it doesn't interfere with clicks */
  color: #000;
}
.message-label.hidden {
  display: none;
}
 

/*Animation stuff*/
@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.25s ease;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.pop {
  animation: pop 100ms ease;
}

.flash-red {
  animation: flashRed 0.25s;
}

@keyframes flashRed {
  0% { background-color: #ff4c4c; }
  100% { background-color: 1; } /*no idea why this works, but this needs to be like this lol */
}

@keyframes infiniteShake {
  0%  { transform: translate(1px, 0px); }
  10% { transform: translate(-1px, 0px); }
  20% { transform: translate(0px, 1px); }
  30% { transform: translate(-1px, -1px); }
  40% { transform: translate(1px, 0px); }
  50% { transform: translate(0px, 1px); }
  60% { transform: translate(0px, -1px); }
  70% { transform: translate(-1px, 0px); }
  80% { transform: translate(1px, 1px); }
  90% { transform: translate(-1px, 0px); }
  100% { transform: translate(0, -1px); }
}

.tile-container.infinite-shake {
  animation-name: infiniteShake;
  animation-timing-function: ease-in-out;
  animation-iteration-count: 100;
}

@keyframes infiniteShakeHalf {
  0%  { transform: translate(0x, 0px); }
  10% { transform: translate(-0.75px, 0px); }
  20% { transform: translate(0px, 0px); }
  30% { transform: translate(-0.75px, 0px); }
  40% { transform: translate(0.75px, 0px); }
  50% { transform: translate(0px, 0.75px); }
  60% { transform: translate(0px, -0.75px); }
  70% { transform: translate(-0.75px, 0px); }
  80% { transform: translate(0px, 0.75px); }
  90% { transform: translate(-0.75px, 0px); }
  100% { transform: translate(0, 0px); }
}

.tile-container.infinite-shake-half {
  animation-name: infiniteShakeHalf;
  animation-timing-function: ease-in-out;
  animation-iteration-count: 50;
}

@keyframes infiniteShakeTiny {
  0%  { transform: translate(0x, 0px); }
  10% { transform: translate(0px, -0.5px); }
  20% { transform: translate(0px, 0px); }
  30% { transform: translate(-0.5px, 0px); }
  40% { transform: translate(0px, 0px); }
  50% { transform: translate(0px, 0px); }
  60% { transform: translate(0px, 0px); }
  70% { transform: translate(-0.5px, 0px); }
  80% { transform: translate(0px, 0.5px); }
  90% { transform: translate(-0.5px, 0px); }
  100% { transform: translate(0, 0px); }
}

.tile-container.infinite-shake-tiny {
  animation-name: infiniteShakeTiny;
  animation-timing-function: ease-in-out;
  animation-iteration-count: 50;
}


/* Font size needs to be 16 to stop double tap zooming in on safari */
button,
input,
select,
textarea {
  font-size: 16px !important;
  touch-action: manipulation; /* Helps prevent double-tap zoom */
}
.key {
  font-size: 16px !important;
  touch-action: manipulation;
}



