* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.game-area {
    display: grid;
    grid-template-columns: 1fr 600px 1fr;
    gap: 30px;
    align-items: start;
}

.word-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.current-word label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
    color: #555;
    font-size: 1.1rem;
}

.word-display {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 2px dashed #667eea;
}

.new-word-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}

.new-word-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.6);
}

.drawing-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

#drawingCanvas {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: crosshair;
    background: white;
}

.drawing-controls {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.control-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #ff3838;
    transform: translateY(-1px);
}

.color-palette {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-palette label {
    font-weight: 600;
    color: #555;
}

.color-options {
    display: flex;
    gap: 5px;
}

.color-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-btn:hover {
    transform: scale(1.1);
    border-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.color-btn.active {
    border-color: #fff;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    transform: scale(1.15);
}

.brush-size {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brush-size label {
    font-weight: 600;
    color: #555;
}

#brushSize {
    width: 100px;
}

#brushSizeValue {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 25px;
    text-align: center;
}

.ai-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.ai-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.timer-display {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    font-weight: 600;
    color: #555;
}

#countdown {
    color: #667eea;
    font-size: 1.2rem;
    font-weight: bold;
}

.guess-history {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    background: #fafafa;
}

.guess-placeholder {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
}

.guess-item {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guess-item.correct {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.guess-item.incorrect {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.guess-text {
    font-weight: 600;
}

.guess-item.correct .guess-text {
    color: #155724;
}

.guess-item.incorrect .guess-text {
    color: #721c24;
}

.guess-time {
    font-size: 0.9em;
    opacity: 0.7;
}

.game-status {
    margin-top: 20px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.game-status.won {
    color: #28a745;
    background: #d4edda;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #28a745;
}

.celebration {
    animation: celebrate 0.6s ease-in-out;
}

@keyframes celebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .game-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .canvas-container {
        width: 100%;
        overflow-x: auto;
    }
    
    #drawingCanvas {
        max-width: 100%;
        height: auto;
    }
    
    .drawing-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

/* Scrollbar styling */
.guess-history::-webkit-scrollbar {
    width: 6px;
}

.guess-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.guess-history::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.guess-history::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
