/* ==========================================
   DÜELLO SİSTEMİ - duel.css v=1
   ========================================== */

/* ── Profil modalındaki düello butonu ── */
.duel-challenge-btn {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    width: 100%;
    letter-spacing: 0.3px;
    transition: opacity 0.2s;
}
.duel-challenge-btn:hover { opacity: 0.88; }
.duel-challenge-btn:disabled { opacity: 0.45; cursor: default; }

/* ── Düello davet modal ── */
#duel-invite-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
#duel-invite-overlay.hidden { display: none; }

.duel-invite-modal {
    background: #1a1f2e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 28px 24px;
    width: 100%; max-width: 360px;
    text-align: center;
}
.duel-invite-modal h2 {
    font-size: 1.3rem; font-weight: 800;
    color: #f59e0b; margin: 0 0 4px;
}
.duel-invite-modal .duel-target-name {
    font-size: 1rem; color: #e2e8f0; margin-bottom: 20px;
}

.duel-duration-grid {
    display: grid; grid-template-columns: repeat(3,1fr); gap: 8px;
    margin-bottom: 20px;
}
.duel-dur-btn {
    background: rgba(255,255,255,0.06);
    border: 2px solid transparent;
    border-radius: 12px;
    color: #cbd5e1; padding: 10px 4px;
    font-size: 0.82rem; font-weight: 700;
    cursor: pointer; transition: all 0.18s;
}
.duel-dur-btn:hover { background: rgba(245,158,11,0.15); color: #f59e0b; }
.duel-dur-btn.active {
    border-color: #f59e0b;
    background: rgba(245,158,11,0.18);
    color: #f59e0b;
}

.duel-invite-actions { display: flex; gap: 10px; }
.duel-invite-actions .btn-send {
    flex: 1; background: linear-gradient(135deg,#f59e0b,#ef4444);
    color: #fff; border: none; border-radius: 12px;
    padding: 12px; font-size: 0.9rem; font-weight: 700;
    cursor: pointer; transition: opacity 0.18s;
}
.duel-invite-actions .btn-send:hover { opacity: 0.88; }
.duel-invite-actions .btn-cancel {
    flex: 0.5; background: rgba(255,255,255,0.06);
    color: #94a3b8; border: none; border-radius: 12px;
    padding: 12px; font-size: 0.9rem; cursor: pointer;
}

/* ── Gelen davet banner (timer ekranı üstü) ── */
#duel-incoming-banner {
    background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(239,68,68,0.18));
    border: 1px solid rgba(245,158,11,0.4);
    border-radius: 14px;
    padding: 14px 16px;
    margin: 0 0 12px;
    display: flex; align-items: center; gap: 10px;
}
#duel-incoming-banner.hidden { display: none; }
.duel-incoming-text { flex: 1; font-size: 0.84rem; color: #e2e8f0; line-height: 1.4; }
.duel-incoming-text strong { color: #f59e0b; }
.duel-incoming-actions { display: flex; gap: 6px; }
.duel-accept-btn {
    background: #22c55e; color: #fff; border: none;
    border-radius: 8px; padding: 7px 13px;
    font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.duel-decline-btn {
    background: rgba(255,255,255,0.08); color: #94a3b8;
    border: none; border-radius: 8px; padding: 7px 10px;
    font-size: 0.8rem; cursor: pointer;
}

/* ── Aktif düello — sağ altta floating widget ── */
#duel-active-bar {
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom));
    right: 14px;
    width: 230px;
    background: #1a1f2e;
    border: 1px solid rgba(245,158,11,0.45);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(245,158,11,0.15);
    z-index: 900;
    overflow: hidden;
    transition: transform 0.25s, opacity 0.25s;
}
#duel-active-bar.hidden { display: none; }
#duel-active-bar.minimized .duel-scores,
#duel-active-bar.minimized .duel-progress-wrap { display: none; }

/* Başlık çubuğu — tıklanınca minimize/maximize */
.duel-bar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(239,68,68,0.12));
    cursor: pointer;
    user-select: none;
}
.duel-bar-title { font-size: 0.78rem; color: #f59e0b; font-weight: 800; letter-spacing: 0.4px; }
.duel-bar-right  { display: flex; align-items: center; gap: 6px; }
.duel-bar-timer  { font-size: 0.75rem; color: #fbbf24; font-weight: 700; }
.duel-bar-toggle { font-size: 0.65rem; color: #64748b; }

/* Skor alanı */
.duel-scores {
    display: grid; grid-template-columns: 1fr auto 1fr;
    gap: 4px; align-items: center; text-align: center;
    padding: 10px 12px 4px;
}
.duel-player-name  { font-size: 0.68rem; color: #64748b; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duel-player-score { font-size: 1.5rem; font-weight: 900; color: #e2e8f0; line-height: 1; }
.duel-player-score span { font-size: 0.65rem; font-weight: 400; color: #475569; }
.duel-vs { font-size: 0.85rem; font-weight: 900; color: #f59e0b; }

/* Progress bar */
.duel-progress-wrap { padding: 6px 12px 12px; }
.duel-progress-bg {
    height: 5px; background: rgba(255,255,255,0.07);
    border-radius: 5px; overflow: hidden; display: flex;
}
.duel-progress-me  { background: linear-gradient(90deg,#6366f1,#8b5cf6); transition: width 0.6s ease; }
.duel-progress-opp { background: linear-gradient(90deg,#ef4444,#f59e0b); transition: width 0.6s ease; }

/* Desktop: daha aşağı */
@media (min-width: 768px) {
    #duel-active-bar {
        bottom: 24px;
        right: 24px;
        width: 250px;
    }
}

/* ── Sonuç modal ── */
#duel-result-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 3100;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
#duel-result-overlay.hidden { display: none; }

.duel-result-modal {
    background: #1a1f2e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 36px 28px;
    width: 100%; max-width: 340px;
    text-align: center;
}
.duel-result-emoji { font-size: 3.5rem; margin-bottom: 8px; }
.duel-result-title { font-size: 1.6rem; font-weight: 900; margin-bottom: 4px; }
.duel-result-title.win  { color: #f59e0b; }
.duel-result-title.lose { color: #94a3b8; }
.duel-result-title.draw { color: #6366f1; }
.duel-result-scores {
    display: flex; justify-content: center; gap: 24px;
    margin: 18px 0; padding: 16px;
    background: rgba(255,255,255,0.04); border-radius: 14px;
}
.duel-res-player { text-align: center; }
.duel-res-name { font-size: 0.75rem; color: #64748b; margin-bottom: 4px; }
.duel-res-score { font-size: 1.8rem; font-weight: 800; color: #e2e8f0; }
.duel-res-score span { font-size: 0.8rem; font-weight: 400; color: #64748b; }
.duel-res-vs { font-size: 1rem; font-weight: 900; color: #f59e0b; align-self: center; }
.duel-result-close {
    width: 100%; padding: 13px;
    background: rgba(255,255,255,0.07);
    border: none; border-radius: 12px;
    color: #e2e8f0; font-size: 0.95rem; font-weight: 700;
    cursor: pointer; margin-top: 4px;
}

/* ── Check-in popup ── */
#duel-checkin-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 3200;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
#duel-checkin-overlay.hidden { display: none; }

.duel-checkin-modal {
    background: #1a1f2e;
    border: 1px solid rgba(245,158,11,0.4);
    border-radius: 20px;
    padding: 32px 28px;
    width: 100%; max-width: 320px;
    text-align: center;
}
.duel-checkin-emoji { font-size: 2.8rem; margin-bottom: 8px; }
.duel-checkin-title { font-size: 1.2rem; font-weight: 800; color: #f59e0b; margin-bottom: 8px; }
.duel-checkin-sub   { font-size: 0.82rem; color: #64748b; margin-bottom: 20px; line-height: 1.4; }
.duel-checkin-btn {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border: none; border-radius: 12px;
    color: #fff; font-size: 1rem; font-weight: 800;
    cursor: pointer; transition: opacity 0.18s;
}
.duel-checkin-btn:hover { opacity: 0.88; }

/* ── Pending duel indicator (bildirim üzerinde) ── */
.duel-pending-badge {
    display: inline-block;
    background: linear-gradient(135deg,#f59e0b,#ef4444);
    color: #fff; font-size: 0.68rem; font-weight: 800;
    border-radius: 20px; padding: 2px 8px;
    margin-left: 6px; vertical-align: middle;
    animation: duel-pulse 1.5s infinite;
}
@keyframes duel-pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.65; }
}
