/* Bóng của ai? — dùng lại khung .quiz / .piccard / .opts của trò "Tìm chữ".
   js/game-shadow.js đo màn hình rồi đặt: --gs-cw × --gs-ch cỡ thẻ bóng, --gs-tw × --gs-th cỡ ảnh đáp án, --gs-cols (3 = một hàng, 1 = một cột), --gs-g khe hở. */
body[data-scene="bong-hinh"] { --sky1: #B9A6F5; --sky2: #F1E8FF; }
@media (min-width: 1040px) and (min-height: 561px) { body[data-scene="bong-hinh"] { --wide: 1280px; } } /* cột nội dung rộng hơn trên màn lớn */

.quiz.gs-quiz { --gs-cw: clamp(130px, 36vw, 300px); --gs-ch: var(--gs-cw); --gs-tw: clamp(90px, 27vw, 200px); --gs-th: var(--gs-tw); --gs-cols: 3; --gs-g: 12px; }
.quiz.gs-quiz { position: relative; }
.quiz.gs-quiz.gs-fit { flex-direction: row; justify-content: center; align-items: center; gap: 12px; }
.gs-hold { flex: none; width: var(--gs-cw); height: var(--gs-ch); }
.quiz .gs-card { position: relative; box-sizing: border-box; flex: none; display: grid; place-items: center; width: var(--gs-cw); height: var(--gs-ch); padding: 0; overflow: hidden;
  background: radial-gradient(circle at 50% 44%, #FFFDF2 0 40%, #FFE9A8 100%) padding-box, var(--rainbow) border-box; }
.quiz .gs-card .gs-shadow { margin: 0; font-size: calc(min(var(--gs-cw), var(--gs-ch)) * .74); filter: brightness(0); transition: filter .45s; }
.quiz .gs-card.gs-lit .gs-shadow { filter: brightness(1); }
/* ảnh thật nằm sẵn dưới cái bóng, hiện ra giữa chừng cú lật */
.gs-card .gs-reveal { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; -webkit-user-drag: none; user-select: none; }
.gs-card.gs-photo .gs-reveal { opacity: 1; transition: opacity .35s; }
.gs-card.gs-photo .gs-shadow { opacity: 0; transition: opacity .3s; }
/* chọn đúng: thẻ rời chỗ và lớn ra giữa khu chơi (js đặt left/top/width/height) */
.quiz .gs-card.gs-big { position: absolute; z-index: 3; margin: 0; transition: left .55s cubic-bezier(.3, 1.2, .5, 1), top .55s cubic-bezier(.3, 1.2, .5, 1), width .55s cubic-bezier(.3, 1.2, .5, 1), height .55s cubic-bezier(.3, 1.2, .5, 1); }
.gs-card.gs-big .gs-name { font-size: clamp(22px, min(7vw, 7vh), 46px); bottom: clamp(8px, 2.4vh, 16px); }
.gs-card .gs-name { position: absolute; left: 50%; bottom: clamp(6px, 4%, 14px); transform: translateX(-50%); box-sizing: border-box; max-width: calc(100% - 16px); padding: .08em .6em .12em; border-radius: 999px;
  background: rgba(255, 255, 255, .95); color: var(--navy); font: 700 clamp(18px, calc(var(--gs-cw) * .1), 38px)/1.2 var(--font-letter); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 4px 0 rgba(30, 42, 94, .28); opacity: 0; }
.gs-card.gs-open .gs-name { opacity: 1; transition: opacity .25s .4s; }
@media (prefers-reduced-motion: reduce) { .quiz .gs-card.gs-big { transition: none; } }

/* ba đáp án: ảnh thật phủ kín ô */
.opts.gs-opts { grid-template-columns: repeat(var(--gs-cols), var(--gs-tw)); gap: var(--gs-g); justify-content: center; width: auto; max-width: none; flex: none;
  font-size: clamp(36px, calc(var(--gs-th) * .34), 76px); }
.gs-opts .block { position: relative; width: var(--gs-tw); height: var(--gs-th); aspect-ratio: auto; padding: 0; overflow: hidden; cursor: pointer; touch-action: manipulation; transition: transform .1s, box-shadow .1s, opacity .25s; }
.gs-opts .block .gs-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.gs-opts .block .emo { width: auto; height: 74%; max-width: 86%; aspect-ratio: 1; pointer-events: none; }
.gs-opts .gs-ok { outline: 6px solid var(--green); outline-offset: 3px; animation: bump .35s; }
.gs-opts .gs-dim { opacity: .4; }

/* ---------- wave 5: polish ---------- */
/* Màn dọc (.gs-stack do js đặt): cái bóng — tức câu hỏi — nằm trên, rộng hết màn và to hơn hẳn các đáp án (trước đây bóng nhỏ hơn đáp án).
   Điện thoại cao (--gs-cols: 2): ba ảnh đáp án xếp 2 trên 1 dưới; màn thấp hơn (--gs-cols: 3): một hàng. */
.quiz.gs-quiz.gs-fit.gs-stack { flex-direction: column; gap: 14px; }
.gs-stack .opts.gs-opts { display: flex; flex-wrap: wrap; width: calc(var(--gs-cols) * var(--gs-tw) + (var(--gs-cols) - 1) * var(--gs-g) + 1px); }
.gs-stack .gs-card .gs-name { font-size: clamp(20px, calc(var(--gs-cw) * .1), 40px); }

/* ---------- wave 7: hình khối (3D) ---------- */
/* Thẻ bóng = tấm màn sáng đèn đặt lõm trong khung dày (như sân khấu múa bóng): giữa sáng, mép tối dần; con vật in bóng lên màn và đổ bóng xuống sàn. */
.quiz .gs-card { background: radial-gradient(ellipse 78% 66% at 50% 40%, #FFFFFA 0, #FFFDF0 26%, #FFEFB6 60%, #F0BE5C 100%) padding-box, var(--rainbow) border-box;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .8), inset 0 16px 22px rgba(125, 72, 8, .3), inset 0 -8px 16px rgba(125, 72, 8, .16), 0 9px 0 rgba(30, 42, 94, .26), 0 22px 26px rgba(30, 42, 94, .3); }
.quiz .gs-card::before { content: ""; position: absolute; left: 14%; right: 14%; bottom: 10%; height: 11%; border-radius: 50%; pointer-events: none; transition: opacity .3s;
  background: radial-gradient(ellipse at center, rgba(70, 40, 6, .5) 0, rgba(70, 40, 6, .22) 45%, rgba(70, 40, 6, 0) 72%); }
.quiz .gs-card .gs-shadow { position: relative; filter: brightness(0) drop-shadow(0 .03em .035em rgba(70, 40, 6, .5)); }
.quiz .gs-card.gs-lit .gs-shadow { filter: brightness(1) drop-shadow(0 .03em .035em rgba(70, 40, 6, .3)); }
.gs-card.gs-photo::before { opacity: 0; }
/* ảnh thật hiện ra: mép ảnh lõm vào khung, một vệt sáng chéo như mặt kính */
.quiz .gs-card::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 28px; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: linear-gradient(118deg, rgba(255, 255, 255, .34) 0, rgba(255, 255, 255, .08) 24%, rgba(255, 255, 255, 0) 40%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .75), inset 0 14px 20px rgba(0, 0, 0, .22), inset 0 -8px 14px rgba(0, 0, 0, .14); }
.gs-card.gs-photo::after { opacity: 1; }
.gs-card .gs-name { z-index: 2; background: linear-gradient(#fff, #EEF2FF); border: 2px solid #fff;
  box-shadow: inset 0 -3px 0 rgba(30, 42, 94, .1), 0 4px 0 rgba(30, 42, 94, .32), 0 8px 12px rgba(30, 42, 94, .3); }

/* ba đáp án: tấm ảnh dày đặt trên bàn — khung màu bóng, ảnh lõm vào trong, mép dưới dày, bóng đổ xuống nền */
.gs-opts .block { border-color: transparent; border-radius: .34em;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, .2)) border-box, linear-gradient(var(--c), var(--c)) border-box;
  box-shadow: 0 .17em 0 rgba(0, 0, 0, .36), 0 .17em 0 var(--c), 0 .3em .1em rgba(30, 42, 94, .22), 0 .5em .5em rgba(30, 42, 94, .3); }
.gs-opts button.block:active { transform: translateY(.11em); box-shadow: 0 .05em 0 rgba(0, 0, 0, .36), 0 .05em 0 var(--c), 0 .12em .16em rgba(30, 42, 94, .3); }
.gs-opts .block::after { content: ""; position: absolute; inset: 0; border-radius: .2em; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, .36) 0, rgba(255, 255, 255, .06) 26%, rgba(255, 255, 255, 0) 42%);
  box-shadow: inset 0 0 0 .05em rgba(255, 255, 255, .9), inset 0 .14em .2em rgba(0, 0, 0, .28), inset 0 -.08em .14em rgba(0, 0, 0, .16); }
.gs-opts .gs-ok { outline: 0; box-shadow: 0 0 0 .09em #fff, 0 0 0 .18em var(--green), 0 0 .5em .26em rgba(60, 203, 107, .7), 0 .3em .1em rgba(30, 42, 94, .22), 0 .5em .5em rgba(30, 42, 94, .3); }
.gs-opts .gs-dim { filter: grayscale(.5); }

/* nút nhỏ "i" cạnh hàng chấm: tác giả và giấy phép của ảnh */
body[data-scene="bong-hinh"] .dots { position: relative; }
.gs-info { position: absolute; right: 2px; top: 50%; display: grid; place-items: center; width: 28px; height: 28px; margin-top: -14px; padding: 0; border-radius: 50%;
  background: linear-gradient(#fff, #E4EAFA); color: var(--navy); font: italic 800 16px/1 Georgia, 'Times New Roman', serif; opacity: .85;
  box-shadow: inset 0 -2px 0 rgba(30, 42, 94, .12), 0 2px 0 rgba(30, 42, 94, .3), 0 4px 6px rgba(30, 42, 94, .2); }
.gs-info::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
.gs-credits { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 14px; background: rgba(30, 42, 94, .5); }
.gs-credits-in { box-sizing: border-box; max-width: min(560px, 100%); max-height: 100%; overflow: auto; padding: 14px 18px; border-radius: 20px; background: #fff; color: var(--navy);
  font: 600 14px/1.45 var(--font-ui); text-align: left; box-shadow: var(--lift); }
.gs-credits-in h3 { margin: 0 0 6px; font-size: 16px; }
.gs-credits-in ul { margin: 0; padding: 0; list-style: none; }
.gs-credits-in p { margin: 8px 0 0; opacity: .7; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .quiz .gs-card::before, .quiz .gs-card::after { transition: none; } }
