:root {
    --bg-color: #121212;
    --text-color: #f5f5f5;
    --accent-color: #6200ee;
    --accent-light: #bb86fc;
    --success-color: #03dac6;
    --error-color: #cf6679;
    --surface-color: #1e1e1e;
    --border-radius: 12px;
    --shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--accent-light), var(--success-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-align: center;
}

.subtitle {
    margin-bottom: 2rem;
    font-size: 1.2rem;
    opacity: 0.8;
    text-align: center;
}

.game-container {
    width: 100%;
    max-width: 800px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .game-container {
        grid-template-columns: 350px 1fr;
    }
}

.left-panel, .right-panel {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.attempts-display {
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.difficulty-display {
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    border-radius: 8px;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 2rem;
}

.color-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.color-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.current-selection {
    display: flex;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.color-slot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.color-slot.empty::after {
    content: "+";
}

.control-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-submit {
    background-color: var(--accent-color);
    color: white;
}

.btn-submit:hover {
    background-color: var(--accent-light);
}

.btn-reset {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.btn-reset:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.results-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.guess-history {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(255, 255, 255, 0.05);
    padding-right: 0.5rem;
}

.guess-history::-webkit-scrollbar {
    width: 8px;
}

.guess-history::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.guess-history::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 10px;
}

.result-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    transition: all 0.3s;
}

.result-entry:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.attempt-number {
    font-weight: bold;
    color: var(--accent-light);
    width: 30px;
    text-align: center;
}

.proposition {
    display: flex;
    gap: 8px;
}

.color-spot {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.result-feedback {
    display: flex;
    gap: 8px;
}

.feedback-pin {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.pin-exact {
    background-color: var(--success-color);
}

.pin-partial {
    background-color: white;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: var(--shadow);
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.modal-message {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.5;
}

.secret-code {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 1.5rem 0;
}

.secret-color {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

.settings-panel {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.setting-group {
    flex: 1;
    min-width: 200px;
}

.setting-label {
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.dropdown {
    width: 100%;
    padding: 0.7rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
}

.setting-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    margin-top: 0.5rem;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
}

.setting-value {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.color-red { background-color: #e53935; }
.color-green { background-color: #43a047; }
.color-blue { background-color: #1e88e5; }
.color-yellow { background-color: #fdd835; }
.color-purple { background-color: #8e24aa; }
.color-orange { background-color: #fb8c00; }
.color-pink { background-color: #d81b60; }
.color-cyan { background-color: #00acc1; }
