/* DeviTest — full-screen test layer for tool pages (same look as the home page) */
:root { --success: #10b981; --danger: #ef4444; --radius-md: 12px; --radius-lg: 20px; }
#overlay { position: fixed; inset: 0; z-index: 9999; display: none; overflow: hidden; overscroll-behavior: none; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; background: #000; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Arabic', Tahoma, 'Helvetica Neue', Arial, sans-serif; line-height: 1.5; }
#overlay.active { display: block; }
#overlay.no-cursor { cursor: none; }
#overlay:focus { outline: none; }
.layer-el { position: absolute; top: 0; left: 0; display: none; pointer-events: none; z-index: 1; }
#sweepDot { width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(circle, #fff 0%, #fff 40%, rgba(255,255,255,0.3) 70%, transparent 100%); box-shadow: 0 0 40px #fff, 0 0 80px rgba(255,255,255,0.5); will-change: transform; }
#zone { pointer-events: auto; cursor: grab; border: 1px solid rgba(255,255,255,0.35); will-change: transform; }
#zone:active { cursor: grabbing; }
#motionBar { top: 50%; margin-top: -80px; width: 160px; height: 160px; background: repeating-conic-gradient(#fff 0% 25%, #000 0% 50%) 0 0 / 20px 20px; border: 2px solid #fff; will-change: transform; }
#touchCanvas { pointer-events: auto; cursor: crosshair; }
#ghost { width: 100%; height: 100%; flex-direction: column; }
#ghost.on { display: flex; }
#ghost .lane { flex: 1; position: relative; overflow: hidden; border-bottom: 1px solid rgba(128,128,128,0.3); }
#ghost .lane:nth-child(1) { background: #000; }
#ghost .lane:nth-child(2) { background: #808080; }
#ghost .lane:nth-child(3) { background: #fff; }
#ghost .ufo { position: absolute; top: 50%; left: 0; width: 90px; height: 90px; margin-top: -45px; border-radius: 12px; will-change: transform; }
#ghost .lane:nth-child(1) .ufo, #ghost .lane:nth-child(2) .ufo { background: #fff; }
#ghost .lane:nth-child(3) .ufo { background: #000; }
#ghost .ufo::after { content: ''; position: absolute; inset: 30%; border-radius: 50%; background: #06b6d4; }
#ghost.blank .lane { visibility: hidden; }
.overlay-ui { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); transition: opacity .3s ease; }
.overlay-ui.hidden { opacity: 0; }
.overlay-ui.hidden * { pointer-events: none !important; }
.overlay-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.overlay-pill, .overlay-btn { background: rgba(15,23,42,0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #fff; padding: 9px 16px; border-radius: 30px; font-size: 13px; font-weight: 600; font-family: inherit; border: 1px solid rgba(255,255,255,0.15); display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
.overlay-pill .value { color: #22d3ee; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.overlay-btn { pointer-events: auto; cursor: pointer; min-height: 40px; }
.overlay-btn:hover { background: rgba(30,41,59,0.95); }
.overlay-btn.exit { border-color: rgba(239,68,68,0.5); }
.overlay-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.overlay-nav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.overlay-nav:empty { display: none; }
.overlay-hint { background: rgba(15,23,42,0.88); color: #fff; padding: 10px 20px; border-radius: 30px; font-size: 13px; border: 1px solid rgba(255,255,255,0.15); text-align: center; max-width: 92vw; }
.overlay-progress { position: absolute; top: 0; left: 0; height: 3px; width: 0%; z-index: 3; background: linear-gradient(90deg, #06b6d4, #2563eb, #8b5cf6); transition: width .2s linear; }
.toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 10002; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: rgba(15,23,42,0.96); border: 1px solid #2d3b52; border-radius: var(--radius-md); padding: 12px 20px; color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: sdpIn .3s ease; max-width: 90vw; }
@keyframes sdpIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
.toast.success { border-color: rgba(16,185,129,0.5); } .toast.success .toast-icon { color: var(--success); }
.toast.info { border-color: rgba(59,130,246,0.5); } .toast.info .toast-icon { color: #3b82f6; }
.toast.warning { border-color: rgba(245,158,11,0.5); } .toast.warning .toast-icon { color: var(--warning); }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); z-index: 10001; display: none; justify-content: center; align-items: center; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal { max-height: 90vh; overflow-y: auto; background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 26px; max-width: 480px; width: 100%; box-shadow: 0 30px 60px rgba(0,0,0,0.6); animation: sdpIn .3s ease; }
.modal h3 { font-size: 19px; margin-bottom: 10px; color: var(--text-strong); }
.modal .modal-desc { color: var(--text-dim); font-size: 14px; line-height: 1.85; margin-bottom: 20px; }
.modal .modal-desc a { color: var(--accent); }
.modal .modal-actions { display: flex; gap: 10px; }
.mbtn-primary, .mbtn-secondary { flex: 1; padding: 13px 20px; border-radius: var(--radius-md); font: 600 14px inherit; font-family: inherit; cursor: pointer; border: 1px solid transparent; }
.mbtn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.mbtn-secondary { background: var(--tile); color: var(--text); border-color: var(--border-light); }
.q-sum { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.q-list { list-style: none; margin-bottom: 12px; padding: 0; }
.q-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.q-list .ok { color: var(--success); } .q-list .bad { color: var(--danger); }
.q-tips p { font-size: 13px; margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--tile); }
/* in-page test launcher */
.test-box { margin: 18px 0 8px; padding: 18px; border-radius: 16px; border: 1px solid var(--border-light); background: var(--tile); }
.test-box .cta-row { margin-top: 4px; }
.test-box .hint { font-size: 14px; color: var(--text-dim); margin-top: 10px; }
.test-box .settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.test-box .settings label { font-size: 13px; }
.test-box .badge-out { display: inline-block; margin-top: 10px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-light); background: var(--bg-panel); font-weight: 700; color: var(--accent); direction: ltr; }
@media (max-width: 600px) { .overlay-pill, .overlay-btn { font-size: 12px; padding: 8px 12px; } }
@media (prefers-reduced-motion: reduce) { .toast, .modal { animation: none; } .overlay-ui, .overlay-progress { transition: none; } }
.test-box .cta[data-arg] { padding: 8px 14px; font-size: 14px; margin: 0; }
.test-box .cta-row + .cta-row { margin-top: 8px; }
