/* Dye Runner - CSS Styles */

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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ecf0f1;
    min-height: 100vh;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

/* Site Header */
.site-header {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.site-logo {
    font-size: 2.2em;
    font-weight: bold;
    background: linear-gradient(45deg, #4a2c5a, #3d4a7a, #2c3e5a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: logoGlow 3s ease-in-out infinite;
    margin: 0;
    line-height: 1;
}

.logo-subtitle {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Modern Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 107, 107, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -2;
    animation: backgroundShift 15s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { 
        background: 
            radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 40% 40%, rgba(255, 107, 107, 0.2) 0%, transparent 50%),
            linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    33% { 
        background: 
            radial-gradient(circle at 80% 20%, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 40% 40%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 20% 80%, rgba(255, 107, 107, 0.2) 0%, transparent 50%),
            linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    }
    66% { 
        background: 
            radial-gradient(circle at 40% 40%, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 20% 80%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.2) 0%, transparent 50%),
            linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
}

/* Floating Color Orbs */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(102, 126, 234, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 90% 80%, rgba(118, 75, 162, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 30% 70%, rgba(255, 107, 107, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 70% 30%, rgba(102, 126, 234, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 50% 10%, rgba(118, 75, 162, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 20% 50%, rgba(255, 107, 107, 0.1) 2px, transparent 2px);
    background-size: 200px 200px, 300px 300px, 250px 250px, 180px 180px, 220px 220px, 280px 280px;
    z-index: -1;
    animation: floatOrbs 20s linear infinite;
}

@keyframes floatOrbs {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
}

@keyframes logoGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 5px rgba(74, 44, 90, 0.3));
    }
    50% { 
        filter: drop-shadow(0 0 15px rgba(61, 74, 122, 0.5));
    }
}

.score-display {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 1.1em;
    font-weight: bold;
    text-align: right;
}

.score-display span {
    display: flex;
    justify-content: flex-start;
    min-width: 200px;
    gap: 5px;
}


#gameCanvas {
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.9), rgba(52, 73, 94, 0.9));
    box-shadow: 
        0 0 30px rgba(0,0,0,0.3),
        0 0 60px rgba(102, 126, 234, 0.2),
        inset 0 0 20px rgba(118, 75, 162, 0.1);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Level Background Themes */
.level-bg-1 {
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(25, 25, 50, 0.8), rgba(50, 25, 75, 0.8));
}

.level-bg-2 {
    background: 
        radial-gradient(circle at 30% 20%, rgba(0, 255, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(0, 150, 255, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(25, 50, 25, 0.8), rgba(25, 75, 50, 0.8));
}

.level-bg-3 {
    background: 
        radial-gradient(circle at 50% 20%, rgba(255, 255, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(0, 100, 255, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(0, 0, 50, 0.8), rgba(25, 25, 75, 0.8));
}

.level-bg-4 {
    background: 
        radial-gradient(circle at 40% 30%, rgba(0, 200, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 60% 70%, rgba(0, 100, 200, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(0, 25, 50, 0.8), rgba(0, 50, 75, 0.8));
}

.level-bg-5 {
    background: 
        radial-gradient(circle at 25% 25%, rgba(255, 200, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 150, 0, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(75, 50, 25, 0.8), rgba(100, 75, 50, 0.8));
}

.level-bg-6 {
    background: 
        radial-gradient(circle at 30% 40%, rgba(200, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(150, 200, 255, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(50, 75, 100, 0.8), rgba(75, 100, 125, 0.8));
}

.level-bg-7 {
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 100, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 50, 0, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(75, 25, 0, 0.8), rgba(100, 50, 25, 0.8));
}

.level-bg-8 {
    background: 
        radial-gradient(circle at 40% 20%, rgba(255, 0, 200, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 60% 80%, rgba(255, 100, 255, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(75, 0, 50, 0.8), rgba(100, 25, 75, 0.8));
}

.level-bg-9 {
    background: 
        radial-gradient(circle at 25% 30%, rgba(200, 200, 100, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 70%, rgba(150, 150, 75, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(50, 50, 25, 0.8), rgba(75, 75, 50, 0.8));
}

.level-bg-10 {
    background: 
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 20% 20%, rgba(200, 100, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(100, 200, 255, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(25, 0, 50, 0.8), rgba(50, 25, 100, 0.8));
}

#gameCanvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 0%, 
        rgba(102, 126, 234, 0.05) 25%, 
        transparent 50%, 
        rgba(118, 75, 162, 0.05) 75%, 
        transparent 100%);
    animation: canvasShimmer 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes canvasShimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.game-controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    gap: 40px;
}

.instructions {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.instructions h3 {
    color: #f39c12;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.instructions p {
    margin-bottom: 8px;
    line-height: 1.4;
}

.instructions strong {
    color: #4a2c5a;
}

.mobile-instructions {
    color: #f39c12;
    font-style: italic;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #7f8c8d;
}

.game-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn.primary {
    background: linear-gradient(45deg, #4a2c5a, #3d4a7a);
    color: white;
    box-shadow: 0 4px 8px rgba(74, 44, 90, 0.3);
}

.btn.primary:hover:not(:disabled) {
    background: linear-gradient(45deg, #3d4a7a, #2c3e5a);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(61, 74, 122, 0.4);
}

.btn.secondary {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn.secondary:hover:not(:disabled) {
    background: linear-gradient(45deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn.install {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
}

.btn.install:hover:not(:disabled) {
    background: linear-gradient(45deg, #e67e22, #d35400);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(243, 156, 18, 0.4);
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(44, 62, 80, 0.95);
    padding: 40px;
    border-radius: 15px;
    border: 3px solid #4a2c5a;
    text-align: center;
    box-shadow: 0 0 30px rgba(0,0,0,0.7);
    z-index: 1000;
}

.game-over h2 {
    color: #4a2c5a;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.game-over p {
    font-size: 1.3em;
    margin-bottom: 30px;
    color: #f39c12;
}

/* Install App Popup */
.install-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.install-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
}

.install-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #7f8c8d;
}

.install-header h3 {
    color: #f39c12;
    font-size: 1.5em;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(74, 44, 90, 0.3);
}

.install-body {
    padding: 20px;
}

.install-body p {
    font-size: 1.1em;
    margin-bottom: 20px;
    color: #ecf0f1;
}

.install-steps {
    margin-bottom: 25px;
}

.install-steps h4 {
    color: #f39c12;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.install-steps ol {
    margin-left: 20px;
    color: #ecf0f1;
}

.install-steps li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.install-benefits {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
}

.install-benefits h4 {
    color: #667eea;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.install-benefits ul {
    margin-left: 20px;
    color: #ecf0f1;
}

.install-benefits li {
    margin-bottom: 5px;
    line-height: 1.4;
}

.install-footer {
    padding: 20px;
    border-top: 2px solid #7f8c8d;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Color indicators for player state */
.color-indicator {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid #ecf0f1;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    z-index: 50;
}

.color-indicator.red {
    background: #4a2c5a;
}

.color-indicator.yellow {
    background: #f39c12;
}

.color-indicator.blue {
    background: #3498db;
}

.color-indicator.pulse {
    animation: colorPulse 0.5s ease-in-out;
}

@keyframes colorPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Mobile Jump Button */
.mobile-jump-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: rgba(74, 44, 90, 0.8);
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-jump-btn:active {
    transform: scale(0.95);
    background: rgba(74, 44, 90, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.mobile-jump-btn span {
    pointer-events: none;
}

/* Show mobile jump button on mobile devices */
@media (max-width: 768px) {
    .mobile-jump-btn {
        display: flex !important;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .site-logo {
        font-size: 1.8em;
    }
    
    .logo-subtitle {
        font-size: 0.7em;
    }
    
    .game-container {
        padding: 10px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .score-display {
        font-size: 1em;
    }
    
    .score-display span {
        min-width: 150px;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 20px;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
    
    .instructions {
        font-size: 0.9em;
    }
    
    .color-indicator {
        top: 120px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
}

/* Footer */
.site-footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #4a2c5a;
}

.footer-branding {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
}

.footer-branding strong {
    color: #4a2c5a;
    font-weight: bold;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-links {
        justify-content: center;
    }
}
