/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Game Header */
.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.title-section h1 {
    color: #ffd700;
    font-size: 3em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-section h1 i {
    color: #ff6b6b;
    animation: float 3s ease-in-out infinite;
}

.subtitle {
    color: #b8c6db;
    font-size: 1.2em;
    margin-bottom: 10px;
}

/* Game Stats */
.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.stat-item i {
    font-size: 1.8em;
    color: #ffd700;
}

.label {
    font-size: 0.9em;
    color: #b8c6db;
    font-weight: 600;
}

.value {
    font-size: 1.6em;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.control-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* Game Wrapper */
.game-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid #ffd700;
}

#gameCanvas {
    display: block;
    background: #000;
    border-radius: 10px;
    touch-action: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Game Logo */
.game-logo {
    margin-bottom: 30px;
}

.game-logo i {
    font-size: 4em;
    color: #ffd700;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

.game-logo h1 {
    color: #ffd700;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Instructions */
.instructions {
    margin-bottom: 30px;
}

.instructions h3 {
    color: #ffd700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.3em;
}

.instruction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.instruction-item i {
    color: #ffd700;
    font-size: 1.3em;
    min-width: 25px;
}

.instruction-item strong {
    color: #fff;
}

/* Game Buttons */
.game-btn {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.game-btn.secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.game-btn.secondary:hover {
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

/* Game Over Screen */
.game-over .game-over-header {
    margin-bottom: 30px;
}

.game-over .game-over-header i {
    font-size: 3em;
    color: #ff6b6b;
    margin-bottom: 15px;
}

.game-over .game-over-header h1 {
    color: #ff6b6b;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.final-stats {
    margin-bottom: 30px;
}

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

.stat-display:last-child {
    border-bottom: none;
}

.stat-display .label {
    color: #b8c6db;
    font-size: 1.1em;
}

.stat-display .value {
    color: #ffd700;
    font-size: 1.3em;
    font-weight: bold;
}

/* Game Controls */
.game-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-section h3 {
    color: #ffd700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
}

.control-options {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.control-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-option i {
    color: #ffd700;
    font-size: 1.2em;
}

/* Mobile Controls */
.mobile-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 200px;
}

.mobile-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5em;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.mobile-btn:hover,
.mobile-btn:active {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* Game Tips */
.game-tips {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-tips h3 {
    color: #ffd700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3em;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tip-item i {
    color: #ffd700;
    font-size: 1.3em;
    min-width: 25px;
}

.tip-item p {
    color: #b8c6db;
    line-height: 1.4;
}

/* Footer */
.game-footer {
    text-align: center;
    color: #b8c6db;
    font-size: 0.9em;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .title-section h1 {
        font-size: 2.2em;
    }
    
    .game-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .game-wrapper {
        padding: 10px;
    }
    
    #gameCanvas {
        max-width: 100%;
        height: auto;
    }
    
    .overlay-content {
        padding: 20px;
        margin: 10px;
    }
    
    .game-logo h1 {
        font-size: 2em;
    }
    
    .instruction-grid {
        grid-template-columns: 1fr;
    }
    
    .control-options {
        flex-direction: column;
        align-items: center;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-controls {
        margin-top: 15px;
    }
    
    .control-grid {
        max-width: 180px;
    }
    
    .mobile-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .title-section h1 {
        font-size: 1.8em;
        flex-direction: column;
        gap: 5px;
    }
    
    .game-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .overlay-content {
        padding: 15px;
    }
    
    .game-btn {
        padding: 12px 20px;
        font-size: 1em;
    }
}