:root {
    --bg-dark: #1a2a3a;
    --accent-teal: #4fc3c3;
    --ui-bg: rgba(0, 0, 0, 0.7);
    --ui-text: #ffffff;
}

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

body {
    background: var(--bg-dark);
    overflow: auto;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: var(--ui-text);
    -webkit-user-select: none;
    user-select: none;
}

canvas {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    cursor: none;
}

/* Start Screen */
#startScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #0f1923 0%, #1a2a3a 50%, #0f2027 100%);
    overflow-y: auto;
}

#startScreen h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #4fc3c3, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.start-header p {
    color: #8899aa;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

#playerName {
    padding: 12px 20px;
    font-size: 1.1rem;
    border: 2px solid #4fc3c3;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    outline: none;
    width: 260px;
    text-align: center;
    margin-bottom: 1rem;
}

#playerName::placeholder {
    color: #667788;
}

#playerName:focus {
    border-color: #a855f7;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.btn {
    padding: 14px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.98);
}

#startBtn {
    background: linear-gradient(135deg, #4fc3c3, #2da5a5);
    color: #fff;
    box-shadow: 0 4px 20px rgba(79, 195, 195, 0.4);
}

/* Game Over Screen */
#gameOverScreen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 100;
}

#gameOverScreen h2 {
    font-size: 2.5rem;
    color: #ff4757;
    margin-bottom: 1rem;
}

#gameOverScreen .score-display {
    font-size: 1.4rem;
    color: #ccddee;
    margin-bottom: 2rem;
}

#restartBtn {
    background: linear-gradient(135deg, #ff4757, #c0392b);
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.4);
}

.gameover-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-share {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    padding: 14px 28px;
}

/* Ad slots */
.ad-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 200;
    min-height: 50px;
    pointer-events: auto;
}

.ad-interstitial {
    margin-top: 1rem;
    min-height: 0;
}

/* Color Picker */
.color-picker-label {
    color: #8899aa;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.color-picker {
    display: flex;
    gap: 10px;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.selected {
    border-color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
    transform: scale(1.15);
}

/* Rank display on game over */
.rank-display {
    font-size: 1.1rem;
    color: #aabbcc;
    margin-bottom: 1.5rem;
}

/* Mobile Boost Button */
.boost-btn {
    display: none;
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 165, 2, 0.6), rgba(255, 165, 2, 0.2));
    border: 3px solid rgba(255, 165, 2, 0.7);
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    align-items: center;
    justify-content: center;
    z-index: 50;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    letter-spacing: 0.5px;
}

.boost-btn:active {
    background: radial-gradient(circle, rgba(255, 165, 2, 0.9), rgba(255, 165, 2, 0.4));
    transform: translateX(-50%) scale(0.92);
}

/* Info sections (How to Play, FAQ) */
.info-section {
    margin-top: 2rem;
    max-width: 480px;
    width: 100%;
    text-align: left;
}

.info-section h2 {
    font-size: 1.1rem;
    color: #4fc3c3;
    margin-bottom: 0.8rem;
    text-align: center;
}

/* How to Play Steps */
.how-to-play {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    counter-reset: steps;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8899aa;
    font-size: 0.85rem;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    counter-increment: steps;
}

.step::before {
    content: counter(steps);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(79, 195, 195, 0.2);
    color: #4fc3c3;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* FAQ */
.faq-item {
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    overflow: hidden;
}

.faq-item summary {
    padding: 10px 14px;
    cursor: pointer;
    color: #aabbcc;
    font-size: 0.85rem;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-item summary::before {
    content: '+';
    color: #4fc3c3;
    font-size: 1rem;
    font-weight: bold;
    flex-shrink: 0;
}

.faq-item[open] summary::before {
    content: '−';
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item p {
    padding: 0 14px 10px;
    color: #667788;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* SEO Footer */
.seo-footer {
    margin-top: 2rem;
    text-align: center;
    max-width: 480px;
}

.seo-footer p {
    color: #445566;
    font-size: 0.75rem;
    line-height: 1.5;
}

/* Controls hint */
.controls-hint {
    margin-top: 2rem;
    color: #556677;
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.6;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #startScreen h1 {
        font-size: 2.2rem;
    }

    .start-header p {
        font-size: 0.95rem;
        margin-bottom: 1.2rem;
    }

    #playerName {
        width: 220px;
        font-size: 1rem;
        padding: 10px 16px;
    }

    .btn {
        padding: 12px 32px;
        font-size: 1.05rem;
    }

    .color-swatch {
        width: 30px;
        height: 30px;
    }

    #gameOverScreen h2 {
        font-size: 1.8rem;
    }

    #gameOverScreen .score-display {
        font-size: 1.1rem;
    }

    .controls-hint {
        font-size: 0.75rem;
        margin-top: 1.5rem;
        padding: 0 20px;
    }

    .info-section {
        margin-top: 1.5rem;
        max-width: 360px;
    }

    .info-section h2 {
        font-size: 1rem;
    }

    .step, .faq-item summary {
        font-size: 0.8rem;
    }

    .faq-item p {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    #startScreen h1 {
        font-size: 1.8rem;
    }

    #playerName {
        width: 190px;
    }

    .color-picker {
        gap: 8px;
    }

    .color-swatch {
        width: 28px;
        height: 28px;
    }
}
