/* games — Góc giải trí: 4 mini-game. */

.game-play {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.game-title { font-size: 1.4rem; }
.game-status { font-size: 1.1rem; color: var(--c-ink-soft); font-weight: 600; min-height: 1.4em; }

/* Hộp mở khoá */
.games-locked {
  text-align: center;
  padding: 30px 20px;
  color: var(--c-ink-soft);
}
.games-locked__icon { font-size: 3rem; }
.games-locked__sub { font-size: 0.9rem; margin-top: 6px; }

/* Kết quả */
.game-win { text-align: center; }
.game-win__emoji { font-size: 3rem; }
.game-win__stat { color: var(--c-ink-soft); }
.game-win__coins { font-size: 1.3rem; font-weight: 800; color: var(--c-primary); margin-top: 4px; }

/* Lật hình */
.memory-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.memory-themes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 380px;
}
.memory-card { position: relative; overflow: hidden; padding: 0; display: flex; align-items: center; justify-content: center; }
.memory-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.memory-card {
  aspect-ratio: 1;
  font-size: 2rem;
  border: none;
  border-radius: var(--radius);
  background: var(--c-primary);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.memory-card.is-up, .memory-card.is-matched { background: var(--c-surface); }
.memory-card.is-matched { opacity: 0.55; }
.memory-card:active { transform: scale(0.95); }

/* Đập chuột */
.whack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 360px;
}
.whack-hole {
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background: #c9a67a;
  box-shadow: inset 0 6px 10px rgba(0,0,0,0.25);
  cursor: pointer;
  font-size: 2.4rem;
  overflow: hidden;
  position: relative;
}
.whack-mole { opacity: 0; transform: translateY(60%); transition: transform 0.12s ease, opacity 0.1s; display: inline-block; }
.whack-hole.is-up .whack-mole { opacity: 1; transform: translateY(0); }

/* Vẽ & tô màu */
.draw-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.draw-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Hàng chọn hình để dán */
.shape-bar {
  display: flex; gap: 8px;
  overflow-x: auto;
  width: 100%;
  max-width: 680px;
  padding: 4px 2px;
}
.shape-btn {
  flex: none;
  width: 46px; height: 46px;
  border: 2px solid #dbe3f0;
  border-radius: var(--radius);
  background: var(--c-surface);
  cursor: pointer;
  padding: 6px;
}
.shape-btn:hover { border-color: var(--c-primary); }
.shape-btn svg { width: 100%; height: 100%; display: block; }

/* Khung vẽ TO + lớp stamp phủ lên */
.draw-stage {
  position: relative;
  width: min(94vw, 680px);
  aspect-ratio: 1;
}
.draw-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #fff;
  touch-action: none;   /* để vẽ không cuộn trang */
  cursor: crosshair;
}
/* Lớp phủ: xuyên chạm xuống canvas ở vùng trống, chỉ hình mới bắt sự kiện. */
.stamp-layer { position: absolute; inset: 0; pointer-events: none; }

/* Hình đang đặt (khung mờ, kéo–thả + phóng thu, chưa in vào tranh) */
.stamp {
  position: absolute;
  touch-action: none;
  cursor: grab;
  pointer-events: auto;
}
.stamp:active { cursor: grabbing; }
.stamp__svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.stamp.is-pending { outline: 2px dashed var(--c-primary); outline-offset: 2px; }
.stamp__resize {
  position: absolute; right: -11px; bottom: -11px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--c-primary);
  border: 2px solid #fff;
  box-shadow: var(--shadow);
  cursor: nwse-resize;
  touch-action: none;
}
.stamp__place {
  position: absolute; left: 50%; top: -16px;
  transform: translateX(-50%);
  white-space: nowrap;
  border: none;
  background: var(--c-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.draw-palette { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 340px; }
.draw-swatch {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #cbd5e1;
  cursor: pointer;
}
.draw-swatch.is-on { outline: 3px solid var(--c-primary); outline-offset: 2px; }
.draw-brushes { display: flex; gap: 6px; }
.draw-brush {
  width: 40px; height: 40px;
  border: 2px solid #dbe3f0;
  border-radius: var(--radius);
  background: var(--c-surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.draw-brush.is-on { border-color: var(--c-primary); }
.draw-brush__dot { background: var(--c-ink); border-radius: 50%; display: inline-block; }
.btn.is-on { outline: 3px solid var(--c-primary); outline-offset: 1px; }

/* Chọn độ khó */
.level-picker { display: flex; flex-direction: column; gap: 10px; }
.level-btn { font-size: 1.05rem; }

/* Xếp hình trượt */
.slide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 320px;
}
.slide-tile {
  aspect-ratio: 1;
  border: none;
  border-radius: var(--radius);
  background: var(--c-primary);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.slide-tile.is-blank { background: transparent; box-shadow: none; }
.slide-tile.can-move { cursor: pointer; }
.slide-tile.can-move:active { transform: scale(0.95); }

body.a11y-reduce .whack-mole, body.a11y-reduce .bubble.is-popped { transition: none; }
