/* Pixel Runner Game Styles */

.game-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #4a5568;
    border-radius: 12px;
    overflow: hidden;
}

.game-wrapper {
    position: relative;
    background: #1a1a2e;
}

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

/* Stats Cards */
.stat-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.score-display {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Game Overlays */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10;
    overflow-y: auto;
    padding: 1rem 0;
}

.overlay-content {
    padding: 1.5rem;
    max-width: 90%;
    background: var(--bs-body-bg);
    border-radius: 12px;
    border: 2px solid var(--bs-border-color);
    color: var(--bs-body-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.overlay-content p {
    color: var(--bs-secondary-color);
}

.overlay-content h2 {
    color: var(--bs-body-color);
}

.game-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--bs-primary);
    letter-spacing: 2px;
}

.game-over-stats .stat-item {
    padding: 0.5rem 1rem;
    background: var(--bs-tertiary-bg);
    border-radius: 8px;
    display: inline-block;
    min-width: 120px;
    margin: 0.25rem;
}

.game-over-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Pulse Animation */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(74, 144, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0);
    }
}

/* Mobile Controls */
.mobile-control-btn {
    border-radius: 12px;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.mobile-control-btn:active {
    transform: scale(0.95);
    background: var(--bs-primary);
    color: white;
}

/* Level Complete */
.level-complete-icon {
    animation: starPulse 0.5s ease-in-out infinite alternate;
}

@keyframes starPulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.2);
    }
}

/* Dark Mode Adjustments */
[data-bs-theme="dark"] .game-card {
    border-color: #4a5568;
}

[data-bs-theme="dark"] .stat-card {
    background: rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 1.5rem;
    }

    .score-display {
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .overlay-content {
        padding: 1rem;
    }

    .game-over-stats .stat-item {
        min-width: 80px;
        padding: 0.4rem 0.6rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
}

/* Keyboard hints */
.form_tool kbd {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: inherit;
    font-size: 0.85em;
    color: var(--bs-body-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 15;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--bs-border-color);
    padding: 6px 10px;
    border-radius: 6px;
}

.fullscreen-btn:hover {
    opacity: 1;
    background: #fff;
}

.fullscreen-btn .fsvg {
    width: 18px;
    height: 18px;
}

/* Fullscreen Mode */
.game-card:fullscreen,
.game-card:-webkit-full-screen {
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.game-card:fullscreen .game-wrapper,
.game-card:-webkit-full-screen .game-wrapper {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
}

.game-card:fullscreen #gameCanvas,
.game-card:-webkit-full-screen #gameCanvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.game-card:fullscreen .fullscreen-btn,
.game-card:-webkit-full-screen .fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
}
