/* --- GLOBAL LAYOUT --- */
    .live-page-container {
        padding: 40px 20px;
        max-width: 1600px; 
        margin: 0 auto;
        min-height: 80vh;
        direction: rtl;
        transition: filter 0.3s;
    }

    /* טשטוש הרקע כשהנגן פתוח */
    body.player-active .live-page-container {
        filter: blur(5px) brightness(0.4);
        pointer-events: none;
    }

    /* --- TOP SECTION --- */
    .top-section-header {
        display: flex; align-items: center; gap: 15px; margin-bottom: 30px;
    }
    .top-title {
        font-family: 'Teko', sans-serif; font-size: 3rem; margin: 0; line-height: 1; color: #fff;
        text-transform: uppercase;
    }
    .top-title span { color: var(--hub-accent); text-shadow: 0 0 15px rgba(255, 165, 0, 0.3); }

    /* הגריד של הטופ 3 - מתוקן */
    .top-live-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
        gap: 25px;
        margin-bottom: 60px;
        align-items: start;
    }

    .top-card {
        position: relative;
        background: #000;
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid var(--glass-border);
        cursor: pointer;
        transition: transform 0.3s ease, border-color 0.3s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        
        /* --- תיקון גובה: גובה אחיד לכולם --- */
        height: 340px; 
    }

    /* המקום הראשון - רק הדגשה ויזואלית ללא שינוי גובה דרסטי */
    .top-card.rank-1 {
        border: 2px solid var(--hub-accent);
        box-shadow: 0 0 30px rgba(var(--hub-accent), 0.15);
    }

    .top-card:hover { transform: translateY(-5px); }
    .top-card:hover .top-img { opacity: 0.5; transform: scale(1.05); }
    .top-card:hover .play-btn-overlay { opacity: 1; transform: translate(-50%, -50%) scale(1); }

    .top-img-wrapper { width: 100%; height: 100%; position: relative; background: #1a1a20; }
    .top-img {
        width: 100%; height: 100%; object-fit: cover;
        opacity: 0.8; transition: all 0.5s ease;
    }

    .rank-badge {
        position: absolute; top: 15px; right: 15px;
        width: 35px; height: 35px;
        background: rgba(0,0,0,0.8); color: #fff;
        display: flex; align-items: center; justify-content: center;
        font-weight: bold; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2);
        z-index: 10; font-family: 'Heebo';
    }
    .rank-1 .rank-badge { background: var(--hub-accent); color: #000; border: none; font-size: 1.2rem; }

    .play-btn-overlay {
        position: absolute; top: 50%; left: 50%; 
        transform: translate(-50%, -50%) scale(0.8);
        width: 60px; height: 60px;
        background: var(--hub-accent);
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        color: #000; font-size: 1.5rem;
        opacity: 0; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        z-index: 5; box-shadow: 0 0 20px var(--hub-accent);
    }

    .card-info {
        position: absolute; bottom: 0; left: 0; right: 0;
        padding: 20px;
        background: linear-gradient(to top, #000 10%, transparent 100%);
        z-index: 5; text-align: right;
    }
    
    .info-live-tag {
        display: inline-block; background: #ff0048; color: white; 
        font-size: 0.7rem; font-weight: bold; padding: 2px 6px; 
        border-radius: 4px; margin-bottom: 5px;
    }
    .streamer-name { font-size: 1.4rem; font-weight: 800; color: #fff; margin: 0; text-shadow: 0 2px 5px rgba(0,0,0,0.8); }
    .streamer-stats { color: #ccc; font-size: 0.9rem; margin-top: 4px; display: flex; align-items: center; gap: 8px; }

    /* --- REST GRID --- */
    .rest-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
    .mini-card {
        background: var(--glass-panel);
        border-radius: 12px; overflow: hidden;
        border: 1px solid var(--glass-border);
        transition: 0.3s; cursor: pointer;
        display: flex; flex-direction: column;
    }
    .mini-card:hover { transform: translateY(-5px); border-color: var(--hub-accent); }
    .mini-thumb-box { position: relative; width: 100%; aspect-ratio: 16/9; }
    .mini-img { width: 100%; height: 100%; object-fit: cover; }
    .mini-content { padding: 12px; text-align: right; }
    .mini-name { font-weight: bold; color: #fff; font-size: 1rem; display: block; }
    .mini-viewers { font-size: 0.85rem; color: #888; margin-top: 3px; }

    /* --- PLAYER & FLOATING BAR STYLES --- */
    
    /* אנימציות */
    @keyframes spin-loader { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
    @keyframes pulse-logo { 0% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 0.8; } }

    /* הנגן המרכזי */
    .big-player-wrapper {
        position: fixed;
        top: 50%; left: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        width: 78%; max-width: 1200px;
        height: calc(100vh - 300px); min-height: 400px;
        background: #000;
        border: 1px solid var(--hub-accent);
        box-shadow: 0 0 50px rgba(var(--hub-accent), 0.15);
        border-radius: 16px;
        z-index: 9999;
        opacity: 0; pointer-events: none;
        transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex; flex-direction: column; overflow: hidden;
    }

    .big-player-wrapper.active {
        opacity: 1; pointer-events: all;
        transform: translate(-50%, -50%) scale(1);
        /* הזזה קלה למעלה כדי לפנות מקום לבר התחתון */
        top: 45%; 
    }

    .close-player-btn {
        position: absolute; top: 15px; right: 15px; 
        background: rgba(0,0,0,0.7); color: white; border: 1px solid rgba(255,255,255,0.2); 
        width: 30px; height: 30px; border-radius: 50%; cursor: pointer; z-index: 100;
        display: flex; align-items: center; justify-content: center; transition: 0.2s;
    }
    .close-player-btn:hover { background: #ff003c; border-color: #ff003c; }

    /* מסך טעינה */
    .player-loading-overlay {
        position: absolute; inset: 0; background: #000; z-index: 50; 
        display: flex; align-items: center; justify-content: center;
        transition: opacity 0.5s ease; opacity: 0; pointer-events: none;
    }
    .player-loading-overlay.visible { opacity: 1; pointer-events: all; }
    
    .loader-content { position: relative; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; }
    .loader-spinner {
        position: absolute; width: 100%; height: 100%;
        border: 3px solid rgba(255, 255, 255, 0.1); border-top: 3px solid var(--hub-accent);
        border-radius: 50%; animation: spin-loader 1s linear infinite;
    }
    .loader-logo-img { width: 60px; height: auto; z-index: 2; animation: pulse-logo 2s infinite ease-in-out; }

    /* הבר התחתון */
    .floating-bar-container {
        position: fixed;
        bottom: -300px; /* מוסתר בהתחלה */
        left: 50%; transform: translateX(-50%);
        width: 85%; max-width: 1600px;
        height: 140px; 
        z-index: 10000;
        background: var(--live-comp-glass-bg);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255,255,255,0.1);
        border-top: 1px solid var(--hub-accent);
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
        display: flex; flex-direction: column; justify-content: center; padding: 15px 25px;
        transition: bottom 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    /* מופיע כשהנגן פעיל */
    body.player-active .floating-bar-container {
        bottom: 0;
    }

    .cards-scroller {
        display: flex; gap: 15px; overflow-x: auto; height: 100%; align-items: center;
        scrollbar-width: none;
    }
    .cards-scroller::-webkit-scrollbar { display: none; }

    /* כרטיסים בבר התחתון */
    .bar-card {
        flex: 0 0 auto;
        width: 160px; height: 90px; 
        border-radius: 8px; overflow: hidden;
        border: 1px solid rgba(255,255,255,0.1);
        position: relative; cursor: pointer;
        transition: transform 0.2s;
    }
    .bar-card:hover { transform: scale(1.05); border-color: var(--hub-accent); }
    .bar-card.active-stream { border: 2px solid #ff003c; filter: brightness(0.6); pointer-events: none; }
    .bar-card.active-stream::before {
        content: 'PLAYING'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
        font-size: 0.7rem; background: #ff003c; padding: 2px 6px; border-radius: 4px; z-index: 10; font-weight: bold; color: white;
    }
    
    .bar-card img { width: 100%; height: 100%; object-fit: cover; }
    .bar-card-name {
        position: absolute; bottom: 0; left: 0; right: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
        color: white; font-size: 0.8rem; font-weight: bold; text-align: center; padding: 5px 2px;
    }
