/* CubeX – 📷 Giải cùng camera (live.js) */
.cg-modal { width: min(560px, calc(100% - 24px)); }
.cg-prog { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.cg-prog b { white-space: nowrap; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.cg-bar { flex: 1; height: 10px; border-radius: 5px; background: var(--surface-2, rgba(120, 120, 140, .2)); overflow: hidden; }
.cg-bar i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, #3ddc84, var(--accent, #5b3df5)); transition: width .3s; }
.cg-wrap { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1; margin: 0 auto; border-radius: 12px; overflow: hidden; background: #000; outline: 0 solid transparent; }
.cg-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-grid { position: absolute; left: 15%; top: 15%; width: 70%; height: 70%; display: grid; grid-template-columns: repeat(3, 1fr); box-shadow: 0 0 0 2px #fff, 0 0 0 9999px rgba(0, 0, 0, .28); border-radius: 6px; pointer-events: none; }
.cg-grid i { border: 1px solid rgba(255, 255, 255, .6); position: relative; }
.cg-grid i::after { content: ''; position: absolute; left: 8%; top: 8%; width: 16%; height: 16%; border-radius: 50%; border: 2px solid #fff; background: var(--g, transparent); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.cg-grid i.unknown::after { border-style: dashed; background: transparent; }
.cg-arrow { position: absolute; left: 15%; top: 15%; width: 70%; height: 70%; overflow: visible; pointer-events: none; }
.cg-arrow .cg-band rect { fill: rgba(61, 220, 132, .22); stroke: #3ddc84; stroke-width: 4; }
.cg-arrow line, .cg-arrow path { stroke: #fff; stroke-width: 26; stroke-linecap: round; fill: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .7)); }
.cg-arrow polygon { fill: #fff; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .7)); }
.cg-arrow .cg-slide { animation: cgSlide 1s ease-in-out infinite; }
.cg-arrow .cg-spin { transform-origin: 150px 150px; animation: cgSpin 1.4s ease-in-out infinite; }
.cg-arrow .cg-spin.ccw { animation-name: cgSpinR; }
.cg-arrow .back .cg-band rect { stroke-dasharray: 14 10; fill: rgba(255, 190, 0, .16); stroke: #ffbe00; }
.cg-arrow .back path { stroke-dasharray: 30 22; stroke-linecap: butt; }
@keyframes cgSlide { 0%, 100% { transform: translate(calc(var(--dx) * -1), calc(var(--dy) * -1)); } 60% { transform: translate(var(--dx), var(--dy)); } }
@keyframes cgSpin { 0%, 100% { transform: rotate(-14deg); } 60% { transform: rotate(14deg); } }
@keyframes cgSpinR { 0%, 100% { transform: rotate(14deg); } 60% { transform: rotate(-14deg); } }
.cg-move { position: absolute; left: 10px; top: 10px; min-width: 54px; padding: 4px 12px; border-radius: 12px; background: rgba(0, 0, 0, .72); color: #fff; font-size: 2rem; font-weight: 900; line-height: 1.2; text-align: center; font-family: var(--font-mono, monospace); }
.cg-move small { font-size: .9rem; margin-left: 4px; color: #3ddc84; }
.cg-move.fix { background: rgba(210, 60, 54, .9); }
.cg-move[hidden], .cg-veil[hidden], .cg-next[hidden] { display: none !important; }
.cg-veil { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.3rem; font-weight: 800; }
.cg-wrap.ok { animation: cgOk .5s ease-out; }
.cg-wrap.bad { animation: cgBad .5s ease-out; }
.cg-wrap.done .cg-grid { box-shadow: 0 0 0 4px #3ddc84, 0 0 0 9999px rgba(0, 0, 0, .28); }
@keyframes cgOk { from { outline: 8px solid #3ddc84; } to { outline: 0 solid rgba(61, 220, 132, 0); } }
@keyframes cgBad { 0% { outline: 8px solid #e5484d; transform: translateX(-6px); } 30% { transform: translateX(6px); } 60% { transform: translateX(-3px); } 100% { outline: 0 solid rgba(229, 72, 77, 0); transform: none; } }
.cg-say { margin: 10px 0 4px; text-align: center; font-size: 1.15rem; font-weight: 800; line-height: 1.35; }
.cg-msg { min-height: 1.4em; margin: 0 0 8px; text-align: center; font-weight: 600; font-size: .95rem; color: var(--text-2, inherit); }
.cg-msg.ok { color: #1f9d55; } .cg-msg.warn { color: #c77700; } .cg-msg.bad { color: #d23c36; }
.cg-next { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 10px; font-size: .9rem; color: var(--muted, inherit); }
.cg-mini { display: grid; grid-template-columns: repeat(3, 14px); grid-auto-rows: 14px; gap: 2px; padding: 3px; border-radius: 6px; background: #111; flex: none; }
.cg-mini i { border-radius: 2px; background: #555; }
.cg-row { flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cg-row button { flex: 1 1 auto; min-height: 42px; }
.cg-row .cg-done { flex-basis: 100%; min-height: 50px; font-size: 1.05rem; font-weight: 800; }
.cg-done.pulse { animation: cgPulse 1.1s ease-in-out infinite; }
@keyframes cgPulse { 50% { box-shadow: 0 0 0 6px rgba(91, 61, 245, .3); } }
.cam-live { margin-top: 12px; }
.cam-live p { margin: 0 0 8px; font-size: .9rem; color: var(--text-2, inherit); line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { .cg-arrow .cg-slide, .cg-arrow .cg-spin, .cg-done.pulse { animation: none; } }
