/* =========================================================================
   css/victory-modals.css
   Modern Zafer ekranı (Finiş Ekranı), Oyun Sonu İstatistikleri ve Geçmiş Kartları
   ========================================================================= */

/* --- Yatay Finiş Ekranı --- */
#victory-modal {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background-color: rgba(0, 0, 0, 0.28);
    z-index: 3000;
    animation: fadeIn .3s ease forwards;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
/* Kapalıyken menü tıklamalarını yemesin */
#victory-modal[style*="display: none"],
#victory-modal[style*="display:none"] {
    pointer-events: none !important;
}

#v-card,
.modern-victory-card {
    background: #fff;
    border: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    border-radius: 22px;
    width: 100%;
    max-width: 340px;
    max-height: min(80vh, 520px);
    /* Taç/fan kesilmesin: kart overflow visible; kaydırma .v-body'de */
    overflow: visible;
    display: flex;
    flex-direction: column;
    transform: scale(.94);
    opacity: 0;
    animation: vPopIn .5s cubic-bezier(.22,1,.36,1) forwards;
    will-change: transform, opacity;
    box-sizing: border-box;
    position: relative;
}
.v-card--hz { padding-top: 8px; }

@keyframes vPopIn { to { transform:scale(1); opacity:1; } }

/* Kaybettin: hafif 3 salınım, kısa süre */
@keyframes vLoseShake {
    0%, 100% { transform: translateX(0); }
    30% { transform: translateX(-3px); }
    70% { transform: translateX(3px); }
}
#v-card.v-card--lose-shake {
    opacity: 1;
    animation: vLoseShake 0.14s ease-in-out 3;
}

/* Kazanınca kart içi konfeti */
.kzl-confetti-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 80;
    border-radius: inherit;
}
.kzl-confetti-piece {
    position: absolute;
    display: block;
    pointer-events: none;
}

/* Legacy dikey header — JS gizler; CSS de yedek */
.v-card--hz .v-header,
.v-card--hz .v-name,
.v-card--hz .v-subtitle,
.v-card--hz .v-stats-title { display: none !important; }
.v-card--hz .v-body {
    padding: 18px 14px 8px; /* üst: taç kesilmesin */
    overflow-y: auto;
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
    max-height: min(68vh, 460px);
}
.v-card--hz #victory-stats { margin-top: 0 !important; }

.v-header { display: none; }
.v-glow, .v-avatar-wrap, .v-crown, .v-avatar, .v-badge { display: none; }
.v-body { padding: 12px 14px 8px; text-align: center; }
.v-name, .v-subtitle { display: none; }

/* Yatay finiş içerik */
.v-hz {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}
.v-hz-top {
    display: flex;
    justify-content: center;
}
.v-hz-result {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .4px;
    padding: 5px 12px;
    border-radius: 999px;
    line-height: 1;
}
.v-hz-result.is-win {
    color: #0f7a35;
    background: rgba(52, 199, 89, 0.14);
}
.v-hz-result.is-loss {
    color: #b42318;
    background: rgba(255, 59, 48, 0.1);
}

.v-hz-board {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 10px;
    min-height: 100px;
    padding: 18px 10px 14px; /* taç + fan için ferah */
    border-radius: 18px;
    background: #f7f7f8;
    overflow: visible;
}
.v-hz-board--multi {
    padding-top: 20px;
    column-gap: 8px;
}
.v-hz-side {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: visible;
}
.v-hz-winner .history-mp-chip { max-width: 84px; }
/* Kazanan temsili her zaman yeşil (halka + isim) */
.v-hz-winner .history-mp-name {
    color: var(--green) !important;
}
.v-hz-winner .history-mp-avatar {
    color: var(--green);
}
.v-hz-winner .history-mp-crown {
    font-size: 20px !important;
    top: -14px;
    transform: translateX(-50%);
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.4));
}
.v-hz-winner .history-mp-chip.has-crown .history-mp-avatar-wrap {
    min-height: 58px;
    padding-top: 4px;
}
.v-hz-opps { justify-self: center; }
.v-hz-mid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 52px;
}
.v-hz-vs {
    font-size: 15px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: .4px;
    line-height: 1;
    color: #ff5a1f;
}
.v-hz-time {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-main);
    background: #fff;
    padding: 3px 7px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.v-hz-board .history-mp-chip.is-me,
.v-hz-board .history-mp-chip { max-width: 78px; }
.v-hz-board .history-mp-name { font-size: 11px; }
.v-hz-board .history-mp-opponents { gap: 4px; }
.v-hz-board .history-mp-fan { width: 110px; height: 52px; }
.v-hz-board .history-mp-fan--three { width: 126px; }
.v-hz-board .history-mp-opp-names { max-width: 140px; }

.v-hz-combat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: #f7f7f8;
    text-align: left;
}
.v-hz-group { display: flex; flex-direction: column; gap: 6px; }
.v-hz-group + .v-hz-group {
    padding-top: 8px;
    border-top: 1px dashed rgba(0,0,0,.08);
}
.v-hz-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}
.v-hz-group-who {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
}
.v-hz-group-block {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 900;
    color: #c46b00;
    background: rgba(255,149,0,.12);
    padding: 3px 8px;
    border-radius: 999px;
}
.v-hz-group-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
}
.v-hz-hit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.25;
}
.v-hz-hit-main {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.v-hz-hit-main b { font-weight: 800; }
.v-hz-hit-count {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 900;
    color: var(--text-main);
}
.v-hz-hit.is-curse .v-hz-hit-count { color: #2F4F4F; }

.v-hz-stat,
.v-hz-hits,
.v-hz-chip-hit,
.v-hz-stats-banner { display: none !important; }

.v-hz-rewards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.v-hz-reward {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 14px;
    background: rgba(52, 199, 89, 0.12);
    border: 1px solid rgba(52, 199, 89, 0.2);
}
.v-hz-reward.is-coin {
    background: rgba(0, 122, 255, 0.08);
    border-color: rgba(0, 122, 255, 0.18);
}
.v-hz-reward-ico { font-size: 14px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.v-hz-reward-ico--coin svg {
    width: 18px;
    height: 18px;
    color: var(--apple-blue);
    display: block;
}
.v-hz-reward-val {
    font-size: 14px;
    font-weight: 900;
    color: var(--text-main);
}
.v-hz-reward.is-coin .v-hz-reward-val { color: #007aff; }

.v-stats-container .v-stats-title { display: none; }

.v-actions { display:flex; gap:8px; justify-content:center; margin-bottom:10px; padding:0 14px; }
.v-btn-icon { width:38px; height:38px; border-radius:12px; background:#fff; border:1px solid rgba(0,0,0,.03); color:var(--c); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:all .3s cubic-bezier(.34,1.56,.64,1); box-shadow:0 4px 12px rgba(0,0,0,.06); }
.v-btn-icon svg { width: 18px; height: 18px; }
.v-footer { padding: 4px 14px 14px; display:flex; flex-direction:row; gap:8px; align-items:stretch; }
.v-footer .menu-btn,
.v-btn,
.v-btn-alt {
    width: auto !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
}
.v-btn { height:42px!important; border-radius:14px!important; font-size:13px!important; font-weight:800!important; box-shadow:0 6px 16px rgba(0,122,255,.22); padding:0 10px!important; }
.v-btn-alt { height:42px!important; border-radius:14px!important; background:#f2f2f4!important; color:var(--text-main)!important; font-size:13px!important; font-weight:700!important; box-shadow:none; border:none!important; padding:0 10px!important; }

/* Eski dikey yardımcı stiller (geriye uyum) */
.v-match-strip, .v-match-meta, .v-match-time, .v-match-vs-row, .v-match-vs-side, .v-match-vs, .v-match-opp { display: none; }

/* =========================================================================
   📊 ZAFER EKRANI MAÇ ÖZETİ VE İSTATİSTİK STİLLERİ
   ========================================================================= */

#victory-stats {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 10px;
    height: auto !important; 
    overflow: visible !important; 
}

.v-modern-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.v-summary-header {
    font-size: 9px;
    color: var(--text-muted, #86868b);
    font-weight: 800;
    letter-spacing: 0.45px;
    margin-bottom: 4px;
    text-align: left;
}

.v-kills-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.v-kill-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    background: rgba(0, 0, 0, 0.03);
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: none;
    transition: all 0.2s ease;
    min-width: 0;
}

.v-kill-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.04);
}

.v-kill-icon { 
    font-size: 14px; 
    background: rgba(0, 0, 0, 0.04);
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
}

.v-v-text { 
    color: var(--text-secondary); 
    font-weight: 600; 
    font-size: 10px; 
    background: rgba(0,0,0,0.05);
    padding: 2px 5px;
    border-radius: 5px;
    flex-shrink: 0;
}

.v-p-name {
    font-weight: 800;
    font-size: 12px !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v-k-count { 
    margin-left: auto; 
    color: var(--text-main); 
    font-weight: 900; 
    font-size: 12px;
    background: rgba(255, 255, 255, 0.8);
    padding: 3px 6px;
    border-radius: 7px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.v-friendly-game {
    text-align: center;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    padding: 10px 0;
}

.v-friendly-game span { 
    font-size: 20px; 
    margin-bottom: 4px; 
    display: block; 
}

.v-rewards-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.v-rewards-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 6px 9px;
    border: 1px solid;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
}

.v-reward-xp {
    color: var(--reward-color);
    background: var(--reward-background);
    border-color: var(--reward-border);
}

.v-reward-pinecones {
    background: rgba(0, 122, 255, 0.05);
    border-color: rgba(0, 122, 255, 0.2);
}

.v-reward-label {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.v-reward-label > span:last-child {
    min-width: 0;
}

.v-reward-icon {
    flex: 0 0 auto;
    font-size: 12px;
    line-height: 1;
}

.v-reward-value {
    color: currentColor;
    font-size: 10px;
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
}

.v-reward-pinecones .v-reward-value {
    color: var(--apple-blue);
}

@media (max-width: 280px) {
    .v-rewards-banner {
        gap: 6px;
        padding-inline: 7px;
        font-size: 9px;
    }

    .v-reward-value {
        font-size: 9px;
    }
}

/* --- Oyun Geçmişi Kartları (History Menu) --- */
.history-modern-card { background:rgba(255,255,255,.65); border:1px solid rgba(255,255,255,.8); border-radius:20px; padding:15px; margin-bottom:15px; box-shadow:0 8px 20px rgba(0,0,0,.03); transition:transform .2s cubic-bezier(.34,1.56,.64,1); }
.history-m-header { display:flex; justify-content:space-between; align-items:center; padding-bottom:12px; border-bottom:1px dashed rgba(0,0,0,.08); margin-bottom:12px; }
.history-m-winner { display:flex; align-items:center; gap:12px; }
.history-m-avatar { width:44px; height:44px; border-radius:14px; background:#fff; box-shadow:0 4px 10px rgba(0,0,0,.1); font-size:24px; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.history-m-title { font-size:10px; font-weight:800; color:var(--text-secondary); letter-spacing:.5px; margin-bottom:2px; text-align:left; }
.history-m-name { font-size:16px; font-weight:800; color:var(--text-main); line-height:1; text-align:left; }
.history-m-meta { text-align:right; display:flex; flex-direction:column; gap:6px; align-items:flex-end; }
.history-m-mode { font-size:10px; font-weight:800; background:rgba(0,0,0,.05); padding:4px 8px; border-radius:8px; color:var(--text-main); display:inline-block; }
.history-m-date { font-size:10px; font-weight:600; color:var(--text-secondary); }
.history-m-stats { background:rgba(255,255,255,.5); border-radius:12px; padding:10px; }
.history-stat-row { display:flex; align-items:center; gap:8px; font-size:13px; margin-bottom:6px; padding:6px 10px; background:rgba(255,255,255,.7); border-radius:8px; border:1px solid rgba(0,0,0,.02); }
.history-stat-row:last-child { margin-bottom:0; }

/* Çok oyunculu geçmiş kartı */
.history-mp-match { padding:20px 10px 12px; overflow:visible; }
.history-mp-row { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; column-gap:6px; min-height:78px; overflow:visible; }
.history-mp-side { display:flex; align-items:center; justify-content:center; overflow:visible; }
.history-mp-me { width:auto; justify-self:center; overflow:visible; }
.history-mp-center { width:54px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; text-align:center; justify-self:center; align-self:center; margin:0; }
.history-mp-vs { font-size:16px; font-weight:900; font-style:italic; letter-spacing:.5px; line-height:1; background:-webkit-linear-gradient(45deg,#ff3b30,#ff9500); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.history-mp-time { font-size:10px; font-weight:800; color:var(--text-main); background:rgba(0,0,0,.04); padding:2px 6px; border-radius:6px; border:1px solid rgba(0,0,0,.03); white-space:nowrap; }
.history-mp-date { font-size:8px; font-weight:700; color:var(--text-secondary); line-height:1.2; max-width:54px; word-break:break-word; text-align:center; }
.history-mp-opponents { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-width:0; justify-self:center; overflow:visible; }
.history-mp-fan { position:relative; width:100px; height:56px; flex-shrink:0; overflow:visible; }
.history-mp-fan--three { width:126px; height:56px; }
.history-mp-fan-card { position:absolute; left:50%; top:50%; width:40px; margin-left:-20px; margin-top:-20px; padding:0; background:transparent; border:none; border-radius:0; box-shadow:none; transform-origin:50% 80%; overflow:visible; }
.history-mp-fan--two .history-mp-fan-card--1 { transform:rotate(-12deg) translateX(-16px); z-index:1; }
.history-mp-fan--two .history-mp-fan-card--2 { transform:rotate(12deg) translateX(16px); z-index:2; }
.history-mp-fan--three .history-mp-fan-card--1 { transform:rotate(-16deg) translateX(-28px); z-index:1; }
.history-mp-fan--three .history-mp-fan-card--2 { transform:rotate(0deg) translateX(0); z-index:2; }
.history-mp-fan--three .history-mp-fan-card--3 { transform:rotate(16deg) translateX(28px); z-index:3; }
.history-mp-opp-names { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:2px 4px; max-width:130px; text-align:center; line-height:1.25; }
.history-mp-opp-name { font-size:10px; font-weight:900; white-space:nowrap; }
.history-mp-opp-sep { font-size:9px; font-weight:800; color:var(--text-muted); opacity:.7; }
.history-mp-chip { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; flex:1; min-width:0; max-width:68px; overflow:visible; }
.history-mp-chip.is-fan { flex:none; max-width:none; width:100%; gap:0; }
.history-mp-chip.is-me { max-width:74px; }
.history-mp-avatar-wrap { position:relative; flex-shrink:0; display:flex; align-items:flex-end; justify-content:center; overflow:visible; min-height:46px; }
.history-mp-chip.is-fan .history-mp-avatar-wrap { min-height:34px; margin:0 auto; }
.history-mp-chip:not(.is-me):not(.is-fan) .history-mp-avatar-wrap { min-height:40px; }
.history-mp-chip.has-crown .history-mp-avatar-wrap { min-height:46px; padding-top:0; box-sizing:border-box; }
.history-mp-chip.is-fan.has-crown .history-mp-avatar-wrap { min-height:34px; padding-top:0; }
.history-mp-chip.is-me.has-crown .history-mp-avatar-wrap { min-height:46px; padding-top:0; }
.history-mp-avatar { position:relative; border-radius:50%; background:var(--bg); overflow:hidden; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.history-mp-avatar.is-win { box-shadow:0 0 0 2px var(--green),0 3px 8px rgba(52,199,89,.22); }
.history-mp-avatar.is-loss { box-shadow:0 0 0 2px var(--red),0 3px 8px rgba(255,59,48,.22); }
.history-mp-avatar.is-me-win { box-shadow:0 0 0 3px var(--green),0 4px 10px rgba(52,199,89,.28); }
.history-mp-avatar.is-me-loss { box-shadow:0 0 0 3px var(--red),0 4px 10px rgba(255,59,48,.22); }
.history-mp-crown { position:absolute; top:-11px; left:50%; transform:translateX(-50%); line-height:1; z-index:5; filter:drop-shadow(0 2px 3px rgba(0,0,0,.4)); pointer-events:none; white-space:nowrap; }
.history-mp-chip.is-me .history-mp-crown { top:-12px; font-size:16px; }
.history-mp-chip.is-fan .history-mp-crown { top:-9px; }
.history-mp-name { font-size:10px; font-weight:900; line-height:1.15; max-width:100%; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

@media (hover: hover) {
    .v-btn-icon:hover { transform:translateY(-4px) scale(1.05); box-shadow:0 12px 25px rgba(0,0,0,.1); background:var(--c); color:#fff; border-color:transparent; }
    .history-modern-card:hover { transform:scale(1.02); box-shadow:0 12px 25px rgba(0,0,0,.06); }
}
