@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
    --primary-color: #4a90e2;
    --primary-hover-color: #357abd;
    --secondary-color: #f5a623;
    --secondary-hover-color: #d89620;
    --light-gray-color: #f7f7f7;
    --gray-color: #e0e0e0;
    --dark-gray-color: #555;
    --background-color: #e9eef2;
    --font-family: 'Noto Sans SC', sans-serif;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--dark-gray-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    background-color: white;
    padding: 30px 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    width: 880px;
}

h1 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 25px;
}

.toolbar {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.main-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.brush-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
}

.shape-controls select {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--gray-color);
    font-family: var(--font-family);
    font-size: 14px;
    background-color: white;
}

button {
    padding: 12px 25px;
    font-size: 16px;
    font-family: var(--font-family);
    font-weight: 500;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#start-btn { background-color: var(--primary-color); }
#start-btn:hover { background-color: var(--primary-hover-color); }

#guess-btn { background-color: var(--secondary-color); }
#guess-btn:hover { background-color: var(--secondary-hover-color); }

#clear-btn { background-color: #e74c3c; }
#clear-btn:hover { background-color: #c0392b; }

#eraser-btn { background-color: #34495e; }
#eraser-btn:hover { background-color: #2c3e50; }
#eraser-btn.active {
    background-color: #1abc9c;
    box-shadow: 0 0 10px #1abc9c;
}

#settings-btn { background-color: #95a5a6; }
#settings-btn:hover { background-color: #7f8c8d; }

.game-info {
    display: flex;
    justify-content: space-around;
    background-color: var(--light-gray-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 18px;
}

.game-info span {
    font-weight: 700;
    color: var(--primary-color);
}

canvas {
    border: 2px solid var(--gray-color);
    border-radius: var(--border-radius);
    background-color: #fff;
    cursor: crosshair;
}

#settings-panel, #custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#settings-panel:not(.hidden), #custom-alert-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

#settings-panel > div, #custom-alert-box {
    background-color: white;
    padding: 30px 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    min-width: 350px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#settings-panel:not(.hidden) > div, #custom-alert-overlay:not(.hidden) #custom-alert-box {
    transform: scale(1);
}

#settings-panel h2 {
    margin-top: 0;
    color: var(--primary-color);
}

.config-choice {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.config-choice label {
    cursor: pointer;
}

#custom-config-fields input:disabled {
    background-color: #f0f2f5;
    cursor: not-allowed;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 15px;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    padding: 10px;
    border: 1px solid var(--gray-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-family);
}

.security-warning {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 10px;
    text-align: left;
}

#custom-alert-message {
    margin: 0 0 25px 0;
    font-size: 18px;
}

#save-settings-btn, #custom-alert-close-btn {
    background-color: var(--primary-color);
    width: 100%;
}

#save-settings-btn:hover, #custom-alert-close-btn:hover {
    background-color: var(--primary-hover-color);
}

/* Responsive Design */
@media (max-width: 920px) {
    .container {
        width: 90%;
        padding: 20px;
    }

    canvas {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 24px;
    }

    .controls {
        flex-direction: column;
        gap: 10px;
    }

    button {
        width: 100%;
    }

    .game-info {
        flex-direction: column;
        gap: 10px;
        font-size: 16px;
    }

    #settings-panel > div, #custom-alert-box {
        width: 80%;
        padding: 20px;
    }
}