:root {
    --primary-color: #4a90e2;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --border-radius: 12px;
    
    /* Light Theme Variables */
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --container-bg: white;
    --text-color: #333;
    --heading-color: #2c3e50;
    --slider-section-bg: #f8f9fa;
    --slider-bg: #ddd;
}

[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #1a1c1e 0%, #2d3436 100%);
    --container-bg: #2d3436;
    --text-color: #e0e0e0;
    --heading-color: #f5f7fa;
    --slider-section-bg: #1a1c1e;
    --slider-bg: #4a4a4a;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: 2px solid var(--text-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: var(--bg-gradient);
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    background-color: var(--container-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    width: 90%;
    max-width: 800px;
    transition: transform 0.3s ease;
}

.container:hover {
    transform: translateY(-5px);
}

h1 {
    text-align: center;
    color: var(--heading-color);
    margin-bottom: 2rem;
    font-weight: 600;
}

.color-preview {
    width: 250px;
    height: 250px;
    margin: 1.5rem auto;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.color-preview:hover {
    transform: scale(1.02);
}

.controls-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.slider-section {
    background: var(--slider-section-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.slider-container {
    margin: 1rem 0;
}

label {
    display: inline-block;
    width: 100px;
    font-weight: 500;
    color: var(--text-color);
}

input[type="range"] {
    width: calc(100% - 160px);
    height: 8px;
    border-radius: 4px;
    -webkit-appearance: none;
    background: var(--slider-bg);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: background 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #357abd;
}

.value-display {
    display: inline-block;
    width: 50px;
    text-align: right;
    margin-left: 10px;
    font-family: monospace;
    font-size: 0.9rem;
}

.color-codes {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    background: var(--slider-section-bg);
    border-radius: var(--border-radius);
    font-family: monospace;
}

#gameArea {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
}

.target-color-section,
.guess-color-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#targetColorName {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2em;
}

#revealColor {
    margin-top: 1rem;
    background-color: var(--heading-color);
}

#revealColor:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.target-color {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.target-color.visible {
    opacity: 1;
}

.game-controls {
    text-align: center;
    margin: 2rem 0;
}

.game-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    margin: 0 10px;
    transition: transform 0.2s ease, background-color 0.3s ease;
}

.game-button:hover {
    transform: translateY(-2px);
    background-color: #357abd;
}

#feedback {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: var(--border-radius);
    font-weight: bold;
}

#feedback.success {
    background-color: var(--success-color);
    color: white;
}

#feedback.error {
    background-color: var(--error-color);
    color: white;
}

#score {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.color-info {
    background: var(--slider-section-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.hidden {
    display: none;
}
