:root {
    --primary: #4facfe;
    --secondary: #00f2fe;
    --bg: #f0f4f8;
    --text: #2d3436;
    --card-bg: #ffffff;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 90vw;
    max-width: 900px;
    text-align: center;
}

header h1 {
    margin: 0 0 10px 0;
    color: var(--primary);
}

#game-status {
    font-size: 1.2rem;
    font-weight: bold;
    color: #636e72;
    margin-bottom: 20px;
}

main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#canvas-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    cursor: crosshair;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#carpetCanvas { z-index: 1; background: #fff; }
#dirtCanvas { z-index: 2; opacity: 0.8; pointer-events: none; }
#waterCanvas { z-index: 3; pointer-events: none; }

#controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: fadeIn 0.5s ease-out;
}

.tool-buttons, .stamp-picker {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #d0d0d0;
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

button.active:not(:disabled) {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(79, 172, 254, 0.4);
}

#wash-instruction {
    font-weight: bold;
    color: var(--primary);
    margin: 5px 0;
    font-size: 1.1rem;
}

.action-btn {
    background: #00b894;
    color: white;
    font-weight: bold;
    padding: 12px 30px;
    margin-top: 10px;
}

.action-btn:hover {
    background: #00a383;
}

input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.progress-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.progress-bar {
    width: 80%;
    height: 20px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

#clean-progress {
    height: 100%;
    background: #00b894;
    transition: width 0.3s ease;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
