/* ============================================
   Game Hub & Trivia Styles
   ============================================ */

/* Shared game page styles */
.game-status-badge {
    display: inline-block;
    padding: 0.25em 0.75em;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Trivia Play (Phone) Styles */
.trivia-play-container {
    min-height: 100vh;
    padding-bottom: 80px;
}

.trivia-play-container .answer-btn {
    display: block;
    width: 100%;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.trivia-play-container .answer-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

.trivia-play-container .answer-btn.selected {
    background: rgba(220,53,69,0.2);
    border-color: #dc3545;
}

.trivia-play-container .answer-btn.correct {
    background: rgba(25,135,84,0.2);
    border-color: #198754;
}

.trivia-play-container .answer-btn.wrong {
    background: rgba(220,53,69,0.15);
    border-color: rgba(220,53,69,0.3);
    opacity: 0.6;
}

.trivia-play-container .answer-btn .letter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.opt-a-badge { background: #dc3545; }
.opt-b-badge { background: #198754; }
.opt-c-badge { background: #0d6efd; }
.opt-d-badge { background: #ffc107; color: #000; }

/* Timer bar for phone */
.timer-bar {
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.timer-bar-fill {
    height: 100%;
    background: #dc3545;
    transition: width 1s linear;
    border-radius: 3px;
}

.timer-bar-fill.warning { background: #ffc107; }
.timer-bar-fill.danger { background: #dc3545; animation: pulse 0.5s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Score display */
.score-display {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.score-display .score-value {
    font-size: 2rem;
    font-weight: 700;
    color: #dc3545;
}

.score-display .score-label {
    font-size: 0.875rem;
    color: #adb5bd;
}

/* Write-in input */
.write-in-input {
    font-size: 1.25rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.15);
    color: #fff;
}

.write-in-input:focus {
    border-color: #dc3545;
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px rgba(220,53,69,0.25);
    color: #fff;
}

/* Host controls */
.host-container {
    min-height: 100vh;
    background: #0a0a0a;
    padding: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.host-btn {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    white-space: nowrap;
}

/* Buttons in flex container should not be full width */
.d-flex .host-btn {
    width: auto;
    flex: 1;
    min-width: 0;
}

/* Standalone buttons are full width */
.host-btn:not(.d-flex .host-btn) {
    width: 100%;
}

.host-status-card {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Mobile host controls */
@media (max-width: 576px) {
    .host-container {
        padding: 10px;
    }
    .host-btn {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    .d-flex.gap-2 {
        gap: 0.5rem !important;
    }
    .d-flex.flex-wrap .host-btn {
        flex: 1 1 45%;
    }
}

/* Confetti animation */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 10000;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Player profile styles */
.player-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #dc3545;
}

.player-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(220,53,69,0.2);
    border: 3px solid #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #dc3545;
}

.stat-card {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #dc3545;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #adb5bd;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
}

.social-link:hover {
    background: #dc3545;
    color: #fff;
}

/* Game Help Button */
.game-help-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(30,30,30,0.9);
    color: #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, border-color 0.2s, color 0.2s;
    font-size: 1.1rem;
}
.game-help-btn:hover {
    opacity: 1;
    border-color: #dc3545;
    color: #dc3545;
}

/* Help modal z-index overrides for game pages (above celebration canvas z:9999) */
#adminHelpModal { z-index: 10050 !important; }
#adminHelpModal + .modal-backdrop,
.modal-backdrop { z-index: 10040 !important; }

/* OG Member */
.og-crown { color: #ffc107; }
.card.border-warning { border-width: 2px !important; }

/* Wall Posts */
.wall-post {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #dc3545;
    margin-bottom: 8px;
}
.wall-post-composer textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 8px;
}
.wall-post-composer textarea:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #dc3545;
    color: #fff;
    box-shadow: none;
}

/* ============================================
   Bingo Ball Spin & Reveal Animation
   ============================================ */

/* Ball container for spin animation */
.ball-reveal-container {
    position: relative;
    display: inline-block;
}

/* Spinning ball animation */
@keyframes ballSpin {
    0% {
        transform: rotateY(0deg) scale(0.3);
        opacity: 0;
        filter: blur(8px);
    }
    20% {
        opacity: 1;
        filter: blur(4px);
    }
    50% {
        transform: rotateY(540deg) scale(1.2);
        filter: blur(2px);
    }
    75% {
        transform: rotateY(680deg) scale(1.1);
        filter: blur(0);
    }
    100% {
        transform: rotateY(720deg) scale(1);
        filter: blur(0);
    }
}

/* Bounce landing effect */
@keyframes ballBounce {
    0% { transform: scale(1.15); }
    40% { transform: scale(0.92); }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Glow pulse during spin */
@keyframes glowPulse {
    0% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.3); }
    50% { box-shadow: 0 0 60px rgba(255, 255, 255, 0.6), 0 0 100px currentColor; }
    100% { box-shadow: 0 0 30px rgba(255, 255, 255, 0.4); }
}

/* Combined spin reveal animation */
.ball-spin-reveal {
    animation: ballSpin 1.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards,
               glowPulse 1.5s ease-in-out forwards;
}

/* Bounce after spin completes */
.ball-bounce {
    animation: ballBounce 0.3s ease-out forwards;
}

/* Spinning placeholder ball (before number revealed) */
.ball-spinning {
    background: linear-gradient(135deg, #444 0%, #222 50%, #444 100%);
    animation: ballSpin 0.5s linear infinite;
}

/* Letter-specific trail/glow colors */
.ball-B.ball-spin-reveal { color: #dc3545; }
.ball-I.ball-spin-reveal { color: #0d6efd; }
.ball-N.ball-spin-reveal { color: #198754; }
.ball-G.ball-spin-reveal { color: #ffc107; }
.ball-O.ball-spin-reveal { color: #6f42c1; }

/* Mini burst particles container */
.mini-burst-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}
