:root {
  --color-tone-1: #ffffff;
  --color-tone-2: #818384;
  --color-tone-3: #565758;
  --color-tone-4: #3a3a3c;
  --color-present: #b59f3b;
  --color-correct: #538d4e;
  --color-absent: #3a3a3c;
  --keyboard-bg: #818384;
}

* {
  box-sizing: border-box;
  font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
}

body {
  background-color: #121213;
  background-image: linear-gradient(rgba(18, 18, 19, 0.85), rgba(18, 18, 19, 0.85)), url('Bdome.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-size: 16px;
}

.alert-container {
  position: fixed;
  top: 10vh;
  left: 50vw;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.alert {
  pointer-events: none;
  background-color: #ffffff;
  padding: 15px;
  border-radius: 5px;
  opacity: 1;
  transition: opacity 500ms ease-in-out;
  margin-bottom: 10px;
  color: #000;
  font-weight: bold;
}

.alert.hide {
  opacity: 0;
}

.game-header {
  text-align: center;
  padding: 8px 0;
  margin-bottom: 5px;
}

.game-title {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-byline {
  margin: 5px 15px 0 15px;
  font-size: 0.85rem;
  color: var(--color-tone-2);
}

.days-remaining {
  margin: 8px 0 0 0;
  font-size: 0.8rem;
  color: var(--color-correct);
  font-weight: 600;
  letter-spacing: 0.05em;
}

[data-days-remaining] {
  color: #ffdb61;
  font-weight: 700;
}

/* [data-target-word-display] {
  color: #ffffff;
  font-weight: 700;
} */

.guess-grid {
  display: grid;
  justify-content: center;
  align-content: center;
  grid-template-columns: repeat(var(--word-length, 5), min(12vw, 3.5em));
  grid-template-rows: repeat(6, min(12vw, 3.5em));
  gap: 0.25em;
  padding: 10px;
}

.tile {
  width: 100%;
  height: 100%;
  border: 2px solid var(--color-tone-4);
  color: white;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  transition: transform 250ms linear;
}

.tile[data-state="active"] {
  border-color: var(--color-tone-3);
}

.tile[data-state="wrong"] {
  border: none;
  background-color: var(--color-absent);
}

.tile[data-state="wrong-location"] {
  border: none;
  background-color: var(--color-present);
}

.tile[data-state="correct"] {
  border: none;
  background-color: var(--color-correct);
}

.tile.shake {
  animation: shake 250ms ease-in-out;
}

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

.footer-credit {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-tone-2);
  margin: 1px 0 5px 0;
  padding: 0 10px;
}

.footer-credit .heart {
  color: rgb(148, 11, 11);
  font-size: 1rem;
}

.footer-credit a {
  color: var(--color-correct);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-credit a:hover {
  color: var(--color-correct);
  text-decoration: underline;
}

@keyframes shake {

  10%,
  90% {
    transform: translateX(-5%);
  }

  20%,
  80% {
    transform: translateX(5%);
  }

  30%,
  50%,
  70% {
    transform: translateX(-7.5%);
  }

  40%,
  60% {
    transform: translateX(7.5%);
  }
}

.keyboard {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  grid-auto-rows: 3em;
  gap: 0.25em;
  justify-content: center;
  padding: 0 6px 2em;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.key {
  font-size: clamp(0.75em, 3.5vw, 1.25em);
  grid-column: span 2;
  border: none;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--keyboard-bg);
  color: white;
  fill: white;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  font-weight: bold;
}

.key.large {
  grid-column: span 3;
}

.key:hover,
.key:focus {
  background-color: var(--color-tone-2);
}

.key[data-state="wrong"] {
  background-color: var(--color-absent);
}

.key[data-state="wrong-location"] {
  background-color: var(--color-present);
}

.key[data-state="correct"] {
  background-color: var(--color-correct);
}

.space {
  grid-column: span 1;
}

.keyboard.hide {
  display: none;
}

.end-game-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(18, 18, 19, 0.85);
  z-index: 100;
}

.end-game-container.hide {
  display: none;
}

.end-game-modal {
  background-color: var(--color-tone-4);
  padding: 30px 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--color-tone-3);
  max-width: 90%;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.end-game-title {
  margin: 0 0 15px 0;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.target-word-display {
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 25px;
  font-weight: bold;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.share-btn {
  background-color: var(--color-present);
  color: white;
  border: none;
  padding: 12px 32px;
  font-size: 1.15rem;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  transition: background-color 0.2s, transform 0.1s;
}

.share-btn:hover {
  background-color: #4caf50;
  transform: scale(1.04);
}

.share-btn:active {
  transform: scale(0.97);
}

.share-btn.copied {
  background-color: var(--color-tone-3);
}

.timer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 1px solid var(--color-tone-3);
  padding-top: 15px;
}

.timer-section h3 {
  margin: 0 0 10px 0;
  font-size: 1rem;
  color: var(--color-tone-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.timer {
  font-size: 2.5rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.reminder-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 18px;
  background-color: #6aaa64;
  /* Wordle green */
  color: white;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.2s;
}

.reminder-btn:hover {
  background-color: #5a9a55;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.reminder-btn:active {
  transform: translateY(0);
  box-shadow: none;
}
