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

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#header {
    text-align: center;
    color: white;
}

#header h1 {
    font-size: 2.5rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    color: #e94560;
    margin-bottom: 10px;
}

#stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    font-size: 1.2rem;
    color: #f1f1f1;
}

#stats span {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #e94560;
}

#game-area {
    position: relative;
    border: 4px solid #e94560;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.3);
}

#gameCanvas {
    display: block;
    background: #4a4a4a;
    border-radius: 4px;
}

#controls-info {
    color: #aaa;
    font-size: 0.9rem;
    text-align: center;
}

/* Overlay screens */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: linear-gradient(135deg, #1f4068 0%, #162447 100%);
    padding: 40px 60px;
    border-radius: 20px;
    text-align: center;
    color: white;
    border: 3px solid #e94560;
    box-shadow: 0 0 50px rgba(233, 69, 96, 0.4);
    max-width: 500px;
}

.overlay-content h2 {
    font-size: 2.5rem;
    color: #e94560;
    margin-bottom: 10px;
}

.overlay-content h3 {
    font-size: 1.5rem;
    color: #f1f1f1;
    margin-bottom: 20px;
}

.overlay-content p {
    font-size: 1.1rem;
    margin-bottom: 15px;
    line-height: 1.6;
}

.overlay-content ul {
    text-align: left;
    margin: 20px 0;
    padding-left: 30px;
}

.overlay-content li {
    margin: 10px 0;
    color: #ddd;
}

.overlay-content button {
    background: linear-gradient(135deg, #e94560 0%, #c73e54 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.3rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.overlay-content button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.6);
}

/* Bump indicator animation */
@keyframes bumpFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; color: #ff0000; }
}

.bump-flash {
    animation: bumpFlash 0.3s ease-in-out 3;
}

/* Screen shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Bump popup styles */
.bump-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 200;
    transition: transform 0.2s ease-out;
}

.bump-popup.show {
    transform: translate(-50%, -50%) scale(1);
}

.bump-popup.hidden {
    display: none;
}

.bump-popup-content {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    border: 5px solid #fff;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 0 50px rgba(231, 76, 60, 0.8), 0 10px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 350px;
}

.bump-popup-content img {
    width: 280px;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    border: 4px solid #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

#angry-quote {
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    margin-top: 12px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-style: italic;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-10deg); }
    50% { transform: translate(-50%, -50%) scale(1.1) rotate(5deg); }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

.bump-popup.pop-in {
    animation: popIn 0.4s ease-out forwards;
}

@keyframes popOut {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

.bump-popup.pop-out {
    animation: popOut 0.3s ease-in forwards;
}

/* Mobile Controls - Touch anywhere to drive */
body.mobile #controls-info {
    display: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    body.mobile {
        align-items: flex-start;
        padding-top: 5px;
    }

    body.mobile #game-container {
        gap: 3px;
    }

    body.mobile #header {
        padding: 0 5px;
    }

    body.mobile #header h1 {
        font-size: 1.1rem;
        margin-bottom: 3px;
    }

    body.mobile #stats {
        gap: 8px;
        font-size: 0.8rem;
        flex-wrap: wrap;
    }

    body.mobile #stats span {
        padding: 3px 8px;
    }

    body.mobile #game-area {
        border-width: 2px;
    }

    body.mobile .overlay-content {
        padding: 15px 20px;
        margin: 10px;
        max-width: 90%;
    }

    body.mobile .overlay-content h2 {
        font-size: 1.6rem;
    }

    body.mobile .overlay-content h3 {
        font-size: 1.1rem;
    }

    body.mobile .overlay-content p {
        font-size: 0.9rem;
    }

    body.mobile .overlay-content ul {
        padding-left: 15px;
        font-size: 0.85rem;
        margin: 10px 0;
    }

    body.mobile .overlay-content li {
        margin: 5px 0;
    }

    body.mobile .overlay-content button {
        padding: 10px 25px;
        font-size: 1rem;
        margin-top: 10px;
    }

    body.mobile .bump-popup-content {
        max-width: 250px;
        padding: 8px;
    }

    body.mobile .bump-popup-content img {
        width: 180px;
        height: 120px;
    }

    body.mobile #angry-quote {
        font-size: 1rem;
    }
}

/* Landscape mode mobile adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    body.mobile #header {
        display: none;
    }
}

/* Prevent text selection on mobile */
body.mobile * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Fix for iOS rubber-banding */
body.mobile {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Show/hide control instructions based on device */
.mobile-controls-info {
    display: none;
}

body.mobile .mobile-controls-info {
    display: block;
}

body.mobile .desktop-controls {
    display: none;
}
