* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 350px;
    min-height: 600px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header Section */
.header {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin: 0;
}

.game-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

.game-controls label {
    font-size: 1.1rem;
}

.game-controls select {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

/* Main Game Area */
.container > div:not(.header):not(.sidebar) {
    padding: 2rem;
}

.game-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.range-info {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.progress-container {
    background: #e9ecef;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997, #17a2b8);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Game Stats */
.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    flex: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.timer, .attempts, .streak {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Input and Buttons */
.game-area {
    text-align: center;
    margin-bottom: 2rem;
}

.input-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

input[type="number"] {
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    width: 180px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.primary-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.primary-btn:active {
    transform: translateY(-1px);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hint-btn {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.hint-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Feedback Section */
.feedback-section {
    text-align: center;
    margin-bottom: 2rem;
}

.feedback {
    font-size: 1.3rem;
    margin: 1rem 0;
    min-height: 2em;
    font-weight: 600;
    animation: fadeIn 0.4s ease-in;
    padding: 1rem;
    border-radius: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.feedback.too-high {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid rgba(220, 53, 69, 0.2);
}

.feedback.too-low {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    border: 2px solid rgba(0, 123, 255, 0.2);
}

.feedback.correct {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid rgba(40, 167, 69, 0.2);
    animation: celebrate 0.8s ease-in-out;
}

.feedback.error {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid rgba(220, 53, 69, 0.2);
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05) rotate(-1deg); }
    50% { transform: scale(1.1) rotate(1deg); }
    75% { transform: scale(1.05) rotate(-1deg); }
}

.hint {
    color: #6f42c1;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 1rem 0;
    padding: 0.8rem;
    background: rgba(111, 66, 193, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(111, 66, 193, 0.2);
}

.score {
    color: #28a745;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(40, 167, 69, 0.2);
}

/* Game Actions */
.game-actions {
    text-align: center;
}

.new-game-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.new-game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

/* Sidebar */
.sidebar {
    background: #f8f9fa;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border-left: 1px solid #e9ecef;
}

.sidebar h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.settings-panel, .stats-panel, .help-panel, .temperature-guide {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    gap: 0.8rem;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 13px;
    position: relative;
    transition: background 0.3s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-label input:checked + .toggle-slider {
    background: #667eea;
}

.toggle-label input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Stats Content */
.stats-content {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.reset-btn {
    padding: 0.6rem 1rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Help Content */
.help-content ul {
    list-style: none;
    padding: 0;
}

.help-content li {
    margin-bottom: 0.8rem;
    padding: 0.5rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

/* Temperature Guide */
.temp-scale {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.temp-item {
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.temp-item:nth-child(1) { background: rgba(0, 123, 255, 0.1); color: #007bff; }
.temp-item:nth-child(2) { background: rgba(108, 117, 125, 0.1); color: #6c757d; }
.temp-item:nth-child(3) { background: rgba(255, 193, 7, 0.1); color: #ffc107; }
.temp-item:nth-child(4) { background: rgba(255, 99, 71, 0.1); color: #ff6347; }
.temp-item:nth-child(5) { background: rgba(220, 53, 69, 0.1); color: #dc3545; }

/* Responsive Design */
@media (max-width: 1000px) {
    .container {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
    
    .sidebar {
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .container > div:not(.header):not(.sidebar) {
        padding: 1.5rem;
    }
    
    .sidebar {
        padding: 1.5rem;
    }
    
    .game-stats {
        flex-direction: column;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    input[type="number"] {
        width: 100%;
        max-width: 200px;
    }
    
    .primary-btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .container > div:not(.header):not(.sidebar) {
        padding: 1rem;
    }
    
    .sidebar {
        padding: 1rem;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hint-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Hover Effects */
.container:hover {
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

/* Animation for new elements */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar > div {
    animation: slideIn 0.6s ease-out;
}

.sidebar > div:nth-child(1) { animation-delay: 0.1s; }
.sidebar > div:nth-child(2) { animation-delay: 0.2s; }
.sidebar > div:nth-child(3) { animation-delay: 0.3s; }
.sidebar > div:nth-child(4) { animation-delay: 0.4s; }
