* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Forum', 'Georgia', serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0d0d0d 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0 40px;
    position: relative;
}

h1 {
    font-size: 4rem;
    font-weight: 800;
    color: #ffd700;
    letter-spacing: 3px;
}

.subtitle {
    font-size: 1.2rem;
    color: #a08520;
    margin-top: 10px;
    font-weight: 300;
    letter-spacing: 2px;
}

/* Game Board */
.game-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 20px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 1px solid rgba(160, 133, 32, 0.2);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

.category-header {
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    padding: 25px 15px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 15px;
    border: 2px solid #a08520;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(160, 133, 32, 0.1);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a08520;
}

.question-cell {
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    padding: 30px 15px;
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    border-radius: 15px;
    border: 1px solid #8b7318;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(139, 115, 24, 0.15), inset 0 0 20px rgba(139, 115, 24, 0.05);
    position: relative;
    overflow: hidden;
    color: #fff;
}

.question-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(160, 133, 32, 0.2), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.question-cell:hover::before {
    left: 100%;
}

.question-cell:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(160, 133, 32, 0.4), 0 0 30px rgba(139, 115, 24, 0.3);
    border-color: #a08520;
}

.question-cell.selected {
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    border-color: #333;
    cursor: default;
    opacity: 0.4;
}

.question-cell.selected:hover {
    transform: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Question Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 30px;
    padding: 60px;
    max-width: 900px;
    width: 90%;
    text-align: center;
    border: 3px solid #a08520;
    box-shadow: 0 0 100px rgba(160, 133, 32, 0.25), 0 0 50px rgba(139, 115, 24, 0.15);
    transform: scale(0.8);
    transition: transform 0.4s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-category {
    font-size: 1.5rem;
    color: #a08520;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.modal-points {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #c9a227, #8b7318);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px;
}

.modal-question {
    font-size: 2.5rem;
    line-height: 1.4;
    margin-bottom: 40px;
    font-weight: 500;
}

.modal-answer {
    font-size: 2rem;
    color: #a08520;
    padding: 30px;
    background: rgba(160, 133, 32, 0.1);
    border-radius: 15px;
    border: 2px solid #a08520;
    margin-top: 30px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.modal-answer.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

.btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, #c9a227, #8b7318);
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(160, 133, 32, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    color: #fff;
    border: 2px solid #a08520;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(160, 133, 32, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 68, 68, 0.4);
}

/* Moderator Controls */
.moderator-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Connection Status */
.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
}

.connection-status.connected {
    background: rgba(160, 133, 32, 0.2);
    color: #a08520;
    border: 2px solid #a08520;
}

.connection-status.disconnected {
    background: rgba(80, 80, 80, 0.2);
    color: #888;
    border: 2px solid #555;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.connected .status-dot {
    background: #a08520;
}

.disconnected .status-dot {
    background: #888;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    h1 {
        font-size: 2.5rem;
    }
    
    .game-board {
        gap: 10px;
    }
    
    .question-cell {
        font-size: 1.8rem;
        padding: 20px 10px;
    }
    
    .category-header {
        font-size: 1rem;
        padding: 15px 10px;
        min-height: 80px;
    }
    
    .modal-content {
        padding: 30px;
    }
    
    .modal-question {
        font-size: 1.8rem;
    }
    
    .modal-points {
        font-size: 3rem;
    }
}

@media (max-width: 600px) {
    .game-board {
        grid-template-columns: repeat(3, 1fr);
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .question-cell {
        font-size: 1.4rem;
        padding: 15px 8px;
    }
}

/* Stars Background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #a08520;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Mode Badge */
.mode-badge {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 100;
}

.mode-badge.viewer {
    background: rgba(184, 134, 11, 0.2);
    color: #b8860b;
    border: 2px solid #b8860b;
}

.mode-badge.moderator {
    background: rgba(160, 133, 32, 0.2);
    color: #a08520;
    border: 2px solid #a08520;
}

/* Gold corner decorations */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #a08520 20%, 
        #c9a227 50%, 
        #a08520 80%, 
        transparent 100%
    );
    pointer-events: none;
    z-index: 1000;
}

/* Elegant Game Board border */
.game-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 20px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}
