@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    font-family: 'Press Start 2P', monospace;
    background: #000;
    color: #fff;
    overflow: hidden;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    margin: 0 auto;
    background: #111;
    border: 4px solid #333;
}

#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
}

.stat-label {
    color: #64748b;
}

.health-bar {
    width: 60px;
    height: 8px;
    background: #374151;
    border: 1px solid #6b7280;
}

.bar-fill {
    height: 100%;
    background: #4ade80;
    transition: width 0.5s ease;
}

#money {
    color: #ef4444;
}

#status-effects {
    display: flex;
    gap: 5px;
}

.status-icon {
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.7);
    border: 1px solid #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: help;
}

#game-canvas {
    display: block;
    background: #020617;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#dialogue-box {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-top: 4px solid #60a5fa;
    border-bottom: 4px solid #1d4ed8;
    padding: 10px;
    display: none;
    z-index: 20;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

#character-portrait {
    width: 80px;
    height: 80px;
    margin-right: 15px;
    margin-top: 5px;
}

#portrait-img {
    width: 100%;
    height: 100%;
    border: 2px solid #94a3b8;
    background: #475569;
    position: relative;
}

.portrait-boomer {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.portrait-boomer::before {
    content: "👴";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
}

.portrait-landlord {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.portrait-landlord::before {
    content: "😈";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
}

.portrait-boss {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.portrait-boss::before {
    content: "🤵";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
}

.portrait-friend {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.portrait-friend::before {
    content: "😎";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
}

#dialogue-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

#speaker-name {
    font-size: 12px;
    color: #fbbf24;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0 #000;
}

#dialogue-text {
    font-size: 11px;
    line-height: 16px;
    color: #f1f5f9;
    flex-grow: 1;
    text-shadow: 1px 1px 0 #000;
}

#continue-prompt {
    align-self: flex-end;
    font-size: 16px;
    color: #fbbf24;
    animation: blink 1s infinite;
    display: none;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

#menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#menu-overlay.hidden {
    display: none;
}

#start-menu {
    text-align: center;
}

#start-menu h1 {
    font-size: 24px;
    margin-bottom: 40px;
    color: #fbbf24;
    text-shadow: 2px 2px 0 #000;
    line-height: 1.2;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    border: 2px solid #60a5fa;
    color: #f1f5f9;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 1px 1px 0 #000;
}

.menu-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #2563eb 100%);
    border-color: #93c5fd;
    transform: translateY(-2px);
}

.menu-btn:active {
    transform: translateY(0);
}

#achievement-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: 3px solid #10b981;
    padding: 20px;
    z-index: 50;
    min-width: 300px;
    text-align: center;
    animation: slideDown 0.5s ease;
}

#achievement-popup.hidden {
    display: none;
}

.achievement-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.achievement-icon {
    font-size: 32px;
}

.achievement-text {
    text-align: left;
}

.achievement-title {
    font-size: 12px;
    color: #fbbf24;
    margin-bottom: 5px;
}

.achievement-desc {
    font-size: 10px;
    color: #f1f5f9;
    line-height: 14px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Responsive design */
@media (max-width: 820px) {
    #game-container {
        width: 100vw;
        height: 100vh;
        border: none;
    }
    
    #game-canvas {
        width: 100%;
        height: calc(100% - 150px);
    }
    
    .stat {
        font-size: 8px;
    }
    
    .menu-btn {
        font-size: 10px;
        padding: 12px 20px;
    }
    
    #start-menu h1 {
        font-size: 18px;
    }
}