/* The constellation: a night sky drawn on canvas (public/js/constellation.js), with its zoom controls,
   the name that appears over a star and the ranks. Built on the site's tokens; the sky
   itself keeps its own deep blue in both themes, like the night it shows. */

.cs-sky {
    --cs-night-top: #0b1226;
    --cs-night-bottom: #162447;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--qr-hairline);
    border-radius: var(--qr-radius-panel);
    background: radial-gradient(120% 90% at 50% 20%, var(--cs-night-bottom) 0%, var(--cs-night-top) 70%);
}

.cs-sky canvas {
    display: block;
    width: 100%;
    height: clamp(360px, 62vh, 680px);
    cursor: grab;
    touch-action: none;
}

.cs-sky.is-compact canvas {
    height: clamp(300px, 46vh, 460px);
}

.cs-sky canvas:active {
    cursor: grabbing;
}

.cs-zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 6px;
}

.cs-zoom button {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(205, 218, 255, 0.28);
    border-radius: var(--qr-radius-small, 6px);
    background: rgba(11, 18, 38, 0.72);
    color: #f0f5ff;
    font: 600 16px/1 var(--qr-body, system-ui, sans-serif);
    cursor: pointer;
}

.cs-zoom button:hover,
.cs-zoom button:focus-visible {
    border-color: var(--qr-mint, #36d399);
    outline: 0;
}

.cs-tip {
    position: absolute;
    z-index: 2;
    padding: 4px 10px;
    border-radius: var(--qr-radius-pill, 999px);
    background: rgba(240, 245, 255, 0.95);
    color: #0b1226;
    font: 600 13px/1.4 var(--qr-body, system-ui, sans-serif);
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 12px));
}

.cs-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    color: var(--qr-muted);
    font-size: 14px;
}

.cs-legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cs-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f0f5ff;
    box-shadow: 0 0 0 1px rgba(11, 18, 38, 0.35);
}

.cs-dot.is-unlit {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--qr-muted);
}

.cs-dot.is-me {
    background: var(--qr-mint, #36d399);
}

.cs-ranks {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-rank {
    padding: 14px 16px;
    border: 1px solid var(--qr-hairline);
    border-radius: var(--qr-radius-card);
}

.cs-rank.is-reached {
    border-color: var(--qr-mint-border, var(--qr-mint));
    background: var(--qr-mint-soft);
}

.cs-rank strong {
    display: block;
    color: var(--qr-text);
}

.cs-rank span {
    color: var(--qr-muted);
    font-size: 14px;
}

.cs-progress {
    height: 8px;
    overflow: hidden;
    border-radius: var(--qr-radius-pill, 999px);
    background: var(--qr-surface-2);
}

.cs-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--qr-mint);
}

.cs-figures {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 32px;
    margin: 16px 0 0;
}

.cs-figures div {
    display: grid;
}

.cs-figures strong {
    color: var(--qr-text);
    font-size: 28px;
    font-variant-numeric: tabular-nums;
}

.cs-figures span {
    color: var(--qr-muted);
    font-size: 14px;
}

@media (max-width: 767px) {
    .cs-ranks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cs-own {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.cs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
