/* LingoCat minigames: hub, shared game chrome and each game's pieces (felt, yarn, bubbles...). */

/* ------------------------------------------------------------------ hub */

.games-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.games-head p { color: var(--ink); font-weight: 700; padding: 0 4px; }
.games-level { display: grid; justify-items: center; gap: 2px; font-size: var(--t-xs); font-weight: 800; color: var(--ink); }
.game-coins {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 24px;
}
.game-coins > .emo { width: 42px; height: 42px; }
.game-coins-main { display: grid; gap: 5px; min-width: 0; }
.game-coins-main strong { font-size: var(--t-s); }
.game-coins-main small { color: var(--ink-2); font-weight: 700; font-size: var(--t-xs); }
.game-coins .bar { --a: var(--cta-a); --b: var(--cta-b); height: 10px; }
.game-level { padding: 3px; }
.game-level button { min-height: 34px; padding: 4px 12px; }

.cat-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 4px 8px;
  margin: 0 -4px;
  scrollbar-width: none;
}
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 14px 4px 6px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-weight: 800;
  font-size: var(--t-s);
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.cat-chip .emo { width: 28px; height: 28px; }
.cat-chip-icon { display: grid; place-items: center; width: 28px; height: 28px; color: var(--accent-ink); }
.cat-chip[aria-checked="true"] { border-color: var(--accent); background: var(--glass-strong); color: var(--accent-ink); }

.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.game-card {
  position: relative;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 4px;
  padding: 14px 14px 16px;
  border-radius: 26px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.game-card:hover:not(:disabled) { transform: translateY(-3px); }
.game-card:active:not(:disabled) { transform: scale(0.98); }
.game-card-art {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--tile-a), var(--tile-b));
  box-shadow: inset 0 2px 0 #fff, 0 10px 18px -12px rgb(var(--shade) / 0.6);
}
.game-card-art .emo { width: 46px; height: 46px; transition: transform 0.2s ease; }
.game-card:hover .game-card-art .emo { transform: rotate(-8deg) scale(1.08); }
.game-card-name { font-size: 1.02rem; line-height: 1.2; }
.game-card-about { font-size: var(--t-xs); color: var(--ink-2); font-weight: 700; line-height: 1.35; }
.game-card-best {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px 2px 4px;
  border-radius: 999px;
  background: var(--glass-strong);
  font-size: var(--t-xs);
  font-weight: 800;
}
.game-card-best .icon { color: #f0a81c; }
.game-card.is-off { opacity: 0.6; cursor: not-allowed; }
.game-card.is-off .game-card-art .emo { filter: grayscale(0.8); }

/* ------------------------------------------------------------------ runner chrome */

.game-screen {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.game-loading { display: grid; justify-items: center; gap: 10px; padding-top: 30vh; font-weight: 800; color: var(--ink); }
.game-loading .emo { width: 80px; height: 80px; animation: bob 1s ease-in-out infinite alternate; }
.game-progress {
  flex: 1;
  height: 16px;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass);
  border: 1.5px solid var(--glass-line);
  overflow: hidden;
}
.game-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cta-a), var(--cta-b));
  transition: width 0.4s ease;
}
.game-timer { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; font-variant-numeric: tabular-nums; }
.game-timer .icon { color: var(--accent-ink); }
.score-pill .icon { color: #f0a81c; }
.game-timer.is-low { color: var(--bad-ink); animation: pulse 0.8s ease-in-out infinite; }
.game-body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 2px 16px calc(24px + env(safe-area-inset-bottom)); }
.game-title-row h1 { font-size: 1.5rem; color: var(--title); text-shadow: var(--title-shadow); }
.game-title-row p { font-weight: 700; color: var(--ink); }
.game-stage-wrap { position: relative; padding: 16px; border-radius: var(--r-xl); }
.game-stage { position: relative; display: grid; gap: 14px; }
.game-fx { z-index: 10; }
.game-meta { text-align: center; font-weight: 800; color: var(--ink-2); font-size: var(--t-s); }

.word-pic { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgb(var(--shade) / 0.25)); user-select: none; -webkit-user-drag: none; }
.word-pic-text { display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; filter: none; text-align: center; }

/* the cat cheering from below the board */
.game-cat {
  position: relative;
  align-self: center;
  width: 110px;
  height: 110px;
  margin-top: -6px;
}
.game-cat .thumb-box { width: 100%; height: 100%; }
.game-cat.hop { animation: cat-hop 0.55s ease-out; }
.game-cat.droop { animation: cat-droop 0.6s ease-out; }
@keyframes cat-hop {
  30% { transform: translateY(-16px) scale(1.04, 0.97); }
  60% { transform: translateY(0) scale(0.97, 1.04); }
}
@keyframes cat-droop {
  30% { transform: rotate(-8deg); }
  60% { transform: rotate(6deg); }
}
.cat-bubble {
  position: absolute;
  left: 92%;
  top: 8px;
  padding: 6px 12px;
  border-radius: 16px 16px 16px 4px;
  background: var(--glass-strong);
  box-shadow: 0 10px 20px -12px rgb(var(--shade) / 0.6);
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.6) translateY(6px);
  transform-origin: 0 100%;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 1.4, 0.4, 1);
  pointer-events: none;
}
.cat-bubble.is-on { opacity: 1; transform: none; }
.cat-bubble.is-good { color: var(--good-ink); }
.cat-bubble.is-bad { color: var(--bad-ink); }

/* effects */
.burst-emo {
  position: absolute;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  animation: burst 0.85s ease-out forwards;
  pointer-events: none;
}
@keyframes burst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.4); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); }
}
.float-score {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--good-ink);
  text-shadow: 0 2px 0 #fff;
  animation: score-up 0.95s ease-out forwards;
  pointer-events: none;
}
.float-score.is-bad { color: var(--bad-ink); }
@keyframes score-up {
  to { opacity: 0; transform: translate(-50%, -150%); }
}
.shake { animation: shake 0.45s ease; }
@keyframes shake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.speak-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1.5px solid var(--glass-line);
  border-radius: 50%;
  background: var(--glass-strong);
  cursor: pointer;
  box-shadow: 0 6px 12px -8px rgb(var(--shade) / 0.6);
}
.speak-btn .emo { width: 26px; height: 26px; }

/* felt tile shared by many games */
.felt {
  background:
    radial-gradient(120% 90% at 30% 15%, rgba(255, 255, 255, 0.75), transparent 55%),
    linear-gradient(160deg, var(--tile-a), var(--tile-b));
}

/* ------------------------------------------------------------------ memory */

.mem-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mem-grid.mem-16 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mem-card {
  aspect-ratio: 3 / 3.6;
  padding: 0;
  border: 0;
  background: none;
  perspective: 700px;
  cursor: pointer;
}
.mem-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.mem-card.is-open .mem-inner,
.mem-card.is-matched .mem-inner { transform: rotateY(180deg); }
.mem-back,
.mem-front {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 10px 18px -12px rgb(var(--shade) / 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.7);
}
/* felt back with a stitched edge and a paw print */
.mem-back {
  background:
    radial-gradient(circle at 50% 58%, rgba(255, 255, 255, 0.85) 0 13%, transparent 14%),
    radial-gradient(circle at 36% 38%, rgba(255, 255, 255, 0.85) 0 6%, transparent 7%),
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.85) 0 6%, transparent 7%),
    radial-gradient(circle at 64% 38%, rgba(255, 255, 255, 0.85) 0 6%, transparent 7%),
    linear-gradient(160deg, var(--pink-a), var(--accent));
  outline: 2px dashed rgba(255, 255, 255, 0.75);
  outline-offset: -7px;
}
.mem-front {
  transform: rotateY(180deg);
  padding: 8px;
  background: linear-gradient(160deg, #fffdfd, var(--tile-b));
}
[data-theme="night"] .mem-front { background: linear-gradient(160deg, #4a3a8a, #35286e); }
.mem-front .word-pic { width: 82%; height: 82%; }
.mem-word { font-weight: 800; font-size: clamp(0.85rem, 3.6vw, 1.15rem); text-align: center; overflow-wrap: anywhere; line-height: 1.15; }
.mem-ru { color: var(--accent-ink); }
.mem-card.is-matched .mem-front { box-shadow: 0 0 0 3px var(--good), 0 10px 18px -12px rgb(var(--shade) / 0.7); animation: matched 0.5s ease; }
@keyframes matched {
  50% { transform: rotateY(180deg) scale(1.08); }
}

/* ------------------------------------------------------------------ listen */

.listen-top { display: flex; justify-content: center; align-items: center; gap: 10px; }
.listen-play {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 8px 22px 8px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cta-a), var(--cta-b));
  color: var(--cta-ink);
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 14px 24px -14px rgba(200, 90, 20, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.6);
}
.listen-play .emo { width: 40px; height: 40px; }
.listen-slow { width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--glass-line); background: var(--glass-strong); cursor: pointer; display: grid; place-items: center; }
.listen-slow .emo { width: 34px; height: 34px; }
.listen-fallback { text-align: center; font-size: 1.6rem; font-weight: 800; }
.bubble-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.bubble {
  position: relative;
  aspect-ratio: 1;
  padding: 16%;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95) 0 9%, transparent 10%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.12) 62%, rgba(190, 160, 255, 0.35) 100%);
  box-shadow: inset 0 -10px 20px rgba(160, 120, 255, 0.25), inset 0 6px 14px rgba(255, 255, 255, 0.6), 0 14px 24px -16px rgb(var(--shade) / 0.6);
  border: 2px solid rgba(255, 255, 255, 0.8);
  transition: transform 0.15s ease;
  animation: float-bubble 3s ease-in-out infinite alternate;
}
.bubble:nth-child(2) { animation-delay: -0.8s; }
.bubble:nth-child(3) { animation-delay: -1.6s; }
.bubble:nth-child(4) { animation-delay: -2.2s; }
@keyframes float-bubble {
  to { transform: translateY(-6px); }
}
.bubble:active { transform: scale(0.96); }
.bubble.is-right { box-shadow: 0 0 0 4px var(--good), inset 0 -10px 20px rgba(60, 200, 150, 0.3); }
.bubble.is-wrong { box-shadow: 0 0 0 4px var(--bad); opacity: 0.7; }
.bubble.pop { animation: pop 0.45s ease forwards; }
@keyframes pop {
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.bubble-word {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--good);
  color: #fff;
  font-weight: 800;
}

/* ------------------------------------------------------------------ true / false */

.tf-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 26px;
  background: linear-gradient(160deg, #fffdfd, var(--tile-b));
  box-shadow: inset 0 2px 0 #fff, 0 12px 22px -16px rgb(var(--shade) / 0.6);
  transition: box-shadow 0.2s ease;
}
[data-theme="night"] .tf-card { background: linear-gradient(160deg, #4a3a8a, #35286e); }
.tf-card.is-right { box-shadow: 0 0 0 4px var(--good); }
.tf-card.is-wrong { box-shadow: 0 0 0 4px var(--bad); }
.tf-picture { width: 46%; max-width: 200px; aspect-ratio: 1; }
.tf-sentence { font-size: 1.5rem; font-weight: 800; text-align: center; display: grid; gap: 4px; }
.tf-was { text-decoration: line-through; color: var(--ink-3); font-size: 1.2rem; }
.tf-fix { color: var(--good-ink); }
.tf-time { width: 100%; height: 8px; border-radius: 99px; background: rgb(var(--shade) / 0.12); overflow: hidden; }
.tf-time i { display: block; height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--joy-a), var(--accent)); transition: width 0.25s linear; }
.tf-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 64px;
  border-radius: 22px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  font-weight: 800;
  font-size: 1.15rem;
  cursor: pointer;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  box-shadow: 0 14px 22px -14px rgb(var(--shade) / 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}
.tf-btn .icon svg { stroke-width: 2.6; }
.tf-yes { background: linear-gradient(180deg, #45d3a1, #12a079); }
.tf-no { background: linear-gradient(180deg, #ff8fae, #e8457a); }
.tf-btn:active { transform: translateY(2px); }

/* ------------------------------------------------------------------ odd one out */

.odd-prompt { text-align: center; font-weight: 800; font-size: 1.15rem; }
.odd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.odd-tile {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px 10px 12px;
  border-radius: 24px;
  border: 3px solid transparent;
  background: linear-gradient(160deg, #fffdfd, var(--tile-b));
  box-shadow: inset 0 2px 0 #fff, 0 12px 20px -14px rgb(var(--shade) / 0.65);
  cursor: pointer;
}
[data-theme="night"] .odd-tile { background: linear-gradient(160deg, #4a3a8a, #35286e); }
.odd-tile .word-pic { width: 64px; height: 64px; }
.odd-word { font-weight: 800; font-size: 1.1rem; }
.odd-tile.is-right { border-color: var(--good); background: var(--good-tint); }
.odd-tile.is-wrong { border-color: var(--bad); background: var(--bad-tint); }
.odd-note { text-align: center; font-weight: 800; min-height: 1.5em; color: var(--accent-ink); }

/* ------------------------------------------------------------------ spelling with yarn */

.spell-top { display: flex; align-items: center; gap: 14px; justify-content: center; }
.spell-picture { width: 120px; height: 120px; flex: none; }
.spell-side { display: grid; gap: 8px; justify-items: start; }
.spell-hint { font-weight: 800; font-size: 1.15rem; }
.spell-listen { display: flex; gap: 8px; }
.spell-slots { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.spell-slot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 46px;
  border-radius: 12px;
  border-bottom: 4px solid var(--accent);
  background: var(--glass-strong);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: lowercase;
}
.spell-slot.is-filled { animation: pop 0.25s ease; }
.spell-slots.is-right .spell-slot { border-color: var(--good); background: var(--good-tint); color: var(--good-ink); }
.spell-slots.is-wrong .spell-slot { border-color: var(--bad); background: var(--bad-tint); color: var(--bad-ink); }
.spell-slots.is-fixed .spell-slot { border-color: var(--good); color: var(--good-ink); }
.spell-balls { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
/* yarn ball: striped radial felt */
.yarn {
  --y: #ff9fbd;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 800;
  color: #4a2340;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  background: var(--y);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.7), transparent 38%),
    repeating-linear-gradient(35deg, rgba(255, 255, 255, 0.28) 0 3px, transparent 3px 8px),
    repeating-linear-gradient(-55deg, rgba(0, 0, 0, 0.06) 0 2px, transparent 2px 9px),
    radial-gradient(circle at 50% 50%, var(--y), color-mix(in srgb, var(--y) 75%, #6a3a5a));
  box-shadow: 0 10px 16px -10px rgb(var(--shade) / 0.8), inset 0 -4px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.yarn:active { transform: scale(0.92); }
.yarn:disabled { opacity: 0.25; transform: scale(0.85); cursor: default; }
.yarn-1 { --y: #ffd38a; }
.yarn-2 { --y: #9fe0c4; }
.yarn-3 { --y: #c6b3ff; }
.yarn-4 { --y: #9fd0ff; }
.yarn-5 { --y: #ffb38f; }
.spell-actions { display: flex; justify-content: center; }

/* ------------------------------------------------------------------ catch the fish */

.catch-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.2rem;
}
.catch-sea {
  position: relative;
  height: min(58vh, 480px);
  border-radius: 24px;
  overflow: hidden;
  touch-action: none;
  background:
    radial-gradient(60% 40% at 20% 10%, rgba(255, 255, 255, 0.6), transparent 70%),
    linear-gradient(180deg, #c9ecff 0%, #b9dcff 45%, #c9c3ff 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}
.catch-cat {
  position: absolute;
  left: 0;
  bottom: 4px;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  will-change: transform;
}
.catch-cat img { width: 100%; height: 100%; object-fit: contain; }
.catch-cat .emo { width: 70px; height: 70px; }
.fish {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  pointer-events: none;
}
.fish-body {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px 60% 60% 999px;
  background: radial-gradient(circle at 28% 30%, rgba(255, 255, 255, 0.8), transparent 45%), var(--fc, #ffb3c8);
  box-shadow: 0 8px 14px -8px rgb(var(--shade) / 0.7), inset 0 -3px 6px rgba(0, 0, 0, 0.08);
  outline: 2px dashed rgba(255, 255, 255, 0.7);
  outline-offset: -5px;
}
.fish-body::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 50%;
  width: 22px;
  height: 26px;
  transform: translateY(-50%);
  background: var(--fc, #ffb3c8);
  clip-path: polygon(0 50%, 100% 0, 80% 50%, 100% 100%);
  filter: brightness(0.96);
}
.fish-pic { width: 30px; height: 30px; filter: none; }
.fish-word { font-weight: 800; font-size: 0.95rem; color: #3a2350; white-space: nowrap; }
.fish.is-caught .fish-body { animation: pop 0.4s ease; box-shadow: 0 0 0 3px var(--good); }
.fish.is-wrong .fish-body { box-shadow: 0 0 0 3px var(--bad); }

/* ------------------------------------------------------------------ sentence train */

.train-hint { text-align: center; font-weight: 800; font-size: 1.1rem; }
.train-track { position: relative; min-height: 82px; padding: 6px 0 14px; overflow: hidden; }
.train-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 6px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, rgb(var(--shade) / 0.35) 0 10px, transparent 10px 18px), rgb(var(--shade) / 0.15);
}
.train { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; min-height: 64px; transition: transform 1.2s ease-in; }
.train-loco { width: 58px; height: 58px; transform: scaleX(-1); }
.train-track.leaving .train { transform: translateX(120%); }
.wagon {
  position: relative;
  min-height: 42px;
  padding: 6px 12px 10px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 12px 12px 6px 6px;
  font-weight: 800;
  font-size: 1rem;
  color: #3a2350;
  cursor: pointer;
  background: var(--wc, #ffc9d9);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08), 0 6px 10px -8px rgb(var(--shade) / 0.7);
}
.wagon::before,
.wagon::after {
  content: "";
  position: absolute;
  bottom: -8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #6c587e;
  box-shadow: inset 0 0 0 3px #b9a6c9;
}
.wagon::before { left: 8px; }
.wagon::after { right: 8px; }
.wagon-1 { --wc: #ffe2a8; }
.wagon-2 { --wc: #bdeed6; }
.wagon-3 { --wc: #dccfff; }
.wagon-4 { --wc: #bfe1ff; }
.train-track.is-right .wagon { box-shadow: 0 0 0 3px var(--good); }
.train-track.is-wrong .train-correct { align-self: center; padding: 8px 14px; border-radius: 14px; background: var(--good-tint); color: var(--good-ink); font-weight: 800; }
.train-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ------------------------------------------------------------------ word search */

.ws-wrap { position: relative; touch-action: none; user-select: none; }
.ws-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 3px;
  padding: 8px;
  border-radius: 22px;
  background: linear-gradient(160deg, #fffdfd, var(--tile-b));
  box-shadow: inset 0 2px 0 #fff;
}
[data-theme="night"] .ws-board { background: linear-gradient(160deg, #4a3a8a, #35286e); }
.ws-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 10px;
  font-weight: 800;
  font-size: clamp(0.9rem, 4.4vw, 1.3rem);
  color: var(--ink);
  cursor: pointer;
}
.ws-cell.is-sel { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.ws-marks { position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: multiply; }
[data-theme="night"] .ws-marks { mix-blend-mode: screen; opacity: 0.6; }
.ws-mark { position: absolute; border-radius: 999px; opacity: 0.75; animation: pop 0.3s ease; }
.ws-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ws-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: var(--glass-strong);
  font-weight: 800;
}
.ws-list li .word-pic { width: 30px; height: 30px; }
.ws-list li.is-found { background: var(--good-tint); color: var(--good-ink); text-decoration: line-through; }
.ws-actions { display: flex; justify-content: center; }

/* ------------------------------------------------------------------ word rain */

.rain-sky {
  position: relative;
  height: min(48vh, 420px);
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(60% 40% at 80% 10%, rgba(255, 255, 255, 0.6), transparent 70%),
    linear-gradient(180deg, #d9d0ff 0%, #ffd6ec 70%, #ffe3cf 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}
.rain-sky::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  background: linear-gradient(180deg, transparent, rgba(150, 210, 170, 0.55));
}
.rain-cloud { position: absolute; top: -10px; width: 90px; height: 90px; opacity: 0.85; animation: drift 6s ease-in-out infinite alternate; }
.rain-cloud.c1 { left: 8%; }
.rain-cloud.c2 { right: 6%; animation-delay: -3s; }
@keyframes drift {
  to { transform: translateX(16px); }
}
.drop {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: radial-gradient(circle at 28% 25%, rgba(255, 255, 255, 0.85), transparent 45%), var(--dc, #ffd1df);
  box-shadow: 0 8px 14px -8px rgb(var(--shade) / 0.7);
  will-change: transform;
}
.drop-pic { width: 28px; height: 28px; filter: none; }
.drop-word { font-weight: 800; color: #3a2350; white-space: nowrap; }
.drop.is-hint { box-shadow: 0 0 0 3px var(--accent), 0 8px 14px -8px rgb(var(--shade) / 0.7); }
.drop.is-popped { animation: pop-out 0.4s ease forwards; }
.drop.is-landed { opacity: 0.4; filter: grayscale(0.7); }
@keyframes pop-out {
  60% { opacity: 1; transform: var(--t, none) scale(1.2); }
  100% { opacity: 0; }
}
.rain-form { display: flex; align-items: center; gap: 8px; }
.rain-input { font-size: 1.2rem; font-weight: 800; text-align: center; }

/* ------------------------------------------------------------------ say the word */

.game-stage-speak { justify-items: center; text-align: center; }
.speak-picture { width: 150px; height: 150px; }
.speak-hint { font-weight: 800; font-size: 1.15rem; }
.mic-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(180deg, var(--pink-a), var(--pink-b));
  cursor: pointer;
  box-shadow: 0 18px 30px -16px rgba(200, 30, 90, 0.7), inset 0 3px 0 rgba(255, 255, 255, 0.5);
}
.mic-btn .emo { width: 62px; height: 62px; }
.mic-btn.is-on::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 4px solid var(--pink-a);
  animation: ring 1s ease-out infinite;
}
@keyframes ring {
  from { opacity: 0.9; transform: scale(0.9); }
  to { opacity: 0; transform: scale(1.3); }
}
.speak-status { font-weight: 800; min-height: 1.5em; }

/* ------------------------------------------------------------------ results */

.result-stars { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); display: flex; gap: 4px; }
.result-stars .emo { width: 46px; height: 46px; filter: grayscale(1) opacity(0.35); }
.result-stars .emo.is-on { filter: drop-shadow(0 4px 6px rgba(200, 120, 0, 0.35)); animation: star-in 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.result-stars .emo.is-on:nth-child(2) { animation-delay: 0.15s; }
.result-stars .emo.is-on:nth-child(3) { animation-delay: 0.3s; }
@keyframes star-in {
  from { transform: scale(0) rotate(-40deg); }
}
.best-chip { margin-left: 6px; }
.game-review { text-align: left; margin-top: 14px; }
.game-review ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.game-review li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 18px;
  background: var(--glass-strong);
}
.game-review li .word-pic,
.review-dot { width: 44px; height: 44px; display: grid; place-items: center; }
.review-dot { color: var(--accent-ink); }
.review-text { display: grid; min-width: 0; }
.review-text strong { overflow-wrap: anywhere; }
.review-text small { color: var(--ink-2); font-weight: 700; }
.review-mark { font-weight: 900; font-size: 1.2rem; width: 28px; text-align: center; }
.game-review li.is-right .review-mark { color: var(--good-ink); }
.game-review li.is-wrong { box-shadow: inset 0 0 0 2px var(--bad-tint); }
.game-review li.is-wrong .review-mark { color: var(--bad-ink); }

@media (min-width: 720px) {
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* in "catch the fish" the cat is already in the sea */
.game-catch .game-cat { display: none; }
