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

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

body {
    background: #000;
    overflow: hidden;
    font-family: 'Share Tech Mono', monospace;
    user-select: none;
}

#game {
    width: 1280px;
    height: 720px;
    position: relative;
    margin: auto;
    overflow: hidden;
}

#background {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

#bg-placeholder {
    width: 100%;
    height: 100%;
    position: absolute;
}

#bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
}

/* === RADIO FREQUENCY DISPLAY === */
#radio-overlay {
    position: absolute;
    left: 124px;
    top: 448px;
    width: 230px;
    height: 30px;
    z-index: 10;
}

#freq-display {
    color: #ff8c00;
    font-family: 'VT323', monospace;
    font-size: 22px;
    text-align: center;
    line-height: 30px;
    text-shadow: 0 0 10px rgba(255,140,0,0.6);
    letter-spacing: 3px;
}

/* === RADIO DIALS (draggable) === */
.dial-area {
    position: absolute;
    top: 544px;
    width: 80px;
    height: 65px;
    z-index: 10;
    cursor: grab;
}

    .dial-area:active {
        cursor: grabbing;
    }

#vol-dial-area {
    left: 120px;
}

#freq-dial-area {
    left: 270px;
}

.dial-knob {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #777, #2a2a2a);
    border: 2px solid #444;
    position: absolute;
    left: 18px;
    top: 3px;
}

.dial-indicator {
    width: 2px;
    height: 16px;
    background: #bbb;
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    transform-origin: bottom center;
}

.dial-label {
    position: absolute;
    bottom: -3px;
    width: 100%;
    text-align: center;
    font-family: 'VT323', monospace;
    font-size: 10px;
    color: #555;
    letter-spacing: 1px;
}

#vol-display {
    position: absolute;
    left: 89px;
    top: 569px;
    width: 80px;
    text-align: center;
    color: #ff8c00;
    font-family: 'VT323', monospace;
    font-size: 13px;
    text-shadow: 0 0 8px rgba(255, 140, 0, 0.4);
    z-index: 10;
    letter-spacing: 1px;
}

/* === MONITOR SCREEN === */
#monitor-screen {
    position: absolute;
    left: 588px;
    top: 168px;
    width: 489px;
    height: 326px;
    background: rgba(5, 5, 5, 0.85);
    z-index: 10;
    overflow: hidden;
    border: none;
    border-radius: 4px;
}

#screen-content {
    padding: 8px;
    height: 100%;
    position: relative;
}

#screen-main {
    display: flex;
    height: 100%;
    gap: 10px;
}

#terminal-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#screen-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px);
    pointer-events: none;
    z-index: 1;
}

#screen-glow {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 60px rgba(0,255,65,0.03);
    pointer-events: none;
    z-index: 1;
}

/* Terminal text */
#terminal-log {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.4;
    color: #00ff41;
}

    #terminal-log::-webkit-scrollbar {
        width: 4px;
    }

    #terminal-log::-webkit-scrollbar-thumb {
        background: #00ff41;
    }

.log-system {
    color: #00ff41;
}

.log-error {
    color: #ff3333;
}

.log-warning {
    color: #ffaa00;
}

.log-success {
    color: #33ff33;
}

.log-cipher {
    color: #00aaff;
}

.log-scary {
    color: #ff0000;
    animation: glitch-text 0.3s infinite;
}

/* Input area */
#input-area {
    display: flex;
    gap: 5px;
    border-top: 1px solid #003300;
    padding-top: 4px;
}

    #input-area span {
        color: #00ff41;
        font-size: 12px;
        line-height: 24px;
    }

#cmd-input {
flex: 1;
    background: transparent;
    border: 1px solid #003300;
    color: #00ff41;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    padding: 2px 5px;
    outline: none;
}

    #cmd-input:focus {
        border-color: #00ff41;
    }

    #cmd-input:disabled {
        opacity: 0.3;
    }

/* === CIPHER (inside monitor) === */
#cipher-col {
    width: 120px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid #003300;
    padding-left: 6px;
}

.cipher-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0px;
    align-content: start;
}

    .cipher-grid::-webkit-scrollbar {
        width: 3px;
    }

    .cipher-grid::-webkit-scrollbar-thumb {
        background: #333;
    }

    #cipher-col h3 {
        font-size: 11px;
        color: #ff8c00;
        margin-bottom: 6px;
        text-align: center;
        letter-spacing: 2px;
        font-family: 'VT323', monospace;
        padding: 2px 0;
        flex-shrink: 0;
    }

.cipher-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 4px;
}

.cipher-symbol {
    color: #ff6644;
    font-size: 24px;
    text-shadow: 0 0 4px rgba(255, 100, 60, 0.4);
}

.cipher-letter {
    color: #00ff41;
    font-size: 18px;
    font-family: 'VT323', monospace;
}

/* === STATUS INDICATORS === */
#status-bar {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #003300;
    flex-shrink: 0;
}

#signal-strength {
    color: #00ff41;
    font-family: 'VT323', monospace;
    font-size: 12px;
    text-shadow: 0 0 5px rgba(0,255,65,0.5);
    text-align: center;
}

/* === TUNING PROGRESS === */
#tune-bar-wrap {
    position: absolute;
    left: 150px;
    top: 525px;
    width: 220px;
    height: 5px;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border: 1px solid #333;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s;
}

#tune-bar {
    width: 0%;
    height: 100%;
    background: #ff8c00;
    border-radius: 1px;
    transition: width 0.1s;
}

#tune-label {
    position: absolute;
    left: 150px;
    top: 533px;
    width: 220px;
    z-index: 10;
    text-align: center;
    font-size: 9px;
    color: #ff8c00;
    font-family: 'VT323', monospace;
    opacity: 0;
    transition: opacity 0.3s;
    letter-spacing: 2px;
}

/* === SCREEN SHAKE === */
.shake {
    animation: shake 0.15s infinite;
}

@keyframes shake {
    0% {
        translate: 0 0;
    }

    25% {
        translate: -2px 1px;
    }

    50% {
        translate: 2px -1px;
    }

    75% {
        translate: -1px -2px;
    }

    100% {
        translate: 1px 2px;
    }
}

@keyframes glitch-text {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-2px);
        opacity: 0.8;
    }

    50% {
        transform: translateX(2px);
    }

    75% {
        transform: translateX(-1px);
        opacity: 0.9;
    }

    100% {
        transform: translateX(0);
    }
}

/* === TITLE SCREEN === */
#title-screen {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    #title-screen h1 {
        font-family: 'VT323', monospace;
        font-size: 72px;
        color: #8b0000;
        text-shadow: 0 0 30px rgba(139,0,0,0.5);
        letter-spacing: 15px;
        margin-bottom: 20px;
    }

    #title-screen p {
        color: #444;
        font-size: 16px;
        letter-spacing: 4px;
        animation: blink 1.5s infinite;
    }

    #title-screen .subtitle {
        color: #333;
        font-size: 13px;
        letter-spacing: 2px;
        margin-top: 40px;
        animation: none;
    }

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

    50% {
        opacity: 0.3
    }
}

/* === ENDING === */
#ending-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    z-index: 90;
    display: none;
    pointer-events: none;
}

    #ending-overlay.active {
        display: block;
        pointer-events: all;
    }

/* === SLEEP ENDING === */
#sleep-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    z-index: 95;
    display: none;
    pointer-events: none;
    transition: background 5s ease;
}

    #sleep-overlay.active {
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: all;
    }

#sleep-text {
    font-family: 'VT323', monospace;
    font-size: 48px;
    color: #00ff41;
    text-shadow: 0 0 30px rgba(0,255,65,0.6), 0 0 60px rgba(0,255,65,0.3);
    letter-spacing: 8px;
    opacity: 0;
    transition: opacity 3s ease 2s;
    text-align: center;
}

/* Fullscreen scaling */
@media (max-width: 1280px) {
    #game {
        transform-origin: top left;
    }
}

/* === PAUSE MENU === */
#pause-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 200;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    #pause-overlay.active {
        display: flex;
    }

    #pause-overlay h2 {
        font-family: 'VT323', monospace;
        font-size: 48px;
        color: #8b0000;
        letter-spacing: 10px;
        margin-bottom: 40px;
        text-shadow: 0 0 20px rgba(139,0,0,0.5);
    }

.pause-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    color: #00ff41;
    background: transparent;
    border: 1px solid #003300;
    padding: 10px 40px;
    margin: 6px;
    cursor: pointer;
    letter-spacing: 3px;
    width: 260px;
    text-align: center;
    transition: all 0.15s;
}

    .pause-btn:hover {
        background: #001800;
        border-color: #00ff41;
        color: #fff;
    }

    .pause-btn.danger {
        color: #ff3333;
        border-color: #330000;
    }

        .pause-btn.danger:hover {
            background: #1a0000;
            border-color: #ff3333;
        }

#pause-freq-info {
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: #444;
    margin-top: 30px;
    letter-spacing: 2px;
}
