/* --- Base Setup & Fonts --- */
body {
    font-family: 'Exo 2', sans-serif;
    background-color: #0A0A18; /* Deeper space blue */
    color: #E0E7FF;
    overflow: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Dynamic Multi-Layered Starfield Background --- */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    background: #0A0A18;
}

/* This is the general style for ALL stars */
.starfield div div {
    position: absolute;
    border-radius: 50%;
    background-color: #FFF;
    animation: twinkle 5s infinite;
}

/* These containers are now just placeholders and don't need individual styles */
#stars1, #stars2, #stars3 {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Target the DIVs INSIDE #stars1 for the smallest stars */
#stars1 div {
    width: 1px;
    height: 1px;
    animation-duration: 50s;
    animation-name: animStar;
}

/* Target the DIVs INSIDE #stars2 for medium stars */
#stars2 div {
    width: 2px;
    height: 2px;
    animation-duration: 100s;
    animation-name: animStar;
}

/* Target the DIVs INSIDE #stars3 for the largest stars */
#stars3 div {
    width: 3px;
    height: 3px;
    animation-duration: 150s;
    animation-name: animStar;
}

/* --- Nebula/Cosmic Dust Effect --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -9;
    background: 
        radial-gradient(ellipse at 70% 20%, rgba(138, 43, 226, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 80%, rgba(0, 191, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    animation: nebula-flow 45s alternate infinite;
}


/* --- Enhanced Glassmorphism & Holographic UI --- */
.glass-pane {
    background: linear-gradient(135deg, rgba(28, 25, 50, 0.7), rgba(40, 35, 80, 0.6));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(124, 58, 237, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.glass-pane:hover {
    transform: translateY(-5px) scale(1.01);
    border-color: rgba(167, 139, 250, 0.8);
    box-shadow: 
        0 12px 40px rgba(124, 58, 237, 0.25),
        0 0 40px rgba(124, 58, 237, 0.2);
}

.glass-pane-inner {
    background: rgba(30, 27, 45, 0.8);
    border: 1px solid rgba(138, 92, 246, 0.25);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.glass-pane-inner:hover {
    background: rgba(45, 40, 70, 0.9);
    border-color: rgba(138, 92, 246, 0.5);
    transform: scale(1.02);
}

/* --- Core Animations --- */
@keyframes animStar {
    from { transform: translateY(0px); }
    to { transform: translateY(-2000px); }
}

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

@keyframes nebula-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes glow-pulse {
    0%, 100% { text-shadow: 0 0 8px #A78BFA, 0 0 16px #A78BFA; }
    50% { text-shadow: 0 0 16px #C4B5FD, 0 0 32px #A78BFA; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.fade-in {
    animation: fadeIn 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* --- UI Component Styling --- */
.title-glow {
    animation: glow-pulse 3s ease-in-out infinite;
    color: #ddd6fe;
}

/* Progress Bars */
.progress-bar-container {
    background: rgba(10, 10, 24, 0.7);
    border-radius: 50px;
    overflow: hidden;
    padding: 2px;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.progress-bar {
    background: linear-gradient(90deg, #6d28d9, #4f46e5, #22d3ee);
    background-size: 200% 100%;
    border-radius: 50px;
    box-shadow: 0 0 10px rgba(138, 92, 246, 0.7), 0 0 20px rgba(79, 70, 229, 0.5);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation: shimmer 3s linear infinite;
}

/* Navigation */
.nav-button {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    border-radius: 8px;
    font-weight: 600;
}

.nav-button.active, .nav-button:hover {
    background: rgba(124, 58, 237, 0.2);
    color: #ddd6fe;
    border-left-color: #a78bfa;
    transform: translateX(5px);
    box-shadow: inset 0 0 15px rgba(124, 58, 237, 0.2);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(45deg, #7c3aed, #4f46e5);
    border: 1px solid #a78bfa;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 50%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(124, 58, 237, 0.5), 0 0 20px #a78bfa;
    transform: translateY(-2px);
    border-color: #c4b5fd;
}

.btn-primary:active::before {
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0s;
}

.btn-primary:disabled {
    background: #37304A;
    border-color: #4c4466;
    color: #8b80b3;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    filter: saturate(0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.8), rgba(55, 65, 81, 0.8));
    border: 1px solid rgba(75, 85, 99, 0.5);
    color: white;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.9), rgba(55, 65, 81, 0.9));
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.8), rgba(185, 28, 28, 0.8));
    border: 1px solid rgba(220, 38, 38, 0.5);
    color: white;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.9), rgba(185, 28, 28, 0.9));
    transform: translateY(-1px);
}

/* Notifications */
.notification {
    background: rgba(28, 25, 50, 0.9);
    backdrop-filter: blur(15px);
    border-left: 4px solid;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: notification-enter 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: auto;
    max-width: 18rem;
    margin-left: auto;
}
.notification p {
    font-size: 0.9rem;
    line-height: 1.2;
}
.notification.success { border-color: #34d399; }
.notification.info { border-color: #60a5fa; }
.notification.error { border-color: #f87171; }
.notification.discovery { border-color: #f59e0b; }
.notification.warning { border-color: #fbbf24; }
.notification.achievement { border-color: #d8b4fe; }

@keyframes notification-enter {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #a78bfa, #7c3aed);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #c4b5fd, #a78bfa); }

/* Loader */
.loader {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #4c4466;
    border-top-color: #c4b5fd;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modals */
#ship-designer-modal, #crafting-modal {
    animation: fadeIn 0.3s ease;
}

/* Production / crafting modal */
.craft-modal__panel {
    width: min(96vw, 1100px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
}

.craft-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.25);
}

.craft-modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0;
}

.craft-modal__subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: rgba(196, 181, 253, 0.75);
}

.craft-modal__close {
    font-size: 1.75rem;
    line-height: 1;
    color: #c4b5fd;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 0.25rem;
}

.craft-modal__close:hover {
    color: #fff;
}

.craft-modal__resources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
    padding: 0.5rem 0.65rem;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 0.5rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
    max-height: 5.5rem;
    overflow-y: auto;
}

.craft-res-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    background: rgba(88, 28, 135, 0.25);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 999px;
    font-size: 0.75rem;
}

.craft-res-chip__sym {
    font-size: 0.9rem;
}

.craft-res-chip__name {
    color: #d8b4fe;
    max-width: 6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.craft-res-chip__amt {
    font-weight: 700;
    color: #f5f3ff;
    font-variant-numeric: tabular-nums;
}

.craft-res-empty {
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
}

.craft-modal__body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1rem;
    overflow: hidden;
}

.craft-modal__section-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a78bfa;
    margin: 0 0 0.5rem;
}

.craft-modal__recipes-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.craft-modal__recipes {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.65rem;
    padding-right: 0.35rem;
}

.craft-modal__queue-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-left: 1px solid rgba(139, 92, 246, 0.2);
    padding-left: 1rem;
}

.craft-modal__queue {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.craft-recipe {
    background: rgba(15, 10, 30, 0.65);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 0.5rem;
    padding: 0.65rem 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.craft-recipe:hover {
    border-color: rgba(167, 139, 250, 0.45);
}

.craft-recipe--blocked {
    opacity: 0.72;
}

.craft-recipe__head {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.craft-recipe__icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.craft-recipe__meta {
    flex: 1;
    min-width: 0;
}

.craft-recipe__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ede9fe;
}

.craft-recipe__sub {
    margin: 0.15rem 0 0;
    font-size: 0.7rem;
    color: #a78bfa;
}

.craft-recipe__dot {
    opacity: 0.5;
    margin: 0 0.2rem;
}

.craft-quality {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.craft-quality__tag {
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 3px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.craft-quality__tag--basic { background: rgba(107, 114, 128, 0.35); color: #e5e7eb; }
.craft-quality__tag--enhanced { background: rgba(37, 99, 235, 0.35); color: #93c5fd; }
.craft-quality__tag--superior { background: rgba(124, 58, 237, 0.35); color: #c4b5fd; }
.craft-quality__tag--legendary { background: rgba(202, 138, 4, 0.35); color: #fde047; }

.craft-recipe__costs {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.45rem;
}

.craft-cost-row {
    display: grid;
    grid-template-columns: 1.25rem 1fr auto;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
}

.craft-cost-row--short .craft-cost-row__have--low {
    color: #f87171;
    font-weight: 700;
}

.craft-cost-row__name {
    color: #c4b5fd;
}

.craft-cost-row__vals {
    font-variant-numeric: tabular-nums;
    color: #e9d5ff;
}

.craft-cost-row__sep {
    opacity: 0.45;
    margin: 0 0.15rem;
}

.craft-cost-row__need {
    color: #a78bfa;
}

.craft-recipe__warn {
    margin: 0 0 0.4rem;
    font-size: 0.7rem;
    color: #fca5a5;
}

.craft-recipe__actions {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.35rem;
    align-items: center;
}

.craft-qty-control {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 0.35rem;
    overflow: hidden;
}

.craft-qty-btn {
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    background: rgba(88, 28, 135, 0.4);
    color: #e9d5ff;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.craft-qty-btn:hover {
    background: rgba(109, 40, 217, 0.6);
}

.craft-qty-input {
    width: 2.5rem;
    text-align: center;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}

.craft-qty-input::-webkit-outer-spin-button,
.craft-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.craft-btn {
    padding: 0.4rem 0.65rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease;
}

.craft-btn--primary {
    background: linear-gradient(180deg, #7c3aed 0%, #5b21b6 100%);
    color: #fff;
    border-color: rgba(167, 139, 250, 0.5);
}

.craft-btn--primary:hover:not(:disabled) {
    filter: brightness(1.1);
}

.craft-btn--ghost {
    background: rgba(30, 20, 50, 0.8);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.35);
}

.craft-btn--ghost:hover:not(:disabled) {
    background: rgba(88, 28, 135, 0.35);
}

.craft-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.craft-queue-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.5rem 0.6rem;
    background: rgba(15, 10, 30, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 0.4rem;
}

.craft-queue-item__name {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ede9fe;
}

.craft-queue__batch {
    color: #a78bfa;
    font-weight: 500;
}

.craft-queue-item__bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    margin: 0.35rem 0 0.2rem;
    overflow: hidden;
}

.craft-queue-item__fill {
    height: 100%;
    background: linear-gradient(90deg, #6d28d9, #a78bfa);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.craft-queue-item__eta {
    margin: 0;
    font-size: 0.68rem;
    color: #9ca3af;
}

.craft-queue-item__cancel {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    border-radius: 0.25rem;
    background: rgba(127, 29, 29, 0.4);
    color: #fca5a5;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.craft-queue-item__cancel:hover {
    background: rgba(185, 28, 28, 0.55);
    color: #fff;
}

.craft-queue-empty,
.craft-empty {
    color: #6b7280;
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
    padding: 1.5rem 0.5rem;
}

@media (max-width: 768px) {
    .craft-modal__body {
        grid-template-columns: 1fr;
    }
    .craft-modal__queue-section {
        border-left: none;
        border-top: 1px solid rgba(139, 92, 246, 0.2);
        padding-left: 0;
        padding-top: 0.75rem;
        max-height: 28vh;
    }
}

/* Ship Designer Modal Improvements */
#ship-designer-modal {
    backdrop-filter: blur(8px);
}

#ship-designer-modal .glass-pane {
    max-height: 90vh;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 
                0 0 0 1px rgba(139, 92, 246, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Equipment Slot Improvements */
.equipment-slot {
    transition: all 0.2s ease;
}

.equipment-slot:hover {
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.equipment-slot select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.equipment-slot select:focus {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    outline: none;
}

/* Stats Panel Improvements */
.stats-category {
    border-left: 2px solid rgba(139, 92, 246, 0.3);
    padding-left: 0.75rem;
}

.stat-row {
    transition: background-color 0.15s ease;
    padding: 0.25rem 0;
    border-radius: 0.25rem;
}

.stat-row:hover {
    background-color: rgba(139, 92, 246, 0.1);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Equipment Summary Improvements */
.quality-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.25rem;
}

.quality-basic { background-color: #6b7280; }
.quality-enhanced { background-color: #3b82f6; }
.quality-superior { background-color: #8b5cf6; }
.quality-legendary { background-color: #f59e0b; }

/* --- Research & Development --- */
.rd-view {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 2rem;
}

.rd-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
}

.rd-header__lead {
    margin-top: 0.5rem;
    max-width: 42rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #a8a3c4;
}

.rd-header__stat {
    text-align: center;
    padding: 0.75rem 1.25rem;
    min-width: 8rem;
}

.rd-header__stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #c4b5fd;
}

.rd-header__stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8b80b3;
}

.rd-lab-strip {
    padding: 1rem 1.25rem;
}

.rd-lab-strip__top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.rd-lab-strip__label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8b80b3;
}

.rd-lab-strip__level {
    font-size: 1.25rem;
    font-weight: 700;
    color: #5eead4;
}

.rd-lab-strip__btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
}

.rd-lab-strip__steps {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.rd-lab-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: rgba(20, 18, 36, 0.6);
    min-width: 2.75rem;
    opacity: 0.45;
}

.rd-lab-step--built {
    opacity: 0.7;
    border-color: rgba(94, 234, 212, 0.4);
}

.rd-lab-step--active {
    opacity: 1;
    border-color: #5eead4;
    box-shadow: 0 0 12px rgba(94, 234, 212, 0.25);
}

.rd-lab-step__lv {
    font-size: 0.65rem;
    color: #8b80b3;
}

.rd-lab-step__tier {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ddd6fe;
}

.rd-lab-step-connector {
    width: 12px;
    height: 2px;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.5), rgba(94, 234, 212, 0.5));
    flex-shrink: 0;
}

.rd-lab-strip__hint {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0;
}

.rd-effects {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
}

.rd-effects__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8b80b3;
    margin-right: 0.25rem;
}

.rd-effects__chip {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(94, 234, 212, 0.15);
    border: 1px solid rgba(94, 234, 212, 0.35);
    color: #99f6e4;
}

.rd-idle,
.rd-active {
    padding: 0.85rem 1.1rem;
    font-size: 0.85rem;
    color: #a8a3c4;
}

.rd-active__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.rd-active__title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8b80b3;
    margin: 0;
}

.rd-active__name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #5eead4;
    margin: 0.15rem 0 0;
}

.rd-active__eta {
    text-align: right;
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0.35rem 0 0;
}

.rd-catalog {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.rd-category {
    border-radius: 16px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: linear-gradient(160deg, rgba(22, 20, 40, 0.85), rgba(30, 25, 55, 0.75));
    overflow: hidden;
}

.rd-category__header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.25);
}

.rd-accent--energy .rd-category__header { border-bottom-color: rgba(251, 191, 36, 0.25); }
.rd-accent--engineering .rd-category__header { border-bottom-color: rgba(94, 234, 212, 0.25); }
.rd-accent--propulsion .rd-category__header { border-bottom-color: rgba(96, 165, 250, 0.25); }
.rd-accent--military .rd-category__header { border-bottom-color: rgba(248, 113, 113, 0.25); }
.rd-accent--advanced .rd-category__header { border-bottom-color: rgba(192, 132, 252, 0.35); }

.rd-category__icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.rd-category__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0;
}

.rd-category__blurb {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0.2rem 0 0;
    line-height: 1.4;
}

.rd-category__progress {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: #a78bfa;
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(124, 58, 237, 0.2);
}

.rd-category__body {
    padding: 1rem 1.15rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.rd-propulsion-note {
    margin: 0 1.15rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #93c5fd;
    border-color: rgba(96, 165, 250, 0.35);
}

.rd-tier-row__label {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.rd-tier-row__tier {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8b80b3;
}

.rd-tier-row__name {
    font-size: 0.8rem;
    color: #c4b5fd;
}

.rd-tier-row__track {
    position: relative;
}

.rd-tier-row__connector {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.35), transparent);
    pointer-events: none;
    z-index: 0;
}

.rd-tier-row__cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.85rem;
    position: relative;
    z-index: 1;
}

.rd-tech-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: rgba(18, 16, 32, 0.75);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.rd-tech-card:hover {
    transform: none;
}

.rd-tech-card--ready {
    border-color: rgba(94, 234, 212, 0.55);
    box-shadow: 0 0 16px rgba(94, 234, 212, 0.12);
}

.rd-tech-card--completed {
    opacity: 0.65;
    border-color: rgba(74, 222, 128, 0.35);
}

.rd-tech-card--locked_prereq,
.rd-tech-card--locked_lab,
.rd-tech-card--busy {
    opacity: 0.82;
}

.rd-tech-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.rd-tier-pill {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8b80b3;
}

.rd-status-pill {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(55, 48, 74, 0.9);
    color: #a8a3c4;
}

.rd-status-pill--ready { background: rgba(94, 234, 212, 0.2); color: #5eead4; }
.rd-status-pill--completed { background: rgba(74, 222, 128, 0.2); color: #86efac; }
.rd-status-pill--researching { background: rgba(167, 139, 250, 0.25); color: #c4b5fd; }
.rd-status-pill--unaffordable { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }

.rd-tech-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0;
}

.rd-tech-card__desc {
    font-size: 0.78rem;
    line-height: 1.45;
    color: #9ca3af;
    margin: 0;
    flex: 1;
}

.rd-tech-card__unlocks {
    font-size: 0.72rem;
    line-height: 1.4;
    color: #67e8f9;
    margin: 0;
}

.rd-prereq-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.rd-prereq-chip {
    font-size: 0.68rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid rgba(124, 58, 237, 0.4);
    color: #c4b5fd;
}

.rd-prereq-chip--done {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.4);
    color: #86efac;
    text-decoration: line-through;
    opacity: 0.85;
}

.rd-prereq-arrow {
    font-size: 0.65rem;
    color: #6b7280;
}

.rd-tech-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
}

.rd-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.rd-meta-label {
    color: #6b7280;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
}

.rd-meta-value {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
    color: #d1d5db;
}

.rd-cost-pill {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(30, 27, 50, 0.9);
    border: 1px solid rgba(124, 58, 237, 0.3);
    white-space: nowrap;
}

.rd-req-banner {
    font-size: 0.72rem;
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    background: rgba(55, 48, 74, 0.6);
    border: 1px solid rgba(124, 58, 237, 0.35);
    color: #c4b5fd;
}

.rd-req-banner--warn {
    border-color: rgba(251, 191, 36, 0.4);
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.08);
}

.rd-tech-card__action {
    margin-top: 0.15rem;
    font-size: 0.72rem;
}

.rd-tier-locked {
    padding: 1rem;
    text-align: center;
    border-style: dashed;
}

.rd-tier-locked__title {
    font-weight: 700;
    color: #a78bfa;
    margin-bottom: 0.35rem;
}

.rd-tier-locked__text {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0 0 0.75rem;
    line-height: 1.45;
}

.rd-tier-locked__btn {
    font-size: 0.75rem;
    padding: 0.4rem 1rem;
}

.rd-empty-tier {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

@media (max-width: 640px) {
    .rd-tier-row__cards {
        grid-template-columns: 1fr;
    }
}

/* --- Icon slots (station, inventory, fleet cards) --- */
.icon-slot {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 2px solid rgba(124, 58, 237, 0.45);
    background: linear-gradient(145deg, rgba(12, 10, 22, 0.95), rgba(28, 24, 48, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.icon-slot--md {
    width: 56px;
    height: 56px;
}

.icon-slot--lg {
    width: 72px;
    height: 72px;
}

.icon-slot--production {
    border-color: rgba(45, 212, 191, 0.5);
    box-shadow: inset 0 0 20px rgba(45, 212, 191, 0.08);
}

.icon-slot--industrial {
    border-color: rgba(251, 146, 60, 0.5);
    box-shadow: inset 0 0 20px rgba(251, 146, 60, 0.08);
}

.icon-slot--station {
    border-color: rgba(167, 139, 250, 0.55);
    box-shadow: inset 0 0 20px rgba(167, 139, 250, 0.1);
}

.icon-slot--advanced {
    border-color: rgba(250, 204, 21, 0.45);
    box-shadow: inset 0 0 20px rgba(250, 204, 21, 0.08);
}

.icon-slot--neutral {
    border-color: rgba(124, 58, 237, 0.4);
}

.icon-slot__img {
    width: 88%;
    height: 88%;
    object-fit: contain;
    image-rendering: auto;
}

.icon-slot__img--hidden {
    display: none;
}

.icon-slot__fallback {
    display: none;
    font-size: 1.75rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.4));
}

.icon-slot--lg .icon-slot__fallback {
    font-size: 2rem;
}

.icon-slot__fallback--visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Station Command --- */
.st-view {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 2rem;
}

.st-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
}

.st-header__lead {
    margin-top: 0.5rem;
    max-width: 44rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #a8a3c4;
}

.st-header__stats {
    display: flex;
    gap: 0.65rem;
}

.st-stat {
    text-align: center;
    padding: 0.65rem 1rem;
    min-width: 7rem;
}

.st-stat__value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: #5eead4;
}

.st-stat__label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8b80b3;
}

.st-catalog {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.st-category {
    border-radius: 16px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: linear-gradient(160deg, rgba(22, 20, 40, 0.88), rgba(28, 24, 50, 0.78));
    overflow: hidden;
}

.st-accent--production .st-category__header { border-bottom-color: rgba(45, 212, 191, 0.3); }
.st-accent--industrial .st-category__header { border-bottom-color: rgba(251, 146, 60, 0.3); }
.st-accent--station .st-category__header { border-bottom-color: rgba(167, 139, 250, 0.35); }
.st-accent--advanced .st-category__header { border-bottom-color: rgba(250, 204, 21, 0.3); }

.st-category__header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.25);
}

.st-category__icon {
    font-size: 1.4rem;
    line-height: 1;
}

.st-category__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0;
}

.st-category__desc {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0.2rem 0 0;
    line-height: 1.4;
}

.st-category__tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.68rem;
    color: #c4b5fd;
    background: rgba(124, 58, 237, 0.2);
}

.st-category__count {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: #a78bfa;
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(124, 58, 237, 0.18);
}

.st-category__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.85rem;
    padding: 1rem 1.15rem 1.15rem;
}

.st-facility-card {
    border-radius: 12px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: rgba(16, 14, 30, 0.82);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.st-facility-card:hover {
    transform: none;
}

.st-facility-card--ready {
    border-color: rgba(94, 234, 212, 0.45);
    box-shadow: 0 0 14px rgba(94, 234, 212, 0.1);
}

.st-facility-card--locked {
    opacity: 0.72;
}

.st-facility-card--maxed {
    border-color: rgba(74, 222, 128, 0.35);
}

.st-card__layout {
    display: flex;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
}

.st-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.st-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.st-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0;
}

.st-card__desc {
    font-size: 0.78rem;
    line-height: 1.4;
    color: #9ca3af;
    margin: 0.2rem 0 0;
}

.st-level-block {
    text-align: right;
    flex-shrink: 0;
}

.st-level-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #c4b5fd;
}

.st-level-max {
    font-size: 0.7rem;
    color: #6b7280;
    margin-left: 0.15rem;
}

.st-level-bar {
    height: 3px;
    border-radius: 999px;
    background: rgba(55, 48, 74, 0.8);
    overflow: hidden;
}

.st-level-bar__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6d28d9, #5eead4);
}

.st-status-pill {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: rgba(55, 48, 74, 0.9);
    color: #a8a3c4;
}

.st-status-pill--ready { background: rgba(94, 234, 212, 0.2); color: #5eead4; }
.st-status-pill--needs_resources { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }
.st-status-pill--maxed { background: rgba(74, 222, 128, 0.2); color: #86efac; }
.st-status-pill--unbuilt { background: rgba(124, 58, 237, 0.25); color: #c4b5fd; }
.st-status-pill--locked { background: rgba(55, 48, 74, 0.9); color: #9ca3af; }

.st-panel {
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    font-size: 0.72rem;
    line-height: 1.4;
}

.st-panel__label {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

.st-panel--benefits {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.st-panel--benefits .st-panel__label { color: #c4b5fd; }

.st-panel--unlocks {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.st-panel--unlocks .st-panel__label { color: #a5b4fc; }

.st-panel--req {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(124, 58, 237, 0.35);
}

.st-panel--req .st-panel__label { color: #fcd34d; }

.st-benefit-line {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    color: #d1d5db;
}

.st-benefit-line__rate {
    color: #5eead4;
    white-space: nowrap;
}

.st-unlock-line { color: #9ca3af; }
.st-unlock-line--met { color: #86efac; }

.st-req-line { margin-top: 0.15rem; }
.st-req-line--met { color: #86efac; }
.st-req-line--pending { color: #fcd34d; }

.st-card__footer {
    margin-top: auto;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
}

.st-cost-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.st-cost-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.st-cost-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.st-cost-pill {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(30, 27, 50, 0.9);
    border: 1px solid rgba(124, 58, 237, 0.3);
    font-size: 0.75rem;
}

.st-cost-ok { color: #d1d5db; }
.st-cost-low { color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); }

.st-card__actions {
    display: flex;
    gap: 0.5rem;
}

.st-card__btn {
    flex: 1;
    padding: 0.45rem 0.5rem;
    font-size: 0.72rem;
}

.st-card__btn--secondary {
    background: linear-gradient(45deg, #4c1d95, #3730a3);
}

.st-queue-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.65rem;
}

.st-queue-item__name {
    font-size: 0.85rem;
    margin: 0;
}

.st-queue-item__eta {
    font-size: 0.7rem;
    text-align: right;
    color: #9ca3af;
    margin: 0.15rem 0 0;
}

.st-queue-item__cancel {
    font-weight: 700;
    font-size: 1.25rem;
    color: #f87171;
    padding: 0 0.35rem;
    line-height: 1;
}

@media (max-width: 640px) {
    .st-category__grid {
        grid-template-columns: 1fr;
    }

    .st-card__layout {
        flex-direction: column;
        align-items: center;
    }

    .st-card__head {
        flex-direction: column;
        align-items: stretch;
    }

    .st-level-block {
        text-align: left;
    }
}

/* Achievement icon slot accents */
.icon-slot--ach-progression { border-color: rgba(74, 222, 128, 0.5); }
.icon-slot--ach-production { border-color: rgba(251, 146, 60, 0.5); }
.icon-slot--ach-fleet { border-color: rgba(96, 165, 250, 0.55); }
.icon-slot--ach-exploration { border-color: rgba(192, 132, 252, 0.55); }
.icon-slot--ach-research { border-color: rgba(34, 211, 238, 0.5); }
.icon-slot--ach-combat { border-color: rgba(248, 113, 113, 0.55); }
.icon-slot--ach-economic { border-color: rgba(250, 204, 21, 0.5); }
.icon-slot--ach-special { border-color: rgba(236, 72, 153, 0.55); }
.icon-slot--ach-milestone { border-color: rgba(167, 139, 250, 0.6); }

.icon-slot--unlocked {
    border-color: rgba(250, 204, 21, 0.65);
    box-shadow: 0 0 14px rgba(250, 204, 21, 0.2);
}

.icon-slot--locked-state {
    opacity: 0.88;
}

.icon-slot--locked-state .icon-slot__fallback {
    filter: grayscale(0.35);
}

.icon-slot__lock {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 0.85rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.icon-slot--secret {
    border-style: dashed;
    opacity: 0.75;
}

.icon-slot--secret .icon-slot__fallback {
    color: #9ca3af;
    font-weight: 700;
}

/* --- Achievements --- */
.ach-view {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 2rem;
    min-height: min-content;
}

.ach-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
}

.ach-header__lead {
    margin-top: 0.5rem;
    max-width: 44rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #a8a3c4;
}

.ach-header__stats {
    display: flex;
    gap: 0.65rem;
}

.ach-stat {
    text-align: center;
    padding: 0.65rem 1rem;
    min-width: 7.5rem;
}

.ach-stat--gold .ach-stat__value {
    color: #fcd34d;
}

.ach-stat__value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #c4b5fd;
}

.ach-stat__label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8b80b3;
}

.ach-rank {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
}

.ach-rank__label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #8b80b3;
}

.ach-rank__title {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fcd34d;
    margin-top: 0.15rem;
}

.ach-rank__next {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0.35rem 0 0;
}

.ach-rank__bar-wrap {
    min-width: 200px;
    flex: 1;
    max-width: 320px;
}

.ach-rank__bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(55, 48, 74, 0.9);
    overflow: hidden;
}

.ach-rank__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ca8a04, #fcd34d, #fde68a);
}

.ach-rank__bar-caption {
    display: block;
    font-size: 0.65rem;
    color: #6b7280;
    text-align: right;
    margin-top: 0.25rem;
}

.ach-catalog {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    /* Scroll via #main-content — avoid flex-shrink squashing categories */
}

.ach-category {
    flex-shrink: 0;
    border-radius: 16px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: linear-gradient(160deg, rgba(22, 20, 40, 0.88), rgba(28, 24, 50, 0.78));
    overflow: hidden;
}

.ach-category__header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.15rem 1.1rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.25);
    flex-shrink: 0;
    min-height: 3.5rem;
}

.ach-category__swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: var(--ach-cat-color, #7c3aed);
    flex-shrink: 0;
    margin-top: 0.25rem;
    box-shadow: 0 0 10px var(--ach-cat-color, #7c3aed);
}

.ach-category__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0;
}

.ach-category__desc {
    font-size: 0.78rem;
    color: #9ca3af;
    margin: 0.25rem 0 0;
    line-height: 1.45;
    padding-bottom: 0.1rem;
}

.ach-category__stats {
    margin-left: auto;
    text-align: right;
    flex-shrink: 0;
}

.ach-category__count {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a78bfa;
}

.ach-category__points {
    display: block;
    font-size: 0.68rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.ach-category__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.15rem 1.15rem;
    flex-shrink: 0;
}

.ach-card {
    border-radius: 12px;
    border: 1px solid rgba(124, 58, 237, 0.3);
    background: rgba(16, 14, 30, 0.82);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ach-card--unlocked {
    border-color: rgba(250, 204, 21, 0.45);
    background: linear-gradient(135deg, rgba(28, 22, 12, 0.9), rgba(22, 18, 36, 0.85));
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.08);
}

.ach-card--in_progress {
    border-color: rgba(167, 139, 250, 0.45);
}

.ach-card--locked {
    opacity: 0.88;
}

.ach-card__layout {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
}

.ach-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ach-card__head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: flex-start;
}

.ach-card__title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: #e9d5ff;
}

.ach-card--unlocked .ach-card__title {
    color: #fcd34d;
}

.ach-card__desc {
    font-size: 0.75rem;
    line-height: 1.4;
    color: #9ca3af;
    margin: 0.2rem 0 0;
}

.ach-card__meta {
    text-align: right;
    flex-shrink: 0;
}

.ach-points-pill {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: #c4b5fd;
    margin-bottom: 0.2rem;
}

.ach-status-pill {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: rgba(55, 48, 74, 0.9);
    color: #9ca3af;
}

.ach-status-pill--unlocked {
    background: rgba(250, 204, 21, 0.2);
    color: #fcd34d;
}

.ach-status-pill--in_progress {
    background: rgba(167, 139, 250, 0.25);
    color: #c4b5fd;
}

.ach-progress__bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(55, 48, 74, 0.9);
    overflow: hidden;
}

.ach-progress__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6d28d9, #818cf8);
    transition: width 0.35s ease;
}

.ach-card--unlocked .ach-progress__fill,
.ach-card--in_progress .ach-progress__fill {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.ach-card--unlocked .ach-progress__fill {
    background: linear-gradient(90deg, #ca8a04, #fcd34d);
}

.ach-progress__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    gap: 0.5rem;
}

.ach-progress__pct {
    font-size: 0.68rem;
    font-weight: 700;
    color: #a78bfa;
}

.ach-progress__label {
    font-size: 0.65rem;
    color: #6b7280;
    text-align: right;
}

.ach-unlocked-banner {
    font-size: 0.72rem;
    color: #86efac;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.25);
}

.ach-card__rewards {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
}

.ach-card__rewards-label {
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.6rem;
    margin-right: 0.15rem;
}

.ach-reward-pill {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(30, 27, 50, 0.9);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: #d1d5db;
}

@media (max-width: 640px) {
    .ach-category__grid {
        grid-template-columns: 1fr;
    }

    .ach-card__layout {
        flex-direction: column;
        align-items: center;
    }

    .ach-card__head {
        flex-direction: column;
    }

    .ach-card__meta {
        text-align: left;
    }

    .ach-rank__bar-wrap {
        max-width: 100%;
    }
}

/* Ship icon tier badge */
.icon-slot__tier {
    position: absolute;
    bottom: 2px;
    left: 2px;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.05rem 0.25rem;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.65);
    color: #c4b5fd;
    line-height: 1.2;
}

.icon-slot--sm {
    width: 48px;
    height: 48px;
}

.icon-slot--empty {
    border-style: dashed;
    opacity: 0.75;
}

.icon-slot--ship-utility { border-color: rgba(45, 212, 191, 0.5); }
.icon-slot--ship-exploration { border-color: rgba(96, 165, 250, 0.55); }
.icon-slot--ship-combat { border-color: rgba(248, 113, 113, 0.5); }
.icon-slot--ship-industrial { border-color: rgba(251, 146, 60, 0.5); }
.icon-slot--ship-science { border-color: rgba(34, 211, 238, 0.5); }
.icon-slot--ship-capital { border-color: rgba(250, 204, 21, 0.5); }
.icon-slot--ship-neutral { border-color: rgba(167, 139, 250, 0.45); }

.icon-slot--comp-weapon { border-color: rgba(248, 113, 113, 0.45); }
.icon-slot--comp-defense { border-color: rgba(96, 165, 250, 0.5); }
.icon-slot--comp-propulsion { border-color: rgba(251, 191, 36, 0.45); }
.icon-slot--comp-utility { border-color: rgba(45, 212, 191, 0.45); }

/* --- Fleet / Shipyard --- */
.fl-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 2rem;
}

.fl-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.fl-header__lead {
    max-width: 44rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #a8a3c4;
}

.fl-header__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.fl-stat-pill {
    text-align: center;
    padding: 0.5rem 0.75rem;
    min-width: 4.5rem;
}

.fl-stat-pill__value {
    display: block;
    font-weight: 700;
    color: #5eead4;
    font-size: 1rem;
}

.fl-stat-pill__label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8b80b3;
}

.fl-tips-btn {
    font-size: 0.72rem;
    padding: 0.4rem 0.75rem;
}

.fl-banner {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #d1d5db;
    line-height: 1.45;
}

.fl-banner__sub {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.fl-panels {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    grid-template-areas:
        'queue wings'
        'hangar wings'
        'blueprints blueprints';
    gap: 1rem;
}

.fl-panel {
    border-radius: 14px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: linear-gradient(160deg, rgba(22, 20, 40, 0.9), rgba(28, 24, 50, 0.8));
    overflow: hidden;
    flex-shrink: 0;
}

.fl-panel:nth-child(1) { grid-area: queue; }
.fl-panel--wings { grid-area: wings; }
.fl-panel:nth-child(3) { grid-area: hangar; }
.fl-panel--blueprints { grid-area: blueprints; }

.fl-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.25);
}

.fl-panel__title {
    font-size: 1rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0;
}

.fl-panel__hint {
    font-size: 0.72rem;
    color: #8b80b3;
}

.fl-panel__action {
    font-size: 0.72rem;
    padding: 0.3rem 0.65rem;
}

.fl-panel__body {
    padding: 0.75rem 1rem 1rem;
}

.fl-panel__body--stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.fl-panel__body--scroll {
    max-height: 22vh;
    overflow-y: auto;
}

.fl-panel--wings .fl-panel__body--stack {
    max-height: none;
}

.fl-empty {
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
    margin: 0;
    text-align: center;
    padding: 0.5rem;
}

.fl-bp-grid,
.fl-blueprint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
    align-items: stretch;
}

.fl-bp-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid rgba(124, 58, 237, 0.4);
    background: linear-gradient(165deg, rgba(20, 18, 36, 0.95), rgba(14, 12, 28, 0.9));
    overflow: hidden;
}

.fl-bp-card--ready {
    border-color: rgba(94, 234, 212, 0.45);
}

.fl-bp-card__header {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.25);
    background: rgba(0, 0, 0, 0.2);
}

.fl-bp-card__intro {
    flex: 1;
    min-width: 0;
}

.fl-bp-card__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.fl-bp-card__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0;
}

.fl-bp-card__desc {
    font-size: 0.75rem;
    line-height: 1.4;
    color: #9ca3af;
    margin: 0;
}

.fl-bp-card__panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    flex: 1;
}

.fl-bp-panel {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

.fl-bp-panel--slots {
    border-right: 1px solid rgba(124, 58, 237, 0.15);
}

.fl-bp-panel--stats {
    background: rgba(0, 0, 0, 0.12);
}

.fl-bp-panel__heading {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a78bfa;
    margin: 0 0 0.45rem;
}

.fl-bp-panel__sub {
    font-weight: 500;
    color: #6b7280;
    text-transform: none;
    letter-spacing: 0;
}

.fl-bp-slot-groups {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.fl-bp-slot-group__label {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5eead4;
    margin-bottom: 0.2rem;
}

.fl-bp-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.fl-bp-chip {
    font-size: 0.62rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid rgba(124, 58, 237, 0.35);
    color: #d1d5db;
}

.fl-bp-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
}

.fl-bp-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.4rem;
    border-radius: 5px;
    background: rgba(30, 27, 50, 0.6);
    border: 1px solid rgba(124, 58, 237, 0.2);
    font-size: 0.68rem;
}

.fl-bp-stat__k {
    color: #9ca3af;
}

.fl-bp-stat__v {
    font-weight: 700;
    color: #e9d5ff;
}

.fl-bp-muted {
    font-size: 0.68rem;
    color: #6b7280;
    font-style: italic;
}

.fl-bp-card__footer {
    display: flex;
    align-items: flex-end;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid rgba(124, 58, 237, 0.25);
    background: rgba(0, 0, 0, 0.25);
    flex-wrap: wrap;
}

.fl-bp-card__cost-block,
.fl-bp-card__time-block {
    flex: 1;
    min-width: 5rem;
}

.fl-bp-footer-label {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.2rem;
}

.fl-bp-cost-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.fl-bp-time {
    font-size: 0.8rem;
    font-weight: 600;
    color: #c4b5fd;
}

.fl-bp-build-btn {
    font-size: 0.72rem;
    padding: 0.45rem 1rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.fl-blueprint__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.fl-blueprint__title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0;
}

.fl-blueprint__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.fl-tag {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    background: rgba(124, 58, 237, 0.25);
    color: #c4b5fd;
}

.fl-tag--tier {
    background: rgba(94, 234, 212, 0.15);
    color: #5eead4;
}

.fl-tag--sm {
    font-size: 0.58rem;
    margin-top: 0.15rem;
}

.fl-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    margin-bottom: 0.2rem;
}

.fl-meta-label {
    color: #6b7280;
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
}

.fl-meta-value {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: flex-end;
}

.fl-cost-pill {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(30, 27, 50, 0.9);
    border: 1px solid rgba(124, 58, 237, 0.3);
    white-space: nowrap;
}

.fl-req-banner {
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    background: rgba(55, 48, 74, 0.6);
    color: #c4b5fd;
    margin-top: 0.15rem;
}

.fl-req-banner--warn {
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.fl-bp-card > .fl-req-banner {
    margin: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(251, 191, 36, 0.3);
    width: 100%;
    text-align: center;
}

.fl-queue-item,
.fl-hangar-card {
    border-radius: 10px;
    border: 1px solid rgba(124, 58, 237, 0.3);
    background: rgba(16, 14, 30, 0.75);
    padding: 0.65rem 0.75rem;
}

.fl-queue-item__head,
.fl-hangar-card__layout {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.fl-queue-item__name,
.fl-hangar-card__title {
    font-weight: 600;
    color: #e9d5ff;
}

.fl-hangar-card__count {
    color: #9ca3af;
    font-weight: 400;
}

.fl-queue-item__eta {
    font-size: 0.7rem;
    text-align: right;
    color: #9ca3af;
    margin: 0.25rem 0 0;
}

.fl-hangar-card__body {
    flex: 1;
    min-width: 0;
}

.fl-hangar-card__actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.fl-hangar-btn {
    flex: 1;
    font-size: 0.68rem;
    padding: 0.35rem 0.4rem;
}

.fl-hangar-btn--secondary {
    background: linear-gradient(45deg, #4c1d95, #3730a3);
}

.fl-wing-card {
    border-radius: 12px;
    border: 1px solid rgba(124, 58, 237, 0.4);
    background: rgba(14, 12, 28, 0.9);
    padding: 0.85rem 1rem;
}

.fl-wing-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.fl-wing-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0 0 0.2rem;
}

.fl-wing-status {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fl-wing-status--docked { color: #fcd34d; }
.fl-wing-status--deployed { color: #86efac; }
.fl-wing-status--transit { color: #fbbf24; }
.fl-wing-status--mission { color: #67e8f9; }

.fl-wing-btn {
    font-size: 0.72rem;
    padding: 0.35rem 0.75rem;
    white-space: nowrap;
}

.fl-wing-btn--recall {
    background: linear-gradient(45deg, #7c2d12, #b45309);
}

.fl-wing-busy {
    font-size: 0.75rem;
    color: #67e8f9;
    white-space: nowrap;
}

.fl-wing-ships {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.fl-wing-ship {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(124, 58, 237, 0.2);
}


.fl-hangar-card__wing-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.fl-hangar-wing-muted {
    font-size: 0.68rem;
    color: #6b7280;
    padding: 0.2rem 0.35rem;
}

.fl-wing-ship__info {
    flex: 1;
    min-width: 0;
}

.fl-wing-ship__name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e9d5ff;
}

.fl-wing-ship__qty {
    color: #9ca3af;
    font-weight: 400;
}

.fl-wing-ship__stats {
    display: flex;
    gap: 0.65rem;
    font-size: 0.68rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.fl-wing-ship__badges {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* Shared height for PWR / Loadout / Remove pills on wing ship rows */
.fl-wing-ship__badges .fl-power-pill,
.fl-wing-ship__badges .fl-loadout-btn,
.fl-wing-ship__badges .fl-wing-remove-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    min-width: 3.25rem;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    box-sizing: border-box;
}

.fl-wing-remove-btn {
    border: 1px solid rgba(239, 68, 68, 0.45);
    background: rgba(127, 29, 29, 0.35);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.fl-wing-remove-btn:hover {
    background: rgba(185, 28, 28, 0.5);
    border-color: rgba(248, 113, 113, 0.65);
}

.fl-wing-remove-btn__label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: #fca5a5;
}

.fl-wing-remove-btn__sub {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    color: #fecaca;
}

.fl-loadout-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.45rem;
    min-width: 3.25rem;
    border-radius: 6px;
    border: 1px solid rgba(94, 234, 212, 0.35);
    background: rgba(15, 23, 42, 0.65);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.fl-loadout-btn:hover {
    background: rgba(34, 211, 238, 0.12);
    border-color: rgba(94, 234, 212, 0.55);
}

.fl-loadout-btn__label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.fl-loadout-btn__slots {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
}

.fl-loadout-btn--ok {
    color: #5eead4;
    border-color: rgba(94, 234, 212, 0.4);
}

.fl-loadout-btn--partial {
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.45);
}

.fl-loadout-btn--bad {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.45);
}

.fl-wing-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.fl-stat {
    text-align: center;
    padding: 0.4rem 0.25rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(124, 58, 237, 0.25);
}

.fl-stat__label {
    display: block;
    font-size: 0.58rem;
    text-transform: uppercase;
    color: #6b7280;
}

.fl-stat__value {
    font-size: 0.9rem;
    font-weight: 700;
}

.fl-stat--power .fl-stat__value { color: #fbbf24; font-size: 1.05rem; }
.fl-stat--combat .fl-stat__value { color: #fca5a5; }
.fl-stat--shields .fl-stat__value { color: #93c5fd; }
.fl-stat--scan .fl-stat__value { color: #67e8f9; }
.fl-stat--mining .fl-stat__value { color: #86efac; }

.fl-wing-card__power {
    font-size: 0.72rem;
    color: #d4c4a8;
    margin-top: 0.25rem;
}

.fl-wing-card__power strong {
    color: #fbbf24;
    font-size: 0.9rem;
}

.fl-wing-card__power-hint {
    color: #6b7280;
    font-weight: normal;
}

.fl-wing-ship__name-row,
.fl-hangar-card__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.fl-power-pill {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.45rem;
    min-width: 3.25rem;
    min-height: 2.35rem;
    border-radius: 6px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Live Operations — combat engagement (distinct from mining/survey cyan bars) */
.ops-combat-card {
    position: relative;
    overflow: hidden;
}

.ops-combat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -12deg,
        transparent,
        transparent 8px,
        rgba(239, 68, 68, 0.03) 8px,
        rgba(239, 68, 68, 0.03) 9px
    );
    pointer-events: none;
}

.ops-combat-phase {
    animation: ops-combat-pulse 1.2s ease-in-out infinite;
}

@keyframes ops-combat-pulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; text-shadow: 0 0 12px rgba(251, 146, 60, 0.45); }
}

.ops-combat-bar-fill {
    background: linear-gradient(90deg, #b91c1c, #f97316, #fbbf24);
    background-size: 200% 100%;
    animation: ops-combat-bar-shift 1.5s linear infinite;
    transition: width 0.35s ease-out;
}

@keyframes ops-combat-bar-shift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.ops-combat-matchup {
    font-family: ui-monospace, monospace;
}

/* --- RPG inventory grid --- */
.inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.5rem;
    padding: 0.15rem;
}

.inv-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-height: 88px;
    padding: 0.35rem 0.25rem 0.3rem;
    border-radius: 8px;
    border: 2px solid rgba(124, 58, 237, 0.45);
    background: linear-gradient(160deg, rgba(15, 12, 28, 0.95), rgba(30, 25, 50, 0.9));
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    overflow: hidden;
}

.inv-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 0 12px rgba(167, 139, 250, 0.15);
    z-index: 1;
}

.inv-tile--selected {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.5), 0 0 18px rgba(251, 191, 36, 0.25);
}

.inv-tile--q-basic { border-color: rgba(156, 163, 175, 0.65); }
.inv-tile--q-enhanced { border-color: rgba(34, 211, 238, 0.75); box-shadow: inset 0 0 12px rgba(34, 211, 238, 0.08); }
.inv-tile--q-superior { border-color: rgba(168, 85, 247, 0.85); box-shadow: inset 0 0 14px rgba(168, 85, 247, 0.12); }
.inv-tile--q-legendary { border-color: rgba(245, 158, 11, 0.9); box-shadow: inset 0 0 16px rgba(245, 158, 11, 0.15); }
.inv-tile--q-neutral { border-color: rgba(100, 116, 139, 0.55); }

.inv-tile--installed {
    background: linear-gradient(160deg, rgba(6, 40, 35, 0.5), rgba(15, 12, 28, 0.92));
}

.inv-tile__icon {
    font-size: 1.65rem;
    line-height: 1;
    margin: 0.15rem 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.inv-tile__label {
    font-size: 0.58rem;
    line-height: 1.15;
    text-align: center;
    color: #e9d5ff;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
}

.inv-tile__qty {
    position: absolute;
    top: 3px;
    right: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #fff;
    background: rgba(88, 28, 135, 0.85);
    border: 1px solid rgba(192, 132, 252, 0.5);
    border-radius: 4px;
    padding: 0 4px;
    line-height: 1.2;
    z-index: 2;
}

.inv-tile__pin {
    position: absolute;
    top: 3px;
    left: 4px;
    font-size: 0.55rem;
    z-index: 2;
}

.inv-tile__q-dot {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 6px currentColor;
}

.inv-tile__ship {
    font-size: 0.5rem;
    color: #6ee7b7;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inv-tile__cond-bar {
    display: block;
    width: 80%;
    height: 3px;
    margin: 2px 0;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.inv-tile__cond-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--cond, 100%);
    border-radius: 2px;
}

.inv-tile__cond-bar--ok::after { background: #22c55e; }
.inv-tile__cond-bar--warn::after { background: #eab308; }
.inv-tile__cond-bar--bad::after { background: #ef4444; }

.inv-filter-bar {
    border-bottom: 1px solid rgba(124, 58, 237, 0.25);
    padding-bottom: 0.5rem;
}

.inv-filter-btn {
    font-size: 0.72rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(124, 58, 237, 0.45);
    background: rgba(0, 0, 0, 0.35);
    color: #c4b5fd;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.inv-filter-btn:hover {
    background: rgba(88, 28, 135, 0.35);
}

.inv-filter-btn--active {
    background: rgba(126, 34, 206, 0.45);
    border-color: rgba(192, 132, 252, 0.65);
    color: #fff;
}

.inv-fleet-details summary::-webkit-details-marker {
    color: #a78bfa;
}

.inv-fleet-details[open] summary {
    margin-bottom: 0.35rem;
}

.inv-detail-panel {
    max-height: 100%;
}

.inv-grid-empty {
    min-height: 12rem;
}

.equipment-card ul li,
.item-details ul li {
    line-height: 1.35;
}

.equipment-card .text-xs ul,
.item-details .text-xs ul {
    margin-top: 0.25rem;
}

.fl-power-pill__value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fcd34d;
    line-height: 1.1;
}

.fl-power-pill__label {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #a8a3c4;
}

.fl-wing-ship__power-line {
    color: #fbbf24;
    font-weight: 600;
}

.fl-bp-stat--power .fl-bp-stat__v {
    color: #fbbf24;
}

.sd-power-block {
    margin-top: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.sd-power-block__label {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a8a3c4;
}

.sd-power-block__value {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fcd34d;
    line-height: 1.2;
}

.sd-power-block__breakdown {
    display: block;
    font-size: 0.65rem;
    color: #9ca3af;
    margin-top: 0.2rem;
    line-height: 1.35;
}

.fl-wing-warn {
    font-size: 0.75rem;
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    margin-bottom: 0.35rem;
}

.fl-wing-ready {
    font-size: 0.72rem;
    color: #86efac;
    margin-bottom: 0.35rem;
}

.fl-wing-guidance {
    font-size: 0.72rem;
    color: #9ca3af;
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 1100px) {
    .fl-panels {
        grid-template-columns: 1fr;
        grid-template-areas:
            'queue'
            'wings'
            'hangar'
            'blueprints';
    }

    .fl-blueprint-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Ship Designer --- */
.sd-view {
    min-height: min-content;
}

.sd-layout {
    display: grid;
    grid-template-columns: minmax(220px, 250px) 1fr;
    gap: 1rem;
    align-items: start;
}

.sd-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.sd-sidebar-block {
    border-radius: 10px;
    border: 1px solid rgba(124, 58, 237, 0.3);
    background: rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.sd-ship-hero {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: none;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(0, 0, 0, 0.2));
}

.sd-ship-hero__name {
    font-size: 1rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0 0 0.15rem;
}

.sd-ship-hero__class {
    font-size: 0.72rem;
    color: #9ca3af;
    text-transform: capitalize;
}

.sd-ship-hero__slots {
    font-size: 0.65rem;
    color: #67e8f9;
    margin: 0.35rem 0 0;
    line-height: 1.35;
}

.sd-block-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a78bfa;
    margin: 0;
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.25);
    background: rgba(124, 58, 237, 0.08);
}

.sd-block-body {
    padding: 0.5rem 0.65rem;
    font-size: 0.72rem;
    max-height: 180px;
    overflow-y: auto;
}

.sd-sidebar .sd-actions {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border: none;
    background: transparent;
}

.sd-action-btn {
    width: 100%;
    font-size: 0.72rem;
    padding: 0.45rem 0.55rem;
    text-align: left;
}

.sd-main__header {
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.3);
}

.sd-main__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0;
}

.sd-main__hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0.3rem 0 0;
    line-height: 1.45;
}

.sd-equip-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sd-cat-panel {
    border-radius: 10px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: rgba(12, 10, 24, 0.85);
    overflow: hidden;
}

.sd-cat-panel--weapons { border-left: 3px solid rgba(248, 113, 113, 0.6); }
.sd-cat-panel--defense { border-left: 3px solid rgba(96, 165, 250, 0.6); }
.sd-cat-panel--propulsion { border-left: 3px solid rgba(251, 191, 36, 0.55); }
.sd-cat-panel--utility { border-left: 3px solid rgba(45, 212, 191, 0.55); }

.sd-cat-panel__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.28);
    border-bottom: 1px solid rgba(124, 58, 237, 0.25);
}

.sd-cat-panel__icon {
    font-size: 1rem;
}

.sd-cat-panel__title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0;
    flex: 1;
}

.sd-cat-panel__count {
    font-size: 0.62rem;
    font-weight: 600;
    color: #8b80b3;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.2);
}

.sd-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.55rem;
    padding: 0.6rem 0.75rem;
}

.sd-slot-card {
    border-radius: 8px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: rgba(18, 16, 32, 0.9);
    padding: 0.55rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sd-slot-card--filled {
    border-color: rgba(94, 234, 212, 0.4);
    box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.08);
}

.sd-slot-card__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sd-slot-card__titles {
    min-width: 0;
}

.sd-slot-card__name {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #e9d5ff;
}

.sd-slot-card__type {
    display: block;
    font-size: 0.62rem;
    color: #6b7280;
    text-transform: capitalize;
}

.sd-slot-card__field-label {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.sd-slot-card__select {
    width: 100%;
    font-size: 0.72rem;
    padding: 0.4rem 2rem 0.4rem 0.5rem;
    background-color: #0c0a14;
    border: 1px solid rgba(124, 58, 237, 0.45);
    border-radius: 6px;
    color: #f3f4f6;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.45rem center;
    background-repeat: no-repeat;
    background-size: 1.1em;
}

.sd-slot-card__select:focus {
    outline: none;
    border-color: #a78bfa;
}

.sd-slot-card__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding-top: 0.15rem;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
}

.sd-slot-card__badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.12rem 0.35rem;
    border-radius: 4px;
    background: rgba(55, 48, 74, 0.8);
}

.sd-slot-card__badge--empty {
    color: #6b7280;
    font-style: italic;
}

.sd-equip-scroll {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sd-equip-category__title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0 0 0.65rem;
}

.sd-equip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.65rem;
}

.sd-equip-slot {
    border-radius: 10px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: rgba(14, 12, 26, 0.85);
    padding: 0.65rem 0.75rem;
    transition: border-color 0.2s ease;
}

.sd-equip-slot--filled {
    border-color: rgba(94, 234, 212, 0.35);
}

.sd-equip-slot--empty {
    opacity: 0.9;
}

.sd-equip-slot__head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.5rem;
}

.sd-equip-slot__labels {
    flex: 1;
    min-width: 0;
}

.sd-equip-slot__name {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #e9d5ff;
}

.sd-equip-slot__type {
    display: block;
    font-size: 0.65rem;
    color: #6b7280;
    text-transform: capitalize;
}

.sd-equip-slot__state {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.35rem;
    border-radius: 999px;
    background: rgba(55, 48, 74, 0.8);
    color: #9ca3af;
    flex-shrink: 0;
}

.sd-equip-slot--filled .sd-equip-slot__state {
    background: rgba(94, 234, 212, 0.15);
    color: #5eead4;
}

.sd-equip-select {
    width: 100%;
    background: #0c0a14;
    border: 1px solid rgba(124, 58, 237, 0.45);
    border-radius: 8px;
    padding: 0.45rem 2rem 0.45rem 0.55rem;
    font-size: 0.78rem;
    color: #f3f4f6;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em;
}

.sd-equip-select:focus {
    outline: none;
    border-color: #a78bfa;
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.25);
}

.sd-slot-detail {
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
    font-size: 0.7rem;
}

.sd-slot-detail__row {
    display: flex;
    justify-content: space-between;
    color: #9ca3af;
    margin-bottom: 0.2rem;
}

.sd-cond-bar {
    height: 4px;
    border-radius: 999px;
    background: rgba(55, 48, 74, 0.9);
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.sd-cond-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #6d28d9, #5eead4);
    border-radius: inherit;
}

.sd-slot-bonuses {
    color: #86efac;
    line-height: 1.35;
    margin-top: 0.15rem;
}

@media (max-width: 900px) {
    .sd-layout {
        grid-template-columns: 1fr;
    }

    .sd-slot-grid {
        grid-template-columns: 1fr;
    }

    .fl-bp-card__panels {
        grid-template-columns: 1fr;
    }

    .fl-bp-panel--slots {
        border-right: none;
        border-bottom: 1px solid rgba(124, 58, 237, 0.15);
    }
}

@media (max-width: 1100px) {
    .fl-bp-grid,
    .fl-blueprint-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* --- Galaxy system map --- */
.gx-map-wrap {
    background: radial-gradient(ellipse at center, rgba(30, 25, 55, 0.5) 0%, rgba(8, 6, 18, 0.95) 70%);
}

.gx-map-canvas {
    width: 100% !important;
    height: 100% !important;
    min-height: 480px;
    touch-action: none;
}

.gx-map-hud {
    position: absolute;
    z-index: 2;
    pointer-events: none;
}

.gx-map-hud--tl {
    top: 0.85rem;
    left: 0.85rem;
    max-width: 260px;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(8, 6, 18, 0.82);
    border: 1px solid rgba(124, 58, 237, 0.45);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.gx-map-hud--tr {
    top: 0.85rem;
    right: 0.85rem;
    pointer-events: auto;
}

.gx-map-hud__label {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #8b80b3;
}

.gx-map-hud__title {
    font-size: 1rem;
    font-weight: 700;
    color: #e9d5ff;
    margin: 0.15rem 0 0;
}

.gx-map-hud__sub {
    font-size: 0.75rem;
    color: #a8a3c4;
    margin: 0.1rem 0 0;
}

.gx-map-hud__hint {
    font-size: 0.68rem;
    color: #6b7280;
    margin: 0.35rem 0 0;
    line-height: 1.35;
}

.gx-poi-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: rgba(15, 12, 30, 0.65);
    color: #a5f3fc;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.gx-poi-link:hover {
    border-color: rgba(167, 139, 250, 0.7);
    background: rgba(30, 25, 55, 0.85);
}

.gx-poi-link__name {
    font-weight: 600;
    color: #e9d5ff;
}

.gx-poi-link__type {
    font-size: 0.68rem;
    color: #8b80b3;
    margin-top: 0.1rem;
}

.gx-poi-actions .btn-secondary {
    margin-top: 0.35rem;
}

/* Galaxy Travel catalog (unified interstellar UI) */
.gx-travel-view {
    max-width: 1200px;
    margin: 0 auto;
}

.gx-travel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gx-travel-header__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #c4b5fd;
    margin: 0;
}

.gx-travel-header__lead {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: #9ca3af;
    max-width: 36rem;
}

.gx-travel-header__back {
    flex-shrink: 0;
    white-space: nowrap;
}

.gx-travel-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
}

@media (min-width: 768px) {
    .gx-travel-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gx-travel-stat__label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a78bfa;
}

.gx-travel-stat__value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f3f4f6;
}

.gx-travel-stat__value--cyan { color: #67e8f9; }
.gx-travel-stat__value--ok { color: #86efac; }
.gx-travel-stat__value--bad { color: #fca5a5; }

.gx-travel-banner {
    padding: 0.65rem 0.85rem;
    margin-bottom: 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    color: #d1d5db;
    background: rgba(30, 27, 75, 0.5);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.gx-travel-banner--warn {
    background: rgba(120, 53, 15, 0.25);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fde68a;
}

.gx-travel-region {
    margin-bottom: 1.75rem;
}

.gx-travel-region__head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.gx-travel-region__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gx-travel-region__count {
    font-size: 0.75rem;
    color: #6b7280;
}

.gx-travel-region__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
}

.gx-travel-card {
    background: rgba(12, 10, 22, 0.75);
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    transition: border-color 0.15s ease;
}

.gx-travel-card:hover {
    border-color: rgba(167, 139, 250, 0.45);
}

.gx-travel-card--current {
    border-color: rgba(34, 211, 238, 0.55);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.15);
}

.gx-travel-card--dim {
    opacity: 0.72;
}

.gx-travel-card__head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.gx-travel-card__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ede9fe;
}

.gx-travel-card__tagline {
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    font-style: italic;
    color: #a78bfa;
}

.gx-travel-card__badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.gx-travel-diff {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.gx-travel-diff--easy { background: rgba(22, 101, 52, 0.5); color: #86efac; }
.gx-travel-diff--medium { background: rgba(30, 64, 175, 0.5); color: #93c5fd; }
.gx-travel-diff--hard { background: rgba(127, 29, 29, 0.5); color: #fca5a5; }
.gx-travel-diff--very-hard { background: rgba(88, 28, 135, 0.5); color: #e9d5ff; }
.gx-travel-diff--legendary { background: rgba(161, 98, 7, 0.5); color: #fde047; }

.gx-travel-pill {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}

.gx-travel-pill--current { background: rgba(14, 116, 144, 0.5); color: #a5f3fc; }
.gx-travel-pill--ready { background: rgba(22, 101, 52, 0.45); color: #bbf7d0; }
.gx-travel-pill--fuel { background: rgba(120, 53, 15, 0.45); color: #fde68a; }
.gx-travel-pill--locked { background: rgba(75, 85, 99, 0.5); color: #d1d5db; }
.gx-travel-pill--hidden { background: rgba(55, 65, 81, 0.5); color: #9ca3af; }

.gx-travel-card__meta {
    font-size: 0.72rem;
    color: #9ca3af;
    margin: 0 0 0.35rem;
}

.gx-travel-card__desc {
    font-size: 0.78rem;
    color: #c4b5fd;
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.gx-travel-card__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.gx-travel-card__label {
    margin: 0 0 0.2rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.gx-travel-card__value {
    margin: 0;
    font-size: 0.72rem;
    color: #fde68a;
}

.gx-travel-card__worlds {
    margin: 0;
    padding-left: 1rem;
    font-size: 0.7rem;
    color: #d1d5db;
}

.gx-travel-card__ptype {
    color: #6b7280;
}

.gx-travel-card__status-hint {
    font-size: 0.68rem;
    color: #9ca3af;
    margin: 0 0 0.5rem;
}

.gx-travel-btn {
    width: 100%;
    padding: 0.45rem 0.75rem;
    border-radius: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.4);
    background: rgba(88, 28, 135, 0.35);
    color: #e9d5ff;
    cursor: pointer;
}

.gx-travel-btn--primary {
    background: linear-gradient(180deg, #7c3aed, #5b21b6);
    color: #fff;
    border-color: rgba(167, 139, 250, 0.5);
}

.gx-travel-btn--primary:hover:not(:disabled) {
    filter: brightness(1.08);
}

.gx-travel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gx-travel-empty {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

.gx-travel-pill--wing { background: rgba(120, 53, 15, 0.45); color: #fdba74; }
.gx-travel-pill--tech { background: rgba(76, 29, 149, 0.45); color: #c4b5fd; }
.gx-travel-pill--route { background: rgba(30, 58, 138, 0.5); color: #93c5fd; }

.gx-travel-btn--secondary {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(100, 116, 139, 0.5);
    color: #cbd5e1;
}

.gx-jump-planner {
    position: sticky;
    bottom: 0;
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 0.5rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 27, 75, 0.98) 100%);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
    z-index: 20;
}

.gx-jump-planner__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.gx-jump-planner__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #a5f3fc;
    margin: 0;
}

.gx-jump-planner__wings {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
}

.gx-jump-wing {
    display: flex;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(71, 85, 105, 0.6);
    background: rgba(15, 23, 42, 0.5);
    cursor: pointer;
}

.gx-jump-wing--selected {
    border-color: rgba(34, 211, 238, 0.55);
    background: rgba(8, 47, 73, 0.45);
}

.gx-jump-wing--disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.gx-jump-wing__radio {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.gx-jump-wing__body {
    flex: 1;
    min-width: 0;
}

.gx-jump-wing__head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gx-jump-wing__name {
    font-weight: 600;
    color: #e9d5ff;
}

.gx-jump-planner__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* --- Auth landing page --- */
.auth-landing {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
}

.auth-landing__backdrop {
    position: absolute;
    inset: 0;
    background: url('/assets/images/stellardominion-login-bg.png') center / cover no-repeat;
    z-index: 0;
}

.auth-landing__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(8, 6, 20, 0.92) 0%, rgba(12, 8, 28, 0.78) 42%, rgba(6, 10, 24, 0.88) 100%),
        radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.18) 0%, transparent 55%);
    z-index: 1;
}

.auth-landing__content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 980px;
    align-items: center;
}

@media (min-width: 768px) {
    .auth-landing__content {
        grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
        gap: 3rem;
    }
}

.auth-landing__hero {
    text-align: center;
}

@media (min-width: 768px) {
    .auth-landing__hero {
        text-align: left;
    }
}

.auth-landing__eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #a78bfa;
}

.auth-landing__title {
    margin: 0 0 0.75rem;
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.05;
    color: #ddd6fe;
}

.auth-landing__tagline {
    margin: 0 0 1.25rem;
    max-width: 34rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #c4b5fd;
}

@media (min-width: 768px) {
    .auth-landing__tagline {
        margin-left: 0;
        margin-right: 0;
    }
}

.auth-landing__features {
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.65rem;
    text-align: left;
}

.auth-landing__features li {
    position: relative;
    padding-left: 1.35rem;
    color: #e0e7ff;
    font-size: 0.95rem;
}

.auth-landing__features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #22d3ee);
    box-shadow: 0 0 8px rgba(167, 139, 250, 0.8);
}

.auth-landing__guest {
    width: 100%;
    max-width: 20rem;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .auth-landing__guest {
        width: auto;
        min-width: 16rem;
    }
}

.auth-landing__status {
    min-height: 1.25rem;
    margin: 0.85rem 0 0;
    font-size: 0.875rem;
    color: #c4b5fd;
}

.auth-landing__status--error {
    color: #fca5a5;
}

.auth-landing__status--success {
    color: #86efac;
}

.auth-landing__card {
    padding: 1.5rem;
    transform: none !important;
}

.auth-landing__card:hover {
    transform: none !important;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.35rem;
    border-radius: 12px;
    background: rgba(15, 12, 30, 0.65);
    border: 1px solid rgba(124, 58, 237, 0.25);
}

.auth-tab {
    padding: 0.7rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #a5b4fc;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab:hover {
    color: #ddd6fe;
    background: rgba(124, 58, 237, 0.12);
}

.auth-tab.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.55), rgba(79, 70, 229, 0.45));
    border-color: rgba(167, 139, 250, 0.45);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form__intro {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #cbd5e1;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-field__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a78bfa;
}

.auth-field__input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: rgba(8, 6, 18, 0.72);
    color: #f8fafc;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field__input::placeholder {
    color: rgba(196, 181, 253, 0.45);
}

.auth-field__input:focus {
    outline: none;
    border-color: rgba(167, 139, 250, 0.85);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.auth-form__submit {
    margin-top: 0.25rem;
    width: 100%;
    padding: 0.8rem 1rem;
}

/* --- Galactic Market --- */
.gx-market__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.gx-market__tab {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #9ca3af;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.gx-market__tab:hover {
    color: #ddd6fe;
}

.gx-market__tab--active {
    color: #e9d5ff;
    border-bottom-color: #a78bfa;
}

.gx-market-modal {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.gx-market-modal.hidden {
    display: none;
}

.gx-market-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.gx-market-modal__card {
    position: relative;
    z-index: 1;
}