/* ====================================================
   Teoria Chibritului - 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, 239,68,68), 0.15);
    color: var(--primary, #ef4444);
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.phase-badge { background: rgba(255,255,255,0.07); color: var(--text-muted, #aaa); }

.status-center { display: flex; align-items: center; gap: 0.75rem; }
.status-timer-pill {
    font-size: 0.9rem; font-weight: 900; padding: 0.3rem 0.85rem; border-radius: 999px;
    background: rgba(239,68,68, 0.2); color: #f87171; border: 1px solid rgba(239,68,68, 0.3);
    font-family: 'Outfit', sans-serif; min-width: 65px; text-align: center;
}
.status-timer-pill.urgent { background: #ef4444; color: #fff; animation: pulseUrgent 1s infinite; }
.status-timer-pill.hidden { display: none; }

/* Override global mobile hide */
@media (max-width: 768px) {
    .status-center { display: flex !important; }
    .status-bar { padding: 0.4rem 0.75rem; gap: 0.5rem; }
    .room-pill, .timer-pill, .status-timer-pill, .phase-badge { padding: 0.25rem 0.6rem; font-size: 0.75rem; min-width: auto; }
}
.game-tabs-header {
    position: sticky;
    top: 45px;
    z-index: 90;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 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(239,68,68, 0.15);
    color: #ef4444;
    border-color: rgba(239,68,68, 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(239,68,68,0.25);
    border-top-color: #ef4444;
    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: #ef4444; box-shadow: 0 8px 32px rgba(239,68,68, 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(239,68,68,0.2); color: #f87171; }
.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(239,68,68, 0.12); border: 1px solid rgba(239,68,68, 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 */

/* ---- Phase Header ---- */
.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.prep { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.phase-banner.debate { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.phase-banner.voting { background: rgba(139,92,246,0.15); color: #a78bfa; border: 1px solid rgba(139,92,246,0.3); }

/* ---- Round progress bar ---- */
.round-progress-bar, .round-progress-fill { display: none !important; }
.round-progress-fill {
    height: 100%; background: linear-gradient(90deg, #ef4444, #f87171); border-radius: 2px; transition: width 0.5s ease;
}

/* ---- Question Card ---- */
.question-card {
    background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.04));
    border: 2px solid rgba(239,68,68, 0.35);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    min-height: auto !important;
    box-shadow: 0 0 30px rgba(239,68,68,0.12);
}
.question-label {
    font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
    color: #ef4444; margin-bottom: 0.25rem;
}
.question-text {
    font-size: 1.25rem; font-weight: 700; color: #fff; line-height: 1.4; margin-bottom: 0;
}

/* ---- Team Cards ---- */
.teams-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.team-card {
    border-radius: 16px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
}
.team-card.team-a {
    background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(37,99,235,0.08));
    border: 2px solid rgba(59,130,246,0.4);
}
.team-card.team-b {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(185,28,28,0.08));
    border: 2px solid rgba(239,68,68,0.4);
}
.team-card.team-a.my-team { box-shadow: 0 0 20px rgba(59,130,246,0.3); }
.team-card.team-b.my-team { box-shadow: 0 0 20px rgba(239,68,68,0.3); }

.team-label {
    font-size: 0.7rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem;
}
.team-a .team-label { color: #60a5fa; }
.team-b .team-label { color: #f87171; }

.team-variant {
    font-size: 1rem; font-weight: 800; margin-bottom: 0.75rem; line-height: 1.2;
}
.team-a .team-variant { color: #93c5fd; }
.team-b .team-variant { color: #fca5a5; }

.team-members {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem;
}
.team-member-pill {
    font-size: 0.78rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px;
}
.team-a .team-member-pill { background: rgba(59,130,246,0.2); color: #93c5fd; }
.team-b .team-member-pill { background: rgba(239,68,68,0.2); color: #fca5a5; }
.team-member-pill.is-me { font-weight: 900; border: 1.5px solid currentColor; }

.my-team-badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.75rem; font-weight: 800; padding: 0.25rem 0.75rem; border-radius: 999px;
    margin-top: 0.5rem; text-transform: uppercase; letter-spacing: 0.06em;
}
.team-a .my-team-badge { background: rgba(59,130,246,0.25); color: #60a5fa; border: 1px solid rgba(59,130,246,0.4); }
.team-b .my-team-badge { background: rgba(239,68,68,0.25); color: #f87171; border: 1px solid rgba(239,68,68,0.4); }

/* ---- Timer ---- */
.timer-circle {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    border: 4px solid #ef4444;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800; color: #fff;
    margin: 0 auto 1.5rem;
    transition: border-color 0.5s;
}
.timer-circle.prep-timer { border-color: #fbbf24; }
.timer-circle.urgent { border-color: #ef4444; color: #ef4444; animation: pulseUrgent 1s infinite; }
@keyframes pulseUrgent { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.debate-timer-bar {
    height: 6px; border-radius: 3px; margin-bottom: 1rem; overflow: hidden;
    background: rgba(255,255,255,0.08);
}
.debate-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #fbbf24);
    border-radius: 3px;
    transition: width 1s linear;
}

/* ---- Voting Grid ---- */
.vote-instruction { text-align: center; font-size: 0.9rem; color: var(--text-muted, #aaa); margin: 0 0 1rem; }
.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: #ef4444; background: rgba(239,68,68, 0.12); box-shadow: 0 8px 24px rgba(239,68,68,0.2);
}
.vote-player-btn.voted { border-color: #ef4444; background: rgba(239,68,68, 0.18); box-shadow: 0 4px 20px rgba(239,68,68,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, #ef4444, #dc2626);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 900; color: #fff;
    box-shadow: 0 3px 8px rgba(239,68,68,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-team-badge {
    font-size: 0.65rem; font-weight: 800; padding: 0.1rem 0.4rem; border-radius: 999px; text-transform: uppercase;
}
.vote-team-a { background: rgba(59,130,246,0.2); color: #93c5fd; }
.vote-team-b { background: rgba(239,68,68,0.2); color: #fca5a5; }

/* ---- Modal ---- */
.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;
}
.modal-overlay.hidden { display: none; }
@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; } }

/* ---- Reveal rows ---- */
.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);
}

/* ---- Host controls ---- */
.host-controls {
    display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem;
}
.btn-host {
    font-size: 0.82rem; font-weight: 700; padding: 0.5rem 1.25rem; border-radius: 999px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-muted); cursor: pointer; transition: all 0.2s ease;
    display: flex; align-items: center; gap: 0.4rem;
}
.btn-host:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #f87171; }

/* ---- Utilities ---- */
.fade-in { animation: fadeInUp 0.4s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.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(239,68,68,0.85); border: 1px solid rgba(239,68,68,0.4); }

@media (max-width: 600px) {
    .teams-grid { grid-template-columns: 1fr; }
    .vote-player-btn { width: 120px; }
    .question-card { padding: 0.5rem 0.75rem; margin-bottom: 0.75rem; min-height: auto !important; }
    .question-text { font-size: 1.1rem; }
    .game-container {  }
    .phase-center { margin-bottom: 0.75rem; }
}
