/* ═══════════════════════════════════════════
   EAR TRAINING — Kulak Eğitimi
   Mode cards, exercise area, feedback states
   ═══════════════════════════════════════════ */

.ear-page {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-4);
}

.ear-header {
    margin-bottom: var(--space-6);
}

.ear-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    color: var(--text-primary);
    margin: 0 0 var(--space-1);
}

.ear-subtitle {
    font-size: var(--text-sm);
    margin: 0;
}

/* --- Mode Select Cards --- */
.ear-modes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.ear-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.ear-mode-card:hover {
    border-color: var(--mode-color, var(--gold-400));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.ear-mode-icon {
    font-size: 2.5rem;
}

.ear-mode-name {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    color: var(--text-primary);
    font-weight: 600;
}

.ear-mode-desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* --- Difficulty Picker --- */
.ear-difficulty {
    text-align: center;
    margin-bottom: var(--space-5);
}

.ear-diff-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.ear-diff-btn {
    padding: var(--space-2) var(--space-5);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ear-diff-btn:hover {
    border-color: var(--gold-400);
}

.ear-diff-btn--active {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.2), rgba(139, 105, 20, 0.15));
    border-color: var(--gold-400);
    color: var(--gold-400);
    font-weight: 600;
}

/* --- Exercise Area --- */
.ear-exercise {
    text-align: center;
}

.ear-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.ear-back-btn {
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: color 0.2s;
}

.ear-back-btn:hover {
    color: var(--text-primary);
    border-color: var(--gold-400);
}

.ear-mode-label {
    font-family: var(--font-display);
    font-size: var(--text-base);
    color: var(--text-primary);
}

.ear-score {
    display: flex;
    gap: var(--space-3);
}

.ear-streak {
    font-size: var(--text-sm);
    color: var(--gold-400);
    font-weight: 600;
}

.ear-correct {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 600;
}

/* Timer */
.ear-timer {
    font-family: var(--font-mono, 'SF Mono', monospace);
    font-size: var(--text-3xl);
    color: var(--gold-400);
    font-weight: 700;
    margin-bottom: var(--space-3);
    animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Prompt */
.ear-prompt {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--text-primary);
    margin-bottom: var(--space-5);
}

/* Play Button */
.ear-play-btn {
    padding: var(--space-4) var(--space-8);
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(139, 105, 20, 0.1));
    border: 2px solid var(--gold-400);
    border-radius: var(--radius-lg);
    color: var(--gold-400);
    font-size: var(--text-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: var(--space-6);
}

.ear-play-btn:hover {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.25), rgba(139, 105, 20, 0.2));
    transform: scale(1.03);
}

.ear-play-btn:active {
    transform: scale(0.97);
}

/* Options */
.ear-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
    max-width: 600px;
    margin: 0 auto var(--space-5);
}

.ear-option {
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ear-option:hover:not(:disabled) {
    border-color: var(--gold-400);
    background: rgba(201, 168, 76, 0.08);
}

.ear-option:disabled {
    cursor: default;
    opacity: 0.6;
}

.ear-option--correct {
    border-color: #4ade80 !important;
    background: rgba(74, 222, 128, 0.15) !important;
    color: #4ade80 !important;
    opacity: 1 !important;
}

.ear-option--wrong {
    border-color: #f87171 !important;
    background: rgba(248, 113, 113, 0.15) !important;
    color: #f87171 !important;
    opacity: 1 !important;
}

/* Feedback */
.ear-feedback {
    margin-bottom: var(--space-4);
}

.ear-fb {
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 600;
}

.ear-fb--correct {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.ear-fb--wrong {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #f87171;
}

/* Next Button */
.ear-next-btn {
    padding: var(--space-3) var(--space-6);
    background: var(--gold-400);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-primary);
    font-size: var(--text-base);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ear-next-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.ear-next-btn.hidden {
    display: none;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .ear-modes {
        grid-template-columns: 1fr;
    }

    .ear-options {
        grid-template-columns: 1fr 1fr;
    }

    .ear-title {
        font-size: var(--text-2xl);
    }

    .ear-topbar {
        flex-wrap: wrap;
        gap: var(--space-2);
    }
}

/* ═══════════════════════════════════════════
   VOCAL MATCH — Ses Eşleştirme
   Ring, countdown, result card, live feedback
   ═══════════════════════════════════════════ */

/* --- Target Perde Display --- */
.vocal-target {
    text-align: center;
    margin-bottom: var(--space-5);
}

.vocal-target__perde {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    color: #34d399;
    font-weight: 700;
    margin-bottom: var(--space-1);
}

.vocal-target__freq {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-family: var(--font-mono, 'SF Mono', monospace);
    margin-bottom: var(--space-3);
}

.vocal-replay-btn {
    padding: var(--space-2) var(--space-5);
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(52, 211, 153, 0.06));
    border: 1px solid rgba(52, 211, 153, 0.4);
    border-radius: var(--radius-md);
    color: #34d399;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vocal-replay-btn:hover {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(52, 211, 153, 0.1));
    transform: scale(1.03);
}

/* --- Pitch Ring --- */
.vocal-ring-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto var(--space-4);
    overflow: hidden;
}

.vocal-ring {
    display: block;
    width: 220px;
    height: 220px;
    max-width: 220px;
    max-height: 220px;
    transform: rotate(-90deg);
}

.vocal-ring__bg {
    fill: none;
    stroke: var(--border-subtle);
    stroke-width: 6;
}

.vocal-ring__progress {
    fill: none;
    stroke: #34d399;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear, stroke 0.2s ease;
}

.vocal-ring__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
}

.vocal-ring__status {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Countdown */
.vocal-ring__countdown {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 800;
    color: #34d399;
    animation: vocal-countdown-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vocal-ring__countdown--go {
    font-size: 2rem;
    color: #fbbf24;
    animation: vocal-countdown-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vocal-countdown-pop {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    60% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* Mic indicator */
.vocal-ring__mic {
    font-size: 2.2rem;
    transition: color 0.15s ease;
}

.vocal-ring--active .vocal-ring__mic {
    animation: vocal-mic-pulse 1s ease-in-out infinite;
}

@keyframes vocal-mic-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* Live cents display */
.vocal-ring__live-cents {
    font-family: var(--font-mono, 'SF Mono', monospace);
    font-size: var(--text-2xl);
    font-weight: 700;
    transition: color 0.15s ease;
}

.vocal-ring__live-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 500;
}

/* Result display inside ring */
.vocal-ring__result-label {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    animation: vocal-result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vocal-ring__result-pct {
    font-family: var(--font-display);
    font-size: var(--text-4xl, 2.5rem);
    font-weight: 800;
    animation: vocal-result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes vocal-result-reveal {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Cents Info --- */
.vocal-cents {
    text-align: center;
    font-size: var(--text-sm);
    font-family: var(--font-mono, 'SF Mono', monospace);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
    min-height: 1.5em;
}

/* --- Result Card --- */
.vocal-result-card {
    background: linear-gradient(135deg,
            rgba(from var(--tier-color, #34d399) r g b / 0.08),
            rgba(from var(--tier-color, #34d399) r g b / 0.03));
    border: 1px solid var(--tier-color, #34d399);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    text-align: center;
    animation: vocal-card-slide 0.4s ease;
}

@supports not (color: rgba(from red r g b / 0.5)) {
    .vocal-result-card {
        background: rgba(52, 211, 153, 0.06);
        border-color: rgba(52, 211, 153, 0.3);
    }
}

@keyframes vocal-card-slide {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.vocal-result-card__message {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.vocal-result-card__stats {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono, 'SF Mono', monospace);
    margin-bottom: var(--space-3);
}

.vocal-result-card__kp {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--gold-400);
}

.vocal-streak-bonus {
    font-size: var(--text-sm);
    color: #f59e0b;
    margin-left: var(--space-2);
}

/* --- Pulsing ring border when active --- */
.vocal-ring--active .vocal-ring__bg {
    stroke: rgba(52, 211, 153, 0.2);
    animation: vocal-ring-glow 2s ease-in-out infinite;
}

@keyframes vocal-ring-glow {

    0%,
    100% {
        stroke: rgba(52, 211, 153, 0.15);
    }

    50% {
        stroke: rgba(52, 211, 153, 0.35);
    }
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .vocal-ring-container {
        width: 180px;
        height: 180px;
    }

    .vocal-target__perde {
        font-size: var(--text-2xl);
    }

    .vocal-result-card__stats {
        flex-direction: column;
        gap: var(--space-1);
    }
}