/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Game container */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
}

.game-title {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    margin-bottom: 20px;
}

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

.game-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}

.stat-label {
    font-size: 0.9rem;
    color: #00ffff;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

/* Main game area */
.game-main {
    flex: 1;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.canvas-container {
    position: relative;
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
}

#gameCanvas {
    width: 100%;
    height: auto;
    max-width: 800px;
    border: 3px solid #00ffff;
    border-radius: 15px;
    background: linear-gradient(135deg, #000814 0%, #001d3d 100%);
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.5),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
    display: block;
}

/* Game overlay */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    max-width: 500px;
}

#overlayTitle {
    font-size: 2.5rem;
    font-weight: 900;
    color: #00ffff;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

#overlayMessage {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 30px;
    line-height: 1.6;
}

.overlay-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button styles */
.game-btn {
    padding: 15px 30px;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.game-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.game-btn:hover::before {
    left: 100%;
}

.game-btn.primary {
    background: linear-gradient(45deg, #00ffff, #0080ff);
    color: #000;
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.4);
}

.game-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 255, 0.6);
}

.game-btn.secondary {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: #fff;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.game-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

/* Controls and info */
.controls-info {
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.control-section, .game-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
}

.control-section h3, .game-info h3 {
    color: #00ffff;
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.control-key {
    background: rgba(0, 255, 255, 0.2);
    color: #00ffff;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 700;
}

.control-desc {
    color: #ffffff;
    font-size: 0.9rem;
}

.game-info ul {
    list-style: none;
}

.game-info li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    color: #ffffff;
    line-height: 1.5;
}

.game-info li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: #00ffff;
    font-size: 0.8rem;
}

/* Footer */
.game-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 1024px) {
    .game-main {
        flex-direction: column;
        align-items: center;
    }
    
    .controls-info {
        min-width: auto;
        width: 100%;
        max-width: 800px;
        flex-direction: row;
        gap: 20px;
    }
    
    .control-section, .game-info {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }
    
    .game-title {
        font-size: 2.2rem;
    }
    
    .game-stats {
        gap: 20px;
    }
    
    .stat-item {
        padding: 12px 20px;
    }
    
    .controls-info {
        flex-direction: column;
        gap: 20px;
    }
    
    #overlayTitle {
        font-size: 2rem;
    }
    
    .overlay-content {
        padding: 30px 20px;
    }
    
    .overlay-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .game-btn {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .game-stats {
        gap: 15px;
    }
    
    .stat-item {
        padding: 10px 15px;
        min-width: 80px;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .control-section, .game-info {
        padding: 20px;
    }
    
    #overlayTitle {
        font-size: 1.6rem;
    }
    
    #overlayMessage {
        font-size: 1rem;
    }
    
    .game-btn {
        padding: 12px 25px;
        font-size: 0.9rem;
        width: 180px;
    }
}

/* Canvas responsive adjustments */
@media (max-width: 800px) {
    #gameCanvas {
        max-width: 100%;
        height: auto;
    }
}

/* Landscape mobile optimization */
@media (max-height: 600px) and (orientation: landscape) {
    .game-header {
        margin-bottom: 15px;
        padding: 10px 0;
    }
    
    .game-title {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .game-main {
        gap: 20px;
    }
    
    .controls-info {
        display: none;
    }
}

/* Mobile touch enhancements */
@media (hover: none) and (pointer: coarse) {
    .game-btn:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 255, 255, 0.4);
    }
    
    .game-btn:active {
        transform: scale(0.95);
    }
    
    .stat-item:hover {
        transform: none;
        background: rgba(0, 255, 255, 0.1);
    }
    
    #gameCanvas {
        touch-action: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* Prevent zoom on double tap */
* {
    touch-action: manipulation;
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #gameCanvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

