/* ══════════ OYUN RENGİ ══════════
 * Butonlar, ilerleme ve vurgular oyunun rengini alır: <body data-mode="survival|daily">.
 * style.css'teki --primary da ezilir; böylece "Tahmin Et", girişler ve listeler aynı renkte olur.
 * Doğru/yanlış geri bildirimi (yeşil rozet, sonuç listesi) anlam taşıdığı için değişmez.
 */
:root { --mode: #1DB954; --mode-rgb: 29, 185, 84; --mode-hover: #1ed760; }
body[data-mode="survival"] { --mode: #FF4D6D; --mode-rgb: 255, 77, 109; --mode-hover: #ff6b85; }
body[data-mode="daily"] { --mode: #FFB020; --mode-rgb: 255, 176, 32; --mode-hover: #ffc14d; }
body[data-mode] { --primary: var(--mode); --primary-hover: var(--mode-hover); --primary-glow: rgba(var(--mode-rgb), 0.35); }
body[data-mode] .primary-btn { box-shadow: 0 4px 20px rgba(var(--mode-rgb), 0.2); }
body[data-mode] .primary-btn:hover:not(:disabled) { box-shadow: 0 8px 30px rgba(var(--mode-rgb), 0.4); }
body[data-mode] input[type="text"]:focus { box-shadow: 0 0 0 3px rgba(var(--mode-rgb), 0.12); }
body[data-mode] .result-item:hover { background: rgba(var(--mode-rgb), 0.08); }
/* Mobil alt menü de oyunun renginde */
body[data-mode] .tabbar .fab { background: var(--mode); box-shadow: 0 10px 30px rgba(var(--mode-rgb), 0.55), 0 0 0 6px var(--bg); }
body[data-mode] .tabbar .tb-play { color: var(--mode) !important; }
body[data-mode] .tabbar a.active svg { color: var(--mode); filter: drop-shadow(0 0 8px rgba(var(--mode-rgb), 0.6)); }
body[data-mode] .lucky-btn:hover { border-color: rgba(var(--mode-rgb), 0.35) !important; color: var(--mode) !important; background: rgba(var(--mode-rgb), 0.06); }

/* ══════════ SURVIVAL: KURULUM ══════════ */
.sv-rules {
    list-style: none;
    display: grid;
    gap: 12px;
    margin-bottom: 1.6rem;
}

.sv-rules li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    line-height: 1.45;
}

.sv-rules b { color: white; font-weight: 600; }

.sv-rules__icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(var(--mode-rgb), 0.1);
    color: var(--primary);
}

.sv-rules__icon svg { width: 16px; height: 16px; }
.sv-rules__icon--heart { background: rgba(255,77,77,0.1); color: var(--error); }

#sv-start { font-size: 1.05rem; padding: 16px; border-radius: 50px; }

/* ══════════ SURVIVAL: HUD ══════════ */
.sv-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.sv-lives { display: flex; gap: 6px; }

.sv-heart {
    width: 20px;
    height: 20px;
    color: var(--error);
    filter: drop-shadow(0 0 6px rgba(255,77,77,0.35));
    transition: color 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

.sv-heart.lost {
    color: rgba(255,255,255,0.12);
    filter: none;
}

.sv-heart.breaking { animation: svHeartBreak 0.6s ease; }

@keyframes svHeartBreak {
    0% { transform: scale(1); }
    30% { transform: scale(1.35); }
    60% { transform: scale(0.8) rotate(-12deg); }
    100% { transform: scale(1); }
}

/* ══════════ SURVIVAL: OYNATICI ══════════ */
.sv-player {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 1.2rem;
}

.sv-play-btn {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: black;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(var(--mode-rgb), 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sv-play-btn:hover:not(:disabled) { transform: scale(1.06); background: var(--primary-hover); }
.sv-play-btn:disabled { opacity: 0.4; cursor: wait; }
.sv-play-btn svg { width: 26px; height: 26px; }
.sv-play-btn .sv-icon-play { margin-left: 3px; }
.sv-play-btn .sv-icon-stop,
.sv-play-btn.playing .sv-icon-play { display: none; }
.sv-play-btn.playing .sv-icon-stop { display: block; }

.sv-player__info { min-width: 0; }

.sv-player__label {
    font-size: 1.05rem;
    font-weight: 700;
}

.sv-player__hint {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Aşama çubuğu: her dilim bir dinleme süresi */
.sv-stages {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 1.4rem;
}

.sv-stage { text-align: center; }

.sv-stage__bar {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.07);
    overflow: hidden;
}

.sv-stage__fill {
    position: absolute;
    inset: 0;
    width: 0%;
    background: var(--primary);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--primary-glow);
}

.sv-stage.unlocked .sv-stage__bar { background: rgba(var(--mode-rgb), 0.25); }

.sv-stage__label {
    display: block;
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.sv-stage.unlocked .sv-stage__label { color: var(--text-dim); }
.sv-stage.current .sv-stage__label { color: var(--primary); }

.sv-more-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 1.4rem;
    background: transparent;
    border: 1px dashed rgba(var(--mode-rgb), 0.4);
    border-radius: 14px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sv-more-btn:hover:not(:disabled) {
    background: rgba(var(--mode-rgb), 0.08);
    border-style: solid;
}

.sv-more-btn:disabled {
    border-color: rgba(255,255,255,0.1);
    color: var(--text-muted);
    cursor: default;
}

/* ══════════ SURVIVAL: TAHMİN ══════════ */
.sv-guess { margin-bottom: 1rem; }
.sv-search-box { position: relative; }

.sv-search-box input.sv-selected {
    border-color: rgba(var(--mode-rgb), 0.5);
    background: rgba(var(--mode-rgb), 0.08);
}

.sv-guess .results-dropdown { max-height: 280px; }

.sv-result-item img { border-radius: 8px; }
.sv-result-item.focused { background: rgba(var(--mode-rgb), 0.12); }

.sv-result-item__text { min-width: 0; }

.sv-result-item__title,
.sv-result-item__artist {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sv-result-item__title { font-size: 0.9rem; font-weight: 600; }
.sv-result-item__artist { font-size: 0.78rem; color: var(--text-dim); }

.sv-dropdown-empty {
    padding: 12px 14px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.sv-pass-btn {
    display: block;
    margin: 10px auto 0;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.sv-pass-btn:hover:not(:disabled) { color: var(--error); }

/* ══════════ SURVIVAL: CEVAP ══════════ */
.sv-reveal { animation: fadeIn 0.35s ease; }

.sv-reveal__badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.sv-reveal__badge.ok { background: rgba(29,185,84,0.15); color: #1DB954; }
.sv-reveal__badge.fail { background: rgba(255,77,77,0.15); color: var(--error); }

.sv-reveal__song {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    margin-bottom: 1.2rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.sv-reveal__song img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
}

.sv-reveal__song > div { min-width: 0; }
.sv-reveal__title { font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.sv-reveal__artist { font-size: 0.85rem; color: var(--text-dim); margin-top: 2px; }

/* ══════════ SURVIVAL: SONUÇ ══════════ */
.sv-final-score {
    text-align: center;
    margin: 0.4rem 0 1.4rem;
}

.sv-final-score span {
    display: block;
    font-size: 3.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
    text-shadow: 0 0 30px var(--primary-glow);
}

.sv-final-score label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.sv-chip {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255,255,255,0.06);
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.summary-correct .sv-chip { background: rgba(29,185,84,0.12); color: #1DB954; }

.summary-track small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

#sv-back { margin-top: 10px; }

@media (max-width: 520px) {
    .sv-play-btn { width: 56px; height: 56px; }
    .sv-stage__label { font-size: 0.65rem; }
}

/* ══════════ SURVIVAL: YÜKLEME HATASI ══════════ */
.sv-load-error {
    margin-bottom: 1rem;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.5;
}

/* ══════════ PUAN ══════════ */
.sv-points-hud { display: flex; align-items: center; gap: 6px; }
.sv-points-hud span { display: inline-block; font-variant-numeric: tabular-nums; }
.sv-points-hud span.pop { animation: svPointsPop 0.45s ease; }
@keyframes svPointsPop { 40% { transform: scale(1.35); } }

.sv-mult {
    font-style: normal;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 50px;
    background: rgba(var(--mode-rgb), 0.15);
    color: var(--primary);
}

.sv-reveal__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sv-reveal__badges .sv-reveal__badge { margin-bottom: 0; }
.sv-reveal__badge.sv-gain { background: rgba(var(--mode-rgb), 0.15); color: var(--primary); }

.sv-points-box {
    max-width: 360px;
    margin: -0.4rem auto 1.4rem;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(var(--mode-rgb), 0.08);
    border: 1px solid rgba(var(--mode-rgb), 0.25);
    text-align: center;
}

.sv-points-box__total { font-size: 0.95rem; color: var(--text-dim); }
.sv-points-box__total b {
    margin-right: 4px;
    font-size: 1.6rem;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.sv-points-box__bonus {
    display: grid;
    gap: 4px;
    margin: 8px 0 0;
    padding: 8px 0 0;
    list-style: none;
    border-top: 1px dashed rgba(var(--mode-rgb), 0.3);
    font-size: 0.82rem;
    color: var(--text-dim);
}

.sv-points-box__bonus li { display: flex; justify-content: space-between; gap: 10px; text-align: left; }
.sv-points-box__bonus b { color: var(--primary); }

@media (prefers-reduced-motion: reduce) {
    .sv-points-hud span.pop { animation: none; }
}
