* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    background: #0a0e27;
    color: #00ff41;
    overflow: hidden;
}

.game-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 8px;
}

.header {
    background: #1a1f3a;
    border: 2px solid #00ff41;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.1);
}

.header h1 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.status {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid #00ff41;
    background: #0a0e27;
    animation: blink 1s infinite;
}

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

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.resources-panel, .upgrades-panel {
    background: #1a1f3a;
    border: 2px solid #00ff41;
    padding: 12px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.1);
}

.panel-header {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    border-bottom: 1px solid #00ff41;
    padding-bottom: 8px;
    margin-bottom: 12px;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

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

.resource-item {
    background: #0a0e27;
    border: 1px solid #00ff41;
    padding: 12px;
    text-align: center;
    transition: all 0.2s;
}

.resource-item:hover {
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    transform: scale(1.02);
}

.resource-label {
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 8px;
    opacity: 0.8;
    letter-spacing: 1px;
}

.resource-value {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 4px;
}

.resource-rate {
    font-size: 9px;
    color: #ff4141;
    opacity: 0.9;
}

.population-display {
    background: #0a0e27;
    border: 1px solid #00ff41;
    padding: 16px;
    text-align: center;
    margin-bottom: 12px;
}

.pop-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 4px;
}

.pop-label {
    font-size: 11px;
    opacity: 0.7;
    letter-spacing: 1px;
}

.upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
}

.upgrade-item {
    background: #0a0e27;
    border: 1px solid #00ff41;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 11px;
}

.upgrade-item:hover:not(.disabled) {
    background: #1a2f5a;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.upgrade-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #666;
    color: #666;
}

.upgrade-name {
    font-weight: bold;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.upgrade-cost {
    font-size: 10px;
    opacity: 0.7;
    margin-bottom: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.upgrade-cost-item {
    display: flex;
    justify-content: space-between;
}

.upgrade-benefit {
    font-size: 10px;
    color: #41ff00;
    opacity: 0.8;
}

.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border: 2px solid #ff4141;
}

.game-over-modal.show {
    display: flex;
}

.modal-content {
    background: #1a1f3a;
    border: 2px solid #ff4141;
    padding: 32px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 0 20px rgba(255, 65, 65, 0.3);
}

.modal-header {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 16px;
    color: #ff4141;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 65, 65, 0.5);
}

.modal-message {
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
    opacity: 0.9;
}

.modal-button {
    background: #00ff41;
    color: #0a0e27;
    border: 2px solid #00ff41;
    padding: 12px 24px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
    font-family: 'MS Sans Serif', Arial, sans-serif;
}

.modal-button:hover {
    background: #0a0e27;
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .resource-grid {
        grid-template-columns: 1fr 1fr;
    }

    .header h1 {
        font-size: 14px;
    }
}

