/* Game-specific styles */

.game-section {
    background-color: #f8f9fa;
}

.game-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Game Info Boxes */
.game-info {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.info-box {
    padding: 10px;
    font-size: 0.95rem;
}

.info-box i {
    color: var(--christmas-red);
}

.info-box strong {
    color: var(--christmas-green);
}

/* Canvas Wrapper */
.canvas-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    background-color: #87CEEB;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    border: 5px solid var(--christmas-red);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Game Overlays */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 70, 102, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 15px;
    max-width: 90%;
    max-height: 95%;
    overflow-y: auto;
}

.overlay-content h2 {
    color: var(--christmas-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.instructions p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.instructions strong {
    color: var(--christmas-gold);
    font-family: 'Courier New', monospace;
}

/* Score Display */
.score-display {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
}

.final-score h3 {
    color: var(--christmas-gold);
    font-size: 2rem;
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
}

.stats p {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.stats i {
    color: var(--christmas-gold);
}

/* Charity Message */
.charity-message {
    border: 2px solid var(--christmas-gold);
}

.charity-message strong {
    color: var(--christmas-gold);
}

/* Button Group in Game Over */
.button-group-game {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.button-group-game button,
.button-group-game a {
    min-width: 200px;
}

/* HUD Overlay */
#hudOverlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 5;
    pointer-events: none;
}

.hud-item {
    display: inline-block;
    background-color: rgba(26, 70, 102, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    margin-right: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--christmas-gold);
}

.hud-item i {
    color: var(--christmas-gold);
}

.hud-score {
    float: left;
}

.hud-distance {
    float: right;
}

/* Controls Info */
.controls-info {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.controls-info strong {
    color: var(--christmas-red);
    font-family: 'Courier New', monospace;
}

/* 8-bit Retro Font Styling */
@font-face {
    font-family: 'RetroPixel';
    src: local('Courier New'), local('Courier');
    font-weight: bold;
}

/* Pixel-perfect rendering hint */
canvas {
    image-rendering: optimizeSpeed;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .canvas-wrapper {
        border-width: 3px;
    }

    .game-info .row {
        flex-direction: column;
    }

    .info-box {
        font-size: 0.85rem;
        padding: 8px;
    }

    .overlay-content {
        padding: 10px;
    }

    .overlay-content h2 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .instructions p {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }

    .final-score h3 {
        font-size: 1.5rem;
    }

    .stats p {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    .score-display {
        padding: 10px;
        margin-bottom: 0.75rem;
    }

    .charity-message {
        padding: 8px !important;
        margin-bottom: 0.75rem !important;
        font-size: 0.9rem;
    }

    .hud-item {
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    .button-group-game {
        flex-direction: column;
    }

    .button-group-game button,
    .button-group-game a {
        min-width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 576px) {
    .overlay-content {
        padding: 8px;
    }

    .overlay-content h2 {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }

    .instructions p {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }

    .final-score h3 {
        font-size: 1.3rem;
    }

    .stats p {
        font-size: 0.8rem;
        margin-bottom: 0.15rem;
    }

    .score-display {
        padding: 8px;
        margin-bottom: 0.5rem;
    }

    .charity-message {
        padding: 6px !important;
        margin-bottom: 0.5rem !important;
        font-size: 0.8rem;
    }

    .charity-message p {
        margin-bottom: 0.2rem !important;
    }

    .hud-item {
        font-size: 0.8rem;
        padding: 5px 10px;
        margin-right: 5px;
    }

    .button-group-game {
        gap: 8px;
    }
}

/* Animation for start button */
#startButton {
    animation: pulse 2s infinite;
}

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

/* Hover effects */
#playAgainButton:hover,
#startButton:hover {
    transform: scale(1.1) !important;
}
