/**
 * Custom CSS for Boxing Day 2026 Display
 * 10-foot interface optimized for TV viewing
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    cursor: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    background: #ebeaff;
}

/* Loading Spinner */
.spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border: 8px solid rgba(0, 191, 99, 0.2);
    border-top-color: #00bf63;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Fade Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Slide Animations */
.slide-in-bottom {
    animation: slideInBottom 0.5s ease-out forwards;
}

.slide-out-right {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Glow Effect */
.glow {
    animation: glow 1s ease-in-out;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 0 rgba(0, 191, 99, 0);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 191, 99, 0.8);
    }
    100% {
        box-shadow: 0 0 0 rgba(0, 191, 99, 0);
    }
}

/* Bounce Animation */
.bounce {
    animation: bounce 0.5s ease-in-out;
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Flash Animation */
.flash {
    animation: flash 0.3s ease-in-out;
}

@keyframes flash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
        background-color: white;
    }
}

/* Text Shadow for Readability */
.text-shadow-strong {
    text-shadow: 4px 4px 0 #003300;
}

.text-shadow-soft {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Safe Zone Margins */
.safe-zone {
    padding: 8vh 10vw;
}

/* Module Transitions */
.module-transition {
    transition: all 0.5s ease-in-out;
}

/* Leaderboard Bar Styles */
.leaderboard-bar {
    height: 60px;
    border-radius: 8px;
    transition: width 0.5s ease-out, background-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.leaderboard-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Timer Progress Bar */
.timer-progress {
    height: 40px;
    border-radius: 20px;
    transition: width 1s linear, background-color 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Jeopardy Grid */
.jeopardy-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 1600px;
}

.jeopardy-cell {
    aspect-ratio: 1.5 / 1;
    background: linear-gradient(135deg, #2a3698 0%, #1a2578 100%);
    border: 3px solid #ffcc00;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jeopardy-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.6);
}

.jeopardy-cell.answered {
    opacity: 0.3;
    cursor: not-allowed;
}

.jeopardy-category {
    background: linear-gradient(135deg, #1a2578 0%, #0a1558 100%);
    font-weight: bold;
    text-transform: uppercase;
}

/* Counter Display */
.counter-display {
    font-size: 20vw;
    font-weight: bold;
    line-height: 1;
    text-align: center;
}

/* Timer Display */
.timer-display {
    font-size: 15vw;
    font-weight: bold;
    line-height: 1;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Game Card Logo */
.game-logo {
    max-width: 600px;
    max-height: 400px;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

/* Welcome Logo */
.welcome-logo {
    width: 400px;
    height: 400px;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

/* Rules List */
.rules-list {
    list-style: none;
    padding: 0;
}

.rules-list li {
    position: relative;
    padding-left: 60px;
    margin-bottom: 40px;
    font-size: 48px;
    line-height: 1.4;
}

.rules-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 32px;
    height: 32px;
    background: #00bf63;
    border-radius: 50%;
}

/* Connection Status */
#connection-status {
    transition: all 0.3s ease;
}

#connection-status.connected {
    background: #00bf63;
    color: white;
}

#connection-status.disconnected {
    background: #ff3131;
    color: white;
}

#connection-status.connecting {
    background: #ffcc00;
    color: #1a1a1a;
}

/* Responsive Adjustments */
@media (max-width: 1920px) {
    .counter-display {
        font-size: 18vw;
    }
    
    .timer-display {
        font-size: 13vw;
    }
}

/* Motion Reduction */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    body {
        background: #000000;
        color: #ffffff;
    }
    
    .leaderboard-bar {
        border: 2px solid #ffffff;
    }
    
    .jeopardy-cell {
        border-width: 4px;
    }
}

/* Print Styles (for debugging) */
@media print {
    body {
        cursor: auto;
    }
    
    #connection-status {
        display: none;
    }
}