/* ═══════════════════════════════════════════════════════════════
   ENLIL DEEP SPACE NAVIGATION SYSTEM STYLESHEET
   2D Space Map + Archived Terminal (для будущих механик)
   ═══════════════════════════════════════════════════════════════ */

/* Сброс базовых стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Основной стиль страницы */
body {
    background-color: #000000;
    color: #FFFFFF;
    font-family: 'Roboto Mono', 'SF Mono', Monaco, 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN MENU (Neobrutalism Style)
   ═══════════════════════════════════════════════════════════════ */

#main-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#menu-starfield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#menu-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
}

#menu-title {
    font-size: 72px;
    font-weight: bold;
    color: #FFFFFF;
    letter-spacing: 10px;
    margin-bottom: 2px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

#menu-subtitle {
    font-size: 14px;
    color: #808080;
    letter-spacing: 8px;
    margin-bottom: 60px;
}

#menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.menu-btn {
    background: #000000;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    padding: 15px 0;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.15s;
    width: 320px;
    box-sizing: border-box;
}

.menu-btn:hover {
    background: #FFFFFF;
    color: #000000;
}

.menu-btn:disabled {
    border-color: #333333;
    color: #333333;
    cursor: not-allowed;
}

.menu-btn:disabled:hover {
    background: #000000;
    color: #333333;
}

.menu-btn.warning-btn {
    border-color: #FFFFFF;
    color: #FFFFFF;
}

.menu-btn.warning-btn:hover {
    background: #FFFFFF;
    color: #000000;
}

#menu-version {
    margin-top: 60px;
    font-size: 11px;
    color: #444444;
    letter-spacing: 2px;
}

#menu-version-link {
    color: #444444;
    text-decoration: none;
    letter-spacing: 2px;
    font-family: inherit;
    font-size: inherit;
}

#menu-version-link:hover {
    color: #666666;
}

/* New Game Warning Modal */
#new-game-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

#warning-content {
    background: #000000;
    border: 1px solid #333333;
    padding: 40px;
    text-align: center;
    max-width: 450px;
    box-sizing: border-box;
}

#warning-content h2 {
    font-size: 24px;
    color: #FFFFFF;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

#warning-content p {
    color: #808080;
    font-size: 14px;
    margin-bottom: 10px;
}

#warning-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Controls Screen */
#controls-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.98);
    z-index: 100003;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

#controls-content {
    background: #000000;
    border: 1px solid #333333;
    padding: 40px;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.3);
}

#controls-content::-webkit-scrollbar {
    width: 8px;
}

#controls-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

#controls-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#controls-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

#controls-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: 1px solid #333333;
    color: #808080;
    width: 35px;
    height: 35px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.15s;
}

#controls-close:hover {
    background: #333333;
    color: #FFFFFF;
}

#controls-content h2 {
    font-size: 24px;
    color: #FFFFFF;
    letter-spacing: 3px;
    margin-bottom: 30px;
    text-align: center;
}

.controls-section {
    margin-bottom: 25px;
    border-bottom: 1px solid #333333;
    padding-bottom: 20px;
}

.controls-section:last-child {
    border-bottom: none;
}

.controls-section h3 {
    font-size: 14px;
    color: #FFFFFF;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
}

.control-row .key {
    background: #FFFFFF;
    color: #000000;
    padding: 4px 10px;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

.control-row span:last-child {
    color: #808080;
}

/* ═══════════════════════════════════════════════════════════════
   2D SPACE MAP CANVAS
   ═══════════════════════════════════════════════════════════════ */

#space-map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 1;
    display: block;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><line x1="12" y1="0" x2="12" y2="24" stroke="rgba(200,200,200,0.5)" stroke-width="1.5"/><line x1="0" y1="12" x2="24" y2="12" stroke="rgba(200,200,200,0.5)" stroke-width="1.5"/></svg>') 12 12, crosshair;
}

/* ═══════════════════════════════════════════════════════════════
   HUD OVERLAY
   ═══════════════════════════════════════════════════════════════ */

#hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    padding: 20px;
}

.hud-panel {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid #333333;
    border-radius: 4px;
    padding: 10px;
    min-width: 150px;
    box-shadow: 0 0 8px rgba(51, 51, 51, 0.5);
}

.hud-left {
    align-self: flex-start;
}

.hud-right {
    align-self: flex-start;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.hud-top {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 400px;
    background: rgba(255, 170, 0, 0.15) !important;
    border: 2px solid rgba(255, 170, 0, 0.8) !important;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.4) !important;
}

.hud-bottom {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.hud-center {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 250px;
    text-align: center;
    background: rgba(0, 136, 255, 0.15) !important;
    border: 2px solid rgba(0, 136, 255, 0.8) !important;
    box-shadow: 0 0 20px rgba(0, 136, 255, 0.4) !important;
}

.hud-section {
    margin-bottom: 10px;
}

.hud-section:last-child {
    margin-bottom: 0;
}

.hud-label {
    color: #808080;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.hud-value {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Roboto Mono', monospace;
}

.hud-bar {
    width: 100%;
    height: 8px;
    background: #000000;
    border: 1px solid #333333;
    margin-top: 5px;
    overflow: hidden;
    display: none; /* Скрываем полоску топлива */
}

.hud-bar-fill {
    height: 100%;
    background: #00ff00; /* Green by default */
    width: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.hud-bar-fill.warning {
    background: #ff8800; /* Orange at ≤50% HP */
}

.hud-bar-fill.critical {
    background: #ff0000; /* Red at ≤25% HP */
}

/* Weapon bar - override display:none from .hud-bar */
#hud-weapon-bar {
    display: block;
    background: rgba(20, 20, 30, 0.8);
    border: 1px solid rgba(100, 100, 120, 0.4);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

#hud-weapon-fill {
    background: linear-gradient(to right, rgba(80, 80, 100, 0.7), rgba(120, 120, 140, 0.9));
    box-shadow: 0 0 8px rgba(150, 150, 180, 0.5);
}

/* Weapon ready shake animation */
#hud-weapon-fill.weapon-ready {
    background: linear-gradient(to right, rgba(150, 150, 180, 0.9), rgba(200, 200, 220, 1));
    box-shadow: 0 0 12px rgba(200, 200, 255, 0.8);
    animation: weaponShake 0.1s infinite;
}

@keyframes weaponShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
}

/* Minimap container - horizontal layout, simple */
.minimap-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

/* Both minimaps - just two simple squares */
#minimap-local,
#minimap-system {
    display: block;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid #333333;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(51, 51, 51, 0.5);
    image-rendering: pixelated;
}

/* Gravity Arrow Indicator */
#gravity-arrow {
    display: block;
    background: transparent;
    image-rendering: crisp-edges;
}

/* Mission HUD */
.hud-mission-type {
    color: #FFFFFF;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.hud-mission-text {
    color: #808080;
    font-size: 12px;
    margin: 2px 0;
}

.hud-mission-reward {
    color: #00ff88;
    font-size: 14px;
    font-weight: bold;
    margin-top: 5px;
}

.hud-mission-timer {
    color: #ffaa00;
    font-size: 13px;
    font-weight: bold;
    margin-top: 5px;
}

.hud-mission-timer.critical {
    color: #ff0000;
    animation: blink 1s infinite;
}

#hud-mission-close:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
    color: rgba(255, 255, 255, 1) !important;
}

.hud-warning-text {
    color: #ffaa00;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 1px;
    animation: pulse 1.5s infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px rgba(255, 170, 0, 0.8); }
    50% { opacity: 0.7; text-shadow: 0 0 20px rgba(255, 170, 0, 1); }
}

/* Blinking HP text when critical */
.hud-value.hp-critical {
    animation: blink 1s infinite;
}

/* Engine Mode Buttons */
.hud-engine-modes {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.engine-mode-btn {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: rgba(51, 51, 51, 0.3);
    border: 2px solid #333333;
    color: #808080;
    font-size: 14px;
    font-weight: bold;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.engine-mode-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: #FFFFFF;
    color: #FFFFFF;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* ═══════════════════════════════════════════════════════════════
   FULLSCREEN SYSTEM MAP
   ═══════════════════════════════════════════════════════════════ */

#fullscreen-map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 10000;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

#fullscreen-map-overlay {
    width: 100%;
    height: 100%;
    background: #000000;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#fullscreen-map-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #333333;
    position: relative;
}

#fullscreen-map-title {
    color: #FFFFFF;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 3px;
    margin: 0;
    text-shadow: none;
}

#fullscreen-map-mode-toggle {
    display: flex;
    gap: 10px;
}

.map-mode-btn {
    background: rgba(51, 51, 51, 0.3);
    border: 2px solid #333333;
    color: #808080;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 1px;
}

.map-mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.map-mode-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: #FFFFFF;
    color: #FFFFFF;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

#fullscreen-map-close {
    position: absolute;
    right: 25px;
    background: transparent;
    border: 1px solid #333333;
    color: #808080;
    font-size: 24px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: 'Roboto Mono', monospace;
    line-height: 1;
}

#fullscreen-map-close:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

#fullscreen-map-canvas {
    flex: 1;
    width: 100%;
    background: #000000;
}

#fullscreen-map-zoom-control {
    position: absolute;
    bottom: 40px;
    right: 60px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #333333;
    border-radius: 4px;
    padding: 10px 15px;
    box-shadow: 0 0 10px rgba(51, 51, 51, 0.5);
}

#fullscreen-map-zoom-control label {
    color: #808080;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}

#fullscreen-map-zoom-slider {
    width: 150px;
    height: 6px;
    background: rgba(51, 51, 51, 0.5);
    border: 1px solid #333333;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#fullscreen-map-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #333333;
    border: 1px solid #555555;
    border-radius: 50%;
    cursor: pointer;
}

#fullscreen-map-zoom-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #333333;
    border: 1px solid #555555;
    border-radius: 50%;
    cursor: pointer;
}

#fullscreen-map-zoom-value {
    color: #FFFFFF;
    font-size: 12px;
    font-weight: bold;
    min-width: 45px;
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   GAME OVER POPUP
   ═══════════════════════════════════════════════════════════════ */

#game-over-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.popup-content {
    background: #000;
    border: 3px solid #FFFFFF;
    padding: 50px;
    text-align: center;
    color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
}

.popup-content h1 {
    font-size: 56px;
    margin-bottom: 20px;
    text-shadow: none;
    letter-spacing: 6px;
}

.popup-content p {
    font-size: 20px;
    margin-bottom: 10px;
    color: #808080;
}

.popup-content button {
    background: #FFFFFF;
    color: #000;
    border: none;
    padding: 16px 50px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 30px;
    border-radius: 4px;
    font-family: 'Roboto Mono', monospace;
    transition: all 0.2s ease;
}

.popup-content button:hover {
    background: #808080;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════════
   АДАПТИВНОСТЬ
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    body {
        font-size: 12px;
        padding: 10px;
    }

    #hud-overlay {
        flex-direction: column;
        gap: 10px;
    }

    .hud-panel {
        min-width: auto;
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
   CONTROL HINTS (Bottom Right)
   ═══════════════════════════════════════════════════════════════ */

.hud-bottom-right {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #333333;
    padding: 15px;
    pointer-events: auto;
}

.control-hints {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-hint {
    color: #808080;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-hint .key {
    background: rgba(51, 51, 51, 0.5);
    border: 1px solid #333333;
    padding: 2px 8px;
    border-radius: 3px;
    color: #FFFFFF;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   HELP POPUP
   ═══════════════════════════════════════════════════════════════ */

#help-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

#help-popup-overlay {
    background: #000000;
    border: 1px solid #333333;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#help-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(51, 51, 51, 0.3);
    border-bottom: 1px solid #333333;
}

#help-popup-header h2 {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

#help-popup-close {
    background: none;
    border: 1px solid #333333;
    color: #808080;
    font-size: 24px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s;
}

#help-popup-close:hover {
    background: #FFFFFF;
    color: #000000;
}

#help-popup-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.3);
}

#help-popup-content::-webkit-scrollbar {
    width: 8px;
}

#help-popup-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

#help-popup-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#help-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

#planet-notification::-webkit-scrollbar {
    width: 6px;
}
#planet-notification::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
#planet-notification::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
#planet-notification::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.help-section {
    margin-bottom: 25px;
}

.help-section h3 {
    color: #FFFFFF;
    font-size: 16px;
    margin-bottom: 10px;
    border-bottom: 1px solid #333333;
    padding-bottom: 5px;
}

.help-section p {
    color: #808080;
    margin-bottom: 10px;
    line-height: 1.6;
}

.help-section ul {
    list-style: none;
    padding: 0;
}

.help-section li {
    color: #808080;
    margin-bottom: 8px;
    padding-left: 10px;
}

.help-section .key {
    background: rgba(51, 51, 51, 0.5);
    border: 1px solid #333333;
    padding: 2px 8px;
    border-radius: 3px;
    color: #FFFFFF;
    font-weight: bold;
}

/* Ship Info Popup Styles (matches help popup) */
#cargo-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

#cargo-popup-overlay {
    background: #000000;
    border: 1px solid #333333;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#cargo-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(51, 51, 51, 0.3);
    border-bottom: 1px solid #333333;
}

#cargo-popup-header h2 {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

#cargo-popup-close {
    background: none;
    border: 1px solid #333333;
    color: #808080;
    font-size: 24px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s;
}

#cargo-popup-close:hover {
    background: #FFFFFF;
    color: #000000;
}

#cargo-popup-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.3);
}

#cargo-popup-content::-webkit-scrollbar {
    width: 8px;
}

#cargo-popup-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

#cargo-popup-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.cargo-section {
    margin-bottom: 25px;
}

.cargo-section h3 {
    color: #FFFFFF;
    font-size: 16px;
    margin-bottom: 10px;
    border-bottom: 1px solid #333333;
    padding-bottom: 5px;
}

.cargo-resource-item {
    background: rgba(51, 51, 51, 0.3);
    border: 1px solid #333333;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cargo-resource-name {
    color: #FFFFFF;
    font-size: 12px;
    font-weight: bold;
}

.cargo-resource-details {
    color: #808080;
    font-size: 10px;
    margin-top: 3px;
}

.cargo-resource-quantity {
    color: #FFFFFF;
    font-size: 14px;
    font-weight: bold;
}

.cargo-empty-message {
    color: #808080;
    font-size: 11px;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   LANDING POPUP
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   PLANET INTERACTION POPUP
   ═══════════════════════════════════════════════════════════════ */

/* Planet Landing Screen - Full Screen Dark Theme */
#planet-interaction-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a0a;
    z-index: 99999;
    display: grid;
    grid-template-columns: 400px 1fr;
    grid-template-rows: 1fr;
    gap: 0;
    pointer-events: auto;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Close button - top right, white minimalist cross */
#planet-interaction-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 300;
    font-family: 'Courier New', monospace;
    z-index: 100000;
}

#planet-interaction-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 1);
    color: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

/* Left side: Action buttons */
#planet-actions-left {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 60px 40px;
    background: #0a0a0a;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* TAKE OFF button - special styling at bottom */
.planet-takeoff-btn {
    margin-top: auto !important;
    border-color: rgba(255, 100, 100, 0.8) !important;
}

/* Right side: Planet visual (large, overflow hidden) */
#planet-info-right {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    overflow: hidden;
    background: #0a0a0a;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

/* Stars background canvas - fills entire right side */
#planet-stars-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Planet visual canvas - large, positioned on right edge */
#planet-visual-canvas {
    position: absolute;
    right: -400px; /* Half off-screen to right */
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.95;
    z-index: 2;
}

/* Info overlay on top of planet */
#planet-info-overlay {
    position: relative;
    z-index: 10;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 600px;
}

#planet-name {
    color: #FFFFFF;
    font-family: 'Courier New', monospace;
    font-size: 32px;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: bold;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

#planet-greeting {
    margin: 0 0 30px 0;
    padding: 20px;
    background: rgba(10, 10, 10, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-style: normal;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
}

#planet-active-mission {
    margin-top: 20px;
    padding: 15px;
    border: 2px solid #00FF64;
    background: rgba(0, 255, 100, 0.15);
    backdrop-filter: blur(5px);
}

#planet-mission-details {
    color: #FFFFFF;
    font-size: 11px;
}

/* Old bottom panel removed - TAKE OFF now in left column */

/* New button style - white outline, dark fill */
.planet-action-btn-new {
    background: rgba(10, 10, 10, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: rgba(255, 255, 255, 0.9);
    padding: 18px 40px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    font-family: 'Courier New', monospace;
    min-width: 280px;
    text-align: center;
}

.planet-action-btn-new:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.planet-action-btn-new:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.3);
}

.planet-action-btn-new .action-text {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.planet-action-btn-new .action-cost {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.planet-stats {
    margin-top: 20px;
    border: 2px solid #FFFFFF;
    padding: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #333;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:first-child {
    color: #808080;
    font-weight: bold;
}

.stat-row span:last-child {
    color: #FFFFFF;
    font-weight: bold;
}

.planet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
}

.planet-action-btn {
    background: #FFFFFF;
    border: none;
    color: #000;
    padding: 18px 15px;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    font-family: 'Courier New', monospace;
}

.planet-action-btn:hover:not(:disabled) {
    background: #808080;
    transform: scale(1.05);
}

.planet-action-btn.primary {
    grid-column: 1 / -1;
    background: #FFFFFF;
    border: none;
}

.planet-action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #333;
    color: #666;
}

.action-text {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

.action-cost {
    font-size: 11px;
    color: #000;
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════
   STORY POPUP
   ═══════════════════════════════════════════════════════════════ */

#story-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

#story-popup-overlay {
    background: #000;
    border: 2px solid #FFFFFF;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

#story-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(51, 51, 51, 0.3);
    border-bottom: 1px solid #333333;
}

#story-popup-title {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    font-family: 'Courier New', monospace;
}

#story-popup-close {
    background: none;
    border: 1px solid #FFFFFF;
    color: #FFFFFF;
    font-size: 24px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Courier New', monospace;
}

#story-popup-close:hover {
    background: #FFFFFF;
    color: #000;
}

#story-popup-content {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    color: #FFFFFF;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
}

#story-popup-loading {
    text-align: center;
    color: #808080;
    padding: 40px 0;
}

#story-popup-text {
    font-size: 14px;
}

#story-popup-text h1,
#story-popup-text h2,
#story-popup-text h3 {
    color: #FFFFFF;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #333333;
    padding-bottom: 5px;
}

#story-popup-text p {
    margin-bottom: 15px;
    color: #CCCCCC;
}

#story-popup-text a {
    color: #00ff88;
    text-decoration: none;
}

#story-popup-text a:hover {
    text-decoration: underline;
}

/* Mission panel scrollbar styling */
#planet-missions-list {
    box-sizing: border-box;
}

#planet-missions-list * {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

#planet-missions-list::-webkit-scrollbar {
    width: 8px;
}

#planet-missions-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

#planet-missions-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

#planet-missions-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

#planet-missions-close:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

/* Mission cards - prevent overflow */
#planet-missions-list > div {
    box-sizing: border-box;
    max-width: 100%;
}

#planet-missions-list h4,
#planet-missions-list h5 {
    margin: 0;
    word-wrap: break-word;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes creditsPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
