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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

#game-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

#hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2c3e50;
    color: white;
    padding: 10px 20px;
    font-size: 14px;
    flex-wrap: wrap;
    gap: 15px;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meter {
    width: 80px;
    height: 12px;
    background: #34495e;
    border-radius: 6px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #27ae60);
    width: 0%;
    transition: width 0.3s ease;
}

#productivity-bar {
    background: linear-gradient(90deg, #e74c3c, #f39c12, #27ae60);
}

#distraction-bar {
    background: linear-gradient(90deg, #95a5a6, #3498db, #9b59b6);
}

#canvas {
    display: block;
    border-bottom: 3px solid #2c3e50;
}

#controls {
    background: #ecf0f1;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.control-section {
    flex: 1;
    min-width: 200px;
}

.control-section h3 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 16px;
}

.control-section p {
    margin: 4px 0;
    font-size: 13px;
    color: #555;
}

.dialogue {
    max-width: 300px;
    background: white;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.dialogue.hidden {
    display: none;
}

.dialogue-content p {
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: bold;
}

#dialogue-options button {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

#dialogue-options button:hover {
    background: #2980b9;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.overlay-content h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 24px;
}

.overlay-content p {
    margin: 10px 0;
    color: #555;
    line-height: 1.5;
}

.overlay-content button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
    transition: background 0.3s ease;
    font-family: inherit;
}

.overlay-content button:hover {
    background: #219a52;
}

/* Mobile responsive */
@media (max-width: 900px) {
    #game-container {
        margin: 10px;
        border-radius: 8px;
    }
    
    #canvas {
        width: 100%;
        height: auto;
        max-width: 800px;
    }
    
    #hud {
        font-size: 12px;
        gap: 10px;
    }
    
    .meter {
        width: 60px;
        height: 10px;
    }
    
    #controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-section {
        min-width: auto;
    }
}

@media (max-width: 600px) {
    #hud {
        flex-direction: column;
        gap: 8px;
        padding: 8px 15px;
    }
    
    .hud-item {
        gap: 5px;
    }
    
    #controls {
        padding: 10px 15px;
    }
    
    .overlay-content {
        margin: 20px;
        padding: 20px;
    }
    
    .dialogue {
        max-width: 250px;
    }
}

/* Game-specific styles */
.floating-message {
    pointer-events: none;
    font-weight: bold;
    white-space: nowrap;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .meter-fill {
        transition: none;
    }
    
    .floating-message {
        animation: none !important;
        opacity: 1;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    #game-container {
        border: 3px solid #000;
    }
    
    .meter {
        border: 2px solid #000;
    }
    
    .dialogue {
        border: 3px solid #000;
    }
}