/* Pixel-art game styling */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.pixel-text {
    font-family: 'Press Start 2P', cursive;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.game-container {
    width: 90%;
    max-width: 800px;
    background: #2a2a2a;
    border: 8px solid #000;
    box-shadow: 0 0 0 4px #fff, 0 0 0 8px #000, 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 0;
    overflow: hidden;
}

.game-header {
    background: linear-gradient(180deg, #ff6b6b 0%, #ee5a6f 100%);
    padding: 20px;
    border-bottom: 4px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-title {
    color: #fff;
    font-size: 24px;
    letter-spacing: 4px;
}

.score-display {
    background: #000;
    padding: 10px 15px;
    border: 3px solid #fff;
}

.score-label {
    color: #ffd700;
    font-size: 12px;
}

.score-value {
    color: #fff;
    font-size: 16px;
    margin-left: 10px;
}

.timer-value {
    color: #4ade80;
    font-size: 16px;
    margin-left: 10px;
    transition: color 0.3s;
}

.timer-value.low {
    color: #fbbf24;
}

.timer-value.critical {
    color: #ef4444;
    animation: timer-pulse 0.5s infinite;
}

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

.screen {
    display: none;
    padding: 40px 20px;
    min-height: 400px;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Start Screen */
.start-content {
    text-align: center;
    color: #fff;
}

.start-content h2 {
    font-size: 20px;
    margin-bottom: 30px;
    color: #ffd700;
}

.start-content p {
    font-size: 12px;
    margin-bottom: 40px;
    line-height: 1.8;
}

/* Buttons */
.pixel-button {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    padding: 15px 30px;
    background: linear-gradient(180deg, #4ecdc4 0%, #44a39d 100%);
    color: #fff;
    border: 4px solid #000;
    cursor: pointer;
    position: relative;
    transition: all 0.1s;
    box-shadow: 4px 4px 0 #000;
}

.pixel-button:hover {
    background: linear-gradient(180deg, #5eede4 0%, #54b3ad 100%);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

.pixel-button:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

/* Game Screen */
.question-container {
    width: 100%;
    color: #fff;
}

.fact-display {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid #ffd700;
}

.category-badge {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #000;
    font-size: 12px;
    color: #fff;
    margin-bottom: 15px;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

.fact-image {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: none;
}

.fact-image.visible {
    display: block;
}

.fact-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.question-text {
    text-align: center;
    margin-bottom: 30px;
}

.question-text p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.options-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.option-card {
    background: linear-gradient(180deg, #f093fb 0%, #f5576c 100%);
    border: 4px solid #000;
    padding: 20px;
    cursor: pointer;
    text-align: center;
    transition: all 0.1s;
    box-shadow: 4px 4px 0 #000;
}

.option-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

.option-card:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.option-card.correct {
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
    animation: correct-flash 0.5s;
}

.option-card.incorrect {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    animation: incorrect-shake 0.5s;
}

@keyframes correct-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes incorrect-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.option-image {
    width: 64px;
    height: 64px;
    margin: 0 auto 10px;
    background: #fff;
    border: 2px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.option-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.option-name {
    font-size: 12px;
    color: #fff;
}

.option-value {
    font-size: 10px;
    color: #fff;
    margin-top: 10px;
    opacity: 0;
}

.option-card.revealed .option-value {
    opacity: 1;
}

/* Result Screen */
.result-content {
    text-align: center;
    color: #fff;
}

.result-content h2 {
    font-size: 24px;
    margin-bottom: 30px;
}

.result-content h2.correct {
    color: #4ade80;
}

.result-content h2.incorrect {
    color: #ef4444;
}

.result-content p {
    font-size: 12px;
    margin-bottom: 40px;
    line-height: 1.8;
}

/* Loading Screen */
.loading-content {
    text-align: center;
    color: #fff;
}

.loading-content p {
    font-size: 16px;
    animation: pulse 1.5s infinite;
}

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

/* Ready Overlay */
.ready-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 48px;
    color: #ffd700;
    z-index: 1000;
    animation: ready-fade-in 0.2s;
}

.ready-overlay.active {
    display: flex;
}

@keyframes ready-fade-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 600px) {
    .game-title {
        font-size: 16px;
        letter-spacing: 2px;
    }
    
    .score-label,
    .score-value,
    .timer-value {
        font-size: 10px;
    }
    
    .start-content h2 {
        font-size: 14px;
    }
    
    .start-content p {
        font-size: 10px;
    }
    
    .pixel-button {
        font-size: 10px;
        padding: 10px 20px;
    }
    
    .question-text p {
        font-size: 11px;
    }
    
    .pick-name {
        font-size: 12px;
    }
    
    .option-name {
        font-size: 10px;
    }
    
    .options-container {
        grid-template-columns: 1fr;
    }

    .ready-overlay {
        font-size: 32px;
    }
}
