* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  background: linear-gradient(135deg, #8ee7ff, #ffd1f1, #fff49b);
  color: #284262;
}

.landing {
  width: min(96vw, 1120px);
  height: min(94vh, 680px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(0.6rem, 2vh, 1.2rem);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.7rem, 2vw, 1.4rem);
  padding: clamp(0.65rem, 2vh, 1.2rem);
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
  border: clamp(5px, 1vw, 9px) solid white;
  border-radius: clamp(22px, 4vh, 38px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

.logo {
  font-size: clamp(2.6rem, 8vh, 5rem);
  line-height: 1;
}

h1 {
  margin: 0;
  color: #5b37ff;
  font-size: clamp(2.2rem, 7vh, 4.7rem);
  line-height: 1;
}

.game-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(0.7rem, 2vw, 1.2rem);
}

.game-card {
  min-height: 0;
  display: grid;
  place-items: center;
  gap: clamp(0.35rem, 1.5vh, 0.8rem);
  padding: clamp(0.8rem, 2vh, 1.4rem);
  text-align: center;
  text-decoration: none;
  color: #284262;
  background: rgba(255, 255, 255, 0.82);
  border: clamp(5px, 1vw, 8px) solid white;
  border-radius: clamp(24px, 5vh, 40px);
  box-shadow: 0 clamp(8px, 2vh, 14px) 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-game {
  background: linear-gradient(160deg, rgba(255,255,255,0.9), rgba(255,244,155,0.92));
  animation: breathe 1.6s ease-in-out infinite;
}

.game-card[href]:hover,
.game-card[href]:focus-visible {
  transform: translateY(-8px) rotate(-1deg);
  outline: none;
}

.coming-soon {
  opacity: 0.42;
  filter: saturate(0.75);
}

.card-icon {
  font-size: clamp(3.3rem, 13vh, 7rem);
  line-height: 1;
}

.primary-game .card-icon {
  font-size: clamp(5rem, 22vh, 11rem);
}

.card-title {
  color: #ff4f8b;
  font-size: clamp(1.5rem, 5vh, 3rem);
  font-weight: 900;
  line-height: 1;
}

.primary-game .card-title {
  font-size: clamp(2rem, 7vh, 4rem);
}

.play-button {
  padding: clamp(0.65rem, 2vh, 1rem) clamp(1.4rem, 4vw, 2.4rem);
  color: white;
  font-size: clamp(1.5rem, 5vh, 3rem);
  font-weight: 900;
  line-height: 1;
  background: #34c759;
  border: 5px solid white;
  border-radius: 999px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.14);
}

.home-link {
  position: fixed;
  top: clamp(0.5rem, 2vh, 1rem);
  left: clamp(0.5rem, 2vh, 1rem);
  z-index: 5;
  width: clamp(3rem, 9vh, 4.5rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: white;
  text-decoration: none;
  font-size: clamp(1.5rem, 5vh, 2.3rem);
  font-weight: 900;
  background: #5b37ff;
  border: 5px solid white;
  border-radius: 50%;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.14);
}

.game {
  width: min(92vw, 760px);
  height: min(94vh, 660px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  place-items: center;
  gap: clamp(0.4rem, 2vh, 1rem);
  padding: clamp(0.8rem, 2.5vh, 2rem);
  text-align: center;
  background: rgba(255, 255, 255, 0.75);
  border: clamp(6px, 1.5vw, 10px) solid white;
  border-radius: clamp(26px, 5vh, 40px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

.game h1 {
  font-size: clamp(2rem, 8vh, 4rem);
}

.letter {
  width: min(58vh, 65vw, 390px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: min(32vh, 12rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 10px 0 rgba(0, 0, 0, 0.15);
  background: #ff5c8a;
  box-shadow: inset 0 -18px 0 rgba(0, 0, 0, 0.12), 0 18px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, background 0.2s ease;
}

.letter.correct {
  animation: pop 0.55s ease;
}

.letter.wrong {
  animation: wiggle 0.35s ease;
}

.message {
  min-height: 1em;
  margin: 0;
  color: #284262;
  font-size: clamp(2rem, 8vh, 4rem);
  line-height: 1;
  font-weight: 900;
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  font-size: 4rem;
  animation: fly 1s ease-out forwards;
}

@media (max-width: 760px), (max-height: 560px) {
  .landing {
    height: 96vh;
  }

  .game-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto auto;
  }

  .coming-soon {
    display: none;
  }

  .primary-game .card-icon {
    font-size: clamp(5rem, 24vh, 10rem);
  }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

@keyframes pop {
  0% { transform: scale(1) rotate(0deg); }
  45% { transform: scale(1.25) rotate(8deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes wiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-18px); }
  75% { transform: translateX(18px); }
}

@keyframes fly {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
  }
  to {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(1.4) rotate(220deg);
  }
}
