/* ====================================================
   Bunicuțul Petrecăreț - Game Styles
   ==================================================== */

/* ---- Loader ---- */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 1rem;
    color: var(--text-muted, #aaa);
}
.premium-loader {
    width: 48px; height: 48px;
    border: 4px solid rgba(245,158,11,0.25);
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Lobby ---- */
.lobby-container { max-width: 960px;   }
.lobby-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.lobby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    
    margin-bottom: 2rem;
}
.room-card {
    background: var(--card-bg, rgba(255,255,255,0.05));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 16px;
    
    cursor: pointer;
    transition: all 0.25s ease;
}
.room-card:hover {
    transform: translateY(-3px);
    border-color: #f59e0b;
    box-shadow: 0 8px 32px rgba(245,158,11, 0.2);
}
.room-card h3 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.room-info { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.badge { font-size: 0.72rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-primary { background: rgba(245,158,11,0.2); color: #fbbf24; }
.badge-waiting { background: rgba(99,102,241,0.2); color: #818cf8; }
.badge-playing { background: rgba(16,185,129,0.2); color: #34d399; }
.room-stat { font-size: 0.8rem; color: var(--text-muted, #aaa); display: flex; align-items: center; gap: 0.3rem; }

/* ---- Waiting Room ---- */
.room-container { max-width: 600px;   }
.grandpa-waiting-icon {
    font-size: 4rem;
    display: block;
    text-align: center;
    margin-bottom: 0.5rem;
    animation: floatGrandpa 3s ease-in-out infinite;
}
@keyframes floatGrandpa {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.player-list-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin: 1.25rem 0; }
.player-pill {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: rgba(245,158,11, 0.12);
    border: 1px solid rgba(245,158,11, 0.25);
    font-size: 0.9rem; font-weight: 600;
}
/* View container logic moved to global style.css */
.room-info-box { display: inline-flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* ---- Game View ---- */
.game-container { 
    max-width: 640px; 
     
    
    width: 100%;
}

/* ---- Question Card (Grandpa Banner) ---- */
.bp-question-card {
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(251,191,36,0.08));
    border: 1.5px solid rgba(245,158,11,0.25);
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.75rem;
    animation: fadeInUp 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    text-align: center;
}
.grandpa-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    width: 100%;
}
.grandpa-text {
    text-align: center;
}
.grandpa-emoji {
    font-size: 2.2rem;
    flex-shrink: 0;
    animation: floatGrandpa 3s ease-in-out infinite;
    line-height: 1;
}
.grandpa-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fbbf24;
    margin: 0 0 0.15rem;
    opacity: 0.8;
    text-align: center;
}
.grandpa-question {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-main);
    margin: 0;
    text-align: center;
}

/* ---- Vote Instruction ---- */
.vote-instruction {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted, #aaa);
    margin: 0 0 1rem;
}

/* ---- Vote Grid ---- */
.vote-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.vote-player-btn {
    width: 110px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 700;
}
.vote-player-btn.is-me {
    border-style: dashed;
    opacity: 0.9;
}
.vote-player-btn:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.04);
    border-color: #f59e0b;
    background: rgba(245,158,11, 0.12);
    box-shadow: 0 8px 24px rgba(245,158,11,0.2);
}
.vote-player-btn:active:not(:disabled) { transform: scale(0.97); }
.vote-player-btn.voted {
    border-color: #f59e0b;
    background: rgba(245,158,11, 0.18);
    box-shadow: 0 4px 20px rgba(245,158,11,0.3);
}
.vote-player-btn:disabled:not(.voted) { opacity: 0.4; cursor: default; }
.vote-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 900; color: #fff;
    box-shadow: 0 3px 8px rgba(245,158,11,0.25);
}
.vote-player-btn.voted .vote-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16,185,129,0.4);
    animation: pulseVoted 1.5s ease-in-out infinite;
}
@keyframes pulseVoted {
    0%, 100% { box-shadow: 0 4px 12px rgba(16,185,129,0.4); }
    50% { box-shadow: 0 4px 24px rgba(16,185,129,0.7); }
}
.vote-name { font-size: 0.88rem; font-weight: 700; text-align: center; }
.vote-done-icon {
    position: absolute;
    top: 0.4rem; right: 0.5rem;
    font-size: 0.7rem;
    color: #34d399;
    background: rgba(16,185,129,0.2);
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* ---- Vote Status ---- */
.vote-status { margin-top: 0.5rem; }
.vote-progress {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.vote-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 999px;
    transition: width 0.5s ease;
}
.vote-status-text {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted, #aaa);
    margin: 0;
}

/* ---- Round Progress ---- */
.round-progress-bar {
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.round-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ---- Result Modal ---- */
.result-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    animation: fadeInBg 0.3s ease;
    overflow: hidden;
}
.result-modal-overlay.hidden { display: none; }
@keyframes fadeInBg { from { opacity: 0; } to { opacity: 1; } }

.result-modal-content {
    background: var(--card-bg, rgba(15, 23, 42, 0.97));
    border: 1.5px solid rgba(245,158,11,0.4);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 60px rgba(245,158,11,0.15);
    animation: slideUpModal 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUpModal {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.result-modal-inner {
    padding: 2rem 1.75rem;
    text-align: center;
}
.grandpa-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    animation: floatGrandpa 3s ease-in-out infinite;
    display: block;
}
.result-modal-label {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fbbf24;
    margin: 0 0 0.6rem;
}
.result-modal-question {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.5;
    color: var(--text-main);
    margin: 0 0 1.5rem;
    padding: 1rem;
    background: rgba(245,158,11,0.08);
    border-radius: 12px;
    border: 1px solid rgba(245,158,11,0.2);
}
.result-modal-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245,158,11,0.4), transparent);
    margin: 0 0 1.25rem;
}
.result-modal-winner-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted, #aaa);
    margin: 0 0 0.75rem;
}
.result-modal-winners {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    margin-bottom: 1.75rem;
}
.winner-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(251,191,36,0.12));
    border: 1.5px solid rgba(245,158,11,0.4);
    animation: fadeInUp 0.4s ease;
    transition: all 0.3s ease;
}
.winner-pill.winner-ready {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(5,150,105,0.12));
    box-shadow: 0 0 15px rgba(16,185,129,0.3);
}
.winner-ready .winner-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
    animation: pulseReady 1.5s ease-in-out infinite;
}
@keyframes pulseReady {
    0%, 100% { transform: scale(1); box-shadow: 0 0 5px rgba(16,185,129,0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(16,185,129,0.8); }
}
.winner-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 900; color: #fff;
    flex-shrink: 0;
}
.winner-name { font-size: 1rem; font-weight: 800; color: var(--text-main); }
.winner-votes {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(245,158,11,0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}
.result-modal-footer { text-align: center; }
.continue-btn {
    display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.9rem 2.5rem;
    border-radius: 12px;
    font-size: 1.05rem; font-weight: 800;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none; cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 24px rgba(245,158,11,0.4);
    min-width: 220px;
    justify-content: center;
}
.continue-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(245,158,11,0.55); }
.continue-btn:disabled { opacity: 0.5; cursor: default; transform: none; }

/* ---- Results / Finished ---- */
.results-container { max-width: 1200px;   width: 100%; }
.results-header { text-align: center; margin-bottom: 2rem; }
.grandpa-finale {
    font-size: 3.5rem;
    display: block;
    text-align: center;
    margin-bottom: 0.5rem;
    animation: floatGrandpa 3s ease-in-out infinite;
}
.results-history { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; }
.history-item {
    display: flex; gap: 1rem; align-items: flex-start;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    transition: background 0.2s;
    font-size: 0.88rem;
}
.history-item:hover { background: rgba(255,255,255,0.07); }
.history-round {
    min-width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(245,158,11,0.18);
    color: #fbbf24;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.82rem;
    flex-shrink: 0;
}
.history-content { flex: 1; }
.history-question { font-weight: 700; color: var(--text-main); margin-bottom: 0.25rem; line-height: 1.4; }
.history-detail { color: var(--text-muted,#aaa); line-height: 1.4; }

/* ---- Emoji Bar ---- */
#game-emoji-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    width: 100%;
    max-width: 500px;
    padding: 0 1rem;
    pointer-events: none;
}
#game-emoji-bar .emoji-reactions-bar {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ---- Toast ---- */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem; font-weight: 600;
    color: #fff;
    backdrop-filter: blur(12px);
    animation: fadeInUp 0.3s ease;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.toast-error { background: rgba(239,68,68,0.85); border: 1px solid rgba(239,68,68,0.5); }
.toast-info { background: rgba(245,158,11,0.85); border: 1px solid rgba(245,158,11,0.4); }
.toast-success { background: rgba(16,185,129,0.85); border: 1px solid rgba(16,185,129,0.4); }

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.4s ease; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 24px rgba(245,158,11,0.4); }
    50% { box-shadow: 0 0 48px rgba(245,158,11,0.7); }
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    .vote-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.6rem; }
    .vote-player-btn { padding: 0.9rem 0.5rem; }
    .vote-avatar { width: 44px; height: 44px; font-size: 1.1rem; }
    .grandpa-question { font-size: 1rem; }
    .result-modal-question { font-size: 1.05rem; }
    .lobby-container, .room-container, .game-container, .results-container {  }
    .result-modal-inner { padding: 1.5rem 1.25rem; }
}
@media (max-width: 600px) {
    #game-emoji-bar { bottom: 1rem; }
}
/* ---- Laptop / Large Screen Optimizations ---- */
@media (min-width: 1024px) {
    .game-container {
        max-width: 1000px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 70vh;
    }

    .bp-question-card {
        padding: 2.5rem 2rem;
        margin-bottom: 2.5rem;
        border-radius: 24px;
    }

    .grandpa-question {
        font-size: 1.75rem;
    }

    .grandpa-emoji {
        font-size: 4rem;
    }

    .grandpa-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .vote-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }

    .vote-player-btn {
        width: 160px;
        padding: 1.5rem 1rem;
        gap: 0.75rem;
        border-radius: 20px;
        min-height: 140px;
    }

    .vote-avatar {
        width: 64px;
        height: 64px;
        font-size: 1.6rem;
    }

    .vote-name {
        font-size: 1.1rem;
    }

    .vote-instruction {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .vote-status {
        max-width: 400px;
        margin: 1rem auto 0;
    }

    #game-emoji-bar {
        max-width: 600px;
        bottom: 2.5rem;
    }

    .room-container {
        max-width: 800px;
    }
}



