/* Mic test — template-parts/tools/mic-test.php */

.mt-stage {
    margin-top: 18px;
    padding: 16px;
    border-radius: 14px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
}

.mt-scope {
    position: relative;
    height: 96px;
    border-radius: 10px;
    background:
        radial-gradient(120% 90% at 50% 50%, color-mix(in srgb, var(--color-accent) 7%, transparent), transparent 70%),
        repeating-linear-gradient(90deg, transparent 0 39px, color-mix(in srgb, var(--color-border) 60%, transparent) 39px 40px);
    overflow: hidden;
}
.mt-wave { display: block; width: 100%; height: 100%; }
.mt-scope__idle {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 16px;
    text-align: center;
    font-size: 14px;
    color: var(--color-text-muted);
}
.mt-stage[data-state="live"] .mt-scope__idle { display: none; }

.mt-meter { margin-top: 14px; }
.mt-bar { height: 16px; }
.mt-bar .army-meter__fill {
    background: var(--color-accent);
    opacity: .9;
    z-index: 1;
}
/* Zones under the fill: below −50 dBFS (quiet) and above −1 dBFS (hot) */
.mt-zone { position: absolute; top: 0; bottom: 0; z-index: 0; }
.mt-zone--quiet {
    left: 0;
    width: 16.667%; /* −60 … −50 of a 60 dB scale */
    background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--color-text-muted) 18%, transparent) 4px 6px);
}
.mt-zone--hot {
    right: 0;
    width: 1.667%; /* −1 … 0 dBFS */
    background: color-mix(in srgb, #e5484d 45%, transparent);
}
.mt-peak {
    position: absolute;
    top: -2px;
    bottom: -2px;
    left: 0;
    width: 3px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--color-text-primary);
    opacity: 0;
    z-index: 2;
}
.mt-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.mt-read {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 0;
}
.mt-read div {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    min-width: 0;
}
.mt-read dt { font-size: 12px; color: var(--color-text-muted); }
.mt-read dd {
    margin: 2px 0 0;
    font-family: var(--cine-mono, ui-monospace, monospace);
    font-size: clamp(14px, 3.6vw, 18px);
    color: var(--color-text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mt-listen {
    margin-top: 12px;
    font-size: 14px;
    color: var(--color-text-secondary);
}
.mt-listen__bar {
    display: block;
    height: 4px;
    margin-top: 8px;
    border-radius: 4px;
    background: var(--color-border);
    overflow: hidden;
}
.mt-listen__bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--color-accent);
}

.mt-rec-btn { gap: 8px; }
.mt-rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e5484d;
}
.mt-rec-btn.is-rec { border-color: #e5484d; color: var(--color-text-primary); }
.mt-rec-btn.is-rec .mt-rec-dot { animation: mt-pulse 1s ease-in-out infinite; }
@keyframes mt-pulse { 50% { opacity: .3; transform: scale(.8); } }

.army-tool[data-context="embed"] .mt-stage { margin-top: 14px; }

@media (max-width: 480px) {
    .mt-stage { padding: 12px; }
    .mt-scope { height: 80px; }
    .mt-read { gap: 6px; }
    .mt-read div { padding: 8px; }
    .mt-scale span:nth-child(even) { visibility: hidden; }
}
