@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

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

body, html {
    width: 100%;
    height: 100%;
    background: #000;
    font-family: 'VT323', monospace;
    overflow: hidden;
}

.crt {
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    position: relative;
    overflow-y: auto;
}

.crt::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.scanline {
    width: 100%;
    height: 100%;
    z-index: 3;
    background: linear-gradient(0deg, transparent 0%, rgba(32, 128, 32, 0.2) 2%, rgba(32, 128, 32, 0.8) 3%, rgba(32, 128, 32, 0.2) 3%, transparent 100%);
    background-repeat: no-repeat;
    animation: scanline 6s linear infinite;
    pointer-events: none;
    position: absolute;
}

@keyframes scanline {
    0% { background-position: 0 -100%; }
    100% { background-position: 0 100%; }
}

.container {
    padding: 20px;
    color: #33ff33;
    text-shadow: 0 0 5px #33ff33;
    position: relative;
    z-index: 1;
}

.header {
    margin-bottom: 20px;
}

.title {
    font-size: 20px;
    text-align: center;
    letter-spacing: 2px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #001100;
    border: 2px solid #33ff33;
    margin-bottom: 20px;
    font-size: 18px;
}

.blink {
    animation: blink 1s infinite;
}

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

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.resource-panel {
    background: #001100;
    border: 2px solid #33ff33;
}

.panel-header, .panel-footer {
    padding: 5px 10px;
    font-size: 16px;
}

.resource-content {
    padding: 15px;
}

.amount {
    font-size: 48px;
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.production {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 16px;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #003300;
    border: 1px solid #33ff33;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #33ff33;
    transition: width 0.3s;
    box-shadow: 0 0 10px #33ff33;
}

.upgrade-btn {
    width: 100%;
    padding: 10px;
    background: #003300;
    color: #33ff33;
    border: 2px solid #33ff33;
    font-family: 'VT323', monospace;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.upgrade-btn:hover {
    background: #33ff33;
    color: #000;
    box-shadow: 0 0 10px #33ff33;
}

.upgrade-btn:active {
    transform: scale(0.98);
}

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

.level {
    text-align: center;
    font-size: 16px;
}

.log-container {
    background: #001100;
    border: 2px solid #33ff33;
    max-height: 150px;
}

.log-header, .log-footer {
    padding: 5px 10px;
    font-size: 16px;
}

.log-content {
    padding: 10px;
    max-height: 130px;
    overflow-y: auto;
    font-size: 14px;
}

.log-entry {
    margin-bottom: 5px;
}

.log-entry.warning {
    color: #ffff33;
}

.log-entry.error {
    color: #ff3333;
}

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

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

.modal-content {
    background: #001100;
    border: 4px solid #33ff33;
    padding: 20px;
    color: #33ff33;
    text-shadow: 0 0 5px #33ff33;
}

.modal-header, .modal-footer {
    font-size: 20px;
    text-align: center;
}

.modal-body {
    padding: 20px;
    text-align: center;
}

.modal-body h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #ff3333;
    text-shadow: 0 0 10px #ff3333;
}

.modal-body p {
    font-size: 20px;
    margin-bottom: 10px;
}

#restartBtn {
    margin-top: 20px;
    padding: 15px 30px;
    background: #003300;
    color: #33ff33;
    border: 2px solid #33ff33;
    font-family: 'VT323', monospace;
    font-size: 20px;
    cursor: pointer;
}

#restartBtn:hover {
    background: #33ff33;
    color: #000;
    box-shadow: 0 0 15px #33ff33;
}

.log-content::-webkit-scrollbar {
    width: 8px;
}

.log-content::-webkit-scrollbar-track {
    background: #001100;
}

.log-content::-webkit-scrollbar-thumb {
    background: #33ff33;
    border: 1px solid #33ff33;
}

