:root {
  --sky-top: #9ad7f0;
  --sky-bottom: #e8f7ff;
  --grass: #7bc96f;
  --ink: #1a2a32;
  --ink-soft: #3d5560;
  --panel: rgba(255, 255, 255, 0.88);
  --shadow: 0 10px 28px rgba(26, 42, 50, 0.18);
  --radius: 28px;
  --ctrl: 64px;
  --font-display: "Fredoka", "Segoe UI Rounded", "Trebuchet MS", "Comic Sans MS", sans-serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-display);
  color: var(--ink);
  background: var(--sky-top);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#app,
.screen {
  width: 100%;
  height: 100%;
}

.screen {
  position: relative;
}

.hidden {
  display: none !important;
}

/* ——— Home ——— */
.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(12px, 2vw, 24px);
  padding: clamp(16px, 4vw, 40px);
  overflow: auto;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, #fff8 0%, transparent 60%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 55%, #c8e9a0 55%, var(--grass) 100%);
}

.home-header {
  text-align: center;
}

.brand {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.55);
  color: #0e5a70;
}

.home-hint {
  margin: 0.4rem 0 0;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--ink-soft);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 200px));
  gap: clamp(12px, 2.5vw, 22px);
  width: min(100%, 680px);
  margin: 8px 0 12px;
}

.game-card {
  appearance: none;
  border: none;
  cursor: pointer;
  min-height: 120px;
  border-radius: var(--radius);
  background: var(--card, #fff);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: #fff;
  font: inherit;
}

.game-card:active {
  transform: scale(0.96);
}

.game-card-icon {
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.12));
}

.game-card-label {
  font-size: clamp(0.95rem, 2.4vw, 1.25rem);
  font-weight: 700;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

.home-controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  padding-bottom: 8px;
}

/* ——— Help ——— */
.help {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, #fff8 0%, transparent 55%),
    linear-gradient(180deg, #9ad7f0 0%, #e8f7ff 40%, #dff5c8 100%);
  overflow: hidden;
}

.help.hidden {
  display: none !important;
}

.help-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 8px;
  flex-shrink: 0;
}

.help-title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: #0e5a70;
}

.help-scroll {
  flex: 1;
  overflow: auto;
  padding: 8px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.help-intro {
  margin: 0;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  line-height: 1.45;
}

.help-card {
  margin: 0;
  padding: 16px 18px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  border-left: 8px solid var(--accent, #7ec8e3);
}

.help-card h3 {
  margin: 0 0 10px;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-card ol,
.help-card ul {
  margin: 0;
  padding-left: 1.3em;
  color: var(--ink-soft);
  font-size: clamp(0.98rem, 2.3vw, 1.12rem);
  line-height: 1.5;
}

.help-card li + li {
  margin-top: 6px;
}

.help-card-tips {
  border-left-color: #f1c40f;
}

.help-card-tips ul {
  list-style: disc;
}

.ctrl-btn {
  appearance: none;
  border: none;
  width: var(--ctrl);
  height: var(--ctrl);
  border-radius: 50%;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 1.6rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease;
}

.ctrl-btn:active {
  transform: scale(0.94);
}

.ctrl-btn[aria-pressed="true"] {
  background: #ffe8a3;
}

.ctrl-btn-text {
  width: auto;
  min-width: var(--ctrl);
  padding: 0 18px;
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

/* ——— Play shell ——— */
.play {
  background: #111;
}

.play-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.play-bar .ctrl-btn {
  pointer-events: auto;
  width: 56px;
  height: 56px;
  font-size: 1.4rem;
}

.game-root {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ——— Shared game bits ——— */
.game-stage {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.pop {
  position: absolute;
  pointer-events: none;
  font-size: 2rem;
  animation: pop-fade 0.55s ease-out forwards;
}

@keyframes pop-fade {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: translateY(-40px) scale(1.3); opacity: 0; }
}

.confetti-bit {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  pointer-events: none;
  animation: confetti-fall 0.9s ease-out forwards;
}

@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(220deg); opacity: 0; }
}

/* Balloons */
.balloons-stage {
  background:
    url("../assets/images/balloons-cute.svg") center / cover no-repeat,
    #b7e4ff;
}

.balloon-score,
.game-score {
  position: absolute;
  top: 14px;
  right: 80px;
  z-index: 30;
  min-width: 72px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(26, 42, 50, 0.16);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 800;
  color: #c0392b;
  text-align: center;
  pointer-events: none;
  line-height: 1;
}

.find-score {
  color: #f1c40f;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  z-index: 35;
}

.balloon-score.bump,
.game-score.bump {
  animation: score-bump 0.28s ease;
}

@keyframes score-bump {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.balloon {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  position: absolute;
  width: 120px;
  height: 150px;
  cursor: pointer;
  touch-action: none;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.18));
  transition: transform 0.08s ease;
}

.balloon:active {
  transform: scale(0.92);
}

.balloon-body {
  width: 100%;
  height: 120px;
  border-radius: 50% 50% 48% 48%;
  background: radial-gradient(circle at 30% 28%, #fff8, transparent 40%), var(--balloon);
  position: relative;
}

.balloon-body::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid var(--balloon);
}

.balloon-string {
  width: 2px;
  height: 40px;
  margin: 8px auto 0;
  background: rgba(0, 0, 0, 0.25);
}

.balloon.popping {
  animation: balloon-pop 0.28s ease-out forwards;
  pointer-events: none;
}

@keyframes balloon-pop {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.8; }
  100% { transform: scale(0); opacity: 0; }
}

/* Pet */
.pet-stage {
  background:
    url("../assets/images/farm-cute.svg") center / cover no-repeat,
    #c8ecff;
}

.pet {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  position: absolute;
  width: 180px;
  height: 180px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 9rem;
  line-height: 1;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.2));
  transition: transform 0.12s ease;
}

.pet.happy {
  animation: pet-bounce 0.45s ease;
}

.pet.dragging {
  cursor: grabbing;
  transform: scale(1.08);
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.28));
  animation: none;
}

@keyframes pet-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-48px) scale(1.08); }
  70% { transform: translateY(6px) scale(0.96); }
}

.pet-heart {
  position: absolute;
  font-size: 2.5rem;
  pointer-events: none;
  animation: heart-up 0.7s ease-out forwards;
}

@keyframes heart-up {
  0% { transform: translateY(0) scale(0.5); opacity: 1; }
  100% { transform: translateY(-80px) scale(1.2); opacity: 0; }
}

/* Flashlight */
.flashlight-stage {
  background:
    linear-gradient(180deg, #1a2744 0%, #2c3e6b 50%, #1e2f4d 100%);
}

.flashlight-room {
  position: absolute;
  inset: 0;
}

.star-target {
  position: absolute;
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  font-size: 5rem;
  cursor: pointer;
  filter: drop-shadow(0 0 12px #ffe566);
  z-index: 2;
}

.star-target.found {
  animation: star-found 0.5s ease-out forwards;
  pointer-events: none;
}

.find-name {
  position: absolute;
  z-index: 36;
  transform: translate(-50%, -100%) scale(0.8);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  color: #1a2a32;
  font-size: clamp(1.25rem, 3.5vw, 1.7rem);
  font-weight: 800;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.find-name.show {
  opacity: 1;
  transform: translate(-50%, -120%) scale(1);
}

@keyframes star-found {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(0); opacity: 0; }
}

.flashlight-mask {
  position: absolute;
  inset: 0;
  bottom: 110px;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(
    circle var(--beam, 130px) at var(--mx, 50%) var(--my, 50%),
    transparent 0%,
    transparent 55%,
    rgba(0, 0, 0, 0.72) 70%,
    rgba(0, 0, 0, 0.92) 100%
  );
}

.find-shelf {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 110px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px 10px;
  background:
    linear-gradient(180deg, #8b5a2b 0%, #6b4220 40%, #4a2e14 100%);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.35);
  border-top: 4px solid #c7924a;
  box-sizing: border-box;
}

.find-shelf-title {
  color: #ffe8c2;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.find-shelf-items {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 4px 4px;
}

.find-shelf-slot {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: rgba(255, 248, 230, 0.92);
  box-shadow: inset 0 0 0 2px rgba(139, 90, 43, 0.35), 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.find-shelf-slot.pop {
  animation: shelf-pop 0.35s ease;
}

@keyframes shelf-pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.find-shelf-emoji {
  font-size: 1.85rem;
  line-height: 1;
}

.find-shelf-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.find-shelf-slot-name {
  display: none;
}

/* Boxes */
.boxes-stage {
  background:
    linear-gradient(180deg, #fff1d6 0%, #ffe0a8 40%, #f0c078 100%);
  position: relative;
  overflow: hidden;
}

.gift-box {
  width: clamp(120px, 22vw, 180px);
  height: clamp(120px, 22vw, 180px);
  border: none;
  border-radius: 20px;
  cursor: grab;
  position: absolute;
  background: var(--box, #e74c3c);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  touch-action: none;
  transition: box-shadow 0.12s ease;
}

.gift-box.dragging {
  cursor: grabbing;
  box-shadow: 0 16px 32px rgba(26, 42, 50, 0.28);
  transform: scale(1.04);
  z-index: 20;
}

.gift-box:active {
  transform: scale(0.98);
}

.gift-box.dragging:active {
  transform: scale(1.04);
}

.gift-box::before {
  content: "";
  position: absolute;
  inset: 42% 0 auto;
  height: 16%;
  background: rgba(255, 255, 255, 0.55);
}

.gift-box::after {
  content: "";
  position: absolute;
  inset: 0 42%;
  width: 16%;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.55);
}

.gift-lid {
  position: absolute;
  top: -12%;
  left: -4%;
  right: -4%;
  height: 28%;
  border-radius: 12px 12px 4px 4px;
  background: color-mix(in srgb, var(--box, #e74c3c) 85%, #000);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.35s ease;
  transform-origin: left center;
}

.gift-box.open .gift-lid {
  transform: rotate(-55deg) translateY(-20px);
}

.gift-surprise {
  font-size: clamp(2.6rem, 7vw, 4rem);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.25s ease, transform 0.35s ease;
  z-index: 2;
  line-height: 1;
}

.gift-box.open .gift-surprise {
  opacity: 1;
  transform: scale(1) translateY(-8px);
}

.gift-name {
  position: absolute;
  left: 50%;
  bottom: -42px;
  transform: translateX(-50%) scale(0.8);
  min-width: max-content;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 16px rgba(26, 42, 50, 0.16);
  color: #1a2a32;
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.25s ease, transform 0.3s ease;
}

.gift-box.open .gift-name {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ——— Phase 2 games ——— */
.paint-stage {
  background: url("../assets/images/paint-cute.svg") center / cover no-repeat, #fff9f0;
  cursor: crosshair;
  touch-action: none;
}

.paint-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.paint-stamp {
  position: absolute;
  font-size: 3rem;
  pointer-events: none;
  animation: stamp-pop 0.35s ease-out forwards;
  z-index: 2;
}

@keyframes stamp-pop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.paint-toolbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 30;
  display: block;
  pointer-events: none;
}

.paint-tools-center {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  pointer-events: auto;
}

.paint-tool {
  pointer-events: auto;
  width: auto !important;
  min-width: 64px;
  height: auto !important;
  min-height: 64px;
  padding: 8px 14px;
  border-radius: 18px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 1rem;
}

.paint-tool-main {
  min-width: 100px !important;
  min-height: 100px !important;
  padding: 12px 18px !important;
  border-radius: 26px !important;
}

.paint-tool-main .paint-tool-icon {
  font-size: 2.6rem;
}

.paint-tool-main .paint-tool-label {
  font-size: 1.1rem;
}

.paint-clear-all {
  position: absolute;
  right: 16px;
  bottom: 0;
  min-width: 72px !important;
  min-height: 72px !important;
}

.paint-tool-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.paint-tool-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}

.paint-tool.active {
  background: #ffe8a3;
  box-shadow: 0 0 0 3px #f1c40f, var(--shadow);
}

.paint-stage.eraser-on,
.paint-stage.eraser-on .paint-canvas {
  cursor: url("../assets/images/eraser-cursor.png") 10 36, auto;
}

.paint-stage.eraser-on .paint-toolbar,
.paint-stage.eraser-on .paint-tool {
  cursor: pointer;
}

.paint-clear {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  pointer-events: auto;
}

.bounce-stage {
  background: url("../assets/images/playground-cute.svg") center / cover no-repeat, #dff5ff;
  cursor: url("../assets/images/bat-cursor.png") 56 12, auto;
}

.bounce-ball {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  position: absolute;
  cursor: url("../assets/images/bat-cursor.png") 56 12, auto;
  display: grid;
  place-items: center;
  line-height: 1;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.22));
  touch-action: none;
}

.bounce-ball.squash {
  animation: ball-squash 0.28s ease;
}

@keyframes ball-squash {
  0%, 100% { transform: scale(1, 1); }
  40% { transform: scale(1.15, 0.85); }
  70% { transform: scale(0.92, 1.08); }
}

.fruit-stage {
  background: url("../assets/images/fruit-cute.svg") center / cover no-repeat, #e8f8ff;
}

.fruit-score {
  top: auto;
  right: auto;
  left: 50%;
  bottom: calc(20px + var(--basket-h, 280px) + 12px);
  transform: translateX(-50%);
  z-index: 40;
  font-size: clamp(2.8rem, 8vw, 3.8rem);
  min-width: 144px;
  padding: 14px 28px;
}

.fruit-score.bump {
  animation: score-bump-center 0.28s ease;
}

@keyframes score-bump-center {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.18); }
}

.fruit-basket {
  position: absolute;
  display: grid;
  place-items: center;
  line-height: 1;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}

.fruit-basket-bowl {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 70%;
  z-index: 2;
  pointer-events: none;
}

.fruit-basket-fill {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 18%;
  bottom: 28%;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}

.fruit-in-basket {
  position: absolute;
  line-height: 1;
  font-size: var(--fruit-in-size, 2.2rem);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.15));
  animation: fruit-land 0.35s ease-out;
  transform: translate(-50%, 50%);
}

@keyframes fruit-land {
  0% { transform: translate(-50%, -20%) scale(1.25); opacity: 0.4; }
  100% { transform: translate(-50%, 50%) scale(1); opacity: 1; }
}

.fruit-basket.plop .fruit-basket-bowl {
  animation: basket-plop 0.3s ease;
}

@keyframes basket-plop {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.06, 0.94); }
  70% { transform: scale(0.98, 1.03); }
}

.fruit-item {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  position: absolute;
  cursor: grab;
  display: grid;
  place-items: center;
  line-height: 1;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.18));
  z-index: 6;
  touch-action: none;
}

.fruit-item.held {
  cursor: grabbing;
  transform: scale(1.1);
  z-index: 20;
}

.fish-stage {
  background: url("../assets/images/ocean-cute.svg") center / cover no-repeat, #3aa0d8;
}

.sea-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.sea-bubble {
  position: absolute;
  bottom: -20px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.95), rgba(180, 230, 255, 0.35) 45%, rgba(120, 200, 255, 0.2) 70%, transparent 75%);
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset -2px -3px 6px rgba(80, 160, 220, 0.25);
  animation: bubble-rise var(--dur, 5s) linear var(--delay, 0s) forwards;
  opacity: 0.85;
}

@keyframes bubble-rise {
  0% {
    transform: translate(0, 0) scale(0.7);
    opacity: 0;
  }
  8% {
    opacity: 0.9;
  }
  100% {
    transform: translate(var(--drift, 0px), calc(-100vh - 40px)) scale(1.15);
    opacity: 0;
  }
}

.fish-item {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  position: absolute;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.2));
  touch-action: none;
  z-index: 4;
}

.fish-item.happy {
  animation: pet-bounce 0.45s ease;
}

.fish-item.growing {
  transition: width 0.35s ease, height 0.35s ease, font-size 0.35s ease;
}

.fish-food {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  padding: 0;
  position: absolute;
  cursor: grab;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: var(--shadow);
  z-index: 15;
  touch-action: none;
}

.fish-food.held {
  cursor: grabbing;
  transform: scale(1.12);
  background: #fff;
}

.garden-stage {
  background: url("../assets/images/garden-cute.svg") center / cover no-repeat, #b6ef86;
}

.garden-flower {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  position: absolute;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  touch-action: none;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.16));
}

.garden-emoji {
  font-size: clamp(4.5rem, 12vw, 6.75rem);
  line-height: 1;
}

.garden-label {
  min-height: 1.2em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  font-weight: 800;
  color: #1a2a32;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.garden-flower.bloomed .garden-label {
  opacity: 1;
  transform: scale(1);
}

.garden-flower.bloomed .garden-emoji {
  animation: pet-bounce 0.45s ease;
}

.garden-can {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  padding: 0;
  position: absolute;
  cursor: grab;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: var(--shadow);
  z-index: 15;
  touch-action: none;
}

.garden-can.held {
  cursor: grabbing;
  transform: scale(1.1);
  background: #fff;
}

/* —— Tô màu —— */
.coloring-stage {
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 214, 165, 0.55), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(186, 230, 253, 0.55), transparent 40%),
    linear-gradient(180deg, #fff8ef 0%, #f3e8ff 45%, #e8f5e9 100%);
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 12px;
  padding: 12px 16px 20px;
  box-sizing: border-box;
}

.coloring-art {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.9), var(--shadow);
  overflow: hidden;
}

.coloring-svg {
  width: min(72vmin, 100%);
  height: min(72vmin, 100%);
  max-width: 520px;
  max-height: 520px;
  display: block;
}

.coloring-svg .color-region {
  transition: fill 0.12s ease;
  touch-action: manipulation;
}

.coloring-svg .color-region.just-colored {
  animation: coloring-pop 0.28s ease;
}

@keyframes coloring-pop {
  0% { transform-box: fill-box; transform-origin: center; transform: scale(1); }
  45% { transform-box: fill-box; transform-origin: center; transform: scale(1.04); }
  100% { transform-box: fill-box; transform-origin: center; transform: scale(1); }
}

.coloring-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
}

.coloring-title {
  min-width: 8ch;
  text-align: center;
  font-size: clamp(1.15rem, 3.5vw, 1.55rem);
  font-weight: 800;
  color: #1a2a32;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
}

.coloring-nav-btn {
  min-width: 64px;
  min-height: 64px;
  font-size: 1.6rem;
}

.coloring-clear {
  min-height: 64px;
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  font-weight: 800;
}

.coloring-palette {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 8px 4px 4px;
}

.color-swatch {
  appearance: none;
  border: 4px solid rgba(255, 255, 255, 0.95);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12), var(--shadow);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch:hover {
  transform: scale(1.08);
}

.color-swatch.active {
  transform: scale(1.18);
  box-shadow:
    0 0 0 5px #ffe566,
    0 6px 0 rgba(0, 0, 0, 0.14),
    var(--shadow);
}

.coloring-error {
  margin: 0;
  padding: 24px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #5d4037;
}

@media (max-width: 520px) {
  .color-swatch {
    width: 56px;
    height: 56px;
  }

  .coloring-nav-btn {
    min-width: 56px;
    min-height: 56px;
  }

  .game-grid {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .game-card {
    min-height: 110px;
  }

  .pet {
    width: 150px;
    height: 150px;
    font-size: 7.5rem;
  }

  .balloon {
    width: 100px;
    height: 130px;
  }

  .balloon-body {
    height: 100px;
  }
}
