/* Balance Barn (TT.G.balance). Fills the cabinet: scale on the left, question panel on the right (stacked on tall screens). */
.bal .bstage { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(8px, 1.2vw, 18px); align-items: stretch; }
main.incab .bal .bstage { flex: 1 1 0; min-height: 0; }
.bal .bscalebox { position: relative; border-radius: 22px; overflow: hidden; border: 4px solid #3B2414; background: #f6e3b4; min-height: 240px; container-type: size; display: grid; place-items: center; }
.bal .bbg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.bal .bbg.stand { object-fit: contain; opacity: .25; }
.bal .bsvg { position: relative; z-index: 1; width: min(100cqw, 100cqh * 1.6667); height: auto; max-height: 100%; display: block; }
.bal .bfx { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: grid; place-items: center; }
.bal .bwin { animation: bwin 1.3s ease-out forwards; }
.bal .bwinimg { width: clamp(90px, 16cqh, 220px); height: auto; }
@keyframes bwin { 0% { transform: scale(.3); opacity: 0 } 25% { transform: scale(1.1); opacity: 1 } 80% { opacity: 1 } 100% { transform: scale(1); opacity: 0 } }
.bal .bpanel { display: flex; flex-direction: column; gap: clamp(8px, 1vw, 14px); min-height: 0; overflow-y: auto; padding: clamp(10px, 1.2vw, 18px); border-radius: 22px; background: #fffaf0; border: 4px solid #3B2414; }
.bal .beq { font-size: clamp(30px, 3.4vw, 64px); font-weight: 800; line-height: 1.2; text-align: center; color: #3B2414; overflow-wrap: anywhere; }
.bal .beq sub { font-size: .55em; vertical-align: -.25em; }
.bal .bcoef { color: #d2601a; margin-right: .06em; }
.bal .bplus, .bal .barrow { font-style: normal; margin: 0 .22em; color: #7a5a2f; }
.bal .bmass { white-space: nowrap; display: inline-block; }
.bal .beq .bq { color: #d7263d; }
.bal .bnote { display: block; font-size: .32em; font-weight: 700; color: #7a5a2f; }
.bal .blegend { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; font-size: clamp(13px, 1vw, 18px); }
.bal .blg { color: #3B2414; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #fff; border: 2px solid #e2cfa6; }
.bal .blg i, .bal .bdot { display: inline-block; width: 1em; height: 1em; border-radius: 50%; border: 2px solid #3B2414; vertical-align: -.15em; margin-right: 4px; }
.bal .bchoices { display: grid; gap: clamp(8px, .9vw, 14px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bal .bch { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px; border-radius: 16px; border: 4px solid #3B2414; background: #fff; color: #3B2414;
  font: inherit; font-weight: 800; font-size: clamp(20px, 2vw, 38px); cursor: pointer; box-shadow: 0 5px 0 #3B2414; transition: transform .1s; }
.bal .bch .k { font-size: .55em; width: 1.7em; height: 1.7em; border-radius: 50%; display: grid; place-items: center; background: #f6e3b4; border: 2px solid #3B2414; flex: none; }
.bal .bch:hover:not(:disabled) { transform: translateY(-2px); background: #fff3d6; }
.bal .bch:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #3B2414; }
.bal .bch.right { background: #c9f2c7; border-color: #2f7a35; }
.bal .bch.wrong { background: #ffd0d0; border-color: #a3222f; opacity: .75; }
.bal .bch:disabled { cursor: default; }
.bal .bwhy { font-size: clamp(15px, 1.2vw, 22px); line-height: 1.35; text-align: center; }
.bal .bwhy.good { color: #1f5f24; } .bal .bwhy.bad { color: #a3222f; }
.bal .brap { margin: 10px auto 0; border-collapse: collapse; width: 100%; max-width: 520px; table-layout: fixed; color: #3B2414; font-size: clamp(14px, 1.05vw, 20px); }
.bal .brap caption { font-weight: 800; margin-bottom: 4px; }
.bal .brap th, .bal .brap td { border: 2px solid #3B2414; padding: 6px 8px; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.bal .brap th { background: #f6e3b4; }
.bal .hban { color: #3B2414; position: absolute; top: 12%; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 14px; font-weight: 900; font-size: clamp(18px, 2vw, 34px); background: #fff; border: 4px solid #3B2414; }
.bal .hban.bad { background: #ffd0d0; }
/* tall screens (phones, upright iPads): stack the scale over the panel */
@media (max-aspect-ratio: 1/1) {
  .bal .bstage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(180px, 1fr) auto; }
  .bal .bpanel { overflow: visible; }
}
@media (max-width: 520px) { .bal .bch { min-height: 52px; } .bal .beq { font-size: 30px; } }
@media (prefers-reduced-motion: reduce) { .bal .bwin { animation: none; } .bal .bch { transition: none; } }
