body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Courier New', monospace;
    background: #000;
    color: #0f0;
    overflow: hidden;
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #000;
    border: 4px solid #0f0;
    box-sizing: border-box;
}

.header {
    background: #0f0;
    color: #000;
    padding: 0;
}

.title-bar {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    font-weight: bold;
    font-size: 18px;
}

.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    padding: 20px;
    gap: 20px;
}

.resources-panel {
    flex: 1;
    border: 2px solid #0f0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upgrades-panel {
    flex: 1;
    border: 2px solid #0f0;
    padding: 16px;
    overflow-y: auto;
}

.panel-title {
    font-size: 20px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

.resource-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.resource-item {
    border: 2px solid #0f0;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: background 0.1s;
}

.resource-item.critical {
    background: #300;
    border-color: #f00;
    animation: blink 0.5s infinite;
}

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

.resource-icon {
    font-size: 32px;
    filter: grayscale(100%) brightness(0.5) sepia(100%) hue-rotate(60deg) saturate(10);
}

.resource-info {
    flex: 1;
}

.resource-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
}

.resource-amount {
    font-size: 24px;
    font-weight: bold;
}

.resource-rate {
    font-size: 12px;
    opacity: 0.7;
}

.resource-rate.positive {
    color: #0f0;
}

.resource-rate.negative {
    color: #f00;
}

.population-section {
    border: 2px solid #0f0;
    padding: 16px;
    margin-top: auto;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
}

.upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upgrade-item {
    border: 2px solid #0f0;
    padding: 12px;
}

.upgrade-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: bold;
}

.upgrade-effect {
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.upgrade-cost {
    display: flex;
    gap: 16px;
    font-size: 12px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.upgrade-btn {
    width: 100%;
    background: transparent;
    border: 2px solid #0f0;
    color: #0f0;
    padding: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s;
}

.upgrade-btn:hover {
    background: #0f0;
    color: #000;
}

.upgrade-btn:active {
    transform: translateY(2px);
}

.upgrade-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.upgrade-btn:disabled:hover {
    background: transparent;
    color: #0f0;
}

.status-bar {
    background: #0f0;
    color: #000;
    padding: 8px 16px;
    font-size: 14px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    border: 4px solid #0f0;
    background: #000;
    padding: 32px;
    min-width: 400px;
    text-align: center;
}

.modal-title {
    font-size: 20px;
    margin-bottom: 20px;
}

.game-over-text {
    font-size: 48px;
    font-weight: bold;
    margin: 20px 0;
}

.game-over-reason {
    font-size: 18px;
    margin: 20px 0;
    color: #f00;
}

.game-over-stats {
    font-size: 16px;
    margin: 20px 0;
}

.restart-btn {
    background: transparent;
    border: 2px solid #0f0;
    color: #0f0;
    padding: 12px 32px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
}

.restart-btn:hover {
    background: #0f0;
    color: #000;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        min-width: 80%;
    }
}

