/* styles.css - Edge of Stars custom styles */

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

body {
    overflow: hidden;
    background-color: #000011;
    font-family: 'Courier New', monospace;
    color: #00FF88;
}

/* Game canvas - fullscreen */
#game-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
}

/* UI Overlay */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10;
}

#ui-overlay > * {
    pointer-events: auto;
}

/* System info panel */
#system-info,
#galaxy-map-help {
    background: linear-gradient(135deg, rgba(0, 30, 50, 0.9) 0%, rgba(0, 15, 35, 0.85) 100%);
    border: 1px solid #00FF88;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px #00FF88;
    color: #00FF88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

#system-info h5,
#galaxy-map-help h5 {
    color: #00FFAA;
    margin-bottom: 0.25rem;
}

#system-info small,
#galaxy-map-help small {
    color: #00CC77;
}

/* Controls hint */
#controls-hint {
    background: linear-gradient(90deg, rgba(0, 20, 30, 0.8) 0%, rgba(0, 10, 20, 0.6) 100%);
    border-radius: 4px;
    border-left: 2px solid rgba(0, 255, 136, 0.3);
    font-family: 'Courier New', monospace;
    color: rgba(0, 255, 136, 0.6);
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
    padding: 0.5rem 1rem;
}

/* Retro scanline effect */
#ui-overlay::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 100;
}

/* Vignette effect */
#ui-overlay::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 60%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
    z-index: 99;
}

/* Glowing panel effect - base class */
.glow-panel {
    background: rgba(0, 20, 40, 0.85);
    border: 1px solid #00FF88;
    border-radius: 4px;
    box-shadow:
        0 0 10px rgba(0, 255, 136, 0.3),
        inset 0 0 20px rgba(0, 255, 136, 0.05);
}

/* Animated border glow */
@keyframes borderGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.3), inset 0 0 20px rgba(0, 255, 136, 0.05); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.5), inset 0 0 30px rgba(0, 255, 136, 0.1); }
}

/* Pause overlay */
#pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 17, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#pause-overlay.d-none {
    display: none !important;
}

.pause-content {
    text-align: center;
    color: #00FF88;
    text-shadow: 0 0 10px #00FF88;
}

.pause-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

.pause-content p {
    color: #00CC77;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Start Screen */
.start-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #000011 0%, #001133 50%, #000022 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
}

.start-screen-content {
    text-align: center;
    padding: 2rem;
}

.start-title {
    font-size: 4rem;
    color: #00FF88;
    text-shadow: 0 0 20px #00FF88, 0 0 40px #00FF88;
    letter-spacing: 0.3em;
    margin-bottom: 0.5rem;
    animation: titleGlow 3s ease-in-out infinite;
}

.start-subtitle {
    font-size: 1.2rem;
    color: #00CC77;
    text-shadow: 0 0 10px #00CC77;
    letter-spacing: 0.2em;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 20px #00FF88, 0 0 40px #00FF88; }
    50% { text-shadow: 0 0 30px #00FFAA, 0 0 60px #00FFAA, 0 0 80px #00FFAA; }
}

.galaxy-size-selection h4 {
    color: #00DDFF;
    text-shadow: 0 0 10px #00DDFF;
    margin-bottom: 1rem;
}

.size-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.size-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    min-width: 120px;
    border: 2px solid #00AACC;
    background: rgba(0, 50, 80, 0.5);
    transition: all 0.3s ease;
}

.size-btn:hover {
    background: rgba(0, 100, 150, 0.7);
    border-color: #00DDFF;
    transform: scale(1.05);
}

.size-btn.active {
    background: rgba(0, 150, 200, 0.5);
    border-color: #00FF88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.size-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #FFFFFF;
}

.size-count {
    font-size: 0.85rem;
    color: #00CCAA;
    margin-top: 0.25rem;
}

#start-game-btn {
    padding: 1rem 3rem;
    font-size: 1.3rem;
    letter-spacing: 0.1em;
    background: linear-gradient(180deg, #00AA66 0%, #008855 100%);
    border: 2px solid #00FF88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    transition: all 0.3s ease;
}

#start-game-btn:hover {
    background: linear-gradient(180deg, #00CC77 0%, #00AA66 100%);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
    transform: scale(1.05);
}

#continue-game-btn {
    padding: 1rem 3rem;
    font-size: 1.3rem;
    letter-spacing: 0.1em;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

#continue-game-btn:hover {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

#start-screen.d-none {
    display: none !important;
}

/* Hyperspace effect */
.hyperspace-active #game-canvas {
    filter: blur(10px) saturate(2) brightness(1.5);
    transition: filter 0.3s ease-in;
}

.hyperspace-active #ui-overlay::after {
    content: 'HYPERSPACE';
    position: fixed;
    top: 50%;
    left: 50%;
    width: auto;
    height: auto;
    background: none;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #00FFFF;
    text-shadow: 0 0 20px #00FFFF, 0 0 40px #00FFFF;
    animation: hyperspace-text 0.5s ease-in-out infinite alternate;
    z-index: 200;
}

@keyframes hyperspace-text {
    from { opacity: 0.7; letter-spacing: 0.5rem; }
    to { opacity: 1; letter-spacing: 1rem; }
}

/* Selection highlight for future use */
.system-selected {
    box-shadow: 0 0 20px #00FF88;
}

/* ===== Phase 2: Exploration UI ===== */

/* System Map Panel */
#system-map-container {
    pointer-events: auto;
}

#system-map-canvas {
    border: 2px solid #00FF88;
    border-radius: 4px;
}

/* Scanner UI */
.scanner-panel {
    background: linear-gradient(135deg, rgba(0, 30, 50, 0.95) 0%, rgba(0, 15, 35, 0.95) 100%);
    border: 1px solid #00FF88;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    padding: 0.75rem 1.25rem;
    text-align: center;
    color: #00FF88;
    font-family: 'Courier New', monospace;
}

.scanner-panel .progress {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00FF88;
}

.scanner-panel .progress-bar {
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
    animation: scanPulse 1s ease-in-out infinite;
}

@keyframes scanPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.6); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 136, 1); }
}

.scanner-target {
    font-size: 0.9rem;
}

#scan-target-name {
    color: #00FFFF;
}

/* Body Info Panel */
.body-info {
    background: linear-gradient(135deg, rgba(0, 30, 50, 0.95) 0%, rgba(0, 15, 35, 0.95) 100%);
    border: 1px solid #00DDFF;
    border-radius: 4px;
    padding: 1rem;
    min-width: 220px;
    max-width: 280px;
    color: #00FF88;
    font-family: 'Courier New', monospace;
    box-shadow:
        0 0 15px rgba(0, 221, 255, 0.3),
        inset 0 0 30px rgba(0, 221, 255, 0.05);
}

.body-info h5 {
    color: #00FFAA;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.body-info hr {
    border-color: rgba(0, 255, 136, 0.3);
    margin: 0.5rem 0;
}

.body-info .scan-status {
    color: #00CC77;
}

.body-info .scan-data {
    font-size: 0.85rem;
}

.body-info .resource-list {
    list-style: none;
    padding-left: 0.5rem;
    margin: 0.25rem 0;
}

.body-info .resource-list li::before {
    content: '> ';
    color: #00FF88;
}

.body-info .anomaly-item {
    color: #FFAA00;
    font-size: 0.85rem;
}

/* Journal Panel (Bootstrap Offcanvas Override) */
.journal-panel.offcanvas {
    background: rgba(0, 20, 40, 0.98) !important;
    color: #00FF88 !important;
    border-left: 2px solid #00FF88 !important;
    font-family: 'Courier New', monospace;
    width: 320px !important;
}

.journal-panel .offcanvas-header {
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
}

.journal-panel .offcanvas-title {
    color: #00FFAA;
}

.journal-panel .btn-close-white {
    filter: invert(48%) sepia(79%) saturate(500%) hue-rotate(100deg);
}

.journal-panel hr {
    border-color: rgba(0, 255, 136, 0.3);
}

.journal-panel h6 {
    color: #00FFAA;
}

.journal-panel .progress {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00FF88;
}

.journal-stats {
    font-size: 0.9rem;
}

/* Discovery List */
.discoveries-list {
    max-height: 400px;
    overflow-y: auto;
}

.discovery-entry {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.discovery-entry:hover {
    background: rgba(0, 255, 136, 0.1);
}

.discovery-icon {
    font-size: 1rem;
    line-height: 1;
}

.discovery-entry.system .discovery-icon {
    color: #FFAA00;
}

.discovery-entry.body .discovery-icon {
    color: #00AAFF;
}

.discovery-info {
    flex: 1;
}

.discovery-name {
    font-size: 0.9rem;
    color: #00FFAA;
}

.discovery-details {
    font-size: 0.75rem;
    color: #00AA77;
}

/* Scrollbar styling for journal */
.discoveries-list::-webkit-scrollbar {
    width: 6px;
}

.discoveries-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.discoveries-list::-webkit-scrollbar-thumb {
    background: #00FF88;
    border-radius: 3px;
}

/* ===== Phase 3: Survival System UI ===== */

/* HUD Container */
#hud-container {
    display: flex;
    gap: 1rem;
    background: linear-gradient(180deg, rgba(0, 30, 50, 0.95) 0%, rgba(0, 15, 30, 0.9) 100%);
    border: 1px solid #00FF88;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    z-index: 50;
}

.hud-bar-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.hud-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hud-label {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #00CC77;
    min-width: 30px;
}

.hud-bar-track {
    width: 80px;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00FF88;
    border-radius: 2px;
    overflow: hidden;
}

.hud-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00AA55, #00FF88);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

.hud-value {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #00FF88;
    min-width: 24px;
    text-align: right;
}

/* HUD Warning States */
.hud-bar.warning .hud-bar-fill {
    background: linear-gradient(90deg, #AA8800, #FFCC00);
    animation: hud-pulse-warning 1s ease-in-out infinite;
}

.hud-bar.warning .hud-label,
.hud-bar.warning .hud-value {
    color: #FFCC00;
}

.hud-bar.critical .hud-bar-fill {
    background: linear-gradient(90deg, #AA0000, #FF4444);
    animation: hud-pulse-critical 0.5s ease-in-out infinite;
}

.hud-bar.critical .hud-label,
.hud-bar.critical .hud-value {
    color: #FF4444;
}

@keyframes hud-pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes hud-pulse-critical {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Credits display */
.hud-credits {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.hud-credits-label {
    color: #00CC77;
}

.hud-credits-value {
    color: #00FF88;
    font-weight: bold;
}

.hud-credits-unit {
    color: #00AA66;
}

.hud-cargo {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    transition: background 0.2s;
}

.hud-cargo:hover {
    background: rgba(0, 255, 136, 0.1);
}

.hud-cargo-label {
    color: #00CC77;
}

.hud-cargo-value {
    color: #FFAA00;
    font-weight: bold;
}

/* Cargo Panel */
.cargo-panel {
    background: linear-gradient(135deg, rgba(0, 30, 50, 0.95) 0%, rgba(0, 15, 35, 0.95) 100%);
    border: 1px solid #00FF88;
    border-radius: 4px;
    padding: 1rem;
    min-width: 200px;
    max-width: 280px;
    font-family: 'Courier New', monospace;
    box-shadow:
        0 0 15px rgba(0, 255, 136, 0.3),
        inset 0 0 30px rgba(0, 255, 136, 0.05);
}

.cargo-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
}

.cargo-panel-header h5 {
    margin: 0;
    color: #00FF88;
    font-size: 1rem;
}

.cargo-capacity {
    color: #FFAA00;
}

.cargo-items {
    max-height: 300px;
    overflow-y: auto;
}

.cargo-item {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
    font-size: 0.85rem;
}

.cargo-item:last-child {
    border-bottom: none;
}

.cargo-item-name {
    color: #CCFFEE;
}

.cargo-item-amount {
    color: #00FF88;
    font-weight: bold;
}

.cargo-item-volume {
    color: #667788;
    font-weight: normal;
    font-size: 0.8rem;
}

.cargo-empty {
    color: #667788;
    font-style: italic;
    text-align: center;
    padding: 1rem 0;
}

.cargo-hint {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 255, 136, 0.3);
    text-align: center;
    color: #667788;
}

/* Warning Alerts */
#warning-container {
    z-index: 60;
}

.warning-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.warning-alert {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: bold;
    text-align: center;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.warning-alert.show {
    opacity: 1;
    transform: translateX(0);
}

.warning-alert.hide {
    opacity: 0;
    transform: translateX(100%);
}

.warning-alert.warning {
    background: rgba(255, 170, 0, 0.9);
    border: 1px solid #FFAA00;
    color: #000;
    animation: warning-blink 1s ease-in-out infinite;
}

.warning-alert.critical {
    background: rgba(255, 0, 0, 0.9);
    border: 1px solid #FF0000;
    color: #FFF;
    animation: critical-blink 0.5s ease-in-out infinite;
}

.warning-alert.info {
    background: rgba(0, 170, 255, 0.9);
    border: 1px solid #00AAFF;
    color: #FFF;
}

@keyframes warning-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes critical-blink {
    0%, 100% { opacity: 1; background: rgba(255, 0, 0, 0.9); }
    50% { opacity: 0.9; background: rgba(200, 0, 0, 0.9); }
}

/* Docking Prompt */
.docking-prompt-panel {
    background: rgba(0, 40, 60, 0.95);
    border: 2px solid #00FFAA;
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #00FF88;
    text-shadow: 0 0 5px #00FF88;
    animation: dock-prompt-pulse 2s ease-in-out infinite;
}

.docking-prompt-panel .key-hint {
    display: inline-block;
    background: #00FF88;
    color: #000;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    font-weight: bold;
    margin: 0 0.25rem;
}

#dock-station-name {
    color: #00FFFF;
}

@keyframes dock-prompt-pulse {
    0%, 100% { border-color: #00FFAA; }
    50% { border-color: #00AA77; }
}

/* Station UI Panel */
.station-panel {
    background: linear-gradient(180deg, rgba(0, 35, 55, 0.98) 0%, rgba(0, 20, 40, 0.98) 100%);
    border: 2px solid #00FF88;
    border-radius: 8px;
    padding: 1.5rem;
    min-width: 400px;
    max-width: 450px;
    font-family: 'Courier New', monospace;
    color: #00FF88;
    box-shadow:
        0 0 30px rgba(0, 255, 136, 0.4),
        0 0 60px rgba(0, 255, 136, 0.2),
        inset 0 0 40px rgba(0, 255, 136, 0.05);
    animation: stationPanelGlow 3s ease-in-out infinite;
}

@keyframes stationPanelGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(0, 255, 136, 0.4), 0 0 60px rgba(0, 255, 136, 0.2), inset 0 0 40px rgba(0, 255, 136, 0.05); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 136, 0.5), 0 0 80px rgba(0, 255, 136, 0.3), inset 0 0 50px rgba(0, 255, 136, 0.08); }
}

.station-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.station-header h4 {
    color: #00FFAA;
    margin-bottom: 0.25rem;
}

.station-type {
    color: #00AA77;
    font-size: 0.9rem;
}

.station-panel hr {
    border-color: rgba(0, 255, 136, 0.3);
    margin: 1rem 0;
}

.station-services h5 {
    color: #00FFAA;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.service-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 255, 136, 0.15);
}

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

.service-info {
    display: flex;
    flex-direction: column;
}

.service-name {
    color: #00FFAA;
    font-size: 0.9rem;
}

.service-status {
    color: #00AA77;
    font-size: 0.75rem;
}

.service-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.service-cost {
    color: #FFAA00;
    font-size: 0.8rem;
    min-width: 60px;
    text-align: right;
}

.station-panel .btn {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

.station-panel .btn-outline-success {
    color: #00FF88;
    border-color: #00FF88;
}

.station-panel .btn-outline-success:hover:not(:disabled) {
    background: #00FF88;
    color: #000;
}

.station-panel .btn-outline-warning {
    color: #FFAA00;
    border-color: #FFAA00;
}

.station-panel .btn-outline-warning:hover:not(:disabled) {
    background: #FFAA00;
    color: #000;
}

.station-panel .btn-outline-info {
    color: #00AAFF;
    border-color: #00AAFF;
}

.station-panel .btn-outline-info:hover:not(:disabled) {
    background: #00AAFF;
    color: #000;
}

.station-panel .btn-outline-danger {
    color: #FF4444;
    border-color: #FF4444;
}

.station-panel .btn-outline-danger:hover {
    background: #FF4444;
    color: #FFF;
}

.station-panel .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.station-credits {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.station-credits span:last-child {
    color: #FFAA00;
    font-weight: bold;
}

.station-actions {
    margin-top: 1rem;
}

.station-message {
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
    font-size: 0.85rem;
}

.station-message.success {
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid #00FF88;
    color: #00FF88;
}

.station-message.error {
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid #FF4444;
    color: #FF4444;
}

/* ===== Phase 4: Trading System UI ===== */

/* Station Tabs */
.station-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    padding-bottom: 0.5rem;
}

.station-tab {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(0, 255, 136, 0.4);
    border-radius: 4px;
    color: #00AA77;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.station-tab:hover {
    background: rgba(0, 255, 136, 0.1);
    color: #00FF88;
}

.station-tab.active {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00FF88;
    color: #00FF88;
}

.station-tab-content {
    min-height: 200px;
}

/* Trade Info Bar */
.trade-info-bar {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #00CC77;
}

/* Trade Columns Layout */
.trade-columns {
    display: flex;
    gap: 1rem;
}

.trade-column {
    flex: 1;
    min-width: 0;
}

.trade-column-header {
    font-size: 0.75rem;
    color: #00FFAA;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

/* Goods List */
.goods-list {
    max-height: 180px;
    overflow-y: auto;
}

.goods-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.25rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
    font-size: 0.8rem;
}

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

.goods-row:hover {
    background: rgba(0, 255, 136, 0.05);
}

.goods-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.goods-name {
    color: #00FFAA;
    font-size: 0.8rem;
}

.goods-stock {
    color: #00AA77;
    font-size: 0.7rem;
}

.goods-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.goods-price {
    color: #FFAA00;
    font-size: 0.75rem;
    min-width: 50px;
    text-align: right;
}

.goods-price.sell-price {
    color: #00AAFF;
}

.goods-list .btn {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
}

.no-goods {
    color: #00AA77;
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem;
    font-style: italic;
}

/* Scrollbar for goods list */
.goods-list::-webkit-scrollbar {
    width: 4px;
}

.goods-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.goods-list::-webkit-scrollbar-thumb {
    background: #00FF88;
    border-radius: 2px;
}

/* Trade Message */
.trade-message {
    margin-top: 0.75rem;
    padding: 0.4rem;
    border-radius: 4px;
    text-align: center;
    font-size: 0.8rem;
}

.trade-message.success {
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid #00FF88;
    color: #00FF88;
}

.trade-message.error {
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid #FF4444;
    color: #FF4444;
}

/* ===== Phase 4: Mining System UI ===== */

/* Mining Prompt Panel */
.mining-prompt-panel {
    background: rgba(0, 40, 60, 0.95);
    border: 2px solid #FFAA00;
    border-radius: 4px;
    padding: 0.75rem 1.25rem;
    font-family: 'Courier New', monospace;
    color: #FFAA00;
    min-width: 180px;
}

.mining-target {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: #00FF88;
}

.mining-target span {
    color: #00FFFF;
}

.mining-resources {
    margin-bottom: 0.5rem;
}

.resource-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 2px;
    margin-bottom: 0.25rem;
}

.resource-item.selected {
    background: rgba(255, 170, 0, 0.2);
}

.resource-number {
    color: #00FF88;
    font-weight: bold;
    margin-right: 0.25rem;
}

.resource-name {
    color: #FFCC00;
}

.resource-amount {
    color: #00AA77;
    font-size: 0.75rem;
}

.no-resources {
    color: #AA7700;
    font-size: 0.8rem;
    font-style: italic;
}

.mining-hint {
    font-size: 0.75rem;
    color: #AA8800;
}

.mining-hint .key-hint {
    display: inline-block;
    background: #FFAA00;
    color: #000;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: bold;
    margin: 0 0.15rem;
}

/* Mining Progress Panel */
.mining-progress-panel {
    background: rgba(0, 40, 60, 0.95);
    border: 1px solid #FFAA00;
    border-radius: 4px;
    padding: 0.75rem 1.25rem;
    text-align: center;
    color: #FFAA00;
    font-family: 'Courier New', monospace;
}

.mining-status {
    font-size: 0.9rem;
}

#mining-resource-name {
    color: #FFCC00;
}

.mining-progress-panel .progress {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #FFAA00;
}

.mining-progress-panel .progress-bar {
    transition: width 0.1s linear;
}

/* ===== Galaxy Map UI ===== */

/* Labels container */
#galaxy-map-labels {
    pointer-events: none;
    z-index: 15;
}

.galaxy-labels {
    position: relative;
    width: 100%;
    height: 100%;
}

/* System labels */
.system-label {
    position: absolute;
    transform: translate(-50%, -100%);
    padding: 0.25rem 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s ease;
    border-radius: 3px;
    margin-top: -10px;
}

.system-label .system-number {
    display: inline-block;
    background: rgba(0, 0, 0, 0.7);
    color: #00FF88;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    margin-right: 0.25rem;
    font-weight: bold;
    border: 1px solid #00FF88;
}

.system-label .system-name {
    color: #00FFAA;
    text-shadow: 0 0 3px #000, 0 0 6px #000;
}

/* Fog of war states */
.system-label.unexplored {
    opacity: 0.3;
}

.system-label.unexplored .system-number {
    border-color: #444;
    color: #666;
}

.system-label.rumored {
    opacity: 0.6;
}

.system-label.rumored .system-number {
    border-color: #666;
    color: #888;
}

.system-label.scanned {
    opacity: 0.85;
}

.system-label.scanned .system-number {
    border-color: #00AA66;
    color: #00CC77;
}

.system-label.explored {
    opacity: 1;
}

/* Current system highlight */
.system-label.current {
    opacity: 1;
}

.system-label.current .system-number {
    background: #00FF88;
    color: #000;
    border-color: #00FF88;
}

.system-label.current .system-name {
    color: #00FF88;
    font-weight: bold;
}

/* Selected system highlight */
.system-label.selected {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1.1);
}

.system-label.selected .system-number {
    background: #FFAA00;
    color: #000;
    border-color: #FFAA00;
    animation: pulse-select 1s ease-in-out infinite;
}

.system-label.selected .system-name {
    color: #FFCC00;
}

@keyframes pulse-select {
    0%, 100% { box-shadow: 0 0 5px #FFAA00; }
    50% { box-shadow: 0 0 15px #FFAA00; }
}

/* Hover effect */
.system-label:hover {
    transform: translate(-50%, -100%) scale(1.1);
    z-index: 100;
}

.system-label:hover .system-number {
    background: rgba(0, 255, 136, 0.3);
}

/* Galaxy info panel */
.galaxy-info-panel {
    background: rgba(0, 20, 40, 0.95);
    border: 2px solid #00FF88;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    min-width: 200px;
    font-family: 'Courier New', monospace;
    color: #00FF88;
}

.galaxy-info-panel h5 {
    color: #00FFAA;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.galaxy-star-type {
    color: #00AA77;
    font-size: 0.85rem;
}

.galaxy-info-panel hr {
    border-color: rgba(0, 255, 136, 0.3);
    margin: 0.75rem 0;
}

.galaxy-status {
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.galaxy-status.unexplored {
    background: rgba(100, 100, 100, 0.3);
    color: #888;
}

.galaxy-status.rumored {
    background: rgba(150, 150, 100, 0.3);
    color: #AAAA66;
}

.galaxy-status.scanned {
    background: rgba(0, 150, 100, 0.3);
    color: #00AA77;
}

.galaxy-status.explored {
    background: rgba(0, 255, 136, 0.3);
    color: #00FF88;
}

.galaxy-details {
    font-size: 0.85rem;
    color: #00CC77;
}

.galaxy-jump-info {
    font-size: 0.8rem;
}

.galaxy-jump-info .current-label {
    color: #00FF88;
    font-weight: bold;
}

.galaxy-jump-info .jump-hint {
    color: #FFAA00;
}

.galaxy-jump-info .key-hint {
    display: inline-block;
    background: #FFAA00;
    color: #000;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: bold;
    margin: 0 0.15rem;
}

/* ===== Nearby Objects Hint ===== */

.nearby-hint-panel {
    background: rgba(0, 20, 40, 0.85);
    border: 1px solid rgba(0, 255, 136, 0.5);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.nearby-objects {
    color: #00CC77;
    margin-bottom: 0.25rem;
}

.nearby-objects .separator {
    color: rgba(0, 255, 136, 0.3);
    margin: 0 0.5rem;
}

#nearby-bodies-count {
    color: #00AAFF;
}

#nearby-stations-count {
    color: #FFAA00;
}

.nearby-action {
    color: rgba(0, 255, 136, 0.7);
    font-size: 0.75rem;
}

.nearby-action .key-hint {
    display: inline-block;
    background: #00FF88;
    color: #000;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-weight: bold;
    margin: 0 0.15rem;
}

/* Pulse animation to draw attention initially */
.nearby-hint-panel.highlight {
    animation: hint-pulse 2s ease-in-out 3;
}

@keyframes hint-pulse {
    0%, 100% { border-color: rgba(0, 255, 136, 0.5); }
    50% { border-color: rgba(0, 255, 136, 1); box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); }
}

/* ===== Phase 5: Combat System UI ===== */

/* Combat UI Container */
#combat-ui-container {
    pointer-events: auto;
    z-index: 80;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
}

#combat-ui-container.d-none {
    display: none !important;
}

/* Combat Panel */
.combat-panel {
    background: rgba(0, 20, 40, 0.95);
    border: 2px solid #FF4444;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    min-width: 600px;
    max-width: 700px;
    font-family: 'Courier New', monospace;
    color: #00FF88;
    position: relative;
}

.combat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 68, 68, 0.5);
}

.combat-label {
    font-size: 1.25rem;
    font-weight: bold;
    color: #FF4444;
    text-shadow: 0 0 10px #FF4444;
    animation: combat-pulse 2s ease-in-out infinite;
}

@keyframes combat-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.combat-pause-hint {
    font-size: 0.8rem;
    color: #FFAA00;
}

/* Status Row */
.combat-status-row {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1rem;
}

.combat-enemy-status,
.combat-player-status {
    flex: 1;
}

.status-header {
    font-size: 0.9rem;
    color: #00FFAA;
    margin-bottom: 0.5rem;
}

#combat-enemy-name {
    color: #FF6666;
}

/* Health Bars */
.health-bar-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.health-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.health-bar .bar-label {
    font-size: 0.7rem;
    color: #00AA77;
    min-width: 40px;
}

.health-bar .bar-track {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00FF88;
    border-radius: 2px;
    overflow: hidden;
}

.health-bar .bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.health-bar .bar-fill.hull-fill {
    background: linear-gradient(90deg, #00AA55, #00FF88);
}

.health-bar .bar-fill.shield-fill {
    background: linear-gradient(90deg, #0066AA, #00AAFF);
}

.health-bar .bar-fill.warning {
    background: linear-gradient(90deg, #AA8800, #FFCC00);
}

.health-bar .bar-fill.critical {
    background: linear-gradient(90deg, #AA0000, #FF4444);
    animation: bar-critical-pulse 0.5s ease-in-out infinite;
}

.health-bar .bar-fill.disabled {
    background: #444;
}

@keyframes bar-critical-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.health-bar .bar-value {
    font-size: 0.7rem;
    color: #00CC77;
    min-width: 50px;
    text-align: right;
}

/* Main Combat Row */
.combat-main-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

/* Power Allocation */
.combat-power {
    flex: 1;
}

.power-header {
    font-size: 0.85rem;
    color: #00FFAA;
    margin-bottom: 0.5rem;
}

.power-slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.power-slider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.power-slider .slider-label {
    font-size: 0.75rem;
    color: #00AA77;
    min-width: 55px;
}

.power-slider .slider-track {
    flex: 1;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00FF88;
    border-radius: 2px;
    overflow: hidden;
}

.power-slider .slider-fill {
    height: 100%;
    transition: width 0.2s ease;
}

.power-slider .slider-fill.weapons-fill {
    background: linear-gradient(90deg, #AA4400, #FF6600);
}

.power-slider .slider-fill.shields-fill {
    background: linear-gradient(90deg, #0044AA, #0088FF);
}

.power-slider .slider-fill.engines-fill {
    background: linear-gradient(90deg, #00AA44, #00FF66);
}

.power-slider .slider-value {
    font-size: 0.7rem;
    color: #00CC77;
    min-width: 30px;
    text-align: right;
}

.power-slider .slider-controls {
    display: flex;
    gap: 0.25rem;
}

.power-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 0.8rem;
    font-weight: bold;
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid #00FF88;
    border-radius: 3px;
    color: #00FF88;
    cursor: pointer;
    transition: all 0.2s ease;
}

.power-btn:hover {
    background: #00FF88;
    color: #000;
}

/* Combat Actions */
.combat-actions {
    min-width: 150px;
}

.actions-header {
    font-size: 0.85rem;
    color: #00FFAA;
    margin-bottom: 0.5rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    border: 1px solid;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn .key-hint {
    display: inline-block;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-size: 0.65rem;
    font-weight: bold;
}

.action-btn.fire-btn {
    background: rgba(255, 68, 68, 0.2);
    border-color: #FF4444;
    color: #FF6666;
}

.action-btn.fire-btn:hover {
    background: #FF4444;
    color: #FFF;
}

.action-btn.pause-btn {
    background: rgba(255, 170, 0, 0.2);
    border-color: #FFAA00;
    color: #FFCC00;
}

.action-btn.pause-btn:hover {
    background: #FFAA00;
    color: #000;
}

.action-btn.flee-btn {
    background: rgba(0, 170, 255, 0.2);
    border-color: #00AAFF;
    color: #00CCFF;
}

.action-btn.flee-btn:hover {
    background: #00AAFF;
    color: #000;
}

.action-btn.surrender-btn {
    background: rgba(136, 136, 136, 0.2);
    border-color: #888;
    color: #AAA;
}

.action-btn.surrender-btn:hover {
    background: #888;
    color: #FFF;
}

/* Combat Log */
.combat-log-row {
    border-top: 1px solid rgba(0, 255, 136, 0.2);
    padding-top: 0.5rem;
}

.combat-log-header {
    font-size: 0.75rem;
    color: #00AA77;
    margin-bottom: 0.25rem;
}

.combat-log {
    max-height: 80px;
    overflow-y: auto;
    font-size: 0.7rem;
    color: #00CC77;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.combat-log .log-entry {
    padding: 0.1rem 0;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
}

.combat-log .log-entry:last-child {
    border-bottom: none;
}

.combat-log .log-time {
    color: #00AA66;
    margin-right: 0.5rem;
}

/* Combat Log Scrollbar */
.combat-log::-webkit-scrollbar {
    width: 4px;
}

.combat-log::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.combat-log::-webkit-scrollbar-thumb {
    background: #00FF88;
    border-radius: 2px;
}

/* Tactical Pause Overlay */
.combat-paused-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 40, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    z-index: 10;
}

.combat-paused-overlay span {
    font-size: 2rem;
    color: #FFAA00;
    text-shadow: 0 0 15px #FFAA00;
    animation: pause-pulse 1.5s ease-in-out infinite;
}

.combat-paused-overlay small {
    color: #AA8800;
    margin-top: 0.5rem;
}

@keyframes pause-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

.combat-paused-overlay.d-none {
    display: none !important;
}

/* Combat Active Body Effect */
body.combat-active #game-canvas {
    filter: saturate(1.2) contrast(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #system-info,
    #galaxy-map-help {
        font-size: 0.875rem;
    }

    #controls-hint {
        font-size: 0.75rem;
    }

    .body-info {
        min-width: 180px;
    }

    .journal-panel.offcanvas {
        width: 280px !important;
    }

    #hud-container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.25rem 0.5rem;
    }

    .hud-bar-track {
        width: 60px;
    }

    .station-panel {
        min-width: 320px;
        padding: 1rem;
    }

    .combat-panel {
        min-width: 90vw;
        padding: 0.75rem;
    }

    .combat-status-row {
        flex-direction: column;
        gap: 1rem;
    }

    .combat-main-row {
        flex-direction: column;
        gap: 1rem;
    }

    .combat-actions {
        min-width: auto;
    }

    .action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .action-btn {
        flex: 1;
        min-width: 45%;
    }
}

/* ===== Anomaly Investigation UI ===== */

/* Anomaly Prompt Panel */
.anomaly-prompt-panel {
    background: rgba(40, 0, 60, 0.95);
    border: 2px solid #AA44FF;
    border-radius: 4px;
    padding: 0.75rem 1.25rem;
    font-family: 'Courier New', monospace;
    color: #CC77FF;
    min-width: 200px;
    animation: anomaly-glow 2s ease-in-out infinite;
}

@keyframes anomaly-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(170, 68, 255, 0.3); }
    50% { box-shadow: 0 0 15px rgba(170, 68, 255, 0.6); }
}

.anomaly-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: bold;
}

.anomaly-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: #AA44FF;
    color: #000;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1rem;
    animation: icon-pulse 1s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.anomaly-title {
    color: #DD88FF;
    text-shadow: 0 0 5px #AA44FF;
}

.anomaly-target {
    font-size: 0.8rem;
    color: #00FF88;
    margin-bottom: 0.25rem;
}

.anomaly-type {
    font-size: 0.9rem;
    color: #FFAA00;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(170, 68, 255, 0.2);
    border-radius: 3px;
}

.anomaly-hint {
    font-size: 0.75rem;
    color: #9966CC;
}

.anomaly-hint .key-hint {
    display: inline-block;
    background: #AA44FF;
    color: #000;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: bold;
    margin: 0 0.15rem;
}

/* Anomaly Progress Panel */
.anomaly-progress-panel {
    background: rgba(40, 0, 60, 0.95);
    border: 1px solid #AA44FF;
    border-radius: 4px;
    padding: 0.75rem 1.25rem;
    text-align: center;
    color: #CC77FF;
    font-family: 'Courier New', monospace;
}

.anomaly-status {
    font-size: 0.9rem;
}

#anomaly-progress-name {
    color: #FFAA00;
}

.anomaly-progress-panel .progress {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #AA44FF;
}

.anomaly-progress-panel .progress-bar {
    transition: width 0.1s linear;
    background: linear-gradient(90deg, #AA44FF, #DD88FF);
}

/* Anomaly Result Panel */
.anomaly-result-panel {
    background: rgba(20, 0, 40, 0.98);
    border: 2px solid #AA44FF;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    font-family: 'Courier New', monospace;
    text-align: center;
    min-width: 300px;
    max-width: 400px;
    animation: result-appear 0.3s ease-out;
}

@keyframes result-appear {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.anomaly-result-header {
    font-size: 1.1rem;
    font-weight: bold;
    color: #DD88FF;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(170, 68, 255, 0.5);
}

.anomaly-result-message {
    font-size: 0.95rem;
    line-height: 1.5;
}

.anomaly-result-message.result-positive {
    color: #00FF88;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

.anomaly-result-message.result-negative {
    color: #FF4444;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.3);
}

.anomaly-result-message.result-neutral {
    color: #AAAAAA;
}

/* ===== Phase 6: Progression System UI ===== */

/* Station Faction Info */
.station-faction {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Missions Tab */
.missions-header,
.upgrades-header {
    font-size: 0.85rem;
    color: #00FFAA;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

.missions-list {
    max-height: 250px;
    overflow-y: auto;
}

.station-mission-entry {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.station-mission-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.mission-icon {
    font-size: 1rem;
}

.mission-name {
    color: #00FFAA;
    font-weight: bold;
    font-size: 0.9rem;
}

.mission-description {
    color: #00AA77;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.mission-objectives {
    margin-bottom: 0.5rem;
}

.mission-objective-preview {
    color: #00CC77;
    font-size: 0.7rem;
    padding-left: 0.5rem;
    border-left: 2px solid #00FF88;
    margin-bottom: 0.25rem;
}

.mission-reward-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.reward-credits {
    color: #FFAA00;
}

.time-limit {
    color: #00AAFF;
}

.no-missions {
    color: #00AA77;
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem;
    font-style: italic;
}

/* Upgrades Tab */
.upgrades-list {
    max-height: 280px;
    overflow-y: auto;
}

.upgrade-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 170, 255, 0.2);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.upgrade-info {
    flex: 1;
}

.upgrade-name {
    color: #00AAFF;
    font-weight: bold;
    font-size: 0.85rem;
}

.upgrade-effect {
    color: #00AA77;
    font-size: 0.7rem;
}

.upgrade-tiers {
    margin-top: 0.25rem;
    display: flex;
    gap: 0.2rem;
}

.tier-box {
    width: 12px;
    height: 12px;
    border: 1px solid #00AAFF;
    border-radius: 2px;
}

.tier-box.filled {
    background: #00AAFF;
}

.tier-box.empty {
    background: transparent;
}

.upgrade-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upgrade-cost {
    color: #FFAA00;
    font-size: 0.75rem;
    min-width: 60px;
    text-align: right;
}

.upgrade-maxed {
    color: #00FF88;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Faction Panel */
.faction-panel {
    background: rgba(0, 20, 40, 0.95);
    border: 2px solid #FFAA00;
    border-radius: 8px;
    padding: 1rem;
    min-width: 280px;
    max-width: 320px;
    font-family: 'Courier New', monospace;
    color: #00FF88;
}

.faction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 170, 0, 0.3);
}

.faction-title {
    font-size: 1rem;
    font-weight: bold;
    color: #FFAA00;
}

.btn-close-panel {
    background: transparent;
    border: none;
    color: #FF4444;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.btn-close-panel:hover {
    color: #FF6666;
}

.faction-list {
    max-height: 300px;
    overflow-y: auto;
}

.faction-row {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
}

.faction-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.faction-info {
    margin-bottom: 0.25rem;
}

.faction-name {
    font-weight: bold;
    font-size: 0.85rem;
}

.faction-description {
    color: #00AA77;
    font-size: 0.7rem;
}

.faction-reputation {
    margin-top: 0.25rem;
}

.rep-bar-container {
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00FF88;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.rep-bar-zones {
    display: flex;
    height: 100%;
}

.rep-zone {
    height: 100%;
}

.rep-zone.hostile {
    background: rgba(255, 0, 0, 0.3);
}

.rep-zone.unfriendly {
    background: rgba(255, 100, 0, 0.3);
}

.rep-zone.neutral {
    background: rgba(100, 100, 100, 0.3);
}

.rep-zone.friendly {
    background: rgba(0, 255, 0, 0.3);
}

.rep-zone.allied {
    background: rgba(0, 255, 255, 0.3);
}

.rep-marker {
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: #FFF;
    transform: translateX(-50%);
    box-shadow: 0 0 5px #FFF;
}

.rep-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

.rep-number {
    color: #00AA77;
}

.rep-standing {
    font-weight: bold;
}

.faction-legend {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 255, 136, 0.2);
    font-size: 0.6rem;
}

.legend-item {
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
}

.legend-item.hostile {
    background: rgba(255, 0, 0, 0.3);
    color: #FF4444;
}

.legend-item.unfriendly {
    background: rgba(255, 100, 0, 0.3);
    color: #FF8844;
}

.legend-item.neutral {
    background: rgba(100, 100, 100, 0.3);
    color: #888;
}

.legend-item.friendly {
    background: rgba(0, 255, 0, 0.3);
    color: #44FF44;
}

.legend-item.allied {
    background: rgba(0, 255, 255, 0.3);
    color: #44FFFF;
}

/* Mission Log Panel */
.mission-panel {
    background: rgba(0, 20, 40, 0.95);
    border: 2px solid #00AAFF;
    border-radius: 8px;
    padding: 1rem;
    min-width: 400px;
    max-width: 500px;
    font-family: 'Courier New', monospace;
    color: #00FF88;
}

.mission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 170, 255, 0.3);
}

.mission-title {
    font-size: 1rem;
    font-weight: bold;
    color: #00AAFF;
}

.mission-list {
    max-height: 350px;
    overflow-y: auto;
}

.mission-entry {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.mission-entry-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.mission-time {
    margin-left: auto;
    font-size: 0.75rem;
}

.mission-time.time-critical {
    color: #FF4444;
    animation: time-blink 0.5s ease-in-out infinite;
}

.mission-time.time-warning {
    color: #FFAA00;
}

@keyframes time-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mission-objective {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0;
}

.mission-objective.complete {
    color: #00FF88;
}

.objective-check {
    font-family: monospace;
    color: #00AA77;
}

.objective-progress {
    margin-left: auto;
    color: #00AAFF;
}

.mission-reward {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    margin: 0.5rem 0;
}

.reward-label {
    color: #00AA77;
}

.reward-rep {
    color: #FFAA00;
}

.mission-progress-bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.mission-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00AAFF, #00FFAA);
    transition: width 0.3s ease;
}

.mission-actions {
    text-align: right;
}

.mission-footer {
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 170, 255, 0.2);
    text-align: center;
}

.mission-count {
    color: #00AA77;
    font-size: 0.75rem;
}

/* Victory Progress Panel */
.victory-progress-panel {
    background: rgba(0, 20, 40, 0.95);
    border: 2px solid #FFCC00;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    min-width: 240px;
    font-family: 'Courier New', monospace;
    color: #00FF88;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(255, 204, 0, 0.3);
}

.progress-title {
    font-size: 0.85rem;
    font-weight: bold;
    color: #FFCC00;
}

.progress-list {
    max-height: 200px;
    overflow-y: auto;
}

.progress-item {
    margin-bottom: 0.5rem;
}

.progress-item.achieved {
    opacity: 0.6;
}

.progress-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.progress-icon {
    font-size: 0.9rem;
}

.progress-name {
    color: #00FFAA;
}

.progress-achieved-badge {
    margin-left: auto;
    background: #00FF88;
    color: #000;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-size: 0.6rem;
    font-weight: bold;
}

.progress-bar-container {
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00FF88;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

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

.progress-values {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    color: #00AA77;
}

.progress-separator {
    color: #00AA77;
}

/* Game Over Screen */
.gameover-overlay {
    width: 100%;
    height: 100%;
    background: rgba(20, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: gameover-fadein 1s ease-out;
    z-index: 300;
}

@keyframes gameover-fadein {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.gameover-content {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
}

.gameover-title {
    font-size: 4rem;
    font-weight: bold;
    color: #FF4444;
    text-shadow: 0 0 30px #FF0000, 0 0 60px rgba(255, 0, 0, 0.5);
    margin-bottom: 1rem;
    animation: gameover-pulse 2s ease-in-out infinite;
    letter-spacing: 0.3rem;
}

@keyframes gameover-pulse {
    0%, 100% {
        text-shadow: 0 0 30px #FF0000, 0 0 60px rgba(255, 0, 0, 0.5);
        opacity: 1;
    }
    50% {
        text-shadow: 0 0 50px #FF0000, 0 0 80px rgba(255, 0, 0, 0.7);
        opacity: 0.8;
    }
}

.gameover-reason {
    font-size: 1.5rem;
    color: #FFAA66;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(255, 170, 100, 0.5);
}

.gameover-stats {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #FF4444;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.gameover-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 68, 68, 0.2);
}

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

.gameover-stat-label {
    color: #AA8888;
}

.gameover-stat-value {
    color: #FFCCCC;
    font-weight: bold;
}

.gameover-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.gameover-buttons .btn {
    min-width: 140px;
    padding: 0.75rem 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.gameover-buttons .btn-primary {
    background: #FF4444;
    border-color: #FF4444;
    color: #000;
}

.gameover-buttons .btn-primary:hover {
    background: #FF6666;
    border-color: #FF6666;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.gameover-buttons .btn-secondary {
    background: transparent;
    border-color: #888;
    color: #AAA;
}

.gameover-buttons .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #AAA;
    color: #FFF;
}

/* Victory Screen */
.victory-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 20, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: victory-fadein 0.5s ease-out;
}

@keyframes victory-fadein {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.victory-content {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
}

.victory-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: victory-bounce 1s ease-in-out infinite;
}

@keyframes victory-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.victory-title {
    font-size: 3rem;
    font-family: 'Courier New', monospace;
    color: #FFCC00;
    text-shadow: 0 0 20px #FFCC00, 0 0 40px #FFAA00;
    margin-bottom: 0.5rem;
    animation: victory-glow 2s ease-in-out infinite;
}

@keyframes victory-glow {
    0%, 100% { text-shadow: 0 0 20px #FFCC00, 0 0 40px #FFAA00; }
    50% { text-shadow: 0 0 30px #FFCC00, 0 0 60px #FFAA00, 0 0 80px #FF8800; }
}

.victory-subtitle {
    font-size: 1.5rem;
    font-family: 'Courier New', monospace;
    color: #00FF88;
    margin-bottom: 0.5rem;
}

.victory-description {
    color: #00AA77;
    font-family: 'Courier New', monospace;
    margin-bottom: 2rem;
}

.victory-stats {
    background: rgba(0, 40, 60, 0.8);
    border: 1px solid #00FF88;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    font-family: 'Courier New', monospace;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

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

.stat-label {
    color: #00AA77;
}

.stat-value {
    color: #00FFAA;
    font-weight: bold;
}

.victory-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.victory-buttons .btn {
    font-family: 'Courier New', monospace;
    min-width: 180px;
}

/* ===== Phase 7: Polish UI ===== */

/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    pointer-events: none;
}

.tutorial-hint {
    background: rgba(0, 40, 60, 0.95);
    border: 2px solid #00FFAA;
    border-radius: 8px;
    padding: 1.25rem 1.75rem;
    font-family: 'Courier New', monospace;
    text-align: center;
    max-width: 500px;
    pointer-events: auto;
    animation: tutorial-appear 0.3s ease-out;
    box-shadow: 0 0 30px rgba(0, 255, 170, 0.3);
}

@keyframes tutorial-appear {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.tutorial-text {
    color: #00FF88;
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

.tutorial-dismiss {
    color: #00AA77;
    font-size: 0.8rem;
}

/* Tutorial highlight for UI elements */
.tutorial-highlight {
    position: relative;
    animation: tutorial-highlight-pulse 1s ease-in-out infinite;
    box-shadow: 0 0 15px #00FFAA, 0 0 30px rgba(0, 255, 170, 0.5) !important;
    z-index: 100;
}

@keyframes tutorial-highlight-pulse {
    0%, 100% { box-shadow: 0 0 15px #00FFAA, 0 0 30px rgba(0, 255, 170, 0.5); }
    50% { box-shadow: 0 0 25px #00FFAA, 0 0 50px rgba(0, 255, 170, 0.7); }
}

/* Tutorial Skip Button */
#tutorial-skip {
    z-index: 201;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

/* Auto-save Indicator */
#autosave-indicator {
    z-index: 150;
    background: rgba(0, 20, 40, 0.9);
    border: 1px solid #00FF88;
    border-radius: 4px;
    padding: 0.25rem 0.75rem !important;
    font-family: 'Courier New', monospace;
    animation: autosave-appear 0.2s ease-out;
}

@keyframes autosave-appear {
    0% { transform: translateX(20px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

.autosave-text {
    font-size: 0.8rem;
    text-shadow: 0 0 5px #00FF88;
}

/* Pause Menu Updates */
.pause-content {
    text-align: center;
    color: #00FF88;
    text-shadow: 0 0 10px #00FF88;
    min-width: 280px;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pause-buttons .btn {
    font-family: 'Courier New', monospace;
}

.pause-buttons hr {
    border-color: rgba(0, 255, 136, 0.3);
    margin: 0.5rem 0;
}

/* Audio Controls in Pause Menu */
.audio-controls {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.audio-controls .form-label {
    color: #00AA77;
    margin-bottom: 0.25rem;
}

.audio-controls .form-range {
    width: 100%;
    accent-color: #00FF88;
}

.audio-controls .form-range::-webkit-slider-thumb {
    background: #00FF88;
}

.audio-controls .form-range::-moz-range-thumb {
    background: #00FF88;
}

/* Continue Prompt (on game load) */
#continue-prompt {
    z-index: 2000;
}

.continue-panel {
    background: rgba(0, 20, 40, 0.98);
    border: 2px solid #00FF88;
    border-radius: 8px;
    padding: 2rem;
    font-family: 'Courier New', monospace;
    min-width: 320px;
}

.continue-panel h3 {
    margin-bottom: 1rem;
}

.save-info {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.save-info div {
    padding: 0.25rem 0;
}

/* ===== Mobile Warning ===== */
#mobile-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 17, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#mobile-warning.d-none {
    display: none !important;
}

.mobile-warning-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.mobile-warning-content .warning-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.mobile-warning-content h3 {
    color: #FFAA00;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.mobile-warning-content p {
    color: #00FF88;
    font-family: 'Courier New', monospace;
    margin-bottom: 0.5rem;
}

.mobile-warning-content .text-dim {
    color: #00AA77;
    font-size: 0.9rem;
}

.mobile-warning-content .btn {
    display: block;
    width: 100%;
    font-family: 'Courier New', monospace;
}


/* ===== Music Attribution ===== */
.music-attribution {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 17, 0.7);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-family: "Courier New", monospace;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    z-index: 100;
}

.music-attribution.visible {
    opacity: 1;
    transform: translateX(0);
}

.music-attribution.d-none {
    display: none !important;
}

.music-attribution .music-icon {
    font-size: 1.2rem;
    color: #00FF88;
    opacity: 0.8;
}

.music-attribution .music-info {
    display: flex;
    flex-direction: column;
}

.music-attribution .music-title {
    color: #FFFFFF;
    font-size: 0.85rem;
    font-weight: bold;
}

.music-attribution .music-artist {
    color: #00DDAA;
    font-size: 0.75rem;
    opacity: 0.8;
}
