body{margin:0;padding:0}*{box-sizing:border-box;margin:0;padding:0}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-color:#f5f5f5;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.app{min-height:100vh;padding:env(safe-area-inset-top,0) env(safe-area-inset-right,0) env(safe-area-inset-bottom,0) env(safe-area-inset-left,0);padding-bottom:calc(48px + env(safe-area-inset-bottom,0));flex-direction:column;display:flex}button{cursor:pointer;border:none;outline:none;font-family:inherit;transition:all .2s}button:disabled{opacity:.5;cursor:not-allowed}.btn-primary{color:#fff;background-color:#007bff;border-radius:8px;min-height:48px;padding:14px 28px;font-size:16px;font-weight:600}.btn-primary:hover:not(:disabled){background-color:#0056b3}.btn-secondary{color:#fff;background-color:#6c757d;border-radius:8px;min-height:48px;padding:14px 28px;font-size:16px;font-weight:600}.btn-secondary:hover:not(:disabled){background-color:#545b62}.btn-back{color:#007bff;background:0 0;min-width:48px;min-height:48px;padding:8px;font-size:16px}.capture-screen,.review-screen,.solve-screen{flex-direction:column;flex:1;width:100%;max-width:800px;margin:0 auto;padding:16px;display:flex}.capture-header,.review-header,.solve-header{text-align:center;margin-bottom:24px}.review-header,.solve-header{align-items:center;gap:16px;display:flex}h1{margin-bottom:8px;font-size:24px}h3{margin-bottom:12px;font-size:16px}.camera-setup{z-index:2;background:#0000008c;flex-direction:column;justify-content:center;align-items:center;gap:16px;padding:24px 16px;display:flex;position:absolute;inset:0}.camera-hint{color:#f3f4f6;text-align:center;max-width:280px;font-size:13px}.error{color:#fecaca;text-align:center;background:#7f1d1dd9;border:1px solid #f87171;border-radius:8px;max-width:320px;padding:10px 12px;font-size:14px}.video-container{aspect-ratio:4/3;background:#000;border-radius:12px;width:100%;position:relative;overflow:hidden}.video-container.idle .video-feed{opacity:.35}.video-feed{object-fit:cover;background:#111;width:100%;height:100%}.switch-camera-btn{z-index:5;color:#0f172a;background:#f8fafc;border:3px solid #0b5fff;border-radius:16px;flex-direction:column;justify-content:center;align-items:center;gap:2px;min-width:72px;max-width:18%;min-height:96px;padding:10px 6px;font-weight:700;display:flex;position:absolute;top:50%;right:4px;transform:translateY(-50%);box-shadow:0 8px 20px #00000059}.switch-camera-btn:active{transform:translateY(-50%)scale(.97)}.switch-camera-icon{color:#0b5fff;font-size:28px;line-height:1}.switch-camera-text{text-align:center;font-size:12px;line-height:1.15}.active-camera-label{color:#334155;text-align:center;font-size:14px}.camera-picker-toggle{width:100%}.camera-live-error{margin:12px auto 0}.camera-picker-backdrop{z-index:1200;padding:12px;padding-bottom:calc(12px + env(safe-area-inset-bottom,0));background:#0f172a8c;justify-content:center;align-items:flex-end;display:flex;position:fixed;inset:0}.camera-picker-sheet{background:#fff;border-radius:16px 16px 12px 12px;width:min(520px,100%);max-height:70vh;padding:12px;overflow:auto;box-shadow:0 -4px 24px #0003}.camera-picker-header{justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px;display:flex}.camera-picker-header h2{font-size:18px}.camera-picker-list{flex-direction:column;gap:8px;list-style:none;display:flex}.camera-picker-item{color:#0f172a;text-align:left;background:#f8fafc;border:2px solid #cbd5e1;border-radius:12px;justify-content:space-between;align-items:center;gap:12px;width:100%;min-height:56px;padding:12px 14px;font-size:15px;font-weight:600;display:flex}.camera-picker-item.selected{background:#eff6ff;border-color:#0b5fff}.camera-picker-item-badge{color:#0b5fff;text-transform:uppercase;font-size:12px;font-weight:700}.scan-overlay{justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.scan-grid{aspect-ratio:1;background:repeating-linear-gradient(#0000 65%,#ffffff4d 66% 67%,#0000 68%,#0000),repeating-linear-gradient(90deg,#0000,#0000 32%,#ffffff4d 33% 34%,#0000 35%);border:3px solid #fffc;border-radius:8px;width:60%}.scan-guide-message{z-index:4;color:#f8fafc;text-align:center;pointer-events:none;background:#0f172ae0;border-radius:10px;max-width:86%;padding:10px 14px;font-size:14px;font-weight:600;line-height:1.3;position:absolute;bottom:12%;left:50%;transform:translate(-50%);box-shadow:0 4px 16px #00000059}.progress-container{flex-direction:column;align-items:center;gap:16px;margin-top:24px;padding-bottom:56px;display:flex}.face-chips{flex-wrap:wrap;justify-content:center;gap:12px;display:flex}.face-chip{color:#333;cursor:pointer;border:2px solid #ccc;border-radius:8px;justify-content:center;align-items:center;width:48px;height:48px;font-size:14px;font-weight:600;transition:all .3s;display:flex}.face-legend{background:#f1f5f9;border:1px solid #e2e8f0;border-radius:10px;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 10px;width:100%;max-width:360px;margin:0;padding:10px 12px;display:grid}.face-legend>div{align-items:baseline;gap:6px;min-width:0;display:flex}.face-legend dt{color:#0f172a;min-width:1.1em;font-size:13px;font-weight:800}.face-legend dd{color:#475569;margin:0;font-size:11px;line-height:1.25}.chip-hint{color:#64748b;text-align:center;font-size:12px}.move-legend{text-align:left;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;width:100%;max-width:420px;margin:8px auto 0;padding:10px 12px}.move-legend p{color:#334155;margin:0;font-size:12px;line-height:1.35}.move-legend p+p{margin-top:4px}.btn-start-over{color:#b91c1c;background:#fff;border:2px solid #ef4444;border-radius:10px;min-width:120px;min-height:48px;padding:12px 18px;font-size:16px;font-weight:700}.btn-start-over:hover{background:#fef2f2}.start-over-inline{margin-top:8px}.start-over-below{width:100%;margin-top:4px}.start-over-backdrop{z-index:1300;background:#0f172a8c;justify-content:center;align-items:center;padding:16px;display:flex;position:fixed;inset:0}.start-over-sheet{background:#fff;border-radius:14px;width:min(420px,100%);padding:18px;box-shadow:0 12px 32px #00000040}.start-over-sheet h2{margin-bottom:8px;font-size:18px}.start-over-sheet p{color:#475569;margin-bottom:16px}.start-over-actions{gap:10px;display:flex}.start-over-actions button{flex:1}.face-chip.detected{color:#fff;text-shadow:0 1px 2px #0000004d;border-color:#28a745;box-shadow:0 0 8px #28a74580}.timer{color:#666;font-size:14px}.cube-net{grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:24px;display:grid}.cube-face{background:#fff;border-radius:8px;padding:12px;box-shadow:0 2px 4px #0000001a}.sticker-grid{grid-template-columns:repeat(3,1fr);gap:4px;display:grid}.sticker{aspect-ratio:1;border:2px solid #ccc;border-radius:4px;min-width:32px;min-height:32px;transition:all .2s}.sticker:not(.center):hover{cursor:pointer;border-color:#007bff;transform:scale(1.1)}.sticker.selected{border-width:3px;border-color:#007bff;transform:scale(1.1)}.sticker.center{opacity:.7;cursor:not-allowed}.color-picker{background:#fff;border-radius:8px;margin-bottom:24px;padding:16px;box-shadow:0 2px 8px #00000026}.color-options{flex-wrap:wrap;justify-content:center;gap:12px;margin-top:12px;display:flex}.color-option{border:2px solid #ccc;border-radius:8px;width:56px;min-width:48px;height:56px;min-height:48px}.color-option:hover{border-color:#007bff;transform:scale(1.1)}.validation-panel{background:#fff;border-radius:8px;margin-bottom:24px;padding:16px;box-shadow:0 2px 4px #0000001a}.color-counts{flex-wrap:wrap;gap:16px;margin-top:12px;display:flex}.count-item{align-items:center;gap:8px;display:flex}.color-dot{border:2px solid #ccc;border-radius:50%;width:24px;height:24px}.errors{background:#fff3cd;border-radius:4px;margin-top:12px;padding:12px}.solve-screen.loading,.solve-screen.error{text-align:center;justify-content:center;align-items:center;gap:24px}.setup-instructions{text-align:center;background:#fff;border-radius:8px;margin-bottom:24px;padding:16px;box-shadow:0 2px 4px #0000001a}.setup-instructions p{margin:4px 0}.cube-container{background:#fff;border-radius:12px;flex:none;width:100%;height:300px;min-height:300px;margin-bottom:24px;position:relative;overflow:hidden;box-shadow:0 2px 8px #0000001a}.cube-visualization{width:100%;height:100%;min-height:300px}.cube-visualization canvas{display:block;width:100%!important;height:100%!important}.cube-fallback-net{background:#f8fafc;place-items:center;padding:12px;display:grid;position:absolute;inset:0}.cube-fallback-net[hidden]{display:none}.cube-fallback-face{grid-template-columns:repeat(3,28px);gap:3px;display:grid}.cube-fallback-sticker{border:1px solid #0f172a;border-radius:3px;width:28px;height:28px}.move-info{text-align:center;background:#fff;border-radius:8px;margin-bottom:24px;padding:16px 16px 28px;box-shadow:0 2px 4px #0000001a}.move-counter{color:#666;margin-bottom:12px;font-size:14px}.current-move{flex-direction:column;gap:8px;display:flex}.move-notation{color:#007bff;font-size:32px;font-weight:700}.move-description{color:#333;font-size:16px}.controls{justify-content:space-between;gap:12px;display:flex}.controls button{flex:1}.solved-actions{flex:1;gap:12px;display:flex}@media (width>=768px){.capture-screen,.review-screen,.solve-screen{padding:32px}h1{font-size:32px}.cube-net{grid-template-columns:repeat(3,1fr);gap:24px}.sticker{min-width:48px;min-height:48px}.cube-container{height:400px;min-height:400px}.cube-visualization{min-height:400px}}.btn-manual-capture{width:100%;max-width:360px}.debug-toggle-on{border-color:#b45309;background:#b45309!important}.debug-console{z-index:1000;pointer-events:none;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;position:fixed;bottom:0;left:0;right:0}.debug-console>*{pointer-events:auto}.debug-console-handle{color:#f9fafb;width:100%;height:32px;min-height:32px;padding:0 8px;padding-bottom:env(safe-area-inset-bottom,0);background:#111827;border-radius:10px 10px 0 0;font-size:12px;font-weight:600;line-height:32px}.debug-console.open .debug-console-handle{border-radius:0}.debug-console-panel{color:#e5e7eb;max-height:40vh;padding-bottom:env(safe-area-inset-bottom,0);background:#0b1220;border-top:1px solid #374151;flex-direction:column;display:flex}.debug-console-toolbar{flex-wrap:wrap;align-items:center;gap:8px;padding:8px;display:flex}.debug-version{color:#93c5fd;letter-spacing:.02em;flex:100%;font-size:12px;font-weight:600}.debug-action{flex:1;min-height:44px;padding:10px 12px;font-size:14px}.debug-console-entries{max-height:calc(40vh - 96px);padding:0 8px 8px;overflow:auto}.debug-console-footer{color:#9ca3af;border-top:1px solid #1f2937;padding:6px 10px 10px;font-size:11px}.debug-empty{color:#9ca3af;padding:8px}.debug-entry{border-bottom:1px solid #1f2937;grid-template-columns:72px 48px 1fr;gap:8px;padding:4px 0;font-size:11px;line-height:1.35;display:grid}.debug-time{color:#9ca3af}.debug-level{text-transform:uppercase;font-weight:700}.debug-message{word-break:break-word;white-space:pre-wrap}.link-button{color:#007bff;background:0 0;min-height:44px;padding:8px 12px;font-size:15px;text-decoration:underline}.fix-banner{background:#fff3cd;border:1px solid #f0d78c;border-radius:8px;margin-bottom:16px;padding:12px}.fix-banner-title{margin-bottom:6px;font-weight:700}.fix-error-list{color:#7a5b00;margin:8px 0 12px 18px}.rescan-face-row{flex-wrap:wrap;gap:8px;display:flex}.rescan-face-btn{flex:40%;min-height:44px;padding:10px 12px;font-size:14px}.cube-face.face-suspicious{outline-offset:2px;outline:2px solid #dc3545}
