:root {
    --bg: #04060d;
    --panel: rgba(14, 20, 40, 0.86);
    --line: rgba(160, 180, 230, 0.25);
    --text: #eef2ff;
    --muted: #a9b4d6;
    --accent: #ffd54a;
    --accent-text: #2a2000;
    --btn: rgba(255, 255, 255, 0.08);
    --btn-hover: rgba(255, 255, 255, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', sans-serif;
    -webkit-text-size-adjust: 100%;
    touch-action: none;
}

#scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ---- 天体ラベル ---- */
.labels {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.label {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -140%);
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.label.small {
    transform: translate(-50%, -50%);
    background: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

/* ---- タイトル ---- */
.title {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    left: 14px;
    pointer-events: none;
}

.title h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
}

.title h1 span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    font-weight: 400;
}

.hint {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--muted);
}

/* ---- 小窓（地球から見た形） ---- */
.inset {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    right: 12px;
    width: clamp(120px, 26vmin, 230px);
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 6px;
    pointer-events: none;
}

.inset.hidden {
    visibility: hidden;
}

.inset-cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

/* ---- 操作パネル ---- */
.panel {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(1100px, 100%);
    padding: 10px 14px calc(8px + env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: 1px solid var(--line);
    border-radius: 10px 10px 0 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    touch-action: manipulation;
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.row + .row {
    margin-top: 8px;
}

button,
select {
    font: inherit;
    color: var(--text);
    background: var(--btn);
    border: 1px solid var(--line);
    border-radius: 6px;
    min-height: 40px;
    padding: 6px 14px;
    cursor: pointer;
}

button:hover {
    background: var(--btn-hover);
}

.views button {
    flex: 1 1 0%;
    font-weight: 700;
    font-size: 15px;
}

.views button[aria-pressed="true"] {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.play {
    min-width: 108px;
    font-weight: 700;
}

.play.on {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.speed {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

select {
    padding: 6px 8px;
}

select option {
    color: #000;
}

input[type="range"] {
    flex: 1 1 160px;
    min-width: 120px;
    accent-color: var(--accent);
    height: 32px;
}

.sub {
    font-size: 13px;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

.toggle input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.info {
    column-gap: 14px;
    row-gap: 2px;
    font-size: 14px;
}

.info strong {
    font-size: 18px;
    color: var(--accent);
}

.info .age,
.info .lit {
    color: var(--muted);
}

.strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
}

.strip button {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 66px;
    padding: 4px 6px;
    font-size: 11px;
    line-height: 1.3;
}

.strip canvas {
    width: 34px;
    height: 34px;
}

.note {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--muted);
}

@media (max-width: 640px) {
    .title h1 {
        font-size: 16px;
    }

    .hint {
        display: none;
    }

    .panel {
        padding: 8px 10px calc(6px + env(safe-area-inset-bottom));
    }

    .row + .row {
        margin-top: 6px;
    }

    .views button {
        font-size: 13px;
        padding: 6px 6px;
    }

    button,
    select {
        min-height: 38px;
    }

    .strip canvas {
        width: 28px;
        height: 28px;
    }

    .strip button {
        min-width: 58px;
    }

    .note {
        display: none;
    }
}

/* スマホでは見る位置のボタンを短い名前にする（4つを1行に収める） */
@media (max-width: 640px) {
    .views .long {
        display: none;
    }
}
