/* ============================================================
   FILE: static/css/landing/tuner.css
   Shared styling for all per-instrument tuners (guitar, bass,
   ukulele, violin, chromatic). Each page loads this + tuner.js
   and sets instrument via data attributes.
   ============================================================ */

.tn-stage {
    background: radial-gradient(ellipse at top, #1e2a44 0%, #0d1628 70%);
    min-height: 640px;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #eaf1ff;
    font-family: var(--font-family, 'Inter', sans-serif);
}
.tn-shell {
    width: 100%;
    max-width: 560px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    padding: 30px 28px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}

/* ── Head ───────────────────────────────────────────────── */
.tn-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}
.tn-brand { display: flex; align-items: center; gap: 12px; }
.tn-brand__icon { font-size: 1.8rem; line-height: 1; }
.tn-brand__title {
    font-family: 'Urbanist', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
}
.tn-brand__sub {
    font-size: 0.72rem;
    color: #8da2c6;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.tn-icon-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #c4d0e9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
}
.tn-icon-btn:hover {
    background: rgba(255,80,80,0.15);
    border-color: rgba(255,120,120,0.4);
    color: #ffdcdc;
}

/* ── Mic start panel ────────────────────────────────────── */
.tn-mic-panel {
    text-align: center;
    padding: 50px 20px;
}
.tn-mic-panel__icon {
    font-size: 3.2rem;
    margin-bottom: 14px;
    line-height: 1;
}
.tn-mic-panel__title {
    font-family: 'Urbanist', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.tn-mic-panel__body {
    font-size: 0.92rem;
    color: #b8c8e4;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}
.tn-mic-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #FF9F43 0%, #EF6F6C 100%);
    border: none;
    border-radius: 999px;
    color: #fff;
    font-family: 'Urbanist', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(239,111,108,0.3);
    transition: all 0.15s;
}
.tn-mic-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(239,111,108,0.4);
}

.tn-mic-denied {
    margin-top: 14px;
    font-size: 0.82rem;
    color: #ff9e9e;
    padding: 10px 16px;
    background: rgba(255,100,100,0.1);
    border: 1px solid rgba(255,100,100,0.3);
    border-radius: 8px;
    display: none;
}
.tn-mic-denied.show { display: block; }

/* ── Tuner body (after mic granted) ─────────────────────── */
.tn-body { display: none; }
.tn-body.active { display: block; }

/* ── Note display ───────────────────────────────────────── */
.tn-note-display {
    text-align: center;
    margin-bottom: 16px;
}
.tn-note-display__note {
    font-family: 'Urbanist', sans-serif;
    font-size: 5.2rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(180deg, #ffffff 0%, #94b3e8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.2s;
}
.tn-note-display__note.in-tune {
    background: linear-gradient(180deg, #4ADE80 0%, #22c55e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 0 40px rgba(74, 222, 128, 0.5);
}
.tn-note-display__freq {
    font-size: 0.85rem;
    color: #8da2c6;
    margin-top: 4px;
}
.tn-note-display__note--dim { opacity: 0.3; }

/* ── Needle meter ───────────────────────────────────────── */
.tn-meter {
    position: relative;
    height: 120px;
    margin: 20px 0 26px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.06);
}
.tn-meter__scale {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tn-meter__track {
    position: relative;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg,
        rgba(239,111,108,0.6) 0%,
        rgba(239,111,108,0.3) 25%,
        rgba(74,222,128,0.2) 45%,
        rgba(74,222,128,0.8) 50%,
        rgba(74,222,128,0.2) 55%,
        rgba(255,159,67,0.3) 75%,
        rgba(255,159,67,0.6) 100%);
    border-radius: 3px;
}
.tn-meter__ticks {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tn-meter__tick {
    width: 1px;
    height: 10px;
    background: rgba(255,255,255,0.2);
}
.tn-meter__tick--major {
    height: 16px;
    background: rgba(255,255,255,0.4);
    width: 2px;
}
.tn-meter__needle {
    position: absolute;
    left: 50%;
    top: -8px;
    bottom: -8px;
    width: 3px;
    background: #fff;
    box-shadow: 0 0 10px rgba(255,255,255,0.7);
    border-radius: 2px;
    transition: left 0.15s ease-out, background 0.2s;
    transform: translateX(-50%);
}
.tn-meter__needle.in-tune {
    background: #4ADE80;
    box-shadow: 0 0 14px rgba(74,222,128,0.9);
}
.tn-meter__labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.72rem;
    color: #8da2c6;
    font-weight: 600;
}

/* Cents number display */
.tn-cents {
    text-align: center;
    font-size: 1.05rem;
    color: #c4d0e9;
    margin-bottom: 8px;
    font-family: monospace;
    letter-spacing: 0.05em;
    min-height: 1.3em;
}
.tn-cents.in-tune { color: #4ADE80; }
.tn-cents__sign { font-weight: 700; }

/* Status ("In tune" / "Flat" / "Sharp") */
.tn-status {
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    min-height: 1.2em;
    margin-top: 4px;
    color: #8da2c6;
    letter-spacing: 0.03em;
}
.tn-status.flat { color: #EF6F6C; }
.tn-status.sharp { color: #FF9F43; }
.tn-status.in-tune { color: #4ADE80; }

/* ── String pills ───────────────────────────────────────── */
.tn-strings {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}
.tn-string {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.15);
    color: #c4d0e9;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: 'Urbanist', sans-serif;
}
.tn-string.active {
    background: rgba(255,159,67,0.2);
    border-color: #FF9F43;
    color: #fff;
    transform: scale(1.1);
}
.tn-string.in-tune {
    background: rgba(74,222,128,0.2);
    border-color: #4ADE80;
    color: #fff;
    box-shadow: 0 0 16px rgba(74,222,128,0.4);
}

/* ── Reference A adjust ─────────────────────────────────── */
.tn-ref {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 22px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
}
.tn-ref__label {
    font-size: 0.8rem;
    color: #8da2c6;
    font-weight: 600;
}
.tn-ref__value {
    font-family: 'Urbanist', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    min-width: 64px;
    text-align: center;
}
.tn-ref__btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: #c4d0e9;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tn-ref__btn:hover {
    background: rgba(255,159,67,0.2);
    color: #fff;
}

/* ── Listening indicator ────────────────────────────────── */
.tn-listening {
    display: inline-flex;
    gap: 3px;
    align-items: flex-end;
    height: 14px;
    margin-right: 6px;
    vertical-align: middle;
}
.tn-listening span {
    width: 3px;
    background: #8da2c6;
    border-radius: 2px;
    animation: tn-wave 1.1s ease-in-out infinite;
}
.tn-listening span:nth-child(1) { height: 6px; animation-delay: 0s; }
.tn-listening span:nth-child(2) { height: 10px; animation-delay: 0.15s; }
.tn-listening span:nth-child(3) { height: 14px; animation-delay: 0.3s; }
.tn-listening span:nth-child(4) { height: 10px; animation-delay: 0.45s; }
.tn-listening span:nth-child(5) { height: 6px; animation-delay: 0.6s; }

@keyframes tn-wave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

/* Mobile */
@media (max-width: 520px) {
    .tn-shell { padding: 22px 18px; }
    .tn-note-display__note { font-size: 4rem; }
    .tn-string { width: 38px; height: 38px; font-size: 0.85rem; }
}