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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Start Screen */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.start-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.start-content {
    text-align: center;
    padding: 2rem;
    animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 300;
    color: #fff;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    text-shadow: 0 0 40px rgba(100, 200, 255, 0.5);
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 40px rgba(100, 200, 255, 0.5); }
    50% { text-shadow: 0 0 60px rgba(100, 200, 255, 0.8), 0 0 80px rgba(150, 100, 255, 0.4); }
}

.game-subtitle {
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 3rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.ripple-demo {
    width: 100px;
    height: 100px;
    margin: 0 auto 3rem;
    position: relative;
}

.ripple-demo::before,
.ripple-demo::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(100, 200, 255, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: demoRipple 2s ease-out infinite;
}

.ripple-demo::after {
    animation-delay: 1s;
    background: rgba(200, 100, 255, 0.4);
}

@keyframes demoRipple {
    0% {
        width: 20px;
        height: 20px;
        opacity: 1;
    }
    100% {
        width: 100px;
        height: 100px;
        opacity: 0;
    }
}

.start-button {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.4s ease;
    margin-bottom: 1.5rem;
}

.start-button:hover,
.start-button:active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(100, 200, 255, 0.6);
    box-shadow: 0 0 30px rgba(100, 200, 255, 0.3);
    transform: scale(1.05);
}

.hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* Canvas */
#game-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    cursor: crosshair;
}

/* UI Overlay */
.ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.5s ease;
}

.ui-overlay.hidden {
    opacity: 0;
}

.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.icon-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.icon-btn:hover,
.icon-btn:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.icon-btn.active {
    background: rgba(100, 200, 255, 0.3);
    border-color: rgba(100, 200, 255, 0.5);
}

.color-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7);
    background-size: 300% 300%;
    animation: colorShift 5s ease infinite;
}

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

.bottom-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    pointer-events: none;
    animation: fadeInOut 3s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .game-title {
        letter-spacing: 0.1em;
    }
    
    .start-button {
        padding: 0.9rem 2.5rem;
        font-size: 1rem;
    }
    
    .top-bar {
        padding: 0.75rem;
    }
    
    .icon-btn {
        width: 40px;
        height: 40px;
    }
}