body.star-map {
    background: #03050b;
}

.solar-destination {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #eef0f2;
    overflow: hidden;
}

.solar-destination::backdrop {
    background: rgba(3, 6, 13, 0.38);
    -webkit-backdrop-filter: blur(14px) saturate(0.6);
    backdrop-filter: blur(14px) saturate(0.6);
    animation: solar-backdrop-in 420ms ease both;
}

.solar-destination-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
}

.solar-destination-choices::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 36%;
    bottom: 36%;
    width: 1px;
    background: linear-gradient(transparent, rgba(222, 232, 242, 0.22), transparent);
    pointer-events: none;
}

.solar-destination-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: 400 clamp(0.7rem, 2.25vw, 1.85rem) var(--editorial);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 240ms ease, color 240ms ease;
    -webkit-tap-highlight-color: transparent;
}

body:not(.lang-en) .solar-destination-choice {
    font-family: var(--kai);
    font-size: clamp(1rem, 2.2vw, 1.8rem);
    letter-spacing: 0.12em;
}

.solar-destination[open] .solar-destination-choice span {
    animation: solar-copy-in 500ms ease both;
}

.solar-destination-choice:hover,
.solar-destination-choice:focus-visible {
    color: #fff;
    background: rgba(220, 232, 248, 0.055);
}

.solar-destination-choice:focus-visible { outline: none; }
.solar-destination-choice:focus-visible span { text-decoration: underline; text-underline-offset: 0.4em; text-decoration-thickness: 1px; }

.solar-destination-close {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b7c0cc;
    font: 300 1.8rem var(--ui);
    cursor: pointer;
}

.solar-destination-close:hover { color: #fff; }
.solar-destination-close:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }

.observatory-return {
    position: fixed;
    z-index: 15;
    right: max(34px, env(safe-area-inset-right));
    bottom: max(30px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 0 8px 16px;
    color: #b7c4d4;
    font: 0.68rem var(--ui);
    text-decoration: none;
    text-underline-offset: 5px;
}

.observatory-return:hover, .observatory-return:focus-visible { color: #fff; text-decoration: underline; }
.panel-open .observatory-return, .deep-sky-open .observatory-return, .section-drawer-open .observatory-return { display: none; }
body.observed-sky .map-footer { right: max(240px, 22vw); }

@keyframes solar-backdrop-in {
    from { background: rgba(3, 6, 13, 0); -webkit-backdrop-filter: blur(0px); backdrop-filter: blur(0px); }
}

@keyframes solar-copy-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
    .observatory-return { right: 22px; bottom: max(20px, env(safe-area-inset-bottom)); font-size: 0.62rem; }
    body.observed-sky .map-footer { right: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .solar-destination::backdrop, .solar-destination[open] .solar-destination-choice span { animation: none; }
    .solar-destination-choice { transition: none; }
}

.star-map #spaceCanvas,
.star-map .space-grain,
.star-map .control-legend,
.star-map .reticle,
.star-map .gaze-label,
.star-map .gaze-instruction,
.star-map .entry-gate {
    display: none;
}

#starMapCanvas,
#starMapFallbackCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#starMapCanvas[hidden],
#starMapFallbackCanvas[hidden] {
    display: none;
}

.star-map .galaxy-world {
    cursor: grab;
}

.star-map .galaxy-world.map-star-hover { cursor: pointer; }

.star-map.map-dragging,
.star-map.map-dragging .galaxy-world {
    cursor: grabbing;
}

.star-map .life-mark {
    top: max(28px, env(safe-area-inset-top));
    left: max(34px, env(safe-area-inset-left));
}

.star-map .life-mark strong {
    font-size: 1.14rem;
    letter-spacing: 0.025em;
}

.star-map .life-mark span {
    margin-top: 4px;
    font-size: 0.55rem;
    letter-spacing: 0.17em;
    color: #b3b9c7;
}

.star-map .scene-status {
    top: 37px;
    left: 50%;
    bottom: auto;
    right: auto;
    width: max-content;
    transform: translateX(-50%);
    font-size: 0.58rem;
    letter-spacing: 0.23em;
    color: #aab7c9;
}

.sky-credit {
    position: fixed;
    top: 57px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    color: #8998ad;
    font: 0.5rem var(--ui);
    text-decoration: none;
    text-underline-offset: 3px;
}

.sky-credit:hover, .sky-credit:focus-visible { color: #d3deec; text-decoration: underline; }
.sky-credit[hidden], .deep-sky-open .sky-credit { display: none; }

.star-map .portal-hit.map-portal {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    width: 154px;
    height: auto;
    min-height: 44px;
    border: 0;
    border-radius: 2px;
    color: #ced5df;
    text-align: left;
    padding: 3px 4px;
    background: transparent;
    text-shadow: 0 1px 12px #02040b, 0 0 5px #02040b;
    transition: color 180ms ease;
}

.star-map .portal-hit[hidden],
.star-map .star-hit[hidden],
.map-entity[hidden] {
    display: none;
}

.star-map .portal-hit.map-portal:hover,
.star-map .portal-hit.map-portal.is-highlighted,
.star-map .portal-hit.map-portal:focus-visible,
.star-map .map-entity:not([aria-disabled="true"]):hover,
.star-map .map-entity:focus-visible {
    color: #fff5da;
    box-shadow: none;
    background: transparent;
}

.star-map .portal-hit.map-portal:focus-visible,
.star-map .map-entity:focus-visible {
    outline: 1px solid #c6d2e388;
    outline-offset: 5px;
}

.map-portal-number {
    color: #8294ad;
    font-family: var(--mono);
    font-size: 0.5rem;
}

.map-portal-copy {
    display: grid;
    gap: 4px;
}

.map-portal-copy strong {
    font-family: var(--editorial);
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.05;
}

body:not(.lang-en) .map-portal-copy strong {
    font-family: var(--kai);
    letter-spacing: 0.12em;
}

.map-portal[data-portal-button="wishlist"] .map-portal-copy strong {
    font-family: var(--editorial);
    letter-spacing: normal;
}

.map-portal-copy > span {
    color: #8e9daf;
    font-family: var(--ui);
    font-size: 0.54rem;
    letter-spacing: 0.045em;
}

.map-footer {
    position: fixed;
    bottom: max(30px, env(safe-area-inset-bottom));
    left: max(34px, env(safe-area-inset-left));
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 12;
    color: #a6afbd;
    font-family: var(--ui);
    font-size: 0.61rem;
    letter-spacing: 0.03em;
}

#mapInputHint {
    white-space: pre-wrap;
}

.map-about summary {
    list-style: none;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid #8294ad55;
    border-radius: 50%;
    font-family: var(--editorial);
    cursor: pointer;
}

.map-about summary::-webkit-details-marker {
    display: none;
}

.map-about p {
    position: absolute;
    bottom: 35px;
    left: 0;
    width: min(320px, calc(100vw - 48px));
    padding: 16px 20px;
    border: 1px solid #9aacc733;
    border-radius: 5px;
    background: #09101aed;
    color: #c6cdda;
    line-height: 1.7;
    backdrop-filter: blur(14px);
}

.map-entities {
    position: fixed;
    inset: 0;
    z-index: 7;
    pointer-events: none;
}

.map-about a {
    display: block;
    margin-top: 10px;
    color: #b9c8de;
    text-underline-offset: 3px;
}

.map-entity {
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    justify-items: center;
    gap: 6px;
    min-width: 100px;
    min-height: 44px;
    padding: 9px 12px;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: #ced5df;
    font: 0.64rem var(--ui);
    letter-spacing: 0.09em;
    text-shadow: 0 1px 12px #02040b, 0 0 5px #02040b;
    transition: color 180ms ease;
    cursor: pointer;
    pointer-events: auto;
}

.map-entity::before {
    content: '';
    width: 11px;
    height: 11px;
    border: 1px solid #acbaca8c;
    border-radius: 50%;
    box-shadow: 0 0 18px #9dbdea30;
}

.map-entity[data-map-entity="solar"]::before {
    content: none;
}

.map-solar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 50%;
}

.map-solar > span {
    position: absolute;
    left: 50%;
    top: 50%;
    padding: 9px 12px;
}

.map-solar > span[hidden] {
    display: none;
}

.map-entity[aria-disabled="true"] {
    cursor: default;
}

.map-entity small {
    color: #91a2b8;
    font-size: 0.53rem;
    letter-spacing: 0.05em;
}

.star-map .section-drawer-toggle {
    top: 103px;
    bottom: auto;
}

.star-map.panel-open .map-footer {
    visibility: hidden;
}

.star-map .star-hit {
    width: 50px;
    height: 50px;
}

.star-map .star-hit-copy {
    background: #080d17bd;
}

@media (max-width: 760px) {
    .star-map .life-mark { top: 22px; left: 20px; }
    .star-map .life-mark strong { font-size: 0.98rem; }
    .star-map .life-mark span { font-size: 0.47rem; }
    .star-map .scene-status { top: 80px; font-size: 0.47rem; }
    .sky-credit { top: 98px; font-size: 0.45rem; }
    .star-map .language-switch { right: 17px; top: 20px; }
    .map-footer { left: 22px; right: 22px; bottom: max(83px, calc(env(safe-area-inset-bottom) + 70px)); gap: 10px; font-size: 0.54rem; }
    .star-map .portal-hit.map-portal { width: 112px; gap: 5px; }
    .map-portal-copy strong { font-size: 0.87rem; }
    .map-portal-copy > span { font-size: 0.47rem; }
    .star-map .section-drawer-toggle { top: 101px; }
}

@media (prefers-reduced-motion: reduce) {
    .star-map *, .star-map *::before, .star-map *::after { transition-duration: 0s !important; }
}
