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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0A0515;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.screen.hidden {
    display: none;
}

/* Menu Screen */
#menu-screen {
    justify-content: center;
    align-items: center;
    background: transparent;
}

.menu-content {
    text-align: center;
}

.title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(48px, 12vw, 72px);
    color: #00F5FF;
    text-shadow: 0 0 30px rgba(0,245,255,0.8);
    margin-bottom: 5px;
}

.subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(18px, 4vw, 24px);
    color: #FF006E;
    margin-bottom: 20px;
}

.tagline {
    font-size: clamp(12px, 3vw, 16px);
    color: #E2E8F0;
    margin-bottom: 40px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.game-btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 3vw, 16px);
    padding: 15px 40px;
    min-width: 200px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

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

.game-btn.primary {
    background: linear-gradient(135deg, #00F5FF, #00A0CC);
    color: #000;
}

.game-btn.secondary {
    background: rgba(255,255,255,0.1);
    color: #E2E8F0;
    border: 1px solid rgba(255,255,255,0.2);
}

.game-btn.accent {
    background: linear-gradient(135deg, #FF006E, #CC0058);
    color: #FFF;
}

.footer {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.3);
}

.footer a {
    color: rgba(255,255,255,0.4);
    text-decoration: none;
}

/* HUD */
.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    pointer-events: none;
}

.day-hud {
    background: rgba(255,255,255,0.95);
}

.night-hud {
    background: rgba(15,10,31,0.95);
}

.hud-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(12px, 3vw, 16px);
}

.hud-item.cash {
    color: #10B981;
    font-weight: 700;
}

.hud-item.day {
    color: #334155;
}

.night-hud .hud-item.day {
    color: #E2E8F0;
}

.hud-item .time {
    font-size: 0.8em;
    opacity: 0.7;
}

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

.suspicion-bar {
    width: 60px;
    height: 10px;
    background: rgba(128,128,128,0.3);
    border-radius: 5px;
    overflow: hidden;
}

.suspicion-fill {
    height: 100%;
    transition: width 0.3s ease;
}

/* Day Screen */
#day-screen {
    background: #F8FAFC;
}

.day-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px;
}

.section-title {
    font-size: clamp(16px, 4vw, 22px);
    font-weight: 700;
    color: #334155;
    text-align: center;
    margin: 20px 0 15px;
}

.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.business-card {
    background: #FFF;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.biz-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.biz-icon {
    font-size: 24px;
}

.biz-name {
    font-weight: 600;
    font-size: 13px;
    color: #334155;
    flex: 1;
}

.biz-level {
    font-size: 11px;
    color: #888;
}

.biz-income {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #10B981;
    margin-bottom: 10px;
}

.upgrade-btn {
    width: 100%;
    padding: 8px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: #2563EB;
    color: #FFF;
    cursor: pointer;
    transition: all 0.2s;
}

.upgrade-btn:hover:not(.disabled) {
    background: #1D4ED8;
}

.upgrade-btn.disabled {
    background: #CCC;
    cursor: not-allowed;
}

.actions-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto 20px;
}

.action-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: #2563EB;
    color: #FFF;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.action-btn:hover:not(.disabled) {
    background: #1D4ED8;
}

.action-btn.disabled {
    background: #CCC;
    cursor: not-allowed;
}

.action-label {
    font-weight: 600;
    font-size: 13px;
}

.action-cost {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    opacity: 0.9;
}

.end-day-btn {
    display: block;
    margin: 20px auto;
    padding: 18px 40px;
}

.day-footer {
    color: rgba(0,0,0,0.3);
}

.day-footer a {
    color: rgba(0,0,0,0.4);
}

/* Night Screen */
#night-screen {
    background: transparent;
}

.night-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.night-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(20px, 5vw, 28px);
    color: #00F5FF;
    text-align: center;
    text-shadow: 0 0 20px rgba(0,245,255,0.5);
    margin-bottom: 20px;
}

.bank-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.bank-card {
    background: rgba(26,16,48,0.8);
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    position: relative;
}

.bank-card.unlocked:hover {
    border-color: rgba(0,245,255,0.5);
    box-shadow: 0 0 15px rgba(0,245,255,0.3);
}

.bank-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.bank-diff {
    font-size: 14px;
    min-width: 80px;
}

.bank-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: #E2E8F0;
}

.bank-reward {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    color: #FF006E;
}

.bank-robbed {
    color: #10B981;
    font-size: 18px;
}

.bank-lock {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
}

.skip-btn {
    display: block;
    margin: 20px auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    cursor: pointer;
    padding: 10px 20px;
}

.skip-btn:hover {
    color: rgba(255,255,255,0.8);
}

/* Heist Screen */
#heist-screen {
    background: transparent;
    pointer-events: none;
}

#heist-screen .hud {
    pointer-events: none;
}

.heist-hint {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 600;
    font-size: 14px;
    color: #FFE500;
    text-shadow: 0 0 10px rgba(255,229,0,0.5);
}

.heist-stats {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #E2E8F0;
    font-size: 12px;
    margin-bottom: 5px;
}

.stat-row.loot {
    justify-content: flex-end;
    font-family: 'JetBrains Mono', monospace;
    color: #10B981;
}

.stealth-bar {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
}

.stealth-fill {
    height: 100%;
    transition: width 0.2s ease;
}

/* Chase Screen */
#chase-screen {
    background: rgba(239,68,68,0.1);
    justify-content: center;
    align-items: center;
    animation: flashRed 0.5s infinite alternate;
}

@keyframes flashRed {
    from { background: rgba(239,68,68,0.1); }
    to { background: rgba(239,68,68,0.25); }
}

.chase-content {
    text-align: center;
    padding: 20px;
}

.chase-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(36px, 10vw, 48px);
    color: #EF4444;
    text-shadow: 0 0 30px rgba(239,68,68,0.8);
    margin-bottom: 15px;
}

.chase-instruction {
    font-size: clamp(14px, 3vw, 18px);
    color: #E2E8F0;
    margin-bottom: 30px;
}

.chase-meter-container {
    width: 90%;
    max-width: 350px;
    height: 25px;
    background: #333;
    border-radius: 12px;
    margin: 0 auto 15px;
    overflow: hidden;
}

.chase-meter {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #EF4444, #10B981);
    transition: width 0.1s ease;
    border-radius: 12px;
}

.chase-progress {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    color: #FFF;
    margin-bottom: 10px;
}

.chase-timer {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 24px;
    color: #FFE500;
}

/* Game Over Screen */
#gameover-screen {
    background: transparent;
    justify-content: center;
    align-items: center;
}

.gameover-content {
    text-align: center;
    padding: 20px;
}

.gameover-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(42px, 12vw, 64px);
    color: #EF4444;
    text-shadow: 0 0 30px rgba(239,68,68,0.8);
    margin-bottom: 15px;
}

.gameover-text {
    font-size: clamp(14px, 3vw, 18px);
    color: #E2E8F0;
    margin-bottom: 5px;
}

.stats-title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: clamp(16px, 4vw, 20px);
    color: #00F5FF;
    margin: 30px 0 15px;
}

.stats-list {
    margin-bottom: 30px;
}

.stat-item {
    font-size: clamp(14px, 3vw, 16px);
    color: #E2E8F0;
    margin-bottom: 8px;
}

.stat-item span {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

.stat-item.empire span {
    color: #FF006E;
}

/* Prevent text selection */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .business-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .hud {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .hud-item.suspicion {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .suspicion-bar {
        width: 100px;
    }
}