* {
    box-sizing: border-box;
    margin: 0; padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body, html {
    width: 100%; height: 100%;
    background-color: #05050a;
    overflow: hidden;
    user-select: none;
}

/* LOBİ SAYAÇ EKRANI */
#lobby-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, #101520 0%, #050810 100%);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 100; opacity: 1; transition: opacity 0.5s ease;
}
.match-found-text { color: #ff4655; font-size: 7rem; font-weight: 900; letter-spacing: -2px; transform: scaleY(1.2); text-align: center; }
.countdown-number { color: #ffffff; font-size: 8rem; font-weight: bold; margin-top: 20px; text-align: center; }

/* CLOVE VİDEOLU AŞAMA */
#video-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; }
#bg-video { position: absolute; top: 50%; left: 50%; min-width: 100%; min-height: 100%; transform: translate(-50%, -50%); object-fit: cover; z-index: 1; }
.video-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(90deg, rgba(5,15,25,0.7) 0%, rgba(0,0,0,0.3) 50%, rgba(25,5,15,0.7) 100%); z-index: 2; }
.gallery-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: space-between; align-items: center; padding: 40px 60px; z-index: 3; }

/* GALERİ YAN PANELLERİ */
.team-side { width: 320px; display: flex; flex-direction: column; }
.team-label { font-weight: bold; font-size: 14px; letter-spacing: 3px; margin-bottom: 15px; padding-bottom: 5px; }
.left-gallery .team-label { color: #00f59b; border-bottom: 2px solid #00f59b; }
.right-gallery .team-label { color: #ff4655; border-bottom: 2px solid #ff4655; }
.player-slots { display: flex; flex-direction: column; gap: 12px; }

/* FOTOĞRAF KARTLARI */
.p-card { 
    width: 100%; height: 80px; background: #000; border: 2px dashed rgba(255, 255, 255, 0.3); border-radius: 40px; 
    overflow: visible; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.p-card img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; border-radius: 40px; }

.p-card .heart-icon { position: absolute; top: -15px; font-size: 20px; opacity: 0; transform: scale(0.5); transition: all 0.3s ease; pointer-events: none; }
.p-card:hover .heart-icon { opacity: 1; top: -25px; transform: scale(1.2); animation: pulseHeart 1s infinite alternate; }

@keyframes pulseHeart {
    0% { transform: scale(1.2) translateY(0); text-shadow: 0 0 5px #ff4655; }
    100% { transform: scale(1.4) translateY(-5px); text-shadow: 0 0 15px #ff4655; }
}

.left-gallery .p-card:hover { border-color: #00f59b; box-shadow: 0 0 20px rgba(0, 245, 155, 0.5); transform: scale(1.03); }
.right-gallery .p-card:hover { border-color: #ff4655; box-shadow: 0 0 20px rgba(255, 70, 85, 0.5); transform: scale(1.03); }

/* ORTA ALAN VE BÜYÜTME */
.vs-center-info { flex: 1; max-width: 600px; margin: 0 40px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; height: 100%; padding: 60px 0 30px 0; }
#center-content-wrapper { width: 100%; display: flex; justify-content: center; align-items: center; min-height: 350px; }
#center-default-text { text-align: center; color: white; }
.map-title { font-size: 6rem; font-weight: 900; letter-spacing: 4px; line-height: 1; }
.game-mode { font-size: 14px; color: #ccc; letter-spacing: 4px; margin-top: 10px; }
.vs-badge { font-size: 3.5rem; font-weight: bold; color: #fff; margin-top: 30px; font-style: italic; opacity: 0.8; }

#center-viewer { position: relative; width: auto; height: auto; max-width: 90vw; max-height: 60vh; background: transparent; border: none; box-shadow: 0 0 40px rgba(255, 255, 255, 0.3); overflow: visible; }
#viewer-img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; display: block; border: 3px solid #fff; border-radius: 8px; }
.close-btn { position: absolute; top: -15px; right: -15px; color: #fff; background: #ff4655; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; z-index: 50; box-shadow: 0 0 10px rgba(0,0,0,0.5); }

/* ULTİ DAİRELERİ VE BUTONLAR */
.main-ult-wrapper, .birthday-ult-wrapper { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.main-ult-wrapper { margin-top: auto; margin-bottom: 70px; }
.birthday-ult-wrapper { margin-top: 40px; }

.ult-btn-container { position: relative; width: 140px; height: 140px; display: flex; justify-content: center; align-items: center; cursor: pointer; }
.progress-ring { position: absolute; transform: rotate(-90deg); width: 140px; height: 140px; pointer-events: none; }
.progress-ring__circle { stroke-dasharray: 377; stroke-dashoffset: 377; transition: none; }

.ult-btn { width: 100px; height: 100px; background: radial-gradient(circle, #2e1a47 0%, #0d0614 100%); border: 3px solid #cc99ff; border-radius: 50%; display: flex; justify-content: center; align-items: center; box-shadow: 0 0 25px rgba(204, 153, 255, 0.6); transition: transform 0.1s ease; }
.butterfly-icon { width: 55px; height: 55px; fill: #cc99ff; }
.prompt-text { font-size: 14px; color: #cc99ff; letter-spacing: 1.5px; font-weight: bold; text-shadow: 0 0 8px rgba(204,153,255,0.6); text-align: center; }

.birthday-btn-style { background: radial-gradient(circle, #471a1a 0%, #140606 100%); border: 3px solid #ff4655; box-shadow: 0 0 25px rgba(255, 70, 85, 0.6); }
.birthday-icon-style { fill: #ff4655; }
.birthday-prompt-style { color: #ff4655; text-shadow: 0 0 8px rgba(255,70,85,0.6); }

/* FLASHBANG */
#flashbang { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #ffffff; z-index: 99999; opacity: 0; pointer-events: none; }
.flash-active { animation: flashEffect 1.2s ease-out; }
@keyframes flashEffect { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

/* LEVEL UP EKRANI */
#next-stage-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #05050a; z-index: 50; display: flex; justify-content: center; align-items: center; }
.next-content { text-align: center; color: #ffffff; width: 100%; }
.next-title { color: #ff4655; font-size: 5rem; font-weight: 900; letter-spacing: 2px; }
.next-subtitle { font-size: 2.2rem; color: #cc99ff; margin-top: 10px; font-weight: bold; font-style: italic; margin-bottom: 20px; }

/* SÜRPRİZ VİDEO ALANLARI */
#final-video-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #000; z-index: 60; display: flex; justify-content: center; align-items: center; }
#final-video { width: 100%; height: 100%; object-fit: contain; background-color: #000; }
#final-prompt-screen, #cake-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: none; flex-direction: column; justify-content: center; align-items: center; z-index: 70; }

/* =======================================================
   ŞİRİN EL ÇİZİMİ AÇIK ZARF SİSTEMİ 
   ======================================================= */
#mektup-kutusu {
    width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    perspective: 1200px; position: relative;
}

#mektup-kapatma-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: transparent; z-index: 85; pointer-events: auto;
}

.envelope-wrapper {
    display: flex; flex-direction: column; align-items: center; position: relative; z-index: 10;
}

.cute-envelope {
    position: relative; width: 320px; height: 220px;
    background-color: #fca6ac; border-radius: 0 0 16px 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); cursor: pointer;
    transition: transform 0.3s ease; pointer-events: auto;
}
.cute-envelope:hover { transform: translateY(-5px); }

.cute-envelope.open {
    pointer-events: none !important;
    transform: none !important;
}

.envelope-back-flap {
    position: absolute; top: -95px; left: 0; width: 0; height: 0;
    border-left: 160px solid transparent; border-right: 160px solid transparent;
    border-bottom: 100px solid #f99199; z-index: 1;
}

.envelope-left-right-flaps {
    position: absolute; bottom: 0; left: 0; width: 0; height: 0;
    border-left: 160px solid #fca6ac; border-right: 160px solid #fca6ac;
    border-top: 110px solid transparent; z-index: 3; pointer-events: none;
}

.envelope-bottom-flap {
    position: absolute; bottom: 0; left: 0; width: 0; height: 0;
    border-left: 160px solid transparent; border-right: 160px solid transparent;
    border-bottom: 110px solid #f7868f; border-radius: 0 0 16px 16px;
    z-index: 4; pointer-events: none;
}

.wax-heart-seal {
    position: absolute; bottom: 90px; left: 135px; font-size: 40px; z-index: 5;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2)); animation: sealHeartPulse 1.5s infinite alternate;
    pointer-events: none;
}
@keyframes sealHeartPulse { 0% { transform: scale(1); } 100% { transform: scale(1.1); } }

/* ZARFIN İÇİNDEKİ KAĞIT (KAPALI HALİ) */
.envelope-inner-paper {
    position: absolute; bottom: 20px; left: 20px; width: 280px; height: 160px;
    background: #ffffff; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    padding: 20px; z-index: 2; transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    overflow: hidden; pointer-events: none;
}

.paper-hearts { font-size: 14px; text-align: right; color: #ff4655; margin-bottom: 10px; }
.letter-main-text { opacity: 0.1; transition: opacity 0.3s ease; text-align: center; }

/* ------------------------------------------------------------- 
   DÜZELTİLEN KISIM: SCALE YERİNE FİZİKSEL BÜYÜME (SCROLL ÇALIŞIR) 
   ------------------------------------------------------------- */
.cute-envelope.open .envelope-inner-paper {
    position: fixed; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); /* Hileli scale kaldırıldı! */
    width: 90vw; 
    max-width: 600px; /* Kağıdın maksimum genişliği */
    height: 75vh;     /* Kağıdın maksimum yüksekliği */
    overflow-y: auto; /* SCROLL ARTIK %100 ÇALIŞIR */
    overflow-x: hidden;
    z-index: 999; 
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8); 
    border: 3px solid #fca6ac; 
    padding: 40px;
    pointer-events: auto !important;
}

.cute-envelope.open .letter-main-text { opacity: 1; }

/* Kağıt Scale edilmediği için içindeki yazıları manuel olarak büyütüyoruz */
.cute-envelope.open .letter-main-text p {
    font-size: 18px !important; 
    line-height: 1.8 !important;
}

.cute-envelope.open .letter-main-text h3 {
    font-size: 26px !important;
}

/* Tatlı Scrollbar Tasarımı */
.cute-envelope.open .envelope-inner-paper::-webkit-scrollbar { width: 8px; }
.cute-envelope.open .envelope-inner-paper::-webkit-scrollbar-track { background: rgba(0,0,0,0.05); border-radius: 10px; }
.cute-envelope.open .envelope-inner-paper::-webkit-scrollbar-thumb { background: #fca6ac; border-radius: 10px; }
.cute-envelope.open .envelope-inner-paper::-webkit-scrollbar-thumb:hover { background: #ff5975; }

.mektup-click-text {
    margin-top: 30px; font-size: 1.2rem; color: #fca6ac; font-weight: bold; letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(252,166,172,0.5); animation: blinkClick 1.2s infinite alternate;
    z-index: 10; position: relative;
}
@keyframes blinkClick { 0% { opacity: 0.6; } 100% { opacity: 1; } }

/* KALP KONFETİ KATMANI */
#heart-shower-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 5; overflow: hidden;
}

.falling-heart {
    position: absolute; color: #ff5975; pointer-events: none;
    font-size: 20px; z-index: 5;
    animation: fallAndFlutter linear forwards;
}

@keyframes fallAndFlutter {
    0% { transform: translateY(-50px) rotate(0deg) translateX(0); opacity: 1; }
    50% { transform: translateY(50vh) rotate(180deg) translateX(30px); opacity: 0.9; }
    100% { transform: translateY(105vh) rotate(360deg) translateX(-30px); opacity: 0; }
}

/* MOBİL VE TELEFON UYUMLULUĞU */
@media (max-width: 768px) {
    .match-found-text { font-size: 3.5rem; }
    .countdown-number { font-size: 5rem; }
    .gallery-overlay { flex-direction: column; padding: 20px 15px; overflow-y: auto; }
    .team-side { width: 100%; }
    .player-slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .vs-center-info { width: 100%; margin: 10px 0; }
    .map-title { font-size: 3rem; }
    
    .cute-envelope.open .envelope-inner-paper { 
        width: 90vw; 
        height: 80vh; 
        padding: 20px;
    }
    .cute-envelope.open .letter-main-text p {
        font-size: 15px !important; 
    }
}