/* Game 1 Fleet Navigation. The dashboard shell remains owned by the shared
   console stylesheet; this layer owns the map and travel command surface. */

.final-travel-page .dashboard-main,
.final-travel-page .right-stack,
.final-travel-page .fleet-navigation-core,
.final-travel-page .travel-command-card,
.final-travel-page .travel-launch-panel,
.final-travel-page .travel-confirm-panel {
    min-width: 0;
}

/* Travel owns both the map and its operations band inside dashboard-main.
   The shared shell places page-level operations sections in outer grid column
   two, so explicitly collapse Travel's inner grid to one central column. */
.final-travel-page .dashboard-main {
    grid-template-columns: minmax(0, 1fr);
}

.final-dashboard-page.final-travel-page .fleet-navigation-core,
.final-dashboard-page.final-travel-page .travel-operations-grid {
    grid-column: 1;
}

/* Keep Travel's intelligence rail on the right at the same desktop widths
   where the shared shell collapses it. The travel command surface remains
   the central column; Top 10 is the only right-rail module. */
@media (min-width: 981px) {
    .final-travel-page .dashboard-frame {
        grid-template-columns: 230px minmax(0, 1fr) 300px;
    }

    .final-travel-page .right-stack {
        grid-column: auto;
        grid-row: auto;
        grid-template-columns: 1fr;
    }
}

@media (min-width: 981px) and (max-width: 1420px) {
    .final-travel-page .travel-operations-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.final-travel-page .fleet-navigation-core {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(0, 6, 12, 0.97), rgba(0, 2, 7, 0.98));
    box-shadow: 0 0 34px rgba(35, 151, 255, 0.13), inset 0 0 42px rgba(29, 230, 255, 0.045);
    padding: 22px;
}

.final-travel-page .fleet-navigation-core::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(29, 230, 255, 0.5), transparent 16%) top left / 100% 1px no-repeat,
        linear-gradient(270deg, rgba(245, 202, 85, 0.45), transparent 20%) bottom right / 100% 1px no-repeat;
    opacity: 0.75;
}

.travel-space-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 78% 25%, rgba(29, 230, 255, 0.12), transparent 22%),
        radial-gradient(circle at 21% 78%, rgba(245, 202, 85, 0.07), transparent 24%),
        linear-gradient(135deg, rgba(0, 10, 22, 0.72), rgba(0, 0, 0, 0.18));
}

.final-travel-page .fleet-navigation-core > *:not(.travel-space-backdrop):not(.core-grid) {
    position: relative;
    z-index: 1;
}

.travel-page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.travel-page-heading > div:first-child > span,
.travel-command-card > header span,
.travel-launch-panel > div > span,
.travel-confirm-copy > span {
    color: var(--cyan);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.travel-page-heading h1 {
    margin: 5px 0 4px;
    color: #f7fbff;
    font-size: clamp(34px, 4vw, 62px);
    line-height: 0.98;
    letter-spacing: -1.5px;
}

.travel-page-heading p {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.travel-heading-state {
    flex: 0 0 auto;
    border: 1px solid rgba(29, 230, 255, 0.4);
    background: rgba(3, 28, 46, 0.72);
    color: #b9f8ff;
    padding: 11px 13px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.6px;
}

.travel-map-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(74, 170, 255, 0.42);
    background: rgba(0, 4, 11, 0.75);
    box-shadow: inset 0 0 40px rgba(29, 230, 255, 0.045);
}

.travel-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(74, 170, 255, 0.22);
    padding: 11px 14px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.travel-map-toolbar strong {
    color: #dffaff;
    font-size: 11px;
}

.travel-map-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}

.travel-map-toolbar-actions > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.travel-map-controls {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.travel-map-controls button {
    min-width: 28px;
    border: 1px solid rgba(74, 170, 255, 0.35);
    background: rgba(4, 28, 46, 0.84);
    color: #c8f8ff;
    padding: 4px 7px;
    font: inherit;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
}

.travel-map-controls button:hover,
.travel-map-controls button:focus-visible {
    border-color: var(--cyan);
    background: rgba(7, 67, 91, 0.95);
    color: #fff;
    outline: none;
}

.travel-map-stage {
    --map-x: 0;
    --map-y: 0;
    --map-scale: 1;
    position: relative;
    min-height: 480px;
    overflow: hidden;
    isolation: isolate;
    touch-action: pan-y;
    background:
        radial-gradient(circle at 50% 50%, rgba(29, 230, 255, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(4, 22, 40, 0.16), rgba(0, 2, 7, 0.82));
}

.travel-map-stage::before,
.travel-map-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.travel-map-stage::before {
    z-index: -1;
    opacity: 0.42;
    background-image:
        linear-gradient(rgba(103, 186, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(103, 186, 255, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: translate3d(calc(var(--map-x) * -8px), calc(var(--map-y) * -8px), 0);
}

.travel-map-plane {
    position: absolute;
    inset: 0;
    transform: scale(var(--map-scale));
    transform-origin: center;
    transition: transform 220ms ease-out;
}

.travel-map-stage::after {
    z-index: 3;
    background: radial-gradient(circle at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.38) 100%);
}

.travel-route-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    transform: translate3d(calc(var(--map-x) * 5px), calc(var(--map-y) * 5px), 0);
    transition: transform 160ms ease-out;
}

.travel-route-lines line {
    stroke: rgba(103, 186, 255, 0.28);
    stroke-width: 2;
    stroke-dasharray: 7 11;
    transition: stroke 180ms ease, stroke-width 180ms ease, filter 180ms ease;
}

.travel-route-lines line[data-route-line="earth-trappist"] {
    stroke: url(#routeEarthTrappist);
}

.travel-route-lines line[data-route-line="earth-kepler"] {
    stroke: url(#routeEarthKepler);
}

.travel-route-lines line[data-route-line="trappist-kepler"] {
    stroke: url(#routeTrappistKepler);
}

.travel-route-lines line[data-active="true"] {
    stroke-width: 5;
    filter: drop-shadow(0 0 7px rgba(29, 230, 255, 0.85));
    animation: travel-route-pulse 1.4s linear infinite;
}

.final-travel-page .signal-list i {
    display: none;
}

.travel-map-signal {
    fill: none;
    stroke: rgba(29, 230, 255, 0.18);
    stroke-width: 1;
    stroke-dasharray: 2 8;
    transform-box: fill-box;
    transform-origin: center;
    animation: travel-signal-spin 20s linear infinite;
}

.planet-node {
    position: absolute;
    z-index: 4;
    display: grid;
    justify-items: center;
    gap: 8px;
    width: 170px;
    border: 0;
    background: transparent;
    color: #fff;
    padding: 0;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: filter 180ms ease, transform 180ms ease;
}

.planet-node:hover,
.planet-node:focus-visible,
.planet-node[data-selected="true"] {
    filter: brightness(1.18) drop-shadow(0 0 12px rgba(29, 230, 255, 0.5));
    transform: translate(-50%, -50%) scale(1.04);
    outline: none;
}

.planet-node:disabled {
    cursor: not-allowed;
    filter: grayscale(0.45) opacity(0.68);
}

.planet-node:disabled:hover {
    filter: grayscale(0.45) opacity(0.68);
    transform: translate(-50%, -50%);
}

.planet-node[data-current="true"] .planet-orb {
    box-shadow: 0 0 0 2px rgba(29, 230, 255, 0.72), 0 0 0 10px rgba(29, 230, 255, 0.1), 0 0 40px rgba(29, 230, 255, 0.62);
}

.planet-node-earth { left: 20%; top: 54%; }
.planet-node-trappist { left: 50%; top: 27%; }
.planet-node-kepler { left: 76%; top: 64%; }

.planet-orb {
    display: block;
    width: 116px;
    height: 116px;
    border: 1px solid rgba(196, 239, 255, 0.72);
    border-radius: 50%;
    background-position: center;
    background-size: cover;
    box-shadow: 0 0 26px rgba(29, 230, 255, 0.27), inset -20px -14px 28px rgba(0, 0, 0, 0.72);
    transform: translate3d(calc(var(--map-x) * 8px), calc(var(--map-y) * 8px), 0);
    transition: transform 180ms ease-out, box-shadow 180ms ease;
}

.planet-node-earth .planet-orb { background-image: url("/assets/images/backgrounds/profiles/earth-profile-bg.png"); }
.planet-node-trappist .planet-orb { background-image: url("/assets/images/backgrounds/profiles/mars-profile-bg.png"); }
.planet-node-kepler .planet-orb { background-image: url("/assets/images/backgrounds/profiles/venus-profile-bg.png"); }

.planet-node-copy {
    display: grid;
    gap: 3px;
    text-align: center;
    text-shadow: 0 2px 8px #000;
}

.planet-node-copy b {
    color: #f8fcff;
    font-size: 13px;
    letter-spacing: 2px;
}

.planet-node-copy small {
    color: #9bb7d3;
    font-size: 11px;
}

.travel-map-legend {
    position: absolute;
    z-index: 4;
    left: 16px;
    bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #91abc6;
    font-size: 10px;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.travel-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.travel-map-hover-card {
    position: absolute;
    z-index: 7;
    top: 16px;
    right: 16px;
    width: min(245px, calc(100% - 32px));
    border: 1px solid rgba(29, 230, 255, 0.45);
    background: linear-gradient(145deg, rgba(3, 22, 38, 0.94), rgba(0, 5, 13, 0.92));
    box-shadow: 0 0 26px rgba(29, 230, 255, 0.12), inset 0 0 18px rgba(29, 230, 255, 0.04);
    padding: 12px 13px;
    pointer-events: none;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 150ms ease, transform 150ms ease;
}

.travel-map-hover-card[hidden] {
    display: none !important;
}

.travel-map-hover-card > span,
.travel-map-hover-card > div span {
    color: var(--cyan);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.travel-map-hover-card > strong {
    display: block;
    margin-top: 4px;
    color: #f7fbff;
    font-size: 21px;
}

.travel-map-hover-card p {
    margin: 5px 0 9px;
    color: #a7c1d9;
    font-size: 11px;
    line-height: 1.4;
}

.travel-map-hover-card > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid rgba(74, 170, 255, 0.2);
    padding-top: 8px;
}

.travel-map-hover-card > div b {
    color: #fff;
    font-size: 11px;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot-current { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.legend-dot-route { background: #f5ca55; box-shadow: 0 0 8px #f5ca55; }

.travel-command-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 10px;
    margin-top: 10px;
}

.travel-command-card {
    border: 1px solid rgba(74, 170, 255, 0.3);
    background: rgba(0, 5, 13, 0.82);
    padding: 16px;
}

.travel-command-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 13px;
}

.travel-command-card > header strong {
    color: #93acc6;
    font-size: 10px;
    letter-spacing: 1.4px;
}

.travel-metric-grid,
.travel-destination-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.travel-metric-grid > div,
.travel-destination-facts > div {
    border: 1px solid rgba(74, 170, 255, 0.18);
    background: rgba(4, 19, 34, 0.54);
    padding: 10px;
}

.travel-metric-grid span,
.travel-destination-facts span {
    display: block;
    color: #8fa8c2;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.travel-metric-grid strong,
.travel-destination-facts strong {
    display: block;
    margin-top: 6px;
    color: #f5faff;
    font-size: clamp(15px, 1.35vw, 22px);
    white-space: nowrap;
}

.travel-manifest-note,
.travel-destination-copy p,
.travel-launch-panel p,
.travel-confirm-copy p {
    margin: 12px 0 0;
    color: #9cb5ce;
    font-size: 12px;
    line-height: 1.5;
}

.travel-countdown {
    display: block;
    min-height: 15px;
    margin-top: 7px;
    color: #9befff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.travel-destination-copy h2 {
    margin: 0;
    color: #f6fbff;
    font-size: clamp(24px, 2.2vw, 38px);
}

.travel-destination-copy p {
    min-height: 38px;
    margin-top: 6px;
}

.travel-destination-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 13px;
}

.travel-launch-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    border: 1px solid rgba(245, 202, 85, 0.4);
    background: linear-gradient(100deg, rgba(40, 30, 4, 0.66), rgba(0, 8, 16, 0.86));
    padding: 15px 16px;
}

.travel-launch-panel strong {
    display: block;
    margin-top: 6px;
    color: #fff8dd;
    font-size: 15px;
}

.travel-launch-button,
.travel-confirm-button,
.travel-cancel-button {
    min-width: 150px;
    border: 1px solid rgba(29, 230, 255, 0.66);
    border-radius: 0;
    background: rgba(4, 64, 88, 0.86);
    color: #effcff;
    padding: 12px 15px;
    font-weight: 900;
    letter-spacing: 0.7px;
    cursor: pointer;
}

.travel-launch-button:hover:not(:disabled),
.travel-confirm-button:hover:not(:disabled) {
    border-color: #fff;
    background: rgba(9, 105, 134, 0.96);
}

.travel-launch-button:disabled,
.travel-confirm-button:disabled {
    border-color: rgba(130, 151, 174, 0.25);
    background: rgba(20, 28, 38, 0.68);
    color: #66788e;
    cursor: not-allowed;
}

.travel-confirm-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    border: 1px solid rgba(255, 74, 99, 0.68);
    background: linear-gradient(100deg, rgba(70, 10, 20, 0.78), rgba(12, 4, 10, 0.92));
    padding: 15px 16px;
}

/* The shared travel panel uses a flex layout, so explicitly preserve the
   native hidden contract instead of allowing the author display rule above
   to make the confirmation gate visible on first paint. */
.final-travel-page .travel-confirm-panel[hidden] {
    display: none !important;
}

.travel-confirm-copy h2 {
    margin: 5px 0 0;
    color: #fff;
    font-size: 22px;
}

.travel-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.travel-cancel-button {
    min-width: 100px;
    border-color: rgba(138, 166, 193, 0.45);
    background: rgba(18, 33, 48, 0.76);
}

.travel-confirm-button {
    border-color: rgba(255, 87, 112, 0.78);
    background: rgba(130, 18, 38, 0.9);
}

.travel-top-ten-list,
.travel-pulse-copy {
    padding: 14px;
}

.travel-top-ten-list {
    display: grid;
    gap: 7px;
}

.travel-top-ten-entry {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 7px;
    border: 1px solid rgba(74, 170, 255, 0.22);
    background: rgba(0, 5, 13, 0.62);
    padding: 8px;
}

.travel-top-ten-entry b {
    color: #fff;
    font-size: 14px;
}

.travel-top-ten-entry span {
    display: block;
    overflow: hidden;
    color: #54b1ff;
    font-size: 12px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.travel-top-ten-entry small {
    display: block;
    margin-top: 2px;
    color: #d9e7f7;
    font-size: 10px;
    font-weight: 800;
}

.travel-pulse-copy {
    color: #a4bdd6;
    font-size: 12px;
    line-height: 1.6;
}

.top-ten-empty {
    border: 1px dashed rgba(74, 170, 255, 0.3);
    border-radius: 12px;
    color: #8fa8c2;
    padding: 15px;
}

@keyframes travel-route-pulse {
    to { stroke-dashoffset: -36; }
}

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

@media (max-width: 1420px) {
    .final-travel-page .fleet-navigation-core {
        padding: 16px;
    }

    .travel-map-stage {
        min-height: 430px;
    }
}

@media (max-width: 980px) {
    .travel-page-heading,
    .travel-launch-panel,
    .travel-confirm-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .travel-command-grid {
        grid-template-columns: 1fr;
    }

    .travel-launch-button,
    .travel-confirm-actions,
    .travel-confirm-button,
    .travel-cancel-button {
        width: 100%;
    }

    .travel-confirm-actions {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .final-travel-page .fleet-navigation-core {
        padding: 10px;
    }

    .travel-map-stage {
        min-height: 390px;
    }

    .planet-node {
        width: 118px;
    }

    .planet-orb {
        width: 76px;
        height: 76px;
    }

    .planet-node-earth { left: 18%; top: 57%; }
    .planet-node-trappist { left: 50%; top: 24%; }
    .planet-node-kepler { left: 80%; top: 65%; }

    .travel-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .travel-map-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .travel-map-toolbar-actions {
        justify-content: space-between;
        width: 100%;
    }

    .travel-map-hover-card {
        top: 10px;
        right: 10px;
        width: min(215px, calc(100% - 20px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .travel-route-lines line[data-active="true"],
    .travel-map-signal {
        animation: none;
    }
}
