/* Game-specific styles */
.instructions {
    color: #0f0;
    margin-bottom: 15px;
    font-size: 10px;
    line-height: 1.8;
    background: rgba(0, 255, 0, 0.1);
    padding: 10px;
    border: 2px solid #0f0;
    text-shadow: 0 0 5px #0f0;
}

/* New game messages */
.combo-message {
    font-size: 20px;
    color: #0ff;
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 255, 255, 0.3);
    border: 3px solid #0ff;
    text-shadow: 0 0 15px #0ff;
    animation: pulse 0.3s ease-in-out, glow 0.5s ease-in-out infinite;
}

.powerup-message {
    font-size: 18px;
    color: #0ff;
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 255, 255, 0.3);
    border: 3px solid #0ff;
    text-shadow: 0 0 15px #0ff;
    animation: scaleIn 0.3s ease-out;
}

.milestone-message {
    font-size: 22px;
    color: #0f0;
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 255, 0, 0.3);
    border: 3px solid #0f0;
    text-shadow: 0 0 15px #0f0;
    animation: scaleIn 0.3s ease-out, glow 1s ease-in-out infinite;
}

.shield-broken-message {
    font-size: 16px;
    color: #fa0;
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 170, 0, 0.2);
    border: 3px solid #fa0;
    text-shadow: 0 0 10px #fa0;
    animation: shake 0.3s ease-in-out;
}

.floating-text {
    font-size: 14px;
    font-weight: bold;
    animation: floatUp 0.5s ease-out;
    margin: 5px 0;
}

/* Stat variations */
.stat.combo-active {
    color: #0ff;
    border-color: #0ff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    animation: pulse 0.5s ease-in-out infinite;
}

.stat.combo-high {
    color: #f0f;
    border-color: #f0f;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.9);
    animation: pulse 0.3s ease-in-out infinite, glow 0.5s ease-in-out infinite;
}

.stat.shield-active {
    color: #0ff;
    border-color: #0ff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    text-shadow: 0 0 10px #0ff;
}

/* Animations */
@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes floatUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-30px);
        opacity: 0;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

#gameCanvas {
    border: 4px solid #ff00ff;
    background: #000;
    display: block;
    margin: 0 auto;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.5),
                inset 0 0 30px rgba(0, 255, 255, 0.2);
    max-width: 100%;
    image-rendering: pixelated;
}

.controls {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    font-size: 12px;
    gap: 10px;
    flex-wrap: wrap;
}

.stat {
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.8);
    color: #0ff;
    border: 2px solid #0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5),
                inset 0 0 10px rgba(0, 255, 255, 0.2);
    min-width: 140px;
    text-shadow: 0 0 5px #0ff;
}

.stat.warning {
    color: #ff0;
    border-color: #ff0;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
    animation: pulse 0.5s infinite;
}

.stat.danger {
    color: #f00;
    border-color: #f00;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    animation: pulse 0.3s infinite;
}

.difficulty {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 0, 255, 0.1);
    border: 2px solid #ff00ff;
}

.difficulty label {
    margin-right: 10px;
    color: #ff00ff;
    font-size: 10px;
    text-shadow: 0 0 5px #ff00ff;
}

.difficulty select {
    padding: 8px;
    font-size: 10px;
    font-family: 'Press Start 2P', cursive;
    border: 2px solid #ff00ff;
    background: #000;
    color: #ff00ff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}

.game-over {
    font-size: 16px;
    color: #f00;
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 0, 0, 0.2);
    border: 3px solid #f00;
    text-shadow: 0 0 10px #f00;
    animation: pulse 0.5s infinite;
}

.game-success {
    font-size: 16px;
    color: #0f0;
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 255, 0, 0.2);
    border: 3px solid #0f0;
    text-shadow: 0 0 10px #0f0;
    animation: glow 1s ease-in-out infinite;
}

/* Mobile Touch Controls */
.mobile-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    justify-content: space-between;
    gap: 20px;
    z-index: 100;
    pointer-events: none;
}

.control-btn {
    pointer-events: all;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.3);
    border: 3px solid #0ff;
    color: #0ff;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5),
                inset 0 0 20px rgba(0, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.control-btn:active {
    background: rgba(0, 255, 255, 0.6);
    transform: scale(0.9);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8),
                inset 0 0 30px rgba(0, 255, 255, 0.4);
}

.control-btn span {
    text-shadow: 0 0 10px #0ff;
}

.control-mode-info {
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #0f0;
    text-align: center;
}

#controlModeText {
    color: #0f0;
    font-size: 9px;
    text-shadow: 0 0 5px #0f0;
}

/* Mobile Responsiveness for Game */
@media (max-width: 768px) {
    .instructions {
        font-size: 8px;
        padding: 8px;
    }

    .stat {
        font-size: 9px;
        min-width: 110px;
        padding: 8px 12px;
    }

    #gameCanvas {
        max-width: 100%;
        height: auto;
        border-width: 3px;
    }

    .mobile-controls {
        display: flex;
    }

    .controls {
        gap: 10px;
    }

    .difficulty {
        padding: 8px;
    }

    .difficulty select {
        font-size: 8px;
    }

    .control-mode-info {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .control-btn {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .stat {
        font-size: 8px;
        min-width: 90px;
        padding: 6px 10px;
    }

    .instructions {
        font-size: 7px;
    }
}

/* Landscape mode optimizations */
@media (max-height: 600px) and (orientation: landscape) {
    .container {
        padding: 10px;
    }

    #gameCanvas {
        max-height: 400px;
    }

    .mobile-controls {
        bottom: 10px;
    }

    .control-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

/* Additional Mobile-First Game Styles */

/* Small mobile devices (320px and up) */
@media (max-width: 480px) {
    #gameCanvas {
        width: 100%;
        height: 300px;
        max-width: 100%;
    }
    
    .instructions { 
        font-size: 7px; 
        line-height: 1.4;
        padding: 8px;
    }
    
    .stat { 
        font-size: 8px; 
        min-width: 80px;
        padding: 6px 8px;
    }
    
    .controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .difficulty {
        padding: 8px;
    }
    
    .difficulty label {
        font-size: 8px;
    }
    
    .difficulty select {
        font-size: 8px;
        padding: 6px;
    }
    
    .player-input-section {
        padding: 10px;
    }
    
    .player-input-section input {
        font-size: 8px;
        padding: 8px;
        width: 150px;
    }
    
    .player-input-section label {
        font-size: 8px;
    }
}

/* Medium mobile devices (481px and up) */
@media (min-width: 481px) and (max-width: 768px) {
    #gameCanvas {
        width: 100%;
        height: 400px;
        max-width: 100%;
    }
}

/* Tablet and up (769px and up) */
@media (min-width: 769px) {
    #gameCanvas {
        width: 600px;
        height: 700px;
    }
}
