/* ---------- SCOUTER (scouter.js): a small piece of equipment, not a dashboard ----------
   Dark gunmetal frame, green phosphor readout, amber labels, restrained red only for warnings. Motion means something:
   the scanline runs while audio is being acquired, the reticle pulses while analyzing, one flash when a result lands,
   then everything goes still. Calm-motion mode (Settings) removes all of it. */
:root { --sc-rim: #a9ae9e; --sc-metal: #4b5148; --sc-metal-hi: #8a9183; --sc-lens: #22392a; --sc-glint: #4e7a57; --sc-amber: #7a5a2c; --sc-ret: #3f6a49;
  --sc-green: #7ff28a; --sc-green-dim: #3d7a47; --sc-panel: #0c110d; --sc-amber-hi: #ffb347; }

/* the player button: lens dark at rest, amber on hover, green while it works, a pulse when it's done */
.player .sc-btn { width: 40px !important; }
.sc-btn .sc-ic { width: 24px; height: 18px; overflow: visible; }
.sc-btn .sc-scan { fill: #8dff9a; opacity: 0; }
.sc-btn:hover, .sc-btn:focus-visible { --sc-lens: #5a3f1a; --sc-glint: #ff9a2e; --sc-ret: #ffcf5a; --sc-amber: #ff9a2e; }
.sc-btn.on { --sc-amber: #ff9a2e; border-color: #ff9a2e !important; }
.sc-btn.is-busy { --sc-lens: #1f4a2b; --sc-glint: #5fbf6d; --sc-ret: #8dff9a; --sc-amber: #8dff9a; }
.sc-btn.is-busy .sc-scan { opacity: .9; animation: sc-sweep 1.1s steps(6, end) infinite; }
.sc-btn.is-ready { --sc-lens: #245a33; --sc-glint: #8dff9a; --sc-ret: #d8ffdc; --sc-amber: #8dff9a; }
.sc-btn.is-ready .sc-ic { animation: sc-pulse .6s ease-out 1; }
.sc-btn.is-unavailable { --sc-lens: #2a2a2a; --sc-glint: #555; --sc-ret: #666; --sc-amber: #555; opacity: .75; }
@keyframes sc-sweep { 0% { transform: translateY(0); } 100% { transform: translateY(5px); } }
@keyframes sc-pulse { 0% { filter: drop-shadow(0 0 0 #8dff9a); } 40% { filter: drop-shadow(0 0 6px #8dff9a); } 100% { filter: none; } }

/* the HUD */
.sc-hud { position: fixed; right: 14px; bottom: calc(var(--ftr, 54px) + 14px); z-index: 140; width: min(330px, calc(100vw - 20px));
  color: var(--sc-green); background: var(--sc-panel); border: 2px solid #050605; outline: 1px solid #3d4239; outline-offset: -5px;
  box-shadow: 0 0 0 2px #6b6f63, 6px 6px 0 #0006, 0 18px 40px #000a; font: 600 12px/1.3 var(--ui); animation: sc-open .14s steps(3, end) both; }
.sc-hud.hidden { display: none; }
@keyframes sc-open { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.sc-head { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 10px; background: #161c17; border-bottom: 1px solid #2c362e; }
.sc-head b { color: var(--sc-amber-hi); font: 700 12px/1 var(--ui); letter-spacing: .14em; }
.sc-led { width: 8px; height: 8px; background: var(--sc-green-dim); box-shadow: 0 0 0 1px #050605; }
.sc-hud.is-acquiring .sc-led, .sc-hud.is-rhythm .sc-led, .sc-hud.is-harmony .sc-led { background: var(--sc-green); animation: sc-blink .8s steps(2, end) infinite; }
.sc-hud.is-unavailable .sc-led, .sc-hud.is-error .sc-led { background: #c4321f; }
@keyframes sc-blink { 50% { opacity: .25; } }
.sc-state { flex: 1; min-width: 0; font: 700 10px/1 var(--ui); letter-spacing: .12em; color: #a9e9b0; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-mini { display: none; }
.sc-x { width: 22px; height: 22px; display: grid; place-items: center; padding: 0; background: #0a0e0b; color: #c9c2ab; border: 1px solid #3d4239; font: 700 14px/1 var(--ui); cursor: pointer; }
.sc-x:hover, .sc-x:focus-visible { color: #fff; border-color: var(--sc-amber-hi); }
.sc-body { padding: 10px 12px 12px; }
.sc-track { margin: 0 0 8px; color: #d9e6d4; font: 600 12px/1.3 var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-screen { position: relative; display: grid; grid-template-columns: 1.25fr 1fr; gap: 6px 10px; padding: 10px 10px 8px; overflow: hidden;
  background: repeating-linear-gradient(180deg, #0f2414 0 2px, #0c1d11 2px 4px); border: 1px solid #2f5a37; box-shadow: inset 0 0 18px #000c; }
.sc-cell { display: grid; gap: 2px; min-width: 0; }
.sc-cell small { color: var(--sc-amber-hi); font: 700 9px/1 var(--ui); letter-spacing: .16em; }
.sc-cell b { color: var(--sc-green); font: 700 18px/1.05 var(--ui); letter-spacing: .03em; text-shadow: 0 0 6px #7ff28a55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-bpm b { font-size: 34px; }
.sc-key b { font-size: 20px; }
.sc-cell em { color: #a9e9b0; font: 600 10px/1 var(--ui); font-style: normal; letter-spacing: .08em; min-height: 10px; }
.sc-conf.low b { color: #ffb347; }
.sc-conf b { font-size:12px; line-height:1.5; white-space:pre-line; }
.sc-meter { grid-column: 1 / -1; position: relative; height: 12px; margin-top: 4px; border: 1px solid #2f5a37; background: #07120a; }
.sc-meter i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, #4fd365 0 6px, #2f8a42 6px 8px); transition: width .3s steps(6, end); }
.sc-meter span { position: absolute; right: 4px; top: 50%; translate: 0 -50%; font: 700 8px/1 var(--ui); letter-spacing: .1em; color: #d8ffdc; text-shadow: 0 0 3px #000; }
.sc-line { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, #8dff9a, transparent); opacity: 0; pointer-events: none; }
.sc-hud.is-acquiring .sc-line, .sc-hud.is-rhythm .sc-line, .sc-hud.is-harmony .sc-line { opacity: .8; animation: sc-scanline 1.6s linear infinite; }
@keyframes sc-scanline { from { transform: translateY(0); } to { transform: translateY(150px); } }
.sc-hud.is-complete .sc-screen { animation: sc-land .35s ease-out 1; }
@keyframes sc-land { 0% { box-shadow: inset 0 0 18px #000c, 0 0 0 2px #8dff9a; } 100% { box-shadow: inset 0 0 18px #000c; } }
.sc-note { margin: 8px 0 0; min-height: 0; color: #b8c6b4; font: 500 11px/1.4 var(--ui); }
.sc-note:empty { display: none; }
.sc-hud.is-unavailable .sc-note, .sc-hud.is-error .sc-note { color: #ffb347; }
.sc-acts { display: flex; gap: 6px; margin-top: 10px; }
.sc-acts .btn { flex: 1; justify-content: center; background: #131a14 !important; color: #d9e6d4 !important; border: 1px solid #3d6a46 !important; box-shadow: none !important; font: 700 11px var(--ui) !important; letter-spacing: .08em; }
.sc-acts .btn:hover:not(:disabled) { background: #1f4a2b !important; color: #fff !important; }
.sc-acts .btn.sc-scan { background: #ff9a2e !important; color: #131313 !important; border-color: #131313 !important; }
.sc-acts .btn:disabled { opacity: .4; }
.sc-compare { margin-top: 10px; border-top: 1px dashed #2c362e; padding-top: 8px; }
.sc-compare summary { cursor: pointer; color: #a9e9b0; font: 700 10px var(--ui); letter-spacing: .12em; }
.sc-compare form { display: flex; gap: 6px; margin-top: 8px; }
.sc-compare input { flex: 1; min-width: 0; padding: 6px 8px; background: #07120a; color: #d9e6d4; border: 1px solid #2f5a37; font: 500 12px var(--ui); }
.sc-compare p { margin: 8px 0 0; color: #d9e6d4; font: 500 11px/1.4 var(--ui); }
.sc-compare p:empty { display: none; }
.sc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* minimized: one line, the result if there is one */
.sc-hud.min { width: auto; }
.sc-hud.min .sc-body, .sc-hud.min .sc-state { display: none; }
.sc-hud.min .sc-mini { display: inline; color: var(--sc-green); font: 700 13px/1 var(--ui); letter-spacing: .06em; cursor: pointer; }
.sc-hud.min .sc-head { cursor: pointer; border-bottom: 0; }
body.motion-quiet .sc-hud, body.motion-quiet .sc-hud *, body.motion-quiet .sc-btn * { animation: none !important; transition: none !important; }
@media (max-width: 760px) {
  .sc-hud { left: 8px; right: 8px; width: auto; bottom: calc(var(--tab-h, 64px) + var(--pl-h, 56px) + var(--safe-b, 0px) + 10px); }
  .sc-bpm b { font-size: 28px; }
}
