/* Star Spark - Global Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0A0E27;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    font-family: 'Outfit', 'Segoe UI', Arial, sans-serif;
    cursor: default;
    user-select: none;
}

#game-container {
    position: relative;
    width: 960px;
    height: 540px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(255, 215, 0, 0.15),
        0 0 80px rgba(155, 89, 182, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: optimizeSpeed;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

/* Loading Screen */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0A0E27 0%, #1A1A4E 50%, #2D1B69 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
}

.loading-title {
    font-size: 48px;
    font-weight: 700;
    color: #FFD700;
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.3);
    margin-bottom: 30px;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    50% { transform: scale(1.03); text-shadow: 0 0 30px rgba(255, 215, 0, 0.7), 0 0 60px rgba(255, 215, 0, 0.3); }
}

.loading-bar-container {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 15px;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FF69B4, #3498DB);
    border-radius: 3px;
    animation: loadProgress 0.8s ease-out forwards;
}

@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.loading-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Prevent text selection during gameplay */
canvas {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none;
}

/* Focus styles for accessibility */
canvas:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}
