/* Global Sıfırlama ve Değişkenler */
:root {
    --bg-dark: #04081c;
    --bg-card: rgba(8, 14, 44, 0.75);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-glow: rgba(0, 242, 254, 0.25);
    
    --neon-blue: #00f2fe;
    --neon-blue-glow: 0 0 12px rgba(0, 242, 254, 0.5);
    --neon-gold: #ffd700;
    --neon-gold-glow: 0 0 12px rgba(255, 215, 0, 0.5);
    --neon-red: #ff0055;
    --neon-red-glow: 0 0 12px rgba(255, 0, 85, 0.5);
    --neon-green: #39ff14;
    --neon-green-glow: 0 0 12px rgba(57, 255, 20, 0.5);
    
    --text-light: #f3f4f6;
    --text-muted: #9ca3af;
    
    --font-outfit: 'Outfit', sans-serif;
    --font-montserrat: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-drag: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-outfit);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Stüdyo Konteyneri (Tam Ekran Sığdırma) */
.studio-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Stack elements at the top, let footer push to bottom */
    padding: 8px 16px; /* Sıkıştırılmış dikey boşluk */
    background: transparent; /* WebGL arka planı için şeffaf */
    z-index: 1;
    overflow: hidden;
    pointer-events: none; /* Arka plandaki Three.js sahnesini etkileşime kapatmamak için */
}

#studio-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    background: radial-gradient(circle at 50% 30%, #0d1a4d 0%, #04081c 100%);
}

.game-header, .game-main, .money-table-section, .tubes-section, .footer-control-panel, .modal-overlay {
    position: relative;
    z-index: 5;
    pointer-events: auto; /* Arayüz elemanlarını tıklanabilir kıl */
}

/* Spot Işıkları ve Efektler */
.glow-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(130px);
    z-index: -1;
    opacity: 0.35;
    pointer-events: none;
}
.orb-1 {
    width: 450px;
    height: 450px;
    background: var(--neon-blue);
    top: -80px;
    left: -50px;
}
.orb-2 {
    width: 500px;
    height: 500px;
    background: #4a00e0;
    bottom: -100px;
    right: -100px;
}

/* Stüdyo Spot Işıkları Görsel Simülasyonu */
.studio-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    width: 150px;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 242, 254, 0.15) 0%, rgba(0, 242, 254, 0) 70%);
    transform: rotate(-15deg);
    transform-origin: top left;
    pointer-events: none;
    z-index: -1;
    animation: spotlight-move-left 8s ease-in-out infinite alternate;
}

.studio-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 15%;
    width: 150px;
    height: 100%;
    background: linear-gradient(to bottom, rgba(74, 0, 224, 0.15) 0%, rgba(74, 0, 224, 0) 70%);
    transform: rotate(15deg);
    transform-origin: top right;
    pointer-events: none;
    z-index: -1;
    animation: spotlight-move-right 8s ease-in-out infinite alternate;
}

@keyframes spotlight-move-left {
    0% { transform: rotate(-20deg); opacity: 0.1; }
    100% { transform: rotate(-10deg); opacity: 0.25; }
}

@keyframes spotlight-move-right {
    0% { transform: rotate(20deg); opacity: 0.1; }
    100% { transform: rotate(10deg); opacity: 0.25; }
}

/* ÜST PANEL: Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 16px;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    height: 54px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
}
.logo-img {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.15));
    object-fit: contain;
}
.logo-main-text {
    font-family: var(--font-montserrat);
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--neon-gold);
    text-shadow: var(--neon-gold-glow);
    line-height: 1;
}

.question-tracker {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    padding: 4px 14px;
    border-radius: 8px;
}
.question-tracker span {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}
.tracker-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--neon-blue);
    text-shadow: var(--neon-blue-glow);
}

.vault-display {
    text-align: right;
}
.vault-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}
.vault-value {
    font-size: 1.4rem;
    font-family: var(--font-montserrat);
    font-weight: 900;
    color: var(--neon-gold);
    text-shadow: var(--neon-gold-glow);
}

.header-right {
    display: flex;
    align-items: center;
}

.btn-mute {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-light);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    transition: all 0.25s;
    outline: none;
}
.btn-dialog {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-light);
    padding: 0 10px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    transition: all 0.25s;
    outline: none;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: var(--font-montserrat);
}
.btn-dialog:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--neon-blue);
    box-shadow: var(--neon-blue-glow);
}
.btn-dialog.disabled {
    color: var(--neon-red);
    border-color: var(--neon-red);
    box-shadow: var(--neon-red-glow);
    background: rgba(255, 0, 85, 0.08);
}
.btn-mute:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--neon-blue);
    box-shadow: var(--neon-blue-glow);
}
.btn-mute.muted {
    color: var(--neon-red);
    border-color: var(--neon-red);
    box-shadow: var(--neon-red-glow);
    background: rgba(255, 0, 85, 0.08);
}

/* ORTA PANEL: Sunucu & Soru Kartı */
.game-main {
    display: grid;
    grid-template-columns: 240px 1fr; /* Enlarged from 160px for a more spacious host panel */
    gap: 15px;
    margin: 4px 0;
    align-items: start;
    flex: none; /* Do not stretch */
    height: 230px; /* Enlarged from 160px to give elements more vertical breathing room */
}

/* Sunucu Bölümü (Sadece Avatar & Kasa Durumu) */
.host-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(135deg, rgba(8, 20, 52, 0.75) 0%, rgba(3, 7, 24, 0.85) 100%);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(0, 242, 254, 0.2);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    height: 100%;
}

.host-avatar-container {
    position: relative;
    width: 80px; /* Enlarged from 55px */
    height: 80px; /* Enlarged from 55px */
    border-radius: 50%;
    background: #000;
    border: 2px solid var(--neon-blue);
    overflow: hidden;
    box-shadow: var(--neon-blue-glow);
    transition: all 0.3s ease;
}
.host-avatar {
    position: relative;
    width: 100%;
    height: 100%;
    background-image: url('host_avatar.jpg');
    background-size: cover;
    background-position: center;
}
.host-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 15px rgba(0, 242, 254, 0.4);
    pointer-events: none;
    z-index: 2;
}

.table-status-panel {
    margin-top: 6px;
    text-align: center;
    width: 100%;
}
.status-label {
    font-size: 0.65rem; /* Enlarged from 0.52rem */
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}
.status-val {
    font-size: 1.1rem; /* Enlarged from 0.85rem */
    font-family: var(--font-montserrat);
    font-weight: 900;
    color: var(--neon-blue);
    text-shadow: var(--neon-blue-glow);
    margin: 2px 0;
}
.status-warning {
    font-size: 0.6rem; /* Enlarged from 0.52rem */
    color: var(--neon-red);
    font-weight: 700;
    text-shadow: var(--neon-red-glow);
    line-height: 1.1;
    margin-top: 2px;
    animation: pulseWarning 1.5s infinite;
}

@keyframes pulseWarning {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* Soru Kartı */
.question-card {
    flex: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(8, 20, 52, 0.85) 0%, rgba(3, 7, 24, 0.92) 100%);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(0, 242, 254, 0.32);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 
                inset 0 0 15px rgba(0, 242, 254, 0.05),
                0 0 15px rgba(0, 242, 254, 0.15);
    transition: all 0.3s ease;
}

/* Dağıtılmayan Para Kutusu (Kare Fanus) */
.active-bundles-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 columns instead of 4 */
    grid-auto-rows: 15px; /* Taller row height */
    gap: 4px;
    width: 100%;
    height: 90px; /* Enlarged from 48px to 90px to fit bundles comfortably */
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass-glow);
    border-radius: 6px;
    padding: 6px;
    margin-top: 6px;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-blue) transparent;
}

/* Scrollbar Özelleştirme */
.active-bundles-container::-webkit-scrollbar {
    width: 4px;
}
.active-bundles-container::-webkit-scrollbar-thumb {
    background: var(--neon-blue);
    border-radius: 2px;
}

/* 2D Para Balyası Tasarımı (Küçültülmüş) */
.cash-bundle {
    position: relative;
    height: 14px;
    background-image: url('banknote_200.jpg');
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 2.5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.38rem; /* Tiny text size */
    font-weight: 800;
    color: #000; /* Black text like a stamp on the band */
    z-index: 1;
}
.cash-bundle::after {
    content: '';
    position: absolute;
    width: 28%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92); /* White paper band in the middle */
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid rgba(0, 0, 0, 0.15);
    border-right: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.15);
    z-index: -1; /* Behind the text so text is visible on the band */
}
.question-text-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
}
#question-text {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 6px;
}
.option-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    height: 38px; /* Taller option cards, enlarged from 32px */
    cursor: pointer;
}
.option-card:hover:not(.correct-answer):not(.wrong-answer) {
    background: rgba(0, 242, 254, 0.08);
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}
.option-card:active:not(.correct-answer):not(.wrong-answer) {
    transform: scale(0.96);
}
.opt-letter {
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    text-shadow: var(--neon-blue-glow);
    font-weight: 800;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 6px;
    font-family: var(--font-montserrat);
    font-size: 0.6rem;
}
.opt-text {
    font-size: 0.8rem; /* Enlarged from 0.7rem for better legibility */
    color: var(--text-light);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ALT PANEL: Cam Tüpler Bölmeleri (WebGL Üzerine Float Edecek) */
.tubes-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10;
}

.tube-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto; /* Tıklanabilir olmalı */
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: opacity 0.2s ease;
}

.tube-label {
    font-family: var(--font-montserrat);
    font-weight: 900;
    font-size: 1.25rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
    background: rgba(8, 14, 44, 0.6);
    border: 1px solid var(--border-glass);
    padding: 2px 10px;
    border-radius: 6px;
    z-index: 3;
}

/* Kontroller */
.tube-control {
    display: flex;
    width: 110px;
    justify-content: center;
    gap: 8px;
    align-items: center;
    background: rgba(8, 14, 44, 0.85);
    border: 1px solid var(--border-glass-glow);
    border-radius: 8px;
    padding: 2px 6px;
    margin-top: 4px;
    z-index: 3;
    height: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.btn-adjust {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-light);
    width: 22px;
    height: 22px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-adjust:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}
.btn-adjust:active {
    transform: scale(0.9);
}

.tube-amount {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--neon-gold);
    text-shadow: var(--neon-gold-glow);
    min-width: 65px;
    text-align: center;
}

/* ALT KONTROL PANELİ: Süre & Kilitle (Tam Oturma) */
.footer-control-panel {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 20px;
    align-items: center;
    background: rgba(8, 14, 44, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 4px 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    height: 40px;
    flex-shrink: 0;
    margin-top: auto; /* Push to the very bottom of the screen */
}

.timer-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
}
.timer-info {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-glass);
    height: 32px;
}
.timer-icon {
    color: var(--neon-blue);
    filter: drop-shadow(var(--neon-blue-glow));
    animation: rotateIcon 5s linear infinite;
    width: 18px;
    height: 18px;
}

#timer-text {
    font-size: 1.1rem;
    font-weight: 800;
    font-family: var(--font-montserrat);
    color: var(--neon-blue);
    text-shadow: var(--neon-blue-glow);
}

.timer-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    flex-grow: 1;
    overflow: hidden;
}
.timer-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue) 0%, #4a00e0 100%);
    border-radius: 4px;
    transition: width 0.1s linear;
}

.action-section {
    width: 100%;
}
#btn-lock {
    width: 100%;
    height: 34px;
    border-radius: 8px;
    font-family: var(--font-montserrat);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-lock-disabled {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    cursor: not-allowed !important;
}
.btn-lock-active {
    background: linear-gradient(135deg, var(--neon-gold) 0%, #d97706 100%);
    color: #000;
    box-shadow: var(--neon-gold-glow);
}
.btn-next-active {
    background: linear-gradient(135deg, var(--neon-green) 0%, #15803d 100%);
    color: #000;
    box-shadow: var(--neon-green-glow);
}

/* MODALLAR */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 6, 20, 0.96);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: linear-gradient(135deg, rgba(12, 22, 64, 0.95) 0%, rgba(4, 8, 28, 0.98) 100%);
    border: 1.5px solid var(--border-glass-glow);
    box-shadow: 0 0 40px rgba(0, 242, 254, 0.2);
    border-radius: 16px;
    padding: 30px;
    max-width: 480px;
    width: 90%;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
}

.modal-logo h2 {
    font-family: var(--font-montserrat);
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--neon-gold);
    text-shadow: var(--neon-gold-glow);
}

.modal-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.rules-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 20px;
}
.rules-box h4 {
    font-size: 0.85rem;
    color: var(--neon-gold);
    margin-bottom: 6px;
}
.rules-box li {
    font-size: 0.78rem;
    margin-bottom: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-blue) 0%, #4a00e0 100%);
    border: none;
    color: #fff;
    padding: 12px 30px;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: var(--font-montserrat);
    border-radius: 10px;
    cursor: pointer;
    box-shadow: var(--neon-blue-glow);
    transition: all 0.2s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.7);
}

.gameover-icon, .victory-icon {
    font-size: 3.5rem;
    margin: 15px 0;
}

.stats-box, .win-amount-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 12px;
    margin: 15px 0 25px 0;
}
.win-amount-box h3 {
    font-size: 1.8rem;
    margin-top: 4px;
}

/* Soru Kartındaki Seçeneklerin Sonuç Durumları */
.option-card.correct-answer {
    background: rgba(57, 255, 20, 0.06);
    border-color: var(--neon-green);
    box-shadow: var(--neon-green-glow);
}
.option-card.wrong-answer {
    background: rgba(255, 0, 85, 0.02);
    border-color: var(--neon-red);
    opacity: 0.5;
}

/* Duraklatma Butonu Stilleri */
.btn-pause-timer {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass-glow);
    color: var(--neon-blue);
    padding: 4px 14px;
    font-family: var(--font-montserrat);
    font-weight: 800;
    font-size: 0.72rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.1);
    outline: none;
    flex-shrink: 0;
}

.btn-pause-timer:hover:not(:disabled) {
    background: rgba(0, 242, 254, 0.12);
    border-color: var(--neon-blue);
    box-shadow: var(--neon-blue-glow);
}

.btn-pause-timer.paused {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--neon-gold);
    color: var(--neon-gold);
    box-shadow: var(--neon-gold-glow);
}

.btn-pause-timer:disabled {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.gold-text {
    color: var(--neon-gold);
    text-shadow: var(--neon-gold-glow);
}

/* Bilgi Notu */
.distribution-tip {
    font-size: 0.68rem;
    color: var(--text-muted);
    background: rgba(0, 242, 254, 0.04);
    border: 1.5px dashed rgba(0, 242, 254, 0.25);
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 8px;
    line-height: 1.35;
    text-align: center;
    text-shadow: none;
    box-shadow: inset 0 0 10px rgba(0, 242, 254, 0.02);
}
.distribution-tip strong {
    color: var(--neon-blue);
    text-shadow: 0 0 4px rgba(0, 242, 254, 0.2);
}


