:root {
    --bg-space: #050510;
    --terminal-bg: #1e1e1e;
    --terminal-sidebar: #252526;
    --code-green: #6A9955;
    --code-blue: #569CD6;
    --code-white: #D4D4D4;
    --code-orange: #CE9178;
    --accent-cyan: #00f3ff;
    --accent-pink: #ff0055;
    --accent-yellow: #f1c40f;
    --danger-red: #ff3333;
}

body {
    margin: 0;
    background-color: var(--bg-space);
    color: white;
    font-family: 'Orbitron', sans-serif;
    overflow: hidden;
    display: flex;
    height: 100vh; /* Fallback */
    height: 100dvh; /* Untuk browser mobile modern */
}

.visual-panel {
    flex: 6;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, #1b2735 0%, #090a0f 100%);
    border-right: 4px solid #333;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stars {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, #ddd, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    z-index: 1;
}

/* Pesawat */
.ship-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    transition: transform 0.2s;
    width: 150px; 
    height: 200px;
}

.spaceship {
    font-size: 8rem;
    color: var(--code-white);
    text-shadow: 0 0 20px var(--accent-cyan);
    filter: drop-shadow(0 0 10px var(--accent-cyan));
    transform: rotate(-90deg); 
    display: block;
    margin: 0 auto;
}

.engine-flame {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%) rotate(180deg);
    width: 40px;
    height: 60px;
    background: linear-gradient(to top, transparent, var(--accent-pink), var(--accent-cyan));
    filter: blur(8px);
    opacity: 0.8;
    border-radius: 50% 50% 20% 20%;
    z-index: 9;
}

.center-warning {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--danger-red);
    font-family: 'Orbitron', sans-serif;
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    background: rgba(0, 0, 0, 0.85);
    padding: 20px 40px;
    border: 2px solid var(--danger-red);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 51, 51, 0.3);
    text-transform: uppercase;
    width: 80%;
    max-width: 600px;
}

.center-warning h2 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    line-height: 1.4;
}

.center-warning p {
    margin: 0;
    font-size: 0.9rem;
    color: #fff;
    opacity: 0.9;
}

.center-warning.visible {
    opacity: 1;
    animation: pulse-panel 1s infinite alternate;
}

@keyframes pulse-panel {
    0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 20px rgba(255, 51, 51, 0.3); }
    100% { transform: translate(-50%, -50%) scale(1.02); box-shadow: 0 0 50px rgba(255, 51, 51, 0.6); }
}

.reset-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(255, 0, 85, 0.2);
    border: 1px solid var(--accent-pink);
    color: var(--accent-pink);
    padding: 10px 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 5px;
    backdrop-filter: blur(5px);
}

.reset-btn:hover {
    background: var(--accent-pink);
    color: white;
    box-shadow: 0 0 15px var(--accent-pink);
}

.hud-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 220px;
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    z-index: 20;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: 20px;
}

.clock-card {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--accent-cyan);
    border-radius: 10px;
    padding: 15px;
    width: 200px;
    text-align: center;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.clock-card.warning {
    border-color: var(--danger-red) !important;
    background: rgba(255, 51, 51, 0.1);
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.4);
    animation: pulse-warning 1s infinite;
}

@keyframes pulse-warning {
    0% { box-shadow: 0 0 10px rgba(255, 51, 51, 0.2); }
    50% { box-shadow: 0 0 25px rgba(255, 51, 51, 0.6); }
    100% { box-shadow: 0 0 10px rgba(255, 51, 51, 0.2); }
}

.clock-face {
    width: 90px;
    height: 90px;
    border: 3px solid var(--code-white);
    border-radius: 50%;
    margin: 0 auto 10px auto;
    position: relative;
    background: rgba(0,0,0,0.5);
}

.hand {
    width: 2px;
    height: 45%;
    background: var(--accent-pink);
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(0deg);
}

.digital-time {
    font-family: 'Fira Code', monospace;
    font-size: 1.1rem;
    color: var(--accent-cyan);
    letter-spacing: 1px;
    min-height: 1.5em;
}

.warning-text {
    color: var(--danger-red);
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.warning-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.label-time {
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 5px;
    text-transform: uppercase;
}

.diff-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--accent-yellow);
}

.diff-value {
    font-family: 'Fira Code', monospace;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
    min-width: 180px;
    text-align: center;
}

.terminal-panel {
    flex: 4;
    background-color: var(--terminal-bg);
    display: flex;
    flex-direction: column;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
}

.terminal-header {
    background-color: #333;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ddd;
    font-size: 12px;
}

.window-controls span {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

.editor-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    color: var(--code-white);
    line-height: 1.6;
    border-left: 1px solid #444;
}

.kwd { color: var(--code-blue); font-weight: bold;}
.str { color: var(--code-orange); }
.com { color: var(--code-green); font-style: italic; }
.num { color: #B5CEA8; }
.typ { color: #4EC9B0; }

.interactive-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--code-white);
    color: var(--accent-pink);
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    width: 80px;
    text-align: center;
    outline: none;
    transition: 0.3s;
}
.interactive-input:focus {
    border-bottom-color: var(--accent-cyan);
    width: 100px;
}

.console-output {
    margin-top: 20px;
    padding: 15px;
    background-color: black;
    border: 1px solid #444;
    border-left: 5px solid var(--code-green);
    font-family: 'Fira Code', monospace;
    color: #ccc;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    background: #444;
    outline: none;
    margin: 10px 0;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: var(--code-blue);
    cursor: pointer;
    border-radius: 50%;
}

@media screen and (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .visual-panel {
        flex: none; 
        height: 50%; 
        width: 100%;
        border-right: none;
        border-bottom: 3px solid #333;
    }

    .terminal-panel {
        flex: none;
        height: 50%;
        width: 100%;
        overflow: hidden;
    }

    .ship-container {
        width: 100px;
        height: 140px;
        top: 50%;
    }
    .spaceship {
        font-size: 5rem;
    }
    .engine-flame {
        width: 25px;
        height: 40px;
    }

    .hud-bottom {
        height: auto;
        min-height: 120px;
        padding: 5px 2px;
        gap: 2px;
    }

    .clock-card {
        padding: 5px 2px;
        width: auto;
        flex: 1;
        min-width: 0;
    }

    .clock-face {
        width: 45px;
        height: 45px;
        border-width: 2px;
        margin-bottom: 3px;
    }

    .digital-time {
        font-size: 0.75rem;
        letter-spacing: 0;
        min-height: auto;
    }

    .label-time {
        font-size: 0.45rem;
        margin-top: 2px;
    }

    .diff-value {
        font-size: 0.8rem;
        min-width: auto;
    }
    .diff-card {
        padding: 0 5px;
    }

    .center-warning {
        width: 85%;
        padding: 10px;
        top: 35%;
    }
    .center-warning h2 {
        font-size: 0.9rem;
    }
    .center-warning p {
        font-size: 0.6rem;
    }
    
    .reset-btn {
        top: 10px;
        right: 10px;
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    .editor-area {
        padding: 10px;
        font-size: 11px;
        flex: 1;
        min-height: 0;
    }
    
    .interactive-input {
        font-size: 11px;
        width: 50px;
    }
    .interactive-input:focus {
        width: 70px;
    }
    
    .terminal-header {
        padding: 5px 10px;
        font-size: 10px;
        min-height: 25px;
    }
}