@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', 'Arial', sans-serif;
    background: linear-gradient(180deg, #0044AA 0%, #0066CC 50%, #0088EE 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

#game-container {
    position: relative;
    background: #000;
    border-radius: 0;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    border: 4px solid #FFD700;
    max-width: 100vw;
}

#game-canvas-container {
    width: 800px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    position: relative;
    image-rendering: pixelated;
}

#game-canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

#ui {
    position: absolute;
    top: 8px;
    left: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    color: #FFFF00;
    font-weight: bold;
    font-size: 12px;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 2px 2px 0px #000, -1px -1px 0px #000;
    pointer-events: none;
    z-index: 10;
}

#ui > div {
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 2px;
}

#level-display {
    color: #FFFFFF;
}

#score {
    color: #FFD700;
}

#lives {
    color: #FF6666;
    position: absolute;
    right: 12px;
    top: 8px;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0033AA 0%, #0055CC 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 100;
    overflow-y: auto;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #FFD700;
    text-shadow: 3px 3px 0px #AA6600, 4px 4px 0px #000;
    font-family: 'Press Start 2P', monospace;
    letter-spacing: 2px;
}

.screen p {
    font-size: 10px;
    margin: 6px 0;
    font-family: 'Press Start 2P', monospace;
}

.controls {
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 20px;
    border: 2px solid #FFD700;
    margin: 12px 0;
}

.controls p {
    margin: 4px 0;
    font-size: 8px;
    font-family: 'Press Start 2P', monospace;
}

.controls strong {
    color: #FFFF00;
    font-size: 8px;
}

.tip {
    color: #88FF88;
    font-style: normal;
    font-size: 8px !important;
}

.level-count {
    color: #00FFFF;
    font-size: 12px !important;
    font-weight: bold;
    text-shadow: 2px 2px 0px #000;
    margin-bottom: 10px !important;
}

.screen button {
    margin-top: 12px;
    padding: 12px 30px;
    font-size: 12px;
    font-weight: bold;
    font-family: 'Press Start 2P', monospace;
    background: #DD0000;
    color: #FFFFFF;
    border: 4px solid #FFFFFF;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 4px 4px 0px #000;
    text-shadow: 2px 2px 0px #000;
}

.screen button:hover {
    background: #FF2222;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #000;
}

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

#coin-display, #coin-display-shop {
    color: #FFD700;
    font-size: 24px;
    font-weight: bold;
    margin: 15px 0;
    text-shadow: 0 0 10px #FFD700;
}

#shop-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    margin-top: 10px;
}

#music-btn {
    background: linear-gradient(135deg, #00AA00 0%, #008800 100%);
    margin-top: 10px;
    font-size: 10px !important;
    padding: 8px 16px !important;
}

.shop-section-title {
    color: #00FFFF;
    font-size: 14px;
    margin: 10px 0 5px 0;
    text-shadow: 2px 2px 0px #000;
}

#weapons-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    max-width: 750px;
    padding: 5px;
    margin: 5px 0;
}

.weapon-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    transition: all 0.3s;
}

.weapon-card:hover {
    border-color: #00FFFF;
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.weapon-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid #000;
}

.weapon-card h3 {
    font-size: 8px;
    margin: 4px 0;
    color: #FFFFFF;
}

.weapon-desc {
    font-size: 6px !important;
    color: #AAAAAA;
    margin: 2px 0 !important;
}

.weapon-btn {
    padding: 4px 8px !important;
    font-size: 7px !important;
    margin-top: 4px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.weapon-btn.equipped {
    background: linear-gradient(135deg, #00FF00 0%, #00AA00 100%) !important;
}

#skins-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 750px;
    max-height: 150px;
    overflow-y: auto;
    padding: 5px;
    margin: 5px 0;
}

.skin-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    transition: all 0.3s;
}

.skin-card:hover {
    border-color: #00FFFF;
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.skin-card.ultimate {
    grid-column: span 3;
    border: 3px solid #FFD700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.2) 100%);
}

.skin-card.ultimate:hover {
    border-color: #FFD700;
    box-shadow: 0 0 20px #FFD700;
}

.skin-preview {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    border-radius: 50%;
    border: 2px solid #000;
}

#preview-classic {
    background: radial-gradient(circle, #4DA6FF 0%, #0066FF 100%);
}

#preview-speed {
    background: radial-gradient(circle, #FF6B6B 0%, #FF0000 100%);
}

#preview-jumper {
    background: radial-gradient(circle, #FFD93D 0%, #FFA500 100%);
}

#preview-tank {
    background: radial-gradient(circle, #6BCF7F 0%, #228B22 100%);
}

#preview-gunner {
    background: radial-gradient(circle, #A78BFA 0%, #6B46C1 100%);
}

#preview-ultimate {
    background: linear-gradient(45deg, #FF0000, #FFD700, #00FF00, #00FFFF, #0000FF, #FF00FF);
    background-size: 400% 400%;
    animation: ultimateGlow 3s ease infinite;
    box-shadow: 0 0 20px #FFD700;
}

@keyframes ultimateGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.skin-card h3 {
    font-size: 16px;
    margin: 8px 0;
    color: #FFFFFF;
}

.skin-card.ultimate h3 {
    color: #FFD700;
    font-size: 18px;
    text-shadow: 0 0 10px #FFD700;
}

.skin-power {
    font-size: 12px;
    color: #00FFFF;
    margin: 5px 0;
    min-height: 30px;
}

.skin-price {
    font-size: 14px;
    color: #FFD700;
    font-weight: bold;
    margin: 5px 0;
}

.skin-btn {
    padding: 8px 20px !important;
    font-size: 14px !important;
    margin-top: 8px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.skin-btn.owned {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
}

.skin-btn.equipped {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
    cursor: default;
}

.skin-btn:disabled {
    background: #666 !important;
    cursor: not-allowed;
    opacity: 0.5;
}

#back-btn {
    margin-top: 10px;
    background: linear-gradient(135deg, #666 0%, #888 100%);
}

.button-row {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

#menu-btn, #victory-menu-btn {
    background: #0066AA !important;
}

#ball-mode {
    position: absolute;
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
    background: #0066FF;
    color: #FFFF00;
    padding: 4px 12px;
    border: 2px solid #FFFF00;
    font-size: 10px;
    font-family: 'Press Start 2P', monospace;
    animation: ballPulse 0.2s ease infinite;
}

#ball-mode.hidden {
    display: none;
}

@keyframes ballPulse {
    0%, 100% { background: #0066FF; }
    50% { background: #0088FF; }
}

/* Mobile Responsive */
@media (max-width: 840px) {
    #game-container {
        width: 100vw;
        max-width: 100vw;
        border-width: 2px;
    }
    .screen {
        position: relative;
        height: auto;
        min-height: 100%;
        padding: 20px 12px;
    }
    .screen h1 {
        font-size: clamp(14px, 4vw, 24px);
        margin-bottom: 10px;
    }
    .screen p {
        font-size: clamp(7px, 2vw, 10px);
    }
    .level-count {
        font-size: clamp(9px, 2.5vw, 12px) !important;
    }
    .controls {
        padding: 8px 12px;
        margin: 8px 0;
        max-width: 100%;
    }
    .controls p, .controls strong {
        font-size: clamp(6px, 1.8vw, 8px);
    }
    .screen button {
        padding: 10px 20px;
        font-size: clamp(9px, 2.5vw, 12px);
        margin-top: 8px;
    }
    #coin-display, #coin-display-shop {
        font-size: clamp(14px, 4vw, 24px);
        margin: 8px 0;
    }
    .shop-section-title {
        font-size: clamp(10px, 2.5vw, 14px);
    }
    #weapons-container {
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
        gap: 6px;
    }
    .weapon-icon { width: 32px; height: 32px; font-size: 16px; }
    .weapon-card h3 { font-size: 7px; }
    #skins-container {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
        max-height: none;
        gap: 6px;
    }
    .skin-card.ultimate { grid-column: span 2; }
    .skin-preview { width: 44px; height: 44px; }
    .skin-card h3 { font-size: clamp(8px, 2vw, 14px); }
    .skin-card.ultimate h3 { font-size: clamp(10px, 2.5vw, 16px); }
    .skin-power { font-size: clamp(6px, 1.5vw, 10px) !important; }
    .skin-price { font-size: clamp(7px, 1.8vw, 12px) !important; }
    .skin-btn { font-size: clamp(7px, 1.8vw, 12px) !important; }
    .button-row {
        flex-direction: column;
        gap: 8px;
        width: 80%;
    }
    .button-row button { width: 100%; }
    .breadcrumb { padding: 6px 10px; text-align: center; }
    .breadcrumb a { font-size: 7px; }
    #ui { font-size: 9px; }
    #music-btn { font-size: 8px !important; padding: 6px 12px !important; }
}
/* Touch device padding handled by mobile-touch.js */
