/* 남은 조각 열두 바구니 — 화면 모양. 색은 base.css 토큰을 쓴다. */
.tb-body { background: var(--sky); overscroll-behavior: none; }
.tb-cover { width: 100%; max-width: 440px; aspect-ratio: 4 / 3; border-radius: var(--r-card); overflow: hidden; background: var(--field); }
.tb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tb-lead { max-width: 30em; font-size: 18px; line-height: 1.5; }
.tb-intro { width: 100%; max-width: 520px; text-align: left; }
.tb-howto { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: var(--cream); font-weight: 800; }
.tb-howto img { width: 36px; height: 36px; animation: tb-drag 1.6s ease-in-out infinite; }
@keyframes tb-drag { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(22px, -10px); } }

/* 놀이 화면: 위 상태 줄 · 판 · 아래 서랍. 넓은 화면은 서랍이 오른쪽 */
.tb-play { display: grid; grid-template-rows: auto 1fr auto; height: calc(100svh - 80px); min-height: 420px; max-width: 1100px; margin: 0 auto; padding: 0 8px 8px; gap: 6px; }
.tb-hud { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.tb-pause { background: var(--cream); color: var(--ink); font-size: 20px; flex: none; }
.tb-stage { margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--cream); font-size: 16px; font-weight: 900; white-space: nowrap; }
.tb-baskets { margin: 0 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 8px; border-radius: 999px; background: var(--cream); font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-baskets i { width: 40px; height: 26px; background: center / contain no-repeat url(../../assets/img/play/manna-catch/basket.webp); }
.tb-baskets.bump { animation: jw-hop .4s; }
.tb-stage-box { position: relative; min-height: 0; overflow: hidden; border-radius: 20px; background: #BFE6FF; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tb-avoid { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; pointer-events: none; }

.tb-tray { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 20px; background: var(--cream); touch-action: none; }
.tb-tools { display: flex; gap: 8px; flex: 1; min-width: 0; }
.tb-tool { position: relative; width: 84px; height: 72px; border: 0; border-radius: 18px; background: #F5E2C0; box-shadow: 0 5px 0 #D9B88A; cursor: grab; touch-action: none; display: grid; place-items: center; padding: 4px; }
.tb-tool canvas { width: 72px; height: 48px; pointer-events: none; }
.tb-tool b { position: absolute; right: -6px; top: -6px; min-width: 28px; height: 28px; border-radius: 14px; background: var(--joy); color: var(--cream); font-size: 17px; line-height: 28px; text-align: center; }
.tb-tool[disabled] { opacity: .35; box-shadow: none; cursor: default; }
.tb-tool span { position: absolute; left: 0; right: 0; bottom: -2px; font-size: 12px; font-weight: 800; }
.tb-acts { display: flex; gap: 8px; flex: none; }
.tb-acts .btn, .tb-acts .btn-gold { min-height: 64px; padding: 0 16px; font-size: 18px; }
.tb-go::after { content: none; }
.tb-help { position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: 16px; z-index: 2; min-height: 60px; background: var(--apricot); font-size: 19px; box-shadow: 0 5px 0 var(--apricot-dark); animation: jw-breathe 1.4s infinite; }

.tb-rot { position: absolute; display: flex; gap: 6px; transform: translate(-50%, 0); pointer-events: auto; }
.tb-rot-btn { width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--gold); color: var(--ink); font-size: 26px; font-weight: 900; box-shadow: 0 4px 0 var(--gold-dark); cursor: pointer; }
.tb-rot-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-dark); }
.tb-finger { position: absolute; width: 64px; height: 64px; pointer-events: none; margin: -14px 0 0 -26px; transition: left .9s ease-in-out, top .9s ease-in-out, opacity .3s; z-index: 3; }

.tb-say { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; justify-content: flex-end; pointer-events: none; }
.tb-say.left { justify-content: flex-start; } /* 제자(조각 나오는 곳) 반대쪽 위에 */
.tb-say .say-row { max-width: 70%; }
.tb-say .say-row { margin: 0; align-items: center; animation: tb-pop .25s ease-out; }
.tb-say .say-fig { width: 44px; height: 52px; }
.tb-say .bubble { font-size: 17px; padding: 6px 12px; }
.tb-say:empty { display: none; }
.tb-banner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 10px 22px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 24px; font-weight: 900; text-align: center; box-shadow: 0 6px 0 var(--gold-dark); pointer-events: none; animation: tb-pop .3s ease-out; }
.tb-pausebox { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; background: rgba(28, 37, 84, .6); color: var(--cream); font-size: 24px; font-weight: 900; }
@keyframes tb-pop { from { transform: translate(-50%, -50%) scale(.8); opacity: 0; } }
.tb-say .say-row { animation-name: tb-pop2; }
@keyframes tb-pop2 { from { transform: scale(.8); opacity: 0; } }

/* 넓은 화면(PC·패드 가로): 서랍을 오른쪽 기둥으로 */
@media (min-aspect-ratio: 1/1) and (min-width: 700px) {
  .tb-play { grid-template-columns: 1fr 220px; grid-template-rows: auto 1fr; }
  .tb-hud { grid-column: 1 / -1; }
  .tb-tray { flex-direction: column; align-items: stretch; justify-content: space-between; }
  .tb-tools { flex-direction: column; align-items: center; gap: 18px; padding-top: 12px; }
  .tb-tool { width: 150px; height: 96px; }
  .tb-tool canvas { width: 120px; height: 70px; }
  .tb-acts { flex-direction: column; }
}
@media (max-width: 520px) {
  .tb-tray { gap: 6px; padding: 6px; }
  .tb-tools { gap: 6px; }
  .tb-tool { width: 72px; }
  .tb-tool canvas { width: 62px; height: 42px; }
  .tb-reset { padding: 0 12px; font-size: 24px; } .tb-reset .tb-lbl { display: none; } /* 좁은 화면: ↺ 만 (이름은 aria-label) */
  .tb-acts .btn-gold { padding: 0 12px; font-size: 17px; }
}
@media (max-width: 380px) { .tb-tool { width: 64px; } .tb-stage { font-size: 14px; } .tb-baskets { font-size: 17px; padding-right: 10px; } }

/* 끝 화면 */
.tb-tally { width: 100%; max-width: 440px; display: grid; gap: 12px; padding: 16px; border-radius: var(--r-card); background: var(--cream); text-align: center; }
.tb-tally img { width: 100%; border-radius: 16px; }
.tb-verse { margin: 0; padding: 14px 16px; border-radius: 16px; background: var(--lake); color: var(--cream); font-size: 18px; font-weight: 700; line-height: 1.5; text-align: left; }
.tb-verse cite { display: block; margin-top: 6px; font-size: 15px; font-style: normal; color: var(--gold); }
.tb-jesus { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.5; }
.tb-pnote { margin: 12px auto 24px; font-size: 11px; opacity: .7; text-align: center; }
