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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 400;
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 24px 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.mode-selector {
    display: flex;
    gap: 0;
    background: #f3f4f6;
    padding: 4px;
}

.mode-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    color: #1a1a1a;
}

.mode-btn.active {
    background: white;
    color: #1a1a1a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stats {
    display: flex;
    gap: 40px;
    font-size: 0.875rem;
    color: #6b7280;
}

.stats span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats strong {
    color: #1a1a1a;
    font-size: 1.25rem;
    font-weight: 600;
}

.challenge-area {
    background: white;
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.challenge-label {
    font-size: 0.875rem;
    margin-bottom: 20px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.color-swatch {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.hex-display {
    font-size: 2rem;
    font-weight: 600;
    color: #1a1a1a;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    letter-spacing: 2px;
}

.color-wall-container {
    background: white;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
}

#colorWall {
    cursor: crosshair;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

.feedback {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
}

.feedback > * {
    pointer-events: auto;
}

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

.feedback-content {
    background: white;
    padding: 32px 40px;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #e5e7eb;
    animation: slideDown 0.3s ease;
}

#feedbackTitle {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a1a;
}

#feedbackMessage {
    font-size: 0.95rem;
    margin-bottom: 24px;
    color: #6b7280;
}

.feedback-colors {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 24px;
}

.feedback-colors > div {
    flex: 0 1 auto;
}

.feedback-colors p {
    margin-bottom: 12px;
    font-weight: 500;
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feedback-colors p:last-child {
    margin-top: 12px;
    margin-bottom: 0;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    color: #1a1a1a;
    text-transform: none;
    letter-spacing: 1px;
    font-size: 0.875rem;
}

.feedback-swatch {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.next-btn {
    padding: 12px 32px;
    background: #1a1a1a;
    color: white;
    border: none;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.next-btn:hover {
    background: #2a2a2a;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.next-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    header {
        margin-bottom: 20px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.875rem;
    }

    .game-controls {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
        margin-bottom: 12px;
    }

    .stats {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
        font-size: 0.75rem;
    }

    .stats strong {
        font-size: 1rem;
    }

    .challenge-area {
        padding: 20px 16px;
        margin-bottom: 12px;
    }

    .challenge-label {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

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

    .hex-display {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }

    .color-wall-container {
        padding: 12px;
    }

    #colorWall {
        max-width: 100%;
        width: 100% !important;
        height: auto !important;
    }

    .feedback {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
    }

    .feedback-content {
        padding: 20px 16px;
    }

    #feedbackTitle {
        font-size: 1.25rem;
    }

    #feedbackMessage {
        font-size: 0.875rem;
        margin-bottom: 16px;
    }

    .feedback-colors {
        gap: 20px;
        margin-bottom: 20px;
    }

    .feedback-colors p {
        font-size: 0.625rem;
        margin-bottom: 8px;
    }

    .feedback-colors p:last-child {
        font-size: 0.75rem;
        margin-top: 8px;
    }

    .feedback-swatch {
        width: 70px;
        height: 70px;
    }

    .next-btn {
        padding: 12px 24px;
        font-size: 0.875rem;
    }
}

/* Game Over Modal */
.game-over {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.game-over-content {
    background: white;
    padding: 60px 80px;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid #e5e7eb;
    text-align: center;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#gameOverTitle {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 40px;
}

.final-score {
    margin-bottom: 32px;
}

.score-label {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-bottom: 8px;
}

.score-value {
    font-size: 4rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}

.high-score-display {
    margin-bottom: 32px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
}

.high-score-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-bottom: 8px;
}

.high-score-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
}

.new-high-score {
    font-size: 1.25rem;
    font-weight: 600;
    color: #16a34a;
    margin-bottom: 24px;
}

.play-again-btn {
    padding: 16px 48px;
    background: #1a1a1a;
    color: white;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.play-again-btn:hover {
    background: #2a2a2a;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.play-again-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .game-over-content {
        padding: 40px 32px;
        margin: 20px;
    }

    #gameOverTitle {
        font-size: 2rem;
        margin-bottom: 32px;
    }

    .score-value {
        font-size: 3rem;
    }

    .high-score-value {
        font-size: 1.5rem;
    }
}
