:root {
  --ink: #1a2a3a;
  --sky-soft: #c8e8f5;
  --sky-mid: #7ec8e3;
  --mint: #b8e6c8;
  --sun: #f5c84c;
  --cream: #fff8e8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--sky-soft);
}

.site-bg {
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, var(--sun) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 20%, var(--mint) 0%, transparent 50%),
    linear-gradient(165deg, #dff3fb 0%, var(--sky-soft) 40%, #a8d9c0 100%);
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  pointer-events: none;
  z-index: -1;
  animation: drift 14s ease-in-out infinite;
}

.blob-a {
  width: min(48vw, 320px);
  height: min(48vw, 320px);
  background: #ffe08a;
  top: 8%;
  right: 5%;
}

.blob-b {
  width: min(56vw, 380px);
  height: min(56vw, 380px);
  background: #8fd4b8;
  bottom: 5%;
  left: -8%;
  animation-delay: -5s;
  animation-direction: reverse;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(12px, -18px) scale(1.06);
  }
}

.brand-float {
  animation: brand-bob 3.2s ease-in-out infinite;
}

@keyframes brand-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.game-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.15rem 1.35rem;
  border-radius: 1.25rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 0 rgba(26, 42, 58, 0.18);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.game-card:hover {
  transform: translateY(-3px);
  filter: brightness(1.05);
}

.game-card:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 rgba(26, 42, 58, 0.18);
}

.game-card:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.game-card__icon {
  flex-shrink: 0;
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.22);
}

.game-card__icon::before,
.game-card__icon::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
}

/* Train: simple engine silhouette */
.game-card__icon--train::before {
  left: 0.55rem;
  bottom: 0.7rem;
  width: 2.1rem;
  height: 1.15rem;
  border-radius: 0.35rem 0.55rem 0.25rem 0.25rem;
}

.game-card__icon--train::after {
  left: 0.85rem;
  bottom: 1.75rem;
  width: 1.15rem;
  height: 0.7rem;
  border-radius: 0.2rem 0.2rem 0 0;
}

/* Claw: arm + hook */
.game-card__icon--claw::before {
  left: 50%;
  top: 0.45rem;
  width: 0.28rem;
  height: 1.35rem;
  transform: translateX(-50%);
  border-radius: 999px;
}

.game-card__icon--claw::after {
  left: 50%;
  top: 1.55rem;
  width: 1.35rem;
  height: 0.7rem;
  transform: translateX(-50%);
  border-radius: 0 0 0.65rem 0.65rem;
  background: transparent;
  border: 0.28rem solid rgba(255, 255, 255, 0.95);
  border-top: none;
}

/* Dash: runner block + ground */
.game-card__icon--dash::before {
  left: 0.85rem;
  bottom: 1.15rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.3rem;
}

.game-card__icon--dash::after {
  left: 0.55rem;
  bottom: 0.55rem;
  width: 2.15rem;
  height: 0.28rem;
  border-radius: 999px;
}

/* Soccer Superstars: ball + goal line */
.game-card__icon--soccer::before {
  left: 0.75rem;
  top: 0.5rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, #1a2a3a 0 0.28rem, transparent 0.3rem), rgba(255, 255, 255, 0.95);
}

.game-card__icon--soccer::after {
  left: 0.55rem;
  bottom: 0.55rem;
  width: 2.15rem;
  height: 0.28rem;
  border-radius: 999px;
}

/* Cup Hunt: cup body + rim */
.game-card__icon--cup::before {
  left: 0.85rem;
  bottom: 0.55rem;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 0.2rem 0.2rem 0.55rem 0.55rem;
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}

.game-card__icon--cup::after {
  left: 0.7rem;
  bottom: 2rem;
  width: 1.85rem;
  height: 0.45rem;
  border-radius: 999px;
}

/* Food Cart Fun: striped awning over a cart */
.game-card__icon--cart::before {
  left: 0.5rem;
  top: 0.6rem;
  width: 2.25rem;
  height: 0.75rem;
  border-radius: 0.4rem 0.4rem 0.15rem 0.15rem;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0 0.375rem, rgba(255, 255, 255, 0.45) 0.375rem 0.75rem);
}

.game-card__icon--cart::after {
  left: 0.75rem;
  bottom: 0.6rem;
  width: 1.75rem;
  height: 1.1rem;
  border-radius: 0.25rem 0.25rem 0.5rem 0.5rem;
}

/* Word Hunt: letter grid tile */
.game-card__icon--hunt::before {
  left: 0.55rem;
  top: 0.55rem;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.35rem;
  background: transparent;
  border: 0.28rem solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0.55rem 0.55rem 0 -0.28rem rgba(255, 255, 255, 0.95),
    0.55rem 0.55rem 0 0 rgba(255, 255, 255, 0.35);
}

.game-card__icon--hunt::after {
  display: none;
}

/* Story Adventures: open book */
.game-card__icon--story::before {
  left: 0.55rem;
  bottom: 0.55rem;
  width: 1.05rem;
  height: 1.7rem;
  border-radius: 0.15rem 0.35rem 0.25rem 0.15rem;
  transform: skewY(-6deg);
}

.game-card__icon--story::after {
  right: 0.55rem;
  left: auto;
  bottom: 0.55rem;
  width: 1.05rem;
  height: 1.7rem;
  border-radius: 0.35rem 0.15rem 0.15rem 0.25rem;
  transform: skewY(6deg);
}

.game-card__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.game-card__title {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.game-card__blurb {
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.9;
  line-height: 1.25;
}

.game-card__chevron {
  flex-shrink: 0;
  font-size: 1.5rem;
  opacity: 0.85;
  transition: transform 160ms ease;
}

.game-card:hover .game-card__chevron {
  transform: translateX(4px);
}

/* Shared coming-soon game shell */
.game-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.game-shell__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  backdrop-filter: blur(6px);
  box-shadow: 0 3px 0 rgba(26, 42, 58, 0.12);
  transition: transform 140ms ease;
}

.back-link:hover {
  transform: translateY(-1px);
}

.back-link:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(26, 42, 58, 0.12);
}

.coming-soon {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem 4rem;
}

.coming-soon__badge {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.coming-soon__title {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 0.75rem;
}

.coming-soon__copy {
  max-width: 22rem;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 0.8;
}

/* Footer credit link (home → About) */
.credit-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(26, 42, 58, 0.3);
  transition: color 140ms ease, text-decoration-color 140ms ease;
}

.credit-link:hover,
.credit-link:focus-visible {
  color: var(--ink);
  text-decoration-color: var(--sun);
}

/* About page */
.about-card {
  margin-bottom: 1.75rem;
  overflow: hidden;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 0 rgba(26, 42, 58, 0.12);
  backdrop-filter: blur(6px);
}

.about-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  /* round the scene itself too: Safari doesn't clip a WebGL canvas to the card's corners */
  border-radius: 1.5rem 1.5rem 0 0;
  isolation: isolate;
  background: #fff8e8;
}

.about-scene canvas {
  border-radius: inherit;
}

/* full-screen button, bottom-right of each scene */
.scene-fs {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 0.7rem;
  background: rgba(26, 42, 58, 0.28);
  color: #fff;
  cursor: pointer;
  opacity: 0.75;
  backdrop-filter: blur(4px);
  transition: opacity 140ms ease, background 140ms ease, transform 140ms ease;
}

.scene-fs:hover,
.scene-fs:focus-visible {
  opacity: 1;
  background: rgba(26, 42, 58, 0.5);
}

.scene-fs:active {
  transform: scale(0.94);
}

.scene-fs:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* the scene grown to fill the browser window */
.about-scene.is-filled {
  position: fixed;
  inset: 0;
  z-index: 50;
  width: 100%;
  height: 100dvh;
  aspect-ratio: auto;
  border-radius: 0;
}

.scene-filled,
.scene-filled body {
  overflow: hidden;
}

/* the card's blur would trap the fixed-position scene inside it */
.scene-filled .about-card {
  backdrop-filter: none;
}

.about-scene--memory {
  background: #fff3e0;
}

.about-card__body {
  padding: 1.35rem 1.5rem 1.6rem;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.6;
}

.about-card__body p + p {
  margin-top: 0.75rem;
}

.about-card__title {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.about-card__eyebrow {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c45a3d;
}

.about-card__hint {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(26, 42, 58, 0.5);
}

.about-card--memory .about-card__title {
  margin-top: 0.15rem;
}

@media (max-width: 520px) {
  .about-scene {
    aspect-ratio: 4 / 3.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blob,
  .brand-float {
    animation: none;
  }

  .game-card,
  .game-card__chevron,
  .back-link,
  .credit-link {
    transition: none;
  }
}
