* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#app {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#instructions {
    text-align: center;
    color: white;
    z-index: 10;
    transition: opacity 0.3s;
}

#instructions h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

#instructions p {
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

#countdown {
    font-size: 3rem;
    font-weight: bold;
    margin-top: 1rem;
    min-height: 4rem;
}

#touch-indicators {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.touch-point {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid white;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

.touch-point.pulsing {
    animation: touchPointPulse 1.2s ease-in-out infinite;
    transform-origin: center;
}

@keyframes touchPointPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1.0);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
    }
}

.touch-point.dimmed {
    opacity: 0.2;
    transform: translate(-50%, -50%) scale(0.8);
    transition: all 0.5s ease-out;
}

.touch-point.winner {
    border-width: 6px;
    transform: translate(-50%, -50%) scale(3);
    animation: winnerPulse 1s ease-out, winnerGlow 1.5s ease-in-out infinite;
    z-index: 100;
    font-size: 2.5rem;
    font-weight: 900;
    opacity: 1;
    /* Winner keeps their original color but with enhanced glow and gold accent */
    border-color: #ffed4e;
    /* Gold gradient overlay on top of player color */
    background: linear-gradient(135deg, var(--player-bg, #ffd700) 0%, #ffd700 50%, var(--player-bg, #ffd700) 100%);
    filter: brightness(1.2) saturate(1.3);
}

@keyframes winnerPulse {
    0% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(3.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 1;
    }
}

@keyframes winnerGlow {
    0%, 100% {
        box-shadow: 0 0 60px var(--player-bg, #ffd700), 
                    0 0 100px var(--player-bg, #ffd700),
                    0 0 150px rgba(255, 215, 0, 0.6),
                    0 0 200px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 80px var(--player-bg, #ffd700), 
                    0 0 120px var(--player-bg, #ffd700),
                    0 0 180px rgba(255, 215, 0, 0.8),
                    0 0 250px rgba(255, 215, 0, 0.5);
    }
}

#winner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 200;
}

#winner.hidden {
    display: none;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: rippleEffect 0.6s ease-out;
}

@keyframes rippleEffect {
    from {
        width: 0;
        height: 0;
        opacity: 1;
    }
    to {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

.install-button {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #764ba2;
    border: none;
    border-radius: 50px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 201;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    animation: slideUp 0.5s ease-out;
}

.install-button:hover,
.install-button:active {
    background: white;
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.install-button.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.install-modal {
    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: 300;
    animation: fadeIn 0.3s;
}

.install-modal.hidden {
    display: none;
}

.install-modal-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease-out;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.install-modal-content h3 {
    color: #764ba2;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.install-steps {
    color: #333;
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.install-steps li {
    margin: 1rem 0;
}

.install-steps strong {
    color: #764ba2;
}

.share-icon {
    display: inline-block;
    font-size: 1.2rem;
    margin: 0 4px;
    vertical-align: middle;
}

.install-close-button {
    width: 100%;
    background: #764ba2;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.3s;
}

.install-close-button:hover,
.install-close-button:active {
    background: #667eea;
    transform: scale(1.02);
}

