/* Bubble Shooter Game - CSS Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#gameContainer {
    position: relative;
    max-width: 900px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Game Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-panel {
    display: flex;
    gap: 30px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-item .label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.score-item span:last-child {
    font-size: 18px;
    color: #fff;
    font-weight: bold;
    margin-top: 2px;
}

.controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 8px 12px;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.control-btn:active {
    transform: translateY(0);
}

/* Game Area */
#gameArea {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 20px;
}

#gameCanvas {
    border-radius: 15px;
    background: linear-gradient(180deg, #1e3c72 0%, #2a5298 100%);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.3);
    cursor: crosshair;
}

/* Game UI Overlays */
#gameUI {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.aim-line {
    position: absolute;
    width: 2px;
    background: rgba(255, 255, 255, 0.6);
    transform-origin: bottom center;
    display: none;
}

.next-bubble {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 10px;
    color: #fff;
    font-size: 12px;
    text-align: center;
    backdrop-filter: blur(5px);
}

#nextBubblePreview {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 5px auto;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.power-ups {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.power-up {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 8px 12px;
    color: #fff;
    font-size: 14px;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    color: #fff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-content h2 {
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.final-stats, .level-stats {
    margin: 20px 0;
}

.final-stats p, .level-stats p {
    font-size: 16px;
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.final-stats span, .level-stats span {
    font-weight: bold;
    color: #FFEB3B;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.game-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-btn.primary {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: #fff;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.game-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.game-btn.primary:hover {
    background: linear-gradient(45deg, #45a049, #4CAF50);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.game-btn:active {
    transform: translateY(0);
}

/* Instructions */
.instructions {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin: 20px;
    color: #fff;
    backdrop-filter: blur(5px);
}

.instructions h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #FFEB3B;
    text-align: center;
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.instructions li:last-child {
    border-bottom: none;
}

.instructions li::before {
    content: "🎯";
    margin-right: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
        overflow-y: auto;
    }
    
    #gameContainer {
        max-width: 100%;
        border-radius: 15px;
    }
    
    .game-header {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .score-panel {
        gap: 20px;
    }
    
    .score-item .label {
        font-size: 10px;
    }
    
    .score-item span:last-child {
        font-size: 16px;
    }
    
    .control-btn {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    #gameArea {
        padding: 15px;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
        max-width: 400px;
        max-height: 500px;
    }
    
    .next-bubble, .power-ups {
        position: static;
        margin: 10px 0;
        display: inline-block;
    }
    
    .power-ups {
        display: flex;
        flex-direction: row;
        gap: 10px;
        justify-content: center;
    }
    
    .modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .modal-content h2 {
        font-size: 24px;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-btn {
        width: 100%;
        padding: 15px;
    }
    
    .instructions {
        margin: 15px;
        padding: 15px;
    }
    
    .instructions h3 {
        font-size: 16px;
    }
    
    .instructions li {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .score-panel {
        gap: 15px;
    }
    
    .controls {
        gap: 5px;
    }
    
    .control-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    #gameCanvas {
        max-width: 350px;
        max-height: 450px;
    }
    
    .modal-content {
        padding: 25px 15px;
    }
    
    .modal-content h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .final-stats p, .level-stats p {
        font-size: 14px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Particle Effects */
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.particle {
    animation: fadeOut 1s ease-out forwards;
}

/* Score Popup Animation */
@keyframes scorePopup {
    0% {
        transform: scale(0.8) translateY(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) translateY(-20px);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(-40px);
        opacity: 0;
    }
}

.score-popup {
    animation: scorePopup 1s ease-out forwards;
}

/* Bubble Glow Effect */
@keyframes bubbleGlow {
    0% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.6); }
    100% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.3); }
}

.bubble-glow {
    animation: bubbleGlow 2s infinite;
}

/* Level Complete Animation */
@keyframes levelComplete {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.level-complete-animation {
    animation: levelComplete 0.5s ease-out;
}

/* Game Over Animation */
@keyframes gameOver {
    0% { transform: translateY(-100px); opacity: 0; }
    50% { transform: translateY(10px); opacity: 1; }
    100% { transform: translateY(0); opacity: 1; }
}

.game-over-animation {
    animation: gameOver 0.7s ease-out;
}

/* Power-up Highlight */
@keyframes powerupHighlight {
    0% { background: rgba(0, 0, 0, 0.5); }
    50% { background: rgba(255, 215, 0, 0.3); }
    100% { background: rgba(0, 0, 0, 0.5); }
}

.power-up.available {
    animation: powerupHighlight 1.5s infinite;
    cursor: pointer;
    pointer-events: all;
}

.power-up.available:hover {
    background: rgba(255, 215, 0, 0.4);
    transform: scale(1.05);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .modal-content {
        border: 3px solid #fff;
    }
    
    .game-btn {
        border: 2px solid #fff;
    }
    
    .control-btn {
        border: 2px solid #fff;
    }
}

/* Focus styles for keyboard navigation */
button:focus {
    outline: 3px solid #FFEB3B;
    outline-offset: 2px;
}

#gameCanvas:focus {
    outline: 3px solid #FFEB3B;
    outline-offset: 5px;
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    #gameContainer {
        box-shadow: none;
        border: 2px solid black;
    }
    
    .modal {
        display: none !important;
    }
}