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

body {
    background: #1a1a1a;
    font-family: 'VT323', monospace;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
}

#header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #C4B49B;
    border-bottom: 4px solid #8B7355;
    flex-wrap: wrap;
    gap: 10px;
}

#title {
    font-family: 'Special Elite', monospace;
    font-size: clamp(14px, 3vw, 24px);
    color: #333;
    letter-spacing: 2px;
    text-shadow: 1px 1px 0 #FFF;
}

#stats {
    display: flex;
    gap: 20px;
    font-size: clamp(16px, 3vw, 22px);
    color: #333;
}

#coffee-count {
    color: #6F4E37;
}

#sanity-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#sanity-label {
    font-size: 14px;
    color: #666;
}

#sanity-bar {
    width: 120px;
    height: 20px;
    background: #666;
    border: 2px solid #333;
    border-radius: 3px;
    overflow: hidden;
}

#sanity-fill {
    height: 100%;
    width: 100%;
    background: #4CAF50;
    transition: width 0.3s, background-color 0.3s;
}

#canvas {
    border: 4px solid #8B7355;
    border-top: none;
    background: #C4B49B;
}

/* Start Screen */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#start-content {
    text-align: center;
    padding: 40px;
    background: #C4B49B;
    border: 4px solid #8B7355;
    border-radius: 0;
    max-width: 90%;
}

#dilbert-desk {
    font-size: 80px;
    margin-bottom: 20px;
    animation: slump 2s ease-in-out infinite;
}

@keyframes slump {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(5px) rotate(5deg); }
}

#start-content h1 {
    font-family: 'Special Elite', monospace;
    font-size: clamp(24px, 5vw, 36px);
    color: #333;
    margin-bottom: 10px;
    letter-spacing: 3px;
}

#tagline {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

#high-score {
    font-size: 16px;
    color: #4169E1;
    margin-bottom: 30px;
}

#start-btn, #restart-btn, #accept-btn {
    font-family: 'VT323', monospace;
    font-size: 24px;
    padding: 15px 40px;
    background: #4169E1;
    color: #FFF;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#start-btn:hover, #restart-btn:hover, #accept-btn:hover {
    background: #2a4a9f;
    transform: scale(1.05);
}

#accept-btn {
    background: #666;
    margin-left: 10px;
}

#controls-hint {
    margin-top: 20px;
    font-size: 14px;
    color: #888;
}

/* Game Over Screen */
#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#game-over-content {
    text-align: center;
    padding: 40px;
    background: #8B0000;
    border: 4px solid #660000;
    max-width: 90%;
}

#game-over-title {
    font-family: 'Special Elite', monospace;
    font-size: clamp(18px, 4vw, 28px);
    color: #FFF;
    margin-bottom: 30px;
}

#final-stats {
    font-size: 20px;
    color: #FFF;
    margin-bottom: 30px;
}

#final-stats p {
    margin: 10px 0;
}

/* Puzzle Overlay */
#puzzle-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#puzzle-content {
    text-align: center;
    padding: 30px;
    background: #FFF;
    border: 4px solid #333;
    max-width: 90%;
    width: 400px;
}

#puzzle-title {
    font-family: 'Special Elite', monospace;
    font-size: 28px;
    color: #333;
    margin-bottom: 15px;
    background: #FFEB3B;
    padding: 5px 20px;
    display: inline-block;
}

#puzzle-question {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
}

#puzzle-timer {
    width: 100%;
    height: 10px;
    background: #DDD;
    margin-bottom: 20px;
    overflow: hidden;
}

#puzzle-timer-fill {
    height: 100%;
    background: #F44336;
    transition: width 0.1s linear;
}

#puzzle-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#puzzle-options button {
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 12px 20px;
    background: #E0E0E0;
    border: 2px solid #999;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

#puzzle-options button:hover {
    background: #4169E1;
    color: #FFF;
    border-color: #2a4a9f;
}

/* Loading Tip */
#loading-tip {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #FFF;
    padding: 10px 20px;
    font-size: 14px;
    z-index: 1000;
}

/* Footer */
footer {
    background: #C4B49B;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 2px solid #8B7355;
}

footer a {
    color: #4169E1;
    text-decoration: none;
    font-size: 14px;
}

footer a:hover {
    text-decoration: underline;
}

footer span {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.hidden {
    display: none !important;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    #header {
        justify-content: center;
        text-align: center;
    }
    
    #sanity-container {
        width: 100%;
        justify-content: center;
    }
    
    #sanity-bar {
        width: 150px;
    }
    
    #game-over-content, #start-content, #puzzle-content {
        padding: 20px;
    }
    
    footer {
        flex-direction: column;
        text-align: center;
    }
}