/* ====================================================
   Nu-i Bai - Game Styles
   ==================================================== */

/* ---- Status Bar ---- */
.status-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    background: rgba(var(--card-bg-rgb, 20, 20, 40), 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    gap: 1rem;
}
.status-bar.hidden { display: none; }
.room-pill, .timer-pill, .phase-badge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    background: rgba(var(--primary-rgb, 59,130,246), 0.15);
    color: var(--primary, #3b82f6);
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.phase-badge { background: rgba(255,255,255,0.07); color: var(--text-muted, #aaa); }

/* ---- Tabs Header ---- */
.game-tabs-header {
    position: sticky;
    top: 45px;
    z-index: 90;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1rem 0.5rem;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    margin: 0 auto 0.5rem auto;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.game-tabs-header.hidden { display: none; }
.game-tab-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding: 0.75rem 1.25rem;
    color: var(--text-muted, #aaa);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.game-tab-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-main); }
.game-tab-btn.active {
    background: rgba(var(--primary-rgb, 59,130,246), 0.15);
    color: var(--primary, #3b82f6);
    border-color: rgba(var(--primary-rgb, 59,130,246), 0.3);
}
.game-tab-content { animation: fadeInUp 0.3s ease; }
.game-tab-content.hidden { display: none; }

/* ---- 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(59,130,246,0.25);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Lobby & General ---- */
.lobby-container, .room-container, .game-container, .results-container { 
    max-width: 960px;   width: 100%;
}
.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: #3b82f6; box-shadow: 0 8px 32px rgba(59,130,246, 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(59,130,246,0.2); color: #60a5fa; }
.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; }

/* ---- Room ---- */
.game-icon {
    font-size: 4rem; display: block; text-align: center; margin-bottom: 0.5rem;
    animation: floatIcon 3s ease-in-out infinite;
}
@keyframes floatIcon { 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(59,130,246, 0.12); border: 1px solid rgba(59,130,246, 0.25);
    font-size: 0.9rem; font-weight: 600;
}
.room-info-box { display: inline-flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* View container logic moved to global style.css */

.game-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.game-tab-content.hidden { display: none !important; }

/* ---- Game Play Styles ---- */
.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, #3b82f6, #60a5fa); border-radius: 2px; transition: width 0.5s ease;
}

.phase-center { text-align: center; margin-bottom: 1rem; }
.phase-banner {
    display: inline-block; padding: 0.4rem 1rem; border-radius: 999px; font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.phase-banner.choosing { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.phase-banner.voting { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }

/* Premise Card (Top Card) */
.premise-card {
    background: #1e1b4b; /* Dark indigo */
    border: 2px solid #6366f1;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.premise-text {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.4;
}

/* Answers (Player Hand & Voting) */
.answers-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}
.answers-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted, #aaa);
}

.cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.answer-card-btn {
    flex: 1 1 200px;
    max-width: 260px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px;
    line-height: 1.3;
}
.answer-card-btn:hover:not(:disabled) {
    transform: translateY(-4px);
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}
.answer-card-btn:disabled {
    opacity: 0.4;
    cursor: default;
    color: rgba(255, 255, 255, 0.7) !important;
}
.answer-card-btn.selected:disabled {
    opacity: 1 !important;
    color: #fff !important;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.25);
}
.answer-card-btn.selected {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.25);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

/* Mobile: Buttons full width or centered */
@media (max-width: 600px) {
    .cards-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
        width: 100%;
    }
    .answer-card-btn {
        width: 100%;
        max-width: 100%;
        min-height: 54px;
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
        margin: 0 auto;
        border-radius: 12px;
    }
    .premise-card {
        padding: 1.25rem 1rem;
        margin-bottom: 1rem;
    }
    .premise-text {
        font-size: 1.1rem;
    }
    .answers-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
}

.vote-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.vote-player-btn {
    width: 140px;
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    padding: 1rem 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:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.02); border-color: #f59e0b; background: rgba(245,158,11, 0.12); box-shadow: 0 8px 24px rgba(245,158,11,0.2);
}
.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, #3b82f6, #2563eb);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 900; color: #fff;
    box-shadow: 0 3px 8px rgba(59,130,246,0.25);
}
.vote-player-btn:hover:not(:disabled) .vote-avatar { background: linear-gradient(135deg, #f59e0b, #d97706); }
.vote-player-btn.voted .vote-avatar { background: linear-gradient(135deg, #10b981, #059669); }

.vote-product { font-size: 0.75rem; font-weight: 400; color: #9ca3af; text-align: center; margin-top: 0.25rem; line-height: 1.2;}

/* Modal general */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px);
    z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fadeInBg 0.3s ease;
}
.modal-overlay.hidden { display: none; }
/* Stilurile globale din style.css se ocupa acum de modal-content */
.result-modal-content { animation: modalShake 0.25s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes slideUpModal { from { opacity: 0; transform: translateY(40px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fadeInBg { from { opacity: 0; } to { opacity: 1; } }

/* Results Modal */
.result-modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px);
    z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fadeInBg 0.3s ease;
    overflow-y: auto;
}
.result-modal-overlay.hidden { display: none; }
.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: none;
}

.reveal-row {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: rgba(255,255,255,0.05); border-radius: 12px; margin-bottom: 0.5rem;
}
.reveal-rank { width: 30px; height: 30px; border-radius: 50%; background: #333; display: flex; align-items: center; justify-content: center; font-weight: 800;}
.reveal-rank.gold { background: linear-gradient(135deg, #fef08a, #eab308); color: #000; }
.reveal-rank.silver { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #000; }
.reveal-rank.bronze { background: linear-gradient(135deg, #fdba74, #ea580c); color: #fff; }

/* 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);
}

/* Utils */
.fade-in { animation: fadeInUp 0.4s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Scoreboard */
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* 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; 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(59,130,246,0.85); border: 1px solid rgba(59,130,246,0.4); }

