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

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Arial', sans-serif;
    padding: 10px;
    overflow-x: hidden;
}

.game-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 20px;
    max-width: 500px;
    width: 100%;
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 15px;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
}

.stats {
    display: flex;
    justify-content: space-around;
    gap: 5px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.stat {
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    color: #667eea;
    flex: 1;
    min-width: 70px;
    text-align: center;
    font-size: 14px;
}

#gameCanvas {
    display: block;
    margin: 0 auto 15px;
    border: 2px solid #333;
    border-radius: 8px;
    background: linear-gradient(180deg, #87ceeb 0%, #90ee90 100%);
    cursor: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    height: auto;
}

#gameCanvas:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.info {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin-bottom: 15px;
}

.info p {
    margin: 5px 0;
}

.info strong {
    color: #667eea;
    font-weight: bold;
}

#gameMessage {
    font-size: 14px;
    font-weight: bold;
    color: #764ba2;
    animation: pulse 1s infinite;
}

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

/* Mobile Controls */
.mobile-controls {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

/* Show mobile controls on touch devices */
@media (hover: none) and (pointer: coarse) {
    .mobile-controls {
        display: flex !important;
    }
}

.jump-area {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.jump-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: white;
    border: 4px solid #2E7D32;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.jump-button:active {
    transform: scale(0.9);
    background: linear-gradient(135deg, #388E3C, #2E7D32);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.control-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.control-button {
    flex: 1;
    padding: 15px 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.control-button:active {
    transform: scale(0.95);
    background: #5a67d8;
}

.control-button:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.shoot-button {
    background: #e53e3e !important;
}

.shoot-button:active {
    background: #c53030 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 5px;
        align-items: flex-start;
        padding-top: 20px;
        min-height: auto;
    }

    .game-container {
        padding: 15px;
        border-radius: 10px;
        max-width: 100%;
        position: relative;
    }

    h1 {
        font-size: 20px;
    }

    .stats {
        gap: 3px;
    }

    .stat {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 60px;
    }

    #gameCanvas {
        border-radius: 6px;
        border-width: 1px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
        max-height: calc(100vh - 260px);
        width: 100%;
        height: auto;
    }

    .info {
        font-size: 11px;
    }

    .info.mobile-hidden {
        display: none;
    }

    .game-container {
        padding: 15px;
        border-radius: 10px;
        max-width: 100%;
        position: relative;
    }

    .mobile-controls {
        display: flex;
        position: static;
        margin-top: 10px;
        width: 100%;
        background: transparent;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        z-index: 1;
        flex-direction: column;
        gap: 8px;
    }

    .control-row {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: wrap;
        width: 100%;
    }

    .control-button {
        flex: 1 1 48%;
        padding: 10px 8px;
        font-size: 13px;
        min-height: 42px;
        max-width: 48%;
    }

    .info {
        display: none;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }

    h1 {
        font-size: 18px;
    }

    .stat {
        padding: 5px 6px;
        font-size: 11px;
        min-width: 50px;
    }

    .control-button {
        padding: 10px 6px;
        font-size: 12px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .control-button {
        min-height: 44px;
    }

    #gameCanvas {
        touch-action: none;
    }
}

/* Landscape orientation for mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 5px;
    }

    .game-container {
        padding: 10px;
    }

    #gameCanvas {
        max-height: 70vh;
    }

    .mobile-controls {
        margin-top: 10px;
    }

    .control-row {
        flex-direction: row;
    }
}

