/* ========================================
   BRACKET BINGO STYLES
   ======================================== */

/* Student Header */
.bingo-student-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    color: white;
}

.bingo-student-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bingo-student-header .student-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bingo-student-header .session-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-family: monospace;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.game-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.game-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
}

.game-status.status-connected .status-dot {
    background: #10b981;
}

.game-status.status-active .status-dot {
    background: #10b981;
    animation: pulse 2s infinite;
}

.game-status.status-error .status-dot {
    background: #ef4444;
}

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

/* Bingo State Sections */
.bingo-state {
    padding: 2rem 0;
}

/* Lobby State */
.bingo-lobby {
    max-width: 850px;
    margin: 0 auto;
    text-align: center;
}

.lobby-message {
    margin-bottom: 2rem;
}

.waiting-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.lobby-message h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.lobby-message p {
    color: #64748b;
}

.card-preview {
    margin-bottom: 2rem;
}

.card-preview h3 {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.player-count {
    font-size: 1rem;
    color: #64748b;
}

.player-count span {
    font-weight: 700;
    color: var(--primary-color);
}

/* Bingo Card Grid */
.bingo-card {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    max-width: 780px;
    margin: 0 auto;
    background: #f1f5f9;
    padding: 20px;
    border-radius: 20px;
}

.bingo-card-preview {
    max-width: 780px;
    margin: 0 auto;
}

.bingo-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 16px;
    font-weight: 600;
    font-size: 2.25rem;
    color: var(--dark-color);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.bingo-cell:hover:not(.claimed):not(.free) {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.bingo-cell.selected {
    border-color: var(--primary-color);
    background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.bingo-cell.claimed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    cursor: default;
}

.bingo-cell.free {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    font-size: 0.75rem;
    cursor: default;
}

.bingo-cell .cell-value {
    pointer-events: none;
}

.bingo-cell.hinted {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    animation: hint-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.5);
}

.bingo-cell.hinted:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
}

@keyframes hint-pulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.5);
    }
}

.card-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #64748b;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.legend-dot.claimed {
    background: #10b981;
}

.legend-dot.selected {
    background: var(--primary-color);
}

.legend-dot.hinted {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

/* Game State */
.bingo-game {
    max-width: 1000px;
    margin: 0 auto;
}

.bingo-round-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
}

.round-counter {
    font-weight: 600;
    color: var(--dark-color);
}

.round-counter span {
    color: var(--primary-color);
}

.timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.timer.urgent {
    color: #ef4444;
    animation: pulse 0.5s infinite;
}

/* Expression Display */
.bingo-expression-area {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.expression-label {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.expression-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
}

/* Game Layout */
.bingo-game-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.bingo-card-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bingo-input-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.target-display {
    text-align: center;
    margin-bottom: 1.5rem;
}

.target-label {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.target-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Bracket Input Area */
.bracket-input-area {
    margin-bottom: 1.5rem;
}

.bracket-slots {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 2px;
    font-size: 1.4rem;
    font-family: 'Courier New', monospace;
    padding: 1rem 0.5rem;
    background: #f8fafc;
    border-radius: 12px;
    min-height: 60px;
    overflow-x: auto;
}

.bracket-slot {
    width: 16px;
    min-width: 16px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.bracket-slot:hover {
    background: #e2e8f0;
    color: var(--primary-color);
}

.bracket-slot.has-bracket {
    color: var(--primary-color);
    font-weight: 700;
}

.expression-number {
    font-weight: 700;
    color: var(--dark-color);
}

.expression-operator {
    color: #64748b;
    padding: 0 4px;
}

.bracket-hint {
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

.input-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.input-actions .btn-secondary {
    padding: 0.75rem 1.5rem;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.input-actions .btn-primary {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.input-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feedback */
.bingo-feedback {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    font-weight: 500;
}

.bingo-feedback.feedback-success {
    background: #d1fae5;
    color: #065f46;
}

.bingo-feedback.feedback-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Progress Bar */
.bingo-progress {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
}

.progress-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.5rem;
    text-align: right;
}

/* Winner/Game Over States */
.bingo-winner,
.bingo-gameover {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.winner-announcement {
    position: relative;
    padding: 2rem;
}

.winner-announcement h1 {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.winner-announcement p {
    font-size: 1.2rem;
    color: #64748b;
}

.bingo-card-final {
    margin: 2rem auto;
}

.winner-stats,
.gameover-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
}

/* Confetti */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Winner Crown */
.winner-crown {
    margin-bottom: 1rem;
}

.winner-crown svg {
    width: 64px;
    height: 64px;
}

.winner-crown.position-1 {
    color: #ffd700;
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.5));
    animation: crown-glow 2s ease-in-out infinite;
}

.winner-crown.position-2 {
    color: #c0c0c0;
    filter: drop-shadow(0 4px 8px rgba(192, 192, 192, 0.4));
}

.winner-crown.position-3 {
    color: #cd7f32;
    filter: drop-shadow(0 4px 8px rgba(205, 127, 50, 0.4));
}

@keyframes crown-glow {
    0%, 100% {
        filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.5));
    }
    50% {
        filter: drop-shadow(0 4px 20px rgba(255, 215, 0, 0.8));
    }
}

.winner-position {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.winner-crown.position-1 + h1 + .winner-position {
    color: #ffd700;
}

.winner-crown.position-2 + h1 + .winner-position {
    color: #a8a8a8;
}

.winner-crown.position-3 + h1 + .winner-position {
    color: #cd7f32;
}

/* Leaderboard */
.bingo-leaderboard {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.bingo-leaderboard-final {
    max-width: 400px;
    margin: 2rem auto;
}

.leaderboard-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: #334155;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f5f9;
}

.leaderboard-title svg {
    color: #ffd700;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: #f8fafc;
    transition: transform 0.2s ease;
}

.leaderboard-entry.is-me {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid var(--primary-color);
}

.leaderboard-entry.position-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 193, 7, 0.1) 100%);
}

.leaderboard-entry.position-1.is-me {
    border-color: #ffd700;
}

.leaderboard-entry.position-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15) 0%, rgba(176, 176, 176, 0.1) 100%);
}

.leaderboard-entry.position-2.is-me {
    border-color: #c0c0c0;
}

.leaderboard-entry.position-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15) 0%, rgba(184, 115, 51, 0.1) 100%);
}

.leaderboard-entry.position-3.is-me {
    border-color: #cd7f32;
}

.leaderboard-position {
    font-size: 1.25rem;
    font-weight: 700;
    width: 2rem;
    text-align: center;
}

.leaderboard-entry.position-1 .leaderboard-position {
    color: #ffd700;
}

.leaderboard-entry.position-2 .leaderboard-position {
    color: #a8a8a8;
}

.leaderboard-entry.position-3 .leaderboard-position {
    color: #cd7f32;
}

.leaderboard-crown {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.leaderboard-crown.position-1 {
    color: #ffd700;
}

.leaderboard-crown.position-2 {
    color: #c0c0c0;
}

.leaderboard-crown.position-3 {
    color: #cd7f32;
}

.leaderboard-name {
    flex: 1;
    font-weight: 600;
    color: #334155;
}

.leaderboard-pattern {
    font-size: 0.85rem;
    color: #64748b;
}

.leaderboard-empty {
    text-align: center;
    color: #94a3b8;
    padding: 1rem;
}

/* In-game leaderboard positioning */
#game-state .bingo-leaderboard {
    max-width: 350px;
    margin: 1.5rem auto 0;
}

/* Teacher Styles */
.bingo-teacher-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 0;
    color: white;
}

.bingo-teacher-header h1 {
    font-size: 2rem;
    margin-top: 0.5rem;
}

.bingo-teacher-header .back-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
}

.bingo-teacher-header .back-link:hover {
    color: white;
}

.bingo-teacher-lobby {
    max-width: 700px;
    margin: 0 auto;
}


/* Game Header */
.bingo-game-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    color: white;
}

.bingo-game-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.game-badge {
    background: #ef4444;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    animation: pulse 2s infinite;
}

.session-code-small {
    font-family: monospace;
    font-size: 0.9rem;
    opacity: 0.8;
}

.round-display {
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-small {
    font-size: 0.85rem;
}

/* Teacher Game Area */
.bingo-teacher-game {
    max-width: 900px;
    margin: 0 auto;
}

.expression-display-large {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.expression-display-large .expression-label {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.expression-display-large .expression-text {
    font-size: 3rem;
    font-weight: 700;
    color: var(--dark-color);
    font-family: 'Courier New', monospace;
}

.possible-results {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.results-label {
    color: #64748b;
}

.results-list {
    color: var(--primary-color);
    font-weight: 600;
}

.btn-toggle-answers {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.4rem 1rem;
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #64748b;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle-answers:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #475569;
}

.round-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.timer-section {
    text-align: center;
}

.timer-ring {
    position: relative;
    width: 100px;
    height: 100px;
}

.timer-ring svg {
    transform: rotate(-90deg);
}

.timer-ring .timer-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 8;
}

.timer-ring .timer-progress {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.timer-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.timer-number.urgent {
    color: #ef4444;
}

.players-status-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.players-status-section h3 {
    font-size: 1rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.players-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.player-status-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.player-status-card.winner {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #10b981;
}

.player-status-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.player-status-score .score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.player-status-score .score-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
}

.player-progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 0.5rem 0;
    overflow: hidden;
}

.player-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
}

.player-progress-text {
    font-size: 0.75rem;
    color: #64748b;
}

/* Lobby Actions */
.lobby-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.lobby-actions .btn-large {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   Universal Fullscreen Display
   ============================================ */

/* Base fullscreen display - use for all activities */
.fullscreen-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

/* Animated particles background */
.fullscreen-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Particles container - add via JS */
.fullscreen-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.fullscreen-particle {
    position: absolute;
    top: 0;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: particle-fall linear infinite;
}

.fullscreen-particle:nth-child(odd) {
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
}

.fullscreen-particle:nth-child(3n) {
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
}

@keyframes particle-fall {
    0% {
        transform: translateY(-10px) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(20px);
        opacity: 0;
    }
}

/* Floating dots variation */
.fullscreen-display.dots-bg .fullscreen-particle {
    animation: particle-float ease-in-out infinite;
}

@keyframes particle-float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-30px) translateX(10px);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-20px) translateX(-10px);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-40px) translateX(5px);
        opacity: 0.5;
    }
}

/* Falling names container (right side) - for group activities */
.fullscreen-falling-names {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.falling-name {
    position: absolute;
    right: 20px;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    animation: name-fall 3s ease-in-out forwards;
    opacity: 0;
}

@keyframes name-fall {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(20vh);
        opacity: 0;
    }
}

/* Bingo-specific fullscreen display */
.bingo-fullscreen-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.fullscreen-close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.fullscreen-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.fullscreen-content {
    text-align: center;
    max-width: 900px;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.fullscreen-header h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.fullscreen-header p {
    font-size: 1.5rem;
    opacity: 0.9;
}

.fullscreen-code-section {
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    backdrop-filter: blur(10px);
}

.fullscreen-instruction {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.fullscreen-instruction strong {
    font-weight: 700;
}

.fullscreen-code-label {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.fullscreen-code {
    font-size: 6rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    font-family: monospace;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.fullscreen-players-section {
    margin-top: 3rem;
}

.fullscreen-players-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.fullscreen-players-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.fullscreen-player-join {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fullscreen-player-join.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

@keyframes player-pop-in {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Winner Announcement (Teacher) */
.bingo-winner-announcement {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.winner-celebration {
    position: relative;
    padding: 3rem;
}

.winner-celebration h1 {
    font-size: 5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.winner-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.winner-pattern {
    font-size: 1.2rem;
    color: #64748b;
}

.final-leaderboard {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.final-leaderboard h3 {
    font-size: 1rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.leaderboard-list {
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item.winner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 8px;
}

.leaderboard-rank {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.leaderboard-item.winner .leaderboard-rank {
    background: #fbbf24;
    color: white;
}

.leaderboard-name {
    flex: 1;
    font-weight: 500;
}

.leaderboard-score {
    color: #64748b;
    font-size: 0.9rem;
}

.bingo-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.winner-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Error State */
.bingo-error {
    text-align: center;
    padding: 3rem;
}

.bingo-error svg {
    color: #ef4444;
    margin-bottom: 1rem;
}

.bingo-error h2 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.bingo-error p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* Loading */
.loading-center {
    text-align: center;
    padding: 4rem;
}

.loading-center .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* ============================================
   Bracket Bingo - Practice Mode Styles
   ============================================ */

.bingo-practice-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
}

.bingo-practice-header .header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.bingo-practice-header .back-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.bingo-practice-header .back-link:hover {
    color: white;
}

.bingo-practice-header .set-for-class-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.bingo-practice-header .set-for-class-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bingo-practice-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.bingo-practice-header p {
    opacity: 0.9;
    font-size: 1rem;
}

.practice-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hint-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.hint-indicator {
    width: 16px;
    height: 16px;
    background: rgba(102, 126, 234, 0.15);
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.practice-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.btn-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #667eea;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-hint:hover {
    background: #f0f4ff;
    border-color: #667eea;
}

.btn-skip {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-skip:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.solution-btn-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

.practice-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: help;
    position: relative;
}

.practice-info-icon:hover {
    color: #667eea;
}

.practice-info-icon::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    max-width: 250px;
    white-space: normal;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
    pointer-events: none;
}

.practice-info-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
}

.practice-info-icon:hover::after,
.practice-info-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

.bingo-feedback.feedback-info {
    background: #e8f4fc;
    color: #1565c0;
    border-color: #90caf9;
}

/* Winning cells animation */
.bingo-cell.winning {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    animation: winning-pulse 1s ease-in-out infinite;
}

@keyframes winning-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px 5px rgba(102, 126, 234, 0.3);
    }
}

.expression-complete {
    color: #667eea;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Bingo Guided Hints */
.bingo-guide-hint {
    padding: 0.6rem 1rem;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 10px;
    color: #b45309;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: center;
    position: relative;
    margin-bottom: 0.75rem;
    animation: bingoHintFadeIn 0.4s ease;
}

.bingo-guide-hint p {
    margin: 0;
}

.bingo-guide-hint strong {
    color: #92400e;
}

.bingo-guide-arrow {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(251, 191, 36, 0.25);
    animation: bingoArrowBounce 1s ease-in-out infinite;
}

@keyframes bingoHintFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bingoArrowBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(4px); }
}

/* Slot hint arrows (phase 1 — point at bracket gaps) */
.bracket-slot.slot-hint {
    position: relative;
}

.bracket-slot.slot-hint::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #b45309;
    animation: bingoSlotBounce 1s ease-in-out infinite;
}

@keyframes bingoSlotBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(3px); }
}

/* Bingo Responsive */
@media (max-width: 768px) {
    .bingo-game-layout {
        grid-template-columns: 1fr;
    }

    .bingo-card {
        max-width: 300px;
    }

    .bingo-cell {
        font-size: 0.9rem;
    }

    .expression-display {
        font-size: 1.5rem;
    }

    .expression-display-large .expression-text {
        font-size: 2rem;
    }

    .bracket-slots {
        font-size: 1.2rem;
    }

    .winner-celebration h1 {
        font-size: 3rem;
    }

    .bingo-student-header .container {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 500px) {
    .bingo-card {
        max-width: 280px;
        gap: 4px;
        padding: 6px;
    }

    .bingo-cell {
        font-size: 0.8rem;
        border-radius: 6px;
    }

    .target-number {
        font-size: 2rem;
    }

    .bracket-slots {
        font-size: 1rem;
        padding: 0.75rem;
    }

    .input-actions {
        flex-direction: column;
    }

    .input-actions button {
        width: 100%;
    }

    .players-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .winner-actions {
        flex-direction: column;
    }

    .winner-actions a,
    .winner-actions button {
        width: 100%;
    }
}

