
/* GENEL AYARLAR: Ferah, Yumuşak ve 3D Destekli */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Press+Start+2P&family=Quicksand:wght@500;700&family=Montserrat:wght@900&display=swap');

/* --- SIFIRLAMA --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: #000000;
}

html, body {
    /* Safe area and 100dvh adjustments for mobile notches */
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    width: 100vw;
    overflow-x: clip;
}

/* --- 1. ANA GÖVDE VE DÖNEN ARKA PLAN SİSTEMİ --- */
body {
    color: #444;
    font-family: 'Press Start 2P', system-ui;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    background-color: transparent; 
    padding-top: env(safe-area-inset-top) !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
}

body::before {
    content: "";
    position: fixed;
    width: 100vw; 
    height: 100vh;
    top: 0;
    left: 0;
    z-index: -2;
    background: url('images/background.png') no-repeat center center;
    background-size: cover;
}

body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle, rgba(0,0,0,0) 30%, rgba(0,0,0,0.8) 100%);
    z-index: -1;
    pointer-events: none; 
}



#header-wrapper {
    position: fixed; /* STICKY YERİNE FIXED KULLANIYORUZ! */
    top: 0; 
    left: 0;
    width: 100%;
    z-index: 15000; 
    display: flex;
    justify-content: center;
    padding-top: 150px; /* Daha sayfanın merkezine indi */
    pointer-events: none; 
    background: transparent; 
    transition: padding-top 0.3s ease; /* Yumuşak geçiş */
}

/* ODA İÇİNDEYKEN SABİT ÜST BAŞLIK */
body.in-room #header-wrapper {
    padding-top: 20px !important;
}

body.in-room #sign-container {
    animation: none !important;
    transform: translateY(0) rotate(0deg) !important;
}

#sign-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: center -150px; /* İpe tam oturması için güncelledik */
    animation: dropAndSwing 3.5s forwards; /* Daha yavaş ve uzun */
}

@keyframes dropAndSwing {
    0% {
        transform: translateY(-100vh) rotate(5deg);
        animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
    }
    15% {
        transform: translateY(0) rotate(5deg);
        animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    30% {
        transform: translateY(0) rotate(-16deg);
        animation-timing-function: ease-in-out;
    }
    45% {
        transform: translateY(0) rotate(10deg);
        animation-timing-function: ease-in-out;
    }
    60% {
        transform: translateY(0) rotate(-6deg);
        animation-timing-function: ease-in-out;
    }
    75% {
        transform: translateY(0) rotate(3deg);
        animation-timing-function: ease-in-out;
    }
    85% {
        transform: translateY(0) rotate(-1.5deg);
        animation-timing-function: ease-in-out;
    }
    95% {
        transform: translateY(0) rotate(0.5deg);
        animation-timing-function: ease-in-out;
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

/* --- 2. HAREKETLİ VE 3D NEON TABELA (GAMEHUB) --- */
#welcome-message {
    pointer-events: auto; /* Tabelaya tıklanabilmesi için */
    background: #2b1111; 
    padding: 15px 70px;
    border-radius: 80px; 
    border: 5px solid #d900ff; 
    box-shadow: 
        0 0 20px #d900ff,            
        inset 0 0 25px #d900ff,      
        0 15px 0px #1a0808,          
        0 25px 30px rgba(0,0,0,0.6); 
    margin-bottom: 0px; /* Attach to menu */
    display: inline-block; 
    position: relative;
    z-index: 2;
}

/* Ropes for Header */
.top-rope {
    position: absolute;
    bottom: 100%;
    width: 6px;
    height: 100vh;
    background: #ffde00;
    box-shadow: 0 0 10px #ffde00, 0 0 20px #ff5e00;
    z-index: -1;
    border-radius: 3px;
}
.top-rope.left-rope {
    left: calc(50% - 140px);
}
.top-rope.right-rope {
    right: calc(50% - 140px);
}

#welcome-message h1 {
    font-family: 'Press Start 2P', system-ui; 
    font-size: 3.5rem;
    margin: 0;
    color: #ffde00; 
    text-transform: uppercase;
    letter-spacing: 10px;
    text-align: center;
    text-shadow: 
        0 0 15px #ff5e00, 
        2px 2px 0px #5e0000,
        3px 3px 0px #5e0000,
        4px 4px 0px #5e0000,
        5px 5px 0px #5e0000,
        6px 6px 0px #5e0000,
        7px 7px 0px #5e0000,
        8px 8px 0px #300000, 
        12px 12px 15px rgba(0,0,0,0.8); 
}

@keyframes floatTitle {
    0% { transform: translateY(0px) rotate(-1deg); }
    50% { transform: translateY(-15px) rotate(1deg); } 
    100% { transform: translateY(0px) rotate(-1deg); }
}

/* --- 3. ANA UYGULAMA BÖLMELERİ --- */
#app-container {
    width: 95%;
    max-width: 1400px; 
    display: flex;
    flex-direction: column; 
    align-items: center;
    /* YENİ: Tabela merkeze indiği için kartları daha da aşağı ittik */
    margin: 320px auto 0 auto; 
    transition: margin-top 0.3s ease;
}

body.in-room #app-container {
    margin-top: 120px !important; /* Oda içinde oyun afişleri daha yukarı gelsin */
}

#left-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; 
}

/* --- YENİLENMİŞ VE BÜYÜTÜLMÜŞ OYUN LOBİSİ --- */
#game-lobby {
    display: grid;
    /* Kartların minimum boyutunu 280'den 320'ye çıkardık */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px; /* Aralarındaki boşluk da arttı */
    padding: 20px;
    justify-items: center; 
    align-content: center; 
    width: 100%;
    max-width: 1400px; 
    margin: 0 auto; 
    box-sizing: border-box;
}

.game-box {
    position: relative;
    width: 100%;
    max-width: 450px; /* KARTLAR KOCAMAN OLDU (Eskiden 350px idi) */
    aspect-ratio: 16 / 9; 
    border-radius: 25px;
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-color: #fff;
    border: 2px solid #ffde00;
    box-shadow: 0 0 12px rgba(255, 222, 0, 0.8), inset 0 0 12px rgba(255, 222, 0, 0.8), 0 10px 25px rgba(0,0,0,0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border 0.3s ease;
    display: flex;
    align-items: flex-end; 
    margin: 0 auto; 
}

.game-box:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 0 25px rgba(255, 222, 0, 1), inset 0 0 15px rgba(255, 222, 0, 0.8), 0 20px 40px rgba(0,0,0,0.6);
    border: 2px solid #ffffff; 
}

.title-overlay {
    width: 100%;
    padding: 50px 15px 20px 15px; /* Gradyan daha yumuşak */
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0) 100%);
    color: white;
    font-size: 1.0rem; /* Yazılar da kartla beraber büyüdü */
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.8);
    text-align: center;
}

.player-count-info {
    font-size: 0.5rem;
    color: #ffde00;
    font-weight: 700;
    margin-top: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(0,0,0,0.5);
    padding: 4px 10px;
    border-radius: 12px;
    text-shadow: none;
    letter-spacing: normal;
}

.img-kostebek { background-image: url('images/kostebek.jpg'); }
.img-vampir { background-image: url('images/vampir.png'); }
.img-isimsehir { background-image: url('images/isimsehir.png'); }
.img-tabu { background-image: url('images/tabu.png'); }
.img-galeri { background-image: url('images/galeri.png'); }
.img-papaz { background-image: url('images/papaz.png'); }
.img-blackjack { background-image: url('images/blackjack.png'); }
.img-keyboard { background-image: url('images/keyboard.png'); }
.img-tavla { background-image: url('images/tavla.png'); }
.img-amiral { background-image: url('images/amiral.png'); }

.empty-box {
    background: rgba(255, 255, 255, 0.4);
    border: 2px dashed #ddd;
    border-radius: 25px;
    cursor: not-allowed;
    height: 240px;
}

/* ====================================================
   LOBİ & SOHBET ÇEKMECESİ (ARTIK PC'DE DE ÇEKMECE)
   ==================================================== */

/* ANA LOBİ BUTONU (HER ZAMAN GÖRÜNÜR) */
#mobile-lobby-btn {
    display: flex !important; /* Artık ana menüde de açık! */
    position: fixed;
    bottom: calc(25px + env(safe-area-inset-bottom));
    right: 25px;
    background: linear-gradient(135deg, #d900ff 0%, #7209b7 100%);
    color: white;
    border: 3px solid #ffde00;
    padding: 15px 30px;
    border-radius: 50px;
    font-family: 'Press Start 2P', system-ui;
    font-weight: 900;
    font-size: 1.2rem;
    z-index: 20000; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.6), 0 0 20px rgba(217, 0, 255, 0.5);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#mobile-lobby-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.8), 0 0 30px rgba(217, 0, 255, 0.8);
}

#mobile-lobby-btn:active {
    transform: scale(0.95);
}

/* AÇIK ODALAR BUTONU (sol altta, cyan) */
#open-rooms-btn {
    position: fixed;
    bottom: calc(25px + env(safe-area-inset-bottom));
    left: 25px;
    background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
    color: white;
    border: 3px solid #4cc9f0;
    padding: 15px 30px;
    border-radius: 50px;
    font-family: 'Press Start 2P', system-ui;
    font-weight: 900;
    font-size: 1.2rem;
    z-index: 20000;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6), 0 0 20px rgba(0, 180, 216, 0.5);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    align-items: center;
    gap: 8px;
}

#open-rooms-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.8), 0 0 30px rgba(76, 201, 240, 0.8);
}

#open-rooms-btn:active {
    transform: scale(0.95);
}

/* ÇEKMECENİN KENDİSİ (HER EKRANDA SABİT VE GİZLİ BAŞlar) */
#right-panel {
    position: fixed;
    top: 0;
    right: -100%; /* Başlangıçta gizli */
    width: 85%;
    max-width: 400px; /* PC'de fazla yayılmasın */
    height: 100%;
    height: 100dvh;
    background: rgba(19, 10, 31, 0.98); 
    backdrop-filter: blur(15px);
    z-index: 25000;
    padding: 25px 20px;
    margin-top: 0;
    box-shadow: -10px 0 30px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 90px;
    overscroll-behavior: contain;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    font-family: 'Quicksand', sans-serif;
}

#right-panel.open {
    right: 0; /* Butona basınca sağdan kayarak girer */
}

/* SOL ÇEKMECE: AÇIK ODALAR */
#left-panel-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    height: 100dvh;
    background: rgba(0, 10, 25, 0.98);
    backdrop-filter: blur(15px);
    z-index: 25000;
    padding: 25px 20px;
    box-shadow: 10px 0 30px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 90px;
    overscroll-behavior: contain;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    border-right: 1px solid rgba(76, 201, 240, 0.2);
    font-family: 'Quicksand', sans-serif;
}

#left-panel-drawer.open {
    left: 0;
}

/* Sol Çekmece Kapat Butonu */
#close-open-rooms-btn {
    display: block !important;
    background: linear-gradient(135deg, #0077b6 0%, #023e8a 100%);
    color: white;
    border: 2px solid #4cc9f0;
    padding: 14px;
    border-radius: 16px;
    font-family: 'Press Start 2P', system-ui;
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 119, 182, 0.4), inset 0 2px 5px rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#close-open-rooms-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 180, 216, 0.6);
    background: linear-gradient(135deg, #00b4d8, #0077b6);
}

/* Açık Odalar Başlık Alanı */
.open-rooms-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(76, 201, 240, 0.2);
}

.open-rooms-header span:first-child {
    font-family: 'Press Start 2P', system-ui;
    font-size: 1.4rem;
    color: #4cc9f0;
}

/* ODA KARTI */
.open-room-card {
    background: rgba(0, 180, 216, 0.07);
    border: 1.5px solid rgba(76, 201, 240, 0.2);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
    animation: popIn 0.3s ease;
}

.open-room-card:hover {
    background: rgba(0, 180, 216, 0.14);
    border-color: #4cc9f0;
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 180, 216, 0.2);
}

.open-room-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.open-room-game-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.open-room-info {
    flex: 1;
}

.open-room-game-name {
    font-family: 'Press Start 2P', system-ui;
    font-size: 1rem;
    color: #e2e8f0;
    display: block;
}

.open-room-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: #4cc9f0;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.open-room-count-bar {
    flex: 1;
    max-width: 80px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.open-room-count-fill {
    height: 100%;
    background: linear-gradient(90deg, #4cc9f0, #0077b6);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.open-room-join-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #00b4d8, #0077b6);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Press Start 2P', system-ui;
    font-weight: 900;
    font-size: 0.85rem;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.4);
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.open-room-join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 180, 216, 0.5);
    background: linear-gradient(135deg, #4cc9f0, #00b4d8);
}

.open-room-join-btn:active {
    transform: translateY(1px);
}

.open-rooms-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(76, 201, 240, 0.5);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.6;
}

/* ÇEKMECEYİ KAPAT BUTONU (ŞIK & 3D TASARIM) */
#close-mobile-lobby-btn {
    display: block !important; /* PC de olsa artık gösteriyoruz */
    background: linear-gradient(135deg, #ff4757 0%, #c0392b 100%);
    color: white;
    border: 2px solid #ff6b81;
    padding: 14px;
    border-radius: 16px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 25px;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(255, 71, 87, 0.4), inset 0 2px 5px rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#close-mobile-lobby-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 71, 87, 0.6), inset 0 2px 5px rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, #ff6b81 0%, #e74c3c 100%);
}

#close-mobile-lobby-btn:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 3px 10px rgba(255, 71, 87, 0.4);
}

/* --- ÇEKMECE İÇİ LOBİ KUTULARI --- */
.lobby-box {
    background: #ffffff;
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    text-align: center;
}
.lobby-box p { font-size: 0.9rem; color: #999; text-transform: uppercase; font-weight: 700; }
.lobby-box #lobby-id { font-size: 2rem; font-family: 'Fredoka One', cursive; color: #7209b7; margin: 5px 0; }
.lobby-box .link-btn {
    background: #4cc9f0; color: white; border: none; padding: 10px 20px;
    border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 1rem;
    box-shadow: 0 4px 0 #3db3d8; transition: 0.2s; width: 100%;
}
.lobby-box .link-btn:hover { transform: translateY(-2px); background: #43b0d1; box-shadow: 0 6px 0 #3db3d8; }
.lobby-box .link-btn:active { transform: translateY(2px); box-shadow: 0 0px 0 #3db3d8; }

.players-box {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    margin-top: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border: 3px solid #d900ff;
}

.players-box h3 { color: #7209b7; font-family: 'Fredoka One', cursive; }

#player-list { list-style-type: none; padding: 0; max-height: 400px; overflow-x: hidden; overflow-y: auto; }
#player-list li {
    background: #f4ebd9; padding: 10px 15px; margin-bottom: 10px;
    border-radius: 10px; font-weight: bold; color: #444; border-left: 5px solid #ff758c;
    animation: popIn 0.3s ease;
}

@keyframes popIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.lobby-mic-btn {
    background-color: #ff4757; color: #fff; border: none; border-radius: 20px;
    padding: 8px 16px; font-size: 0.9rem; font-weight: 700; cursor: pointer;
    font-family: 'Quicksand', sans-serif; transition: all 0.1s ease;
    box-shadow: 0 4px 0px #ff1e34, 0 5px 10px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 6px; outline: none;
}
.lobby-mic-btn:active { transform: translateY(4px); box-shadow: 0 0px 0px #ff1e34, 0 2px 5px rgba(0,0,0,0.15); }
.lobby-mic-btn.active { background-color: #1dd1a1; box-shadow: 0 4px 0px #10ac84, 0 5px 10px rgba(0,0,0,0.15); }
.lobby-mic-btn.active:active { transform: translateY(4px); box-shadow: 0 0px 0px #10ac84, 0 2px 5px rgba(0,0,0,0.15); }

#player-list input[type="range"] {
    -webkit-appearance: none; appearance: none; width: 65px; 
    background: rgba(108, 92, 231, 0.15); height: 8px; border-radius: 4px; outline: none; margin-left: 10px;
}
#player-list input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 16px; height: 16px;
    background: #3bc2db; border-radius: 50%; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: transform 0.1s ease;
}
#player-list input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px; background: #3bc2db; border-radius: 50%; cursor: pointer; border: none; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* --- GİŞE / MODAL VE TOAST BİLDİRİM EKRANI --- */
#entry-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85); display: flex; justify-content: center; align-items: center; z-index: 20000;
}

.main-menu-box {
    display: flex; flex-direction: column; gap: 25px; align-items: center; 
    width: 90%; max-width: 450px; margin: 0 auto; padding: 40px 30px;
    background: #2b1111; border-radius: 50px 50px 20px 20px;
    border: 4px solid #d900ff; box-shadow: 0 0 30px #d900ff, inset 0 0 20px rgba(217, 0, 255, 0.5), 0 20px 50px rgba(0,0,0,0.9);
    position: relative;
    pointer-events: auto;
    z-index: 1;
}

/* Ropes for Menu */
.menu-rope-container {
    position: absolute;
    bottom: 100%;
    width: 24px;
    height: 100vh;
    z-index: -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}
.menu-rope-container.left-rope {
    left: calc(50% - 140px);
}
.menu-rope-container.right-rope {
    right: calc(50% - 140px);
}
.menu-rope {
    width: 6px;
    flex-grow: 1;
    background: #ffde00;
    box-shadow: 0 0 10px #ffde00, 0 0 20px #ff5e00;
    border-radius: 3px;
}
.menu-ring {
    width: 24px;
    height: 24px;
    border: 4px solid #ffde00;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffde00, 0 0 20px #ff5e00, inset 0 0 5px #ffde00;
    margin-bottom: -12px;
    background: #2b1111;
    z-index: 1;
}

.modal-box {
    background: #2b1111; padding: 40px 30px; border-radius: 50px 50px 20px 20px;
    text-align: center; width: 90%; max-width: 380px; 
    border: 4px solid #d900ff; box-shadow: 0 0 30px #d900ff, inset 0 0 20px rgba(217, 0, 255, 0.5), 0 20px 50px rgba(0,0,0,0.9);
    animation: popUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Quicksand', sans-serif;
}

@keyframes popUp { 0% { transform: scale(0.8) translateY(50px); opacity: 0; } 100% { transform: scale(1) translateY(0); opacity: 1; } }

.modal-box h2 {
    font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 1.8rem;
    color: #ffde00; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 15px;
    text-shadow: 0 0 15px #ff5e00, 2px 2px 0px #5e0000, 3px 3px 0px #5e0000, 4px 4px 0px #300000;
}
.modal-box p { color: #f4ebd9; font-weight: 700; font-size: 1.1rem; margin-bottom: 25px; }

.modal-box input[type="text"] {
    width: 100%; padding: 15px; margin: 10px 0; font-size: 1.2rem; font-weight: 900; text-align: center;
    font-family: 'Montserrat', sans-serif; background: #1a0808; color: #ffde00;
    border: 2px solid #4cc9f0; border-radius: 30px; box-shadow: inset 0 0 10px #4cc9f0; outline: none; transition: 0.3s;
}
.modal-box input[type="text"]:focus { box-shadow: inset 0 0 20px #4cc9f0, 0 0 15px #4cc9f0; border-color: #fff; }
.modal-box input[type="text"]::placeholder { color: rgba(255, 222, 0, 0.4); }

.modal-box input[type="radio"] {
    accent-color: #4cc9f0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* YENİ GİZLİLİK RADIO BUTONLARI (KUTU GÖRÜNÜMÜ) */
.privacy-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.privacy-option {
    position: relative;
    cursor: pointer;
    flex: 1;
}

.privacy-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.privacy-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #1a0808;
    color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.privacy-option input[type="radio"]:checked + .privacy-box {
    background: rgba(76, 201, 240, 0.15);
    color: #4cc9f0;
    border-color: #4cc9f0;
    box-shadow: 0 0 15px rgba(76, 201, 240, 0.4), inset 0 0 10px rgba(76, 201, 240, 0.2);
    transform: scale(1.05);
}

.privacy-option input[type="radio"]:hover + .privacy-box {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.privacy-option input[type="radio"]:checked:hover + .privacy-box {
    background: rgba(76, 201, 240, 0.2);
    border-color: #4cc9f0;
}

/* "Gizli" Seçeneği İçin Özel Renk (Kırmızı/Pembe Neon) */
.privacy-option input[value="private"]:checked + .privacy-box {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
    border-color: #ff4757;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.4), inset 0 0 10px rgba(255, 71, 87, 0.2);
}

.privacy-option input[value="private"]:checked:hover + .privacy-box {
    background: rgba(255, 71, 87, 0.25);
    border-color: #ff4757;
}

.modal-box button {
    width: 100%; padding: 15px; margin-top: 15px; font-size: 1.1rem; font-weight: 900; font-family: 'Montserrat', sans-serif;
    text-transform: uppercase; letter-spacing: 2px; border-radius: 30px; cursor: pointer; transition: all 0.3s ease;
    background: transparent; color: #ffde00; border: 3px solid #ffde00; box-shadow: 0 0 15px rgba(255, 222, 0, 0.5), inset 0 0 15px rgba(255, 222, 0, 0.5);
}
.modal-box button:hover { background: #ffde00; color: #2b1111; box-shadow: 0 0 30px #ffde00; transform: scale(1.05); }
.modal-box .alt-btn { color: #4cc9f0; border-color: #4cc9f0; box-shadow: 0 0 15px rgba(76, 201, 240, 0.5), inset 0 0 15px rgba(76, 201, 240, 0.5); }
.modal-box .alt-btn:hover { background: #4cc9f0; color: #2b1111; box-shadow: 0 0 30px #4cc9f0; }
.modal-box .back-btn { background: transparent; border: none; box-shadow: none; color: #888; font-size: 0.9rem; letter-spacing: 1px; padding: 10px; }
.modal-box .back-btn:hover { background: transparent; color: #fff; box-shadow: none; transform: none; text-decoration: underline; }
.modal-box .outline-btn { color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.2); box-shadow: none; margin-top: 10px; }
.modal-box .outline-btn:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.4); box-shadow: none; transform: scale(1.02); }

.modal-box .close-modal-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: #ff4757;
    color: #fff;
    border: 3px solid #2b1111;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), 0 0 10px rgba(255, 71, 87, 0.4);
    text-shadow: none;
    cursor: pointer;
    z-index: 10;
    text-transform: none;
    letter-spacing: normal;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-box .close-modal-btn:hover {
    background: #ff6b81;
    color: #fff;
    border-color: #2b1111;
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 6px 15px rgba(255, 71, 87, 0.6);
}

#toast-container {
    position: fixed !important; 
    top: 20px !important; 
    left: 50% !important; 
    transform: translateX(-50%) translateY(-300px); 
    background: #2b1111; 
    border: 3px solid #ffde00; 
    box-shadow: 0 0 20px rgba(255, 222, 0, 0.6), inset 0 0 10px rgba(255, 222, 0, 0.4);
    border-radius: 30px; 
    padding: 15px 30px; 
    z-index: 999999 !important; 
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#toast-container.show { 
    transform: translateX(-50%) translateY(0) !important; 
}
#toast-message { color: #ffde00; font-family: 'Press Start 2P', system-ui; font-weight: 900; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 0 10px #ff5e00; text-align: center; }

/* --- 6. OYUN EKRANI (OVERLAY) --- */
#game-overlay {
    position: fixed !important; 
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important; 
    height: 100dvh !important; 
    min-height: -webkit-fill-available;
    background-color: #0d0d14 !important; 
    z-index: 9990 !important; 
    display: none; 
}

#game-frame {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    background-color: #0d0d14 !important;
    display: block !important;
}

#exit-game-btn {
    position: absolute; top: 20px; right: 20px; padding: 12px 25px;
    background: #ff758c; color: white; border: 3px solid #2b1111; border-radius: 15px;
    cursor: pointer; font-family: 'Press Start 2P', system-ui; font-weight: 900;
    z-index: 20001; box-shadow: 0 5px 15px rgba(0,0,0,0.3); transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
#exit-game-btn:hover { transform: scale(1.1); background: #ff5270; }

/* GİZLENECEK ESKİ BUTONLARI VE PANELLERİ YOK ET */
#in-game-fab, .panel-closed {
    display: none !important;
}

/* ====================================================
    MOBİL & TABLET UYUMU (RESPONSIVE)
   ==================================================== */

@media (max-width: 600px) {
    body::before {
        background-image: url('images/background_mobil.png');
    }

    #header-wrapper {
        padding-top: 200px; /* Kullanıcı talebine göre 200px olarak güncellendi */
    }

    #sign-container {
        transform-origin: center -200px;
    }

    .top-rope.left-rope,
    .menu-rope-container.left-rope {
        left: calc(50% - 65px); /* Tabela küçüldüğü için ipleri daha da daralttık */
    }
    .top-rope.right-rope,
    .menu-rope-container.right-rope {
        right: calc(50% - 65px);
    }

    #welcome-message { 
        padding: 8px 20px; /* En ve boydan küçültüldü */
        border-width: 3px; 
        border-radius: 30px; 
        margin-bottom: 0px;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: fit-content;
    }
    #welcome-message h1 { font-size: 1.5rem; letter-spacing: 2px; } /* Yazı boyutu küçüldü */
    #leader-text { text-align: center; font-size: 0.75rem; margin-top: 3px; }

    .main-menu-box {
        padding: 15px 15px; /* Menü alanı küçültüldü */
        gap: 10px;
        border-radius: 20px 20px 10px 10px;
        border-width: 3px;
        max-width: 300px; /* Boyut sınırlandı */
    }

    .main-menu-box button {
        padding: 12px !important; /* Butonlar küçültüldü */
        font-size: 0.75rem !important;
    }
    
    #app-container {
        margin-top: 330px; /* Kartların margin değeri orantılı olarak düzeltildi */
    }

    body.in-room #app-container {
        margin-top: 100px !important;
    }

    #game-lobby { grid-template-columns: 1fr; }
    
    .game-box, .empty-box { 
        aspect-ratio: auto; 
        height: 200px; 
    }
    
    .modal-box h2 { font-size: 1.5rem; }
    .modal-box { padding: 30px 20px; }
} /* CLOSE max-width: 600px */

/* MOBİL VE YATAY EKRANLAR İÇİN LOBİ BUTONLARINI KÜÇÜLT VE KÖŞEYE AL */
@media (max-width: 950px), (max-height: 600px) {
    #exit-game-btn span {
        display: none !important;
    }

    #exit-game-btn {
        top: 15px !important; right: 15px !important;
        width: 45px !important; height: 45px !important;
        padding: 0 !important; font-size: 1.2rem !important; border-width: 2px !important;
        border-radius: 50% !important;
    }

    #mobile-lobby-btn {
        width: 45px !important;
        height: 45px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        bottom: 15px !important;
        right: 15px !important;
        left: auto !important; 
        transform: none !important;
        justify-content: center !important;
        align-items: center !important;
        box-shadow: 0 3px 10px rgba(0,0,0,0.5), 0 0 5px rgba(217, 0, 255, 0.4) !important;
        font-size: 0 !important;
    }

    #mobile-lobby-btn::after {
        content: "\f0c0";
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        position: absolute;
        font-size: 1.2rem;
        color: white !important; 
    }

    #open-rooms-btn {
        width: 45px !important;
        height: 45px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        bottom: 15px !important;
        left: 15px !important;
        transform: none !important;
        justify-content: center !important;
        align-items: center !important;
        box-shadow: 0 3px 10px rgba(0,0,0,0.5), 0 0 5px rgba(0, 180, 216, 0.4) !important;
        font-size: 0 !important;
    }

    #open-rooms-btn::after {
        content: "\f46d";
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        position: absolute;
        font-size: 1.2rem;
        color: white !important;
    }
}

/* --- YENİ MODERN BUTON TASARIMLARI --- */

.how-to-buttons {
    display: flex;
    flex-direction: column;
    align-items: center; 
    gap: 15px;
    margin-top: 25px;
}

.play-confirm-btn {
    background: linear-gradient(135deg, #ff007f 0%, #7209b7 100%); 
    color: #ffffff;
    border: none;
    padding: 16px 30px;
    border-radius: 50px; 
    font-family: 'Press Start 2P', system-ui;
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 2px;
    width: 100%;
    max-width: 280px; 
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(114, 9, 183, 0.5), inset 0 2px 5px rgba(255,255,255,0.3); 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
}

.play-confirm-btn:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 30px rgba(255, 0, 127, 0.7), inset 0 2px 5px rgba(255,255,255,0.4);
}

.play-confirm-btn:active:not(:disabled) {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 4px 10px rgba(114, 9, 183, 0.4);
}

.play-confirm-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    box-shadow: none;
    cursor: not-allowed;
}

.play-cancel-btn {
    background: rgba(255, 255, 255, 0.05); 
    color: #b2bec3;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 25px;
    border-radius: 30px;
    font-family: 'Press Start 2P', system-ui;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.play-cancel-btn:hover {
    background: rgba(255, 71, 87, 0.15); 
    color: #ff4757;
    border-color: rgba(255, 71, 87, 0.3);
    transform: translateY(-2px);
}


/* --- NASIL OYNANIR MODAL KUTUSU (MÜKEMMEL MERKEZLEME) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0; 
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 30000;
}

.how-to-box {
    background: #130a1f; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-top: 4px solid #ff007f; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 40px rgba(114, 9, 183, 0.3); 
    border-radius: 24px;
    padding: 40px 30px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    z-index: 30001; 
    box-sizing: border-box; 
    margin: auto; 
}

#how-to-icon { 
    font-size: 3.5rem; 
    margin-bottom: 10px;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5)); 
}

#how-to-title { 
    font-family: 'Press Start 2P', system-ui; 
    color: #ffffff; 
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 15px; 
    text-shadow: 0 2px 10px rgba(255,255,255,0.2); 
}

#how-to-text { 
    font-family: 'Press Start 2P', system-ui;
    color: #e2e8f0; 
    font-size: 1.15rem; 
    line-height: 1.6; 
    font-weight: 600;
    margin-bottom: 30px; 
    padding: 0 15px;
}

/* Sadece yatay (alt) kaydırma çubuğunu tamamen görünmez yap! */
#player-list::-webkit-scrollbar:horizontal {
    display: none !important;
    height: 0 !important;
}

/* İNCE SCROLLBAR (Sohbet ve Menüler İçin) */
::-webkit-scrollbar {
    width: 6px; 
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ====================================================
    HIZLI EŞLEŞMESİSTEMİ STİLLERİ
   ==================================================== */

/* Hızlı Eşleş modal-box için genişletilmiş boyut */
#step-quickmatch {
    max-width: 480px !important;
    padding: 30px 24px !important;
}

/* Hızlı Eşleş butonu (giriş ekranında 3. buton) */
.quickmatch-btn {
    color: #f7971e !important;
    border-color: #f7971e !important;
    box-shadow: 0 0 15px rgba(247,151,30,0.5), inset 0 0 15px rgba(247,151,30,0.3) !important;
}
.quickmatch-btn:hover {
    background: linear-gradient(135deg, #f7971e, #ffd200) !important;
    color: #1a0808 !important;
    box-shadow: 0 0 30px #ffd200 !important;
}

/* Oyun seçimi başlığı */
.qm-section-title {
    color: rgba(255,222,0,0.7);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 14px 0 8px 0;
    text-align: left;
}

/* Oyun kartları grid */
.qm-game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.qm-game-card {
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px 6px 8px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.4rem;
    color: #e2e8f0;
}
.qm-game-card span {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: #aaa;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.qm-game-card:hover {
    background: rgba(247,151,30,0.15);
    border-color: #f7971e;
    transform: translateY(-2px);
}
.qm-game-card.selected {
    background: rgba(247,151,30,0.25);
    border-color: #ffd200;
    box-shadow: 0 0 12px rgba(255,210,0,0.4);
}
.qm-game-card.selected span {
    color: #ffd200;
}

/* Eşleş butonu (disabled durumu) */
#qm-match-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* Public oda listesi */
.qm-rooms-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 140px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.qm-room-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.qm-room-card:hover {
    background: rgba(76,201,240,0.15);
    border-color: #4cc9f0;
    transform: translateX(3px);
}
.qm-room-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e2e8f0;
}
.qm-room-count {
    font-size: 0.8rem;
    color: #74b9ff;
    font-weight: 700;
    white-space: nowrap;
}

/* Gizlilik toggle satırı (quick match ve lobi içi) */
.qm-privacy-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    font-size: 0.85rem;
    color: #ccc;
    font-weight: 700;
}

/* Privacy Switch Toggle */
.privacy-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.privacy-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    /* Modal input reset'ini ezmemek için */
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
}

.privacy-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ff4757;
    border-radius: 24px;
    transition: 0.3s;
}
.privacy-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.privacy-switch input:checked + .privacy-slider {
    background-color: #1dd1a1;
}
.privacy-switch input:checked + .privacy-slider::before {
    transform: translateX(20px);
}

/* ====================================================
   QM BANNER — Hızlı Eşleşme Modu Şeridi
   ==================================================== */
#qm-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 95%;
    max-width: 1400px;
    margin: 0 auto 16px auto;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(247,151,30,0.18), rgba(255,210,0,0.10));
    border: 1.5px solid rgba(247,151,30,0.5);
    border-radius: 16px;
    backdrop-filter: blur(8px);
    animation: popIn 0.4s ease;
}

#qm-banner span {
    font-family: 'Press Start 2P', system-ui;
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffd200;
    letter-spacing: 0.5px;
}

#qm-banner button {
    background: rgba(255,71,87,0.2);
    border: 1px solid #ff4757;
    color: #ff4757;
    border-radius: 10px;
    padding: 6px 14px;
    font-family: 'Press Start 2P', system-ui;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

#qm-banner button:hover {
    background: #ff4757;
    color: white;
}

/* QM modunda oyun kartlarının hover efekti daha belirgin */
.qm-mode-active .game-box:hover {
    border: 3px solid #ffd200 !important;
    box-shadow: 0 0 20px rgba(255,210,0,0.5) !important;
}