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

body {
    background: #000;
    font-family: 'Press Start 2P', monospace;
    color: #00ff00;
    overflow: hidden;
    min-height: 100vh;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
}

#crt-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.3) 100%);
}

#border-frame {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 900px;
    border: 4px solid #c4a000;
    background: #000;
    display: flex;
    flex-direction: column;
    padding: 8px;
    position: relative;
}

#title-bar {
    text-align: center;
    font-size: 14px;
    color: #ffff00;
    padding: 8px;
    border-bottom: 2px solid #c4a000;
    text-shadow: 0 0 10px #ffff00;
    letter-spacing: 2px;
}

#main-content {
    display: flex;
    flex: 1;
    gap: 10px;
    padding: 10px 0;
    min-height: 0;
}

#viewport-container {
    flex: 1;
    position: relative;
    border: 2px solid #00ffff;
    background: #000;
    min-height: 200px;
}

#scene-container {
    width: 100%;
    height: 100%;
}

#hyperspace-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, #000 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#hyperspace-overlay.active {
    opacity: 1;
    animation: hyperspace-flash 0.5s ease-in-out;
}

@keyframes hyperspace-flash {
    0%, 100% { background: radial-gradient(ellipse at center, transparent 0%, #000 70%); }
    50% { background: radial-gradient(ellipse at center, rgba(0,255,255,0.3) 0%, #000 70%); }
}

#info-panel {
    width: 180px;
    padding: 10px;
    border: 2px solid #00ff00;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 8px;
}

.panel-section .label {
    color: #888;
    margin-bottom: 2px;
}

.panel-section .value {
    color: #00ffff;
    word-wrap: break-word;
}

#system-name {
    font-size: 12px;
    color: #ffff00 !important;
    text-shadow: 0 0 5px #ffff00;
}

#description-panel {
    border: 2px solid #00ff00;
    padding: 8px;
    height: 60px;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.6;
    color: #00ff00;
}

#description-text {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 2px #00ff00; }
    to { text-shadow: 0 0 8px #00ff00; }
}

#controls-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
    align-items: center;
    justify-content: space-between;
    border-top: 2px solid #c4a000;
    border-bottom: 2px solid #c4a000;
}

#seed-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#seed-input-group label {
    color: #888;
    font-size: 8px;
}

#seed-input {
    background: #111;
    border: 1px solid #00ffff;
    color: #00ffff;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    padding: 6px 8px;
    width: 120px;
    outline: none;
}

#seed-input:focus {
    border-color: #ffff00;
    box-shadow: 0 0 5px #ffff00;
}

button {
    background: #111;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: #00ff00;
    color: #000;
    box-shadow: 0 0 10px #00ff00;
}

button:active {
    transform: scale(0.95);
}

#nearby-systems {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#nearby-systems .label {
    color: #888;
    font-size: 8px;
}

.nearby-btn {
    border-color: #ff00ff;
    color: #ff00ff;
    padding: 4px 8px;
    font-size: 7px;
}

.nearby-btn:hover {
    background: #ff00ff;
    color: #000;
    box-shadow: 0 0 10px #ff00ff;
}

#hud-panel {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px;
    background: linear-gradient(180deg, #111 0%, #000 100%);
    border: 2px solid #444;
    flex-wrap: wrap;
}

#radar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #00ff00;
    position: relative;
    background: radial-gradient(circle, #001100 0%, #000 100%);
    overflow: hidden;
}

#radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, #00ff00, transparent);
    transform-origin: left center;
    animation: sweep 3s linear infinite;
}

@keyframes sweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#radar-dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.radar-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.radar-dot.station {
    background: #ffff00;
    box-shadow: 0 0 5px #ffff00;
}

.radar-dot.planet {
    background: #00ffff;
    box-shadow: 0 0 3px #00ffff;
}

#status-bars {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.bar-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.bar-group span {
    color: #888;
    font-size: 7px;
    width: 20px;
}

.bar {
    width: 60px;
    height: 12px;
    border: 1px solid #00ff00;
    background: #000;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #004400, #00ff00);
    transition: width 0.3s;
}

#rating-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

#rating-display .label {
    color: #888;
    font-size: 8px;
}

#combat-rating {
    color: #ffff00;
    font-size: 10px;
    text-shadow: 0 0 5px #ffff00;
}

#footer {
    text-align: center;
    font-size: 7px;
    color: #666;
    padding: 8px;
}

#footer a {
    color: #ff6b9d;
    text-decoration: none;
}

#footer a:hover {
    text-shadow: 0 0 5px #ff6b9d;
}

/* Responsive Design */
@media (max-width: 768px) {
    #border-frame {
        padding: 4px;
    }
    
    #title-bar {
        font-size: 10px;
        padding: 6px;
    }
    
    #main-content {
        flex-direction: column;
    }
    
    #info-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }
    
    .panel-section {
        text-align: center;
    }
    
    #seed-input {
        width: 80px;
    }
    
    #hud-panel {
        justify-content: center;
    }
    
    #radar {
        width: 60px;
        height: 60px;
    }
    
    .bar {
        width: 40px;
    }
    
    #rating-display {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    #title-bar {
        font-size: 8px;
    }
    
    #controls-panel {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #nearby-systems {
        width: 100%;
    }
    
    .nearby-btn {
        font-size: 6px;
        padding: 3px 6px;
    }
    
    #status-bars {
        display: none;
    }
}