/* Xếp thứ tự: bậc thang cầu vồng, thẻ số/chữ là khối đồ chơi, gà con leo lên từng bậc.
   Mọi cỡ do js/game-order.js đo rồi ghi vào biến: --gs cạnh một ô trên thang, --gc cạnh một thẻ trong khay,
   --gt khe giữa hai thẻ, --gg khe giữa thang và khay, --gm cạnh nút chọn chế độ. Tiền tố lớp riêng: go- */
body[data-scene="xep-thu-tu"] { --sky1: #FF9F6B; --sky2: #FFEBD9; }

.go-play { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--gg, 16px);
  width: 100%; min-height: 0; touch-action: none; }
.go-play.go-side { flex-direction: row; }

/* ---------- màn chọn chế độ ---------- */
.go-modes { display: flex; align-items: center; justify-content: center; gap: var(--gg, 20px); }
.go-modes.go-col { flex-direction: column; }
.go-mode { position: relative; width: var(--gm, 220px); height: var(--gm, 220px); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6%; border-radius: 18%; border: 6px solid #fff; color: #fff;
  background: radial-gradient(rgba(255, 255, 255, .3) 14%, transparent 15%) 0 0 / 30px 30px, linear-gradient(160deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 55%), var(--c);
  box-shadow: 0 9px 0 rgba(0, 0, 0, .28), 0 9px 0 var(--c), 0 18px 24px rgba(30, 42, 94, .25); transition: transform .1s, box-shadow .1s; animation: popin .45s both; }
.go-mode + .go-mode { animation-delay: .08s; }
.go-mode:active { transform: translateY(6px); box-shadow: 0 3px 0 rgba(0, 0, 0, .28), 0 3px 0 var(--c); }
.go-mode b { font-weight: 800; font-size: calc(var(--gm, 220px) * .2); line-height: 1; text-shadow: var(--outline); }
/* ba bậc nhỏ trên nút: 1 2 3 / a b c */
.go-mart { display: flex; align-items: flex-end; justify-content: center; gap: 5%; width: 78%; }
.go-mart i { flex: 1 1 0; display: grid; place-items: center; aspect-ratio: 1; border-radius: 22%; font: 700 calc(var(--gm, 220px) * .15)/1 var(--font-letter); color: var(--navy);
  border: calc(var(--gm, 220px) * .022) solid var(--c);
  background: linear-gradient(#FFFEF8, #F1E8D0) padding-box, linear-gradient(var(--c), var(--c)) border-box;
  box-shadow: 0 calc(var(--gm, 220px) * .02) 0 rgba(0, 0, 0, .25); }
.go-mart i:nth-child(2) { margin-bottom: 9%; } .go-mart i:nth-child(3) { margin-bottom: 18%; }

/* ---------- bậc thang ---------- */
.go-stairs { position: relative; flex: none; }
.go-ground { position: absolute; left: -3%; right: -3%; bottom: 0; height: 12px; border-radius: 99px;
  background: linear-gradient(#8BE27A, #3FAE4E); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 3px 0 rgba(30, 42, 94, .18); }
/* mỗi bậc là một khối nhựa màu, mặt trên sáng, đáy đậm */
.go-step { position: absolute; border-radius: calc(var(--gs, 60px) * .16) calc(var(--gs, 60px) * .16) 5px 5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, .18) calc(var(--gs, 60px) * .1), rgba(255, 255, 255, 0) calc(var(--gs, 60px) * .3), rgba(0, 0, 0, .16) 100%),
    radial-gradient(rgba(255, 255, 255, .28) 18%, transparent 20%) 0 0 / calc(var(--gs, 60px) * .34) calc(var(--gs, 60px) * .34), var(--c);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .6), inset 0 -4px 0 rgba(0, 0, 0, .14), 0 4px 6px rgba(30, 42, 94, .25); }
/* ô trên bậc: khung kính viền đứt chờ thẻ */
.go-slot { position: absolute; display: grid; place-items: center; box-sizing: border-box; border-radius: 22%;
  border: 3px dashed rgba(255, 255, 255, .95); background: rgba(255, 255, 255, .38); transition: transform .15s, background .15s; }
.go-slot.go-next { background: rgba(255, 255, 255, .7); animation: go-wait 1.3s ease-in-out infinite; }
.go-slot.go-near { background: #fff; border-style: solid; border-color: var(--yellow); transform: scale(1.1); animation: none; }
.go-slot.go-full { border: 0; background: none; animation: none; transform: none; }
.go-face { display: grid; place-items: center; box-sizing: border-box; width: 100%; height: 100%; border-radius: 22%;
  font: 700 calc(var(--gs, 60px) * .56)/1 var(--font-letter); color: var(--navy);
  border: calc(var(--gs, 60px) * .075) solid transparent;
  background: radial-gradient(ellipse 130% 100% at 30% 8%, #fff 0, #FFFEF8 45%, #EDE6D2 100%) padding-box, linear-gradient(var(--c), var(--c)) border-box;
  box-shadow: 0 calc(var(--gs, 60px) * .06) 0 rgba(0, 0, 0, .3), 0 calc(var(--gs, 60px) * .06) 0 var(--c), 0 calc(var(--gs, 60px) * .1) calc(var(--gs, 60px) * .1) rgba(30, 42, 94, .3);
  transition: transform .4s cubic-bezier(.3, 1.25, .6, 1); }
.go-face.go-2 { font-size: calc(var(--gs, 60px) * .44); letter-spacing: -.03em; }
/* gà con và ngôi sao trên đỉnh */
.go-chick { position: absolute; z-index: 3; pointer-events: none; filter: drop-shadow(0 3px 2px rgba(30, 42, 94, .3));
  transition: left .42s cubic-bezier(.3, 1.2, .6, 1), bottom .42s cubic-bezier(.3, 1.2, .6, 1); }
.go-chick > .emo, .go-goal > .emo { display: block; width: 100%; height: 100%; }
.go-chick.go-hop > .emo { animation: go-hop .45s ease-out; }
.go-goal { position: absolute; z-index: 2; pointer-events: none; filter: drop-shadow(0 0 8px rgba(255, 230, 120, .9)); animation: go-twinkle 1.6s ease-in-out infinite; }
.go-goal.go-got { animation: go-gone .5s ease-out forwards; }
.go-stairs.go-win .go-step { animation: go-bounce .6s ease-in-out; }

/* ---------- khay thẻ ---------- */
.go-tray { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: var(--gt, 14px); flex: none; box-sizing: border-box; max-width: 100%;
  padding: 8px; border-radius: 26px; background: rgba(255, 255, 255, .42); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), 0 4px 0 rgba(30, 42, 94, .08); }
.go-card { position: relative; display: grid; place-items: center; box-sizing: border-box; width: var(--gc, 80px); height: var(--gc, 80px); border-radius: 22%;
  font: 700 calc(var(--gc, 80px) * .56)/1 var(--font-letter); color: var(--navy); touch-action: none; cursor: grab;
  border: calc(var(--gc, 80px) * .075) solid transparent;
  background: radial-gradient(ellipse 130% 100% at 30% 8%, #fff 0, #FFFEF8 45%, #EDE6D2 100%) padding-box,
    linear-gradient(150deg, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, 0) 36%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .2) 100%) border-box,
    linear-gradient(var(--c), var(--c)) border-box;
  box-shadow: 0 calc(var(--gc, 80px) * .07) 0 rgba(0, 0, 0, .32), 0 calc(var(--gc, 80px) * .07) 0 var(--c), 0 calc(var(--gc, 80px) * .13) calc(var(--gc, 80px) * .12) rgba(30, 42, 94, .3);
  text-shadow: 0 .03em 0 #fff; transition: transform .25s ease-out, box-shadow .15s; }
.go-card > span { pointer-events: none; }
.go-card.go-2 { font-size: calc(var(--gc, 80px) * .45); letter-spacing: -.03em; }
.go-card:active:not(.go-lift) { transform: translateY(3px); }
.go-card.go-lift { z-index: 30; cursor: grabbing; transition: none; box-shadow: 0 calc(var(--gc, 80px) * .07) 0 rgba(0, 0, 0, .32), 0 calc(var(--gc, 80px) * .07) 0 var(--c), 0 calc(var(--gc, 80px) * .3) calc(var(--gc, 80px) * .3) rgba(30, 42, 94, .35); }
/* thẻ đã lên thang: để lại chỗ trống mờ (các thẻ còn lại không xô chỗ dưới ngón tay bé), không nhận chạm */
.go-card.go-used { pointer-events: none; transition: none; color: transparent; text-shadow: none; box-shadow: none; animation: none;
  background: rgba(255, 255, 255, .3); border-color: rgba(255, 255, 255, .5); }
.go-card.go-no { animation: wobble .45s; }

/* ---------- thẻ trang chủ: ba bậc 1 2 3 và gà con ---------- */
.card .art > .go-art { display: inline-flex; align-items: flex-end; gap: .08em; }
.card .art > .go-art .block { width: 1.05em; font-size: .7em; border-width: .12em; transform: none; }
.card .art > .go-art .block:nth-child(2) { margin-bottom: .3em; } .card .art > .go-art .block:nth-child(3) { margin-bottom: .6em; }

@keyframes go-wait { 0%, 100% { transform: none; } 50% { transform: scale(1.06); } }
@keyframes go-hop { 0%, 100% { transform: none; } 45% { transform: translateY(-45%) scale(1.05, .95); } 75% { transform: translateY(0) scale(1.08, .9); } }
@keyframes go-twinkle { 0%, 100% { transform: scale(.92) rotate(-6deg); } 50% { transform: scale(1.08) rotate(6deg); } }
@keyframes go-gone { 0% { transform: scale(1); opacity: 1; } 40% { transform: scale(1.5); opacity: 1; } 100% { transform: scale(.2) translateY(-60%); opacity: 0; } }
@keyframes go-bounce { 0%, 100% { transform: none; } 30% { transform: translateY(-10%); } 60% { transform: translateY(2%); } }
@media (prefers-reduced-motion: reduce) {
  .go-mode, .go-slot.go-next, .go-chick.go-hop > .emo, .go-goal, .go-stairs.go-win .go-step { animation: none; }
  .go-face, .go-chick, .go-card { transition: none; }
}
