/* ไหว้สวยขอบคุณ · ภาพฉากใหญ่ด้านบน + ปุ่มท่าทาง · ขนาดอิงตัวแปรใน stage.css */

/* การ์ดฉาก (ภาพโจทย์) · ใหญ่กว่าการ์ดโจทย์ปกติเล็กน้อย เพราะต้องเห็นเรื่องในภาพ */
.scene-card {
  position: relative;
  cursor: pointer;
  background: #fff;
}
.scene-card #scene-img {
  display: block;
  width: calc(var(--prompt) * 1.3);
  height: auto;
  border-radius: var(--radius-sm);
}
.scene-card.hello #scene-img { animation: wai-hello .6s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes wai-hello {
  0% { transform: scale(.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ตอบถูก: ตัวละครยิ้ม · ภาพเด้ง + หัวใจลอย + ของในเรื่องโผล่มุมขวาล่าง */
.scene-card.happy #scene-img { animation: wai-happy .7s ease both; }
@keyframes wai-happy {
  0%, 100% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.07) rotate(-2deg); }
  70% { transform: scale(1.02) rotate(2deg); }
}
.scene-card .scene-prop {
  position: absolute;
  right: calc(var(--s2) * -1);
  bottom: calc(var(--s2) * -1);
  width: calc(var(--prompt) * .5);
  height: auto;
  background: #fff;
  border: 3px solid #ffd166;
  border-radius: 50%;
  box-shadow: 0 4px 0 rgba(31, 61, 52, .08);
}
.scene-card .scene-prop[hidden] { display: none; }
.scene-card.happy .scene-prop { animation: wai-prop .55s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes wai-prop {
  0% { transform: scale(0) rotate(-30deg); }
  100% { transform: scale(1) rotate(0); }
}
.scene-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.scene-hearts i {
  position: absolute;
  bottom: 30%;
  font-style: normal;
  font-size: calc(var(--prompt) * .28);
  line-height: 1;
  color: #ff6f91;
  opacity: 0;
}
.scene-hearts i::before { content: '\2665'; }
.scene-hearts i:nth-child(1) { left: 12%; }
.scene-hearts i:nth-child(2) { left: 44%; font-size: calc(var(--prompt) * .36); }
.scene-hearts i:nth-child(3) { left: 74%; }
.scene-card.happy .scene-hearts i { animation: wai-heart 1.6s ease-out both; }
.scene-card.happy .scene-hearts i:nth-child(2) { animation-delay: .15s; }
.scene-card.happy .scene-hearts i:nth-child(3) { animation-delay: .3s; }
@keyframes wai-heart {
  0% { transform: translateY(0) scale(.4); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-120%) scale(1.1); opacity: 0; }
}

/* ปุ่มท่าทาง · ระดับ 1 ปุ่มเดียวใหญ่กว่าปกติ */
.act-choice img { border-radius: var(--radius-sm); }
.act-big { border-color: #ffd166; background: #fff8e1; }
.act-big img { width: calc(var(--pick) * 1.15); }
.choices[data-n="3"] .act-choice img { width: var(--pick-3); }

/* ถึงตาหนูพูดตาม: ลูกโป่งคำพูดจุดสามจุดเหนือปุ่ม (ไม่มีไมค์ แค่ชวน) */
.act-choice.your-turn::before {
  content: '\2022\2022\2022';
  position: absolute;
  top: calc(var(--s3) * -1);
  left: 50%;
  transform: translateX(-50%);
  padding: 0 var(--s2);
  font-size: clamp(22px, 5vmin, 36px);
  line-height: 1.3;
  letter-spacing: .12em;
  color: var(--ink);
  background: #fff;
  border: 3px solid #ffd166;
  border-radius: 999px;
  animation: wai-talk 1s ease-in-out infinite;
}
@keyframes wai-talk {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.12); }
}

/* หน้าเริ่ม: ฉากกับท่าไหว้คู่กัน */
.wai-hello { flex-direction: row; gap: var(--s3); }
.wai-hello .target-card img { width: calc(var(--prompt) * .95); border-radius: var(--radius-sm); }

/* หน้าจบรอบ: เรื่องที่เล่นรอบนี้ (ฉาก + ท่า) */
.wai-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: min(92vw, 640px);
}
.wai-tile {
  position: relative;
  padding: var(--s1);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
}
.wai-tile img { display: block; width: clamp(64px, 13vmin, 110px); height: auto; border-radius: var(--radius-sm); }
.wai-tile .tile-act {
  position: absolute;
  right: calc(var(--s1) * -1);
  bottom: calc(var(--s1) * -1);
  width: clamp(30px, 6vmin, 48px);
  border: 2px solid #ffd166;
  border-radius: 50%;
  background: #fff;
}
#done-screen.active .wai-tile { animation: pop .45s ease; }

@media (prefers-reduced-motion: reduce) {
  .scene-card.hello #scene-img, .scene-card.happy #scene-img, .scene-card.happy .scene-prop,
  .act-choice.your-turn::before, #done-screen.active .wai-tile { animation: none; }
  .scene-card.happy .scene-hearts i { animation: none; opacity: 1; transform: translateY(-40%); }
}

/* มือถือแนวนอน: ฉากซ้าย ตัวเลือกขวา · ภาพคุมด้วยความสูงจอ */
@media (orientation: landscape) and (max-height: 520px) {
  .scene-card #scene-img { width: calc(var(--prompt) * 1.15); }
  .act-big img { width: var(--pick); }
  .wai-tile img { width: clamp(48px, 16dvh, 80px); }
}
/* แนวตั้ง 3 ตัวเลือก: ฉากเล็กลงให้ปุ่มพอ */
@media (orientation: portrait) {
  .stage:has(.choices[data-n="3"]) .scene-card #scene-img { width: calc(var(--prompt) * 1.15); }
}
