/* Timbangan Aljabar: timbangan di kanvas, panel operasi, pilihan persamaan cerita */
.ta-wrap { flex: 1; min-height: 0; display: flex; padding: clamp(4px, 1vw, 12px); background: #4c1d95; }
.ta-stage { position: relative; flex: 1; min-height: 0; border-radius: 16px; overflow: hidden; border: 3px solid #fff; background: linear-gradient(180deg, #ede9fe, #fef3c7); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); }
.ta-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ta-hud { display: flex; flex-wrap: wrap; gap: 5px; padding: 5px 8px; font-weight: 800; font-size: clamp(11px, 1.45vw, 16px); }
.ta-hud span { background: rgba(15,23,42,.75); color: #fff; border-radius: 999px; padding: 1px 10px; white-space: nowrap; }
.ta-hud .k { background: #7c3aed; }
.ta-story { margin: 0 8px; background: #fff; border: 3px solid #7c3aed; border-radius: 12px; padding: 4px 10px; font-weight: 700; font-size: clamp(12px, 1.6vw, 18px); line-height: 1.3; }
.ta-story[hidden] { display: none; }
.ta-cvbox { position: relative; flex: 1; min-height: 0; }
.ta-cvbox canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ta-eq { text-align: center; font-weight: 900; font-size: clamp(20px, 4.4vh, 40px); padding: 2px 8px 6px; color: #3b0764; min-height: 1.4em; }
.ta-eq.bad { color: #dc2626; }
.ta-panel { display: flex; flex-direction: column; gap: clamp(4px, 1.2vh, 10px); padding: clamp(6px, 1.4vh, 12px); background: rgba(255,255,255,.85); border-left: 3px solid #fff; overflow-y: auto; justify-content: center; }
.ta-grp { display: flex; flex-direction: column; gap: 2px; }
.ta-lbl { font-weight: 800; font-size: clamp(10px, 1.3vw, 14px); color: var(--muted); }
.ta-seg { display: flex; gap: 4px; background: #ede9fe; border-radius: 999px; padding: 3px; }
.ta-seg button { flex: 1; min-height: clamp(30px, 5.4vh, 42px); border: 0; border-radius: 999px; background: transparent; font: inherit; font-weight: 800; font-size: clamp(12px, 1.6vw, 17px); color: var(--ink); cursor: pointer; padding: 0 8px; }
.ta-seg button[aria-pressed="true"] { background: #7c3aed; color: #fff; }
.ta-seg button:disabled { opacity: .35; cursor: default; }
.ta-step { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ta-step button { width: clamp(34px, 6vh, 46px); height: clamp(34px, 6vh, 46px); border: 0; border-radius: 50%; background: #e0e7ff; color: #1e1b4b; font: inherit; font-weight: 900; font-size: 1.3rem; cursor: pointer; padding: 0; box-shadow: 0 3px 0 rgba(15,23,42,.25); }
.ta-step b { min-width: 2ch; text-align: center; font-size: clamp(20px, 3.4vh, 30px); }
.ta-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ta-go { grid-column: 1 / -1; min-height: clamp(38px, 6.6vh, 50px); border: 0; border-radius: 999px; background: #16a34a; color: #fff; font: inherit; font-weight: 900; font-size: clamp(15px, 2vw, 22px); cursor: pointer; box-shadow: 0 4px 0 rgba(15,23,42,.3); }
.ta-go:active { transform: translateY(2px); }
.ta-sec { min-height: clamp(30px, 5.2vh, 40px); border: 2px solid #7c3aed; border-radius: 999px; background: #fff; color: #5b21b6; font: inherit; font-weight: 800; font-size: clamp(11px, 1.4vw, 15px); cursor: pointer; }
.ta-sec:disabled, .ta-go:disabled { opacity: .45; cursor: default; }
.ta-fb { position: absolute; left: 33%; top: 18%; transform: translate(-50%, -6px); background: var(--ink); color: #fff; padding: 6px 16px; border-radius: 14px; font-weight: 800; font-size: clamp(13px, 1.8vw, 22px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center; max-width: 56%; z-index: 4; }
.ta-fb.show { opacity: 1; transform: translate(-50%, 0); }
.ta-fb.ok { background: var(--ok); } .ta-fb.bad { background: var(--bad); }
.ta-next { position: absolute; left: 33%; transform: translateX(-50%); bottom: 14%; min-height: 48px; padding: 0 26px; border: 0; border-radius: 999px; background: #7c3aed; color: #fff; font: inherit; font-weight: 900; font-size: clamp(16px, 2.2vw, 24px); cursor: pointer; box-shadow: 0 5px 0 rgba(15,23,42,.3); z-index: 5; }
.ta-next[hidden] { display: none; }
.ta-choose { position: absolute; inset: 0; background: rgba(15,23,42,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; z-index: 6; text-align: center; color: #fff; }
.ta-choose[hidden] { display: none; }
.ta-choose h3 { margin: 0; font-size: clamp(15px, 2.2vw, 26px); } .ta-choose p { margin: 0; font-weight: 700; font-size: clamp(13px, 1.8vw, 22px); max-width: 780px; }
.ta-opts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ta-opts button { min-height: 48px; padding: 0 22px; border: 4px solid #7c3aed; border-radius: 16px; background: #fff; font: inherit; font-weight: 900; font-size: clamp(16px, 2.4vw, 28px); color: var(--ink); cursor: pointer; }
.ta-opts button.bad { background: var(--rose-100); border-color: var(--bad); }
.ta-stars { font-size: clamp(32px, 7vh, 60px); color: #f59e0b; letter-spacing: 6px; line-height: 1; } .ta-stars .off { color: #cbd5e1; }
@media (max-height: 520px) { .ta-wrap { padding: 3px 6px; } .ta-stage { border-width: 2px; border-radius: 12px; } .ta-hud { padding: 3px 6px; } .ta-eq { font-size: clamp(18px, 4vh, 28px); padding-bottom: 2px; } }
@media (max-width: 700px) and (orientation: portrait) { .ta-stage { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; } .ta-panel { border-left: 0; border-top: 3px solid #fff; } .ta-fb, .ta-next { left: 50%; } .ta-fb { max-width: 90%; } }
@media (prefers-reduced-motion: reduce) { .ta-fb { transition: none; } }
@media (max-height: 520px) { .ta-panel { gap: 3px; padding: 4px 8px; } .ta-lbl { font-size: 10px; line-height: 1.1; } .ta-seg button { min-height: 28px; } .ta-step button { width: 30px; height: 30px; } .ta-step b { font-size: 20px; } .ta-go { min-height: 34px; } .ta-sec { min-height: 28px; font-size: 11px; padding: 0 2px; } }
