:root {
    --red: #e60012;
    --gold: #facc15;
    --ink: #3b2412;
    --cream: #fff8e7;
    --navy: #0f172a;
    --font: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
    font-family: var(--font);
    background: radial-gradient(circle at top, #1e1b4b, #030712);
    color: #f8fafc;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 12px;
}

kbd {
    display: inline-block;
    background: var(--gold);
    color: var(--navy);
    padding: 2px 8px;
    margin: 0 2px;
    border-radius: 6px;
    border-bottom: 3px solid #b45309;
    font-family: var(--font);
    font-weight: 900;
    font-size: 0.8em;
}

/* ───── 스테이지 ───── */
.stage {
    position: relative;
    width: min(100%, calc((100vh - 24px) * 16 / 9));
    aspect-ratio: 16 / 9;
    border-radius: 22px;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    background: #8fd3ff;
    user-select: none;
}

#game-canvas { display: block; width: 100%; height: 100%; }

/* ───── 타이틀 (맑은 3D 쇼케이스 + 커스텀 SVG 크레스트) ───── */
.title-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 2.8% 4% 3.2%;
    background: linear-gradient(180deg, rgba(14, 116, 144, 0.28) 0%, rgba(15, 23, 42, 0) 38%, rgba(15, 23, 42, 0.42) 100%);
    transition: opacity 0.65s ease;
    overflow: hidden;
}
.title-screen.fade-out { opacity: 0; pointer-events: none; }

.title-emblem {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    filter: drop-shadow(0 10px 22px rgba(15, 23, 42, 0.38));
}
.title-crest-svg {
    width: clamp(240px, 34vw, 420px);
    height: auto;
    margin-bottom: -24px;
    pointer-events: none;
    @media (prefers-reduced-motion: no-preference) {
        animation: crest-float 3.6s ease-in-out infinite;
    }
}
@keyframes crest-float { 50% { transform: translateY(-6px); } }

.title-kicker {
    position: relative;
    display: inline-block;
    background: linear-gradient(90deg, #ff6b35, #facc15);
    color: #3b1706;
    padding: 5px 18px;
    border-radius: 999px;
    border: 2px solid #fff;
    font-weight: 900;
    letter-spacing: 0.08em;
    font-size: clamp(0.68rem, 1.15vw, 0.92rem);
    box-shadow: 0 4px 0 #b45309;
}
.title-emblem h1 { display: flex; flex-direction: column; line-height: 1.02; margin-top: 8px; }
.title-small {
    font-size: clamp(1.3rem, 3vw, 2.35rem);
    font-weight: 900;
    color: #fff;
    -webkit-text-stroke: 2px #7c2d12;
    paint-order: stroke fill;
    text-shadow: 0 4px 0 #dc2626;
}
.title-big {
    font-size: clamp(2.5rem, 6.8vw, 5.4rem);
    font-weight: 900;
    color: #fde047;
    -webkit-text-stroke: 5px #7c2d12;
    paint-order: stroke fill;
    text-shadow: 0 6px 0 #e60012, 0 12px 24px rgba(0, 0, 0, 0.45);
    @media (prefers-reduced-motion: no-preference) {
        animation: title-bob 2.6s ease-in-out infinite;
    }
}

.title-bottom-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.title-press.title-start-btn {
    border: 4px solid #fff;
    border-bottom: 7px solid #991b1b;
    background: linear-gradient(180deg, #ff4757 0%, #e60012 100%);
    color: #fff;
    font-family: var(--font);
    font-weight: 900;
    font-size: clamp(1.05rem, 2.2vw, 1.6rem);
    padding: 12px 38px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.45);
    transition: transform 0.16s ease;
    @media (prefers-reduced-motion: no-preference) {
        animation: start-pulse 1.6s ease-in-out infinite;
    }
}
.title-press.title-start-btn:hover { transform: translateY(-2px) scale(1.04); }
@keyframes start-pulse { 50% { transform: scale(1.04); } }

.title-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    padding: 5px 14px;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
}
.video-status { font-size: clamp(0.65rem, 1.05vw, 0.85rem); color: #fde68a; font-weight: 700; }
.video-status.ok { color: #86efac; }

.ghost-btn {
    cursor: pointer;
    background: rgba(15, 23, 42, 0.65);
    color: #e2e8f0;
    border: 2px solid rgba(255, 255, 255, 0.35);
    padding: 6px 14px;
    border-radius: 999px;
    font-family: var(--font);
    font-weight: 800;
    font-size: 0.82rem;
}
.ghost-btn:hover { background: rgba(239, 68, 68, 0.85); border-color: #fecaca; color: #fff; }

.voice-btn {
    pointer-events: auto;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    border: 3px solid #38bdf8;
    padding: 7px 14px;
    border-radius: 999px;
    font-family: var(--font);
    font-weight: 900;
    font-size: clamp(0.75rem, 1.25vw, 0.95rem);
}
.voice-btn:hover { background: #0284c7; }
.voice-btn.small { font-size: 0.82rem; padding: 5px 12px; }

@keyframes title-bob { 50% { transform: translateY(-8px) rotate(-1deg); } }
@keyframes blink { 50% { opacity: 0.35; } }

/* ───── HUD ───── */
.hud {
    position: absolute;
    inset: 16px 18px auto 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}
.mission-card {
    background: rgba(255, 248, 231, 0.94);
    color: var(--ink);
    border-radius: 18px;
    padding: 12px 18px 14px;
    border: 3px solid #e8c48a;
    box-shadow: 0 6px 0 rgba(124, 74, 33, 0.35);
    font-size: clamp(0.65rem, 1.15vw, 0.9rem);
}
.location-tag { font-weight: 900; color: #16a34a; }
.mission-card h2 { font-size: 1.15em; margin: 2px 0 6px; }
.objective-list { list-style: none; display: grid; gap: 3px; }
.objective-list li { font-weight: 700; padding-left: 1.5em; position: relative; }
.objective-list li::before { content: "☐"; position: absolute; left: 0; }
.objective-list li.done { color: #16a34a; text-decoration: line-through; }
.objective-list li.done::before { content: "✅"; }

.moon-slot-bar {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 2px dashed #e8c48a;
}
.moon-slot {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(124, 74, 33, 0.12);
    font-size: 0.95rem;
    opacity: 0.35;
    filter: grayscale(0.75);
    transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}
.moon-slot.is-collected {
    opacity: 1;
    filter: none;
    background: #fef3c7;
    box-shadow: 0 0 0 2px var(--gold);
    transform: scale(1.12);
}

.hud-counters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.moon-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.85);
    border: 3px solid var(--gold);
    padding: 8px 18px;
    border-radius: 999px;
    color: var(--gold);
    font-weight: 900;
    font-size: clamp(0.9rem, 1.8vw, 1.4rem);
}
.moon-icon { font-size: 1.2em; }

/* ───── 머리 위 ENTER 말풍선 ───── */
.prompt-bubble {
    position: absolute;
    transform: translate(-50%, -100%);
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--navy);
    color: #fff;
    border: 3px solid var(--gold);
    border-radius: 999px;
    padding: 6px 14px 6px 8px;
    font-weight: 900;
    font-size: clamp(0.7rem, 1.2vw, 0.95rem);
    white-space: nowrap;
    pointer-events: none;
    filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.3));
}
.prompt-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -11px;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--gold);
}
.prompt-bubble.pop { animation: bubble-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), bubble-float 1.4s ease-in-out 0.35s infinite; }
@keyframes bubble-pop { from { scale: 0.2; } to { scale: 1; } }
@keyframes bubble-float { 50% { translate: 0 -6px; } }

/* ───── 대화창 ───── */
.talk-box {
    position: absolute;
    left: 50%;
    bottom: 5%;
    transform: translateX(-50%);
    width: min(78%, 820px);
    min-height: 22%;
    background: var(--cream);
    color: var(--ink);
    border-radius: 40px;
    padding: 30px 40px 24px 120px;
    box-shadow: 0 8px 0 rgba(124, 74, 33, 0.35), 0 18px 40px rgba(0, 0, 0, 0.3);
    font-size: clamp(0.8rem, 1.55vw, 1.2rem);
    animation: talk-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes talk-in { from { transform: translateX(-50%) scale(0.85); opacity: 0; } }
.talk-portrait {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    font-size: 44px;
    background: #fde68a;
    border-radius: 50%;
    border: 4px solid #f59e0b;
}
.talk-name {
    position: absolute;
    top: -16px;
    left: 110px;
    background: #f97316;
    color: #fff;
    padding: 4px 18px;
    border-radius: 999px;
    font-weight: 900;
    transform: rotate(-3deg);
    font-size: 0.9em;
}
.talk-text { font-weight: 700; line-height: 1.6; white-space: pre-wrap; }
.talk-next { position: absolute; right: 30px; bottom: 14px; color: #f97316; animation: next-bob 0.7s ease-in-out infinite; }
@keyframes next-bob { 50% { transform: translateY(4px); } }
.talk-choices { list-style: none; position: absolute; right: 28px; bottom: calc(100% + 10px); display: grid; gap: 6px; }
.talk-choices li {
    background: var(--cream);
    padding: 8px 18px 8px 32px;
    border-radius: 999px;
    font-weight: 900;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 0 rgba(124, 74, 33, 0.3);
}
.talk-choices li.selected { background: #fde68a; }
.talk-choices li.selected::before { content: "▶"; position: absolute; left: 12px; color: #f97316; }

/* ───── 조작 안내 & 우측 하단 미니맵 ───── */
.controls-hint {
    position: absolute;
    left: 18px;
    bottom: 16px;
    display: flex;
    gap: 14px;
    background: rgba(15, 23, 42, 0.75);
    padding: 7px 16px;
    border-radius: 999px;
    font-size: clamp(0.6rem, 1vw, 0.82rem);
    font-weight: 700;
    pointer-events: none;
}

.minimap-wrap {
    position: absolute;
    right: 18px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}
#minimap-canvas {
    width: clamp(118px, 14vw, 176px);
    height: clamp(118px, 14vw, 176px);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.55);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}
.minimap-label {
    background: rgba(15, 23, 42, 0.82);
    border: 2px solid var(--gold);
    color: #fff;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: clamp(0.62rem, 0.95vw, 0.78rem);
}

/* ───── 토스트 / 카운트다운 / 플래시 ───── */
.toast {
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: var(--navy);
    font-weight: 900;
    padding: 10px 26px;
    border-radius: 999px;
    font-size: clamp(0.85rem, 1.6vw, 1.2rem);
    box-shadow: 0 6px 0 #b45309;
}
.toast.show { animation: toast 2.6s ease forwards; }
@keyframes toast {
    0% { opacity: 0; translate: 0 -20px; scale: 0.8; }
    12%, 85% { opacity: 1; translate: 0 0; scale: 1; }
    100% { opacity: 0; translate: 0 -10px; }
}

.countdown {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: clamp(5rem, 16vw, 12rem);
    font-weight: 900;
    color: #fff;
    -webkit-text-stroke: 4px var(--red);
    text-shadow: 0 10px 0 rgba(0, 0, 0, 0.25);
    pointer-events: none;
}
.countdown.final { color: var(--gold); font-size: clamp(4rem, 12vw, 9rem); }
.countdown.pop { animation: count-pop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
@keyframes count-pop {
    0% { scale: 2.4; opacity: 0; }
    30% { scale: 1; opacity: 1; }
    80% { scale: 1; opacity: 1; }
    100% { scale: 0.7; opacity: 0; }
}

.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash 1.1s ease forwards; }
@keyframes flash { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }

/* ───── 컷신 ───── */
.cutscene-layer { position: absolute; inset: 0; background: #000; }
#cutscene-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cutscene-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 10px;
    text-align: center;
    font-weight: 800;
    font-size: clamp(0.9rem, 1.8vw, 1.3rem);
    background: radial-gradient(circle, #312e81, #030712);
}
.cutscene-fallback code { color: var(--gold); }
.skip-btn {
    position: absolute;
    right: 20px;
    bottom: 18px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 800;
    font-family: var(--font);
}

/* ───── 엔딩 (우주 박사 수료식) ───── */
.end-screen {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 35%, rgba(67, 56, 202, 0.56), rgba(11, 16, 38, 0.78) 72%);
    backdrop-filter: blur(4px);
}
.end-card {
    text-align: center;
    background: rgba(15, 23, 42, 0.88);
    border: 3px solid var(--gold);
    border-radius: 28px;
    padding: 26px 34px;
    max-width: min(92vw, 680px);
    display: grid;
    gap: 10px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    animation: talk-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.end-gifts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 4px 0;
}
.end-gift-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.78rem;
    font-weight: 800;
    color: #94a3b8;
}
.end-gift-item.is-collected {
    background: rgba(49, 46, 129, 0.92);
    border-color: var(--gold);
    color: #fef08a;
}
.solar-action-btn.grad {
    border-color: var(--gold);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
}
.end-card h2 { font-size: clamp(1.6rem, 3.6vw, 2.6rem); color: var(--gold); }
.end-next { color: #bae6fd; }
.end-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.primary-btn {
    justify-self: center;
    cursor: pointer;
    background: var(--red);
    color: #fff;
    border: none;
    border-bottom: 4px solid #7f1d1d;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 1rem;
    font-family: var(--font);
}

/* ───── 오디세이 파워문 획득 배너 ───── */
.moon-banner {
    position: absolute;
    top: 16%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.94));
    border: 4px solid var(--gold);
    border-radius: 999px;
    padding: 14px 32px 14px 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 10;
}
.moon-banner.pop { animation: banner-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes banner-pop { from { opacity: 0; scale: 0.55; } to { opacity: 1; scale: 1; } }
.moon-banner-badge { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1; }
.moon-banner h2 { font-size: clamp(1.1rem, 2.4vw, 1.75rem); color: var(--gold); margin-bottom: 2px; }
.moon-banner p { font-size: clamp(0.8rem, 1.4vw, 1.05rem); font-weight: 800; color: #bae6fd; }

/* ───── 그림 카드 퀴즈 <dialog> ───── */
dialog:modal {
    overscroll-behavior: contain;
    margin: auto;
    border: 4px solid #e8c48a;
    border-radius: 28px;
    background: var(--cream);
    color: var(--ink);
    padding: 26px;
    max-width: 660px;
    width: 94%;
    font-family: var(--font);
    box-shadow: 0 10px 0 rgba(124, 74, 33, 0.35), 0 25px 60px rgba(0, 0, 0, 0.6);
}
dialog::backdrop {
    overflow: hidden;
    overscroll-behavior: contain;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(4px);
}
.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.dialog-title { font-size: 1.45rem; color: #c2410c; margin: 0; }
.dialog-fact { background: #fff; border-radius: 16px; padding: 12px 16px; line-height: 1.55; font-weight: 700; font-size: 1.02rem; margin-bottom: 12px; }
.quiz-clue-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(135deg, #fef9c3, #ffedd5);
    border: 3px dashed #f59e0b;
    border-radius: 20px;
    padding: 10px 18px;
    margin-bottom: 12px;
}
.clue-emoji { font-size: 3.4rem; line-height: 1; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.12)); }
.clue-guide { font-weight: 900; color: #b45309; font-size: 1.05rem; }
.quiz-question { font-weight: 900; color: #0369a1; margin-bottom: 12px; font-size: 1.1rem; }

.picture-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}
.picture-card-btn {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 10px;
    border-radius: 22px;
    border: 4px solid #e8c48a;
    background: #fff;
    color: var(--ink);
    font-weight: 900;
    font-size: 0.98rem;
    font-family: var(--font);
    text-align: center;
    box-shadow: 0 5px 0 rgba(124, 74, 33, 0.2);
    transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.card-icon { font-size: 3.8rem; line-height: 1; }
.card-label { line-height: 1.3; }
.picture-card-btn.is-highlighted,
.picture-card-btn:hover:not(:disabled),
.picture-card-btn:focus-visible {
    border-color: #f97316;
    background: #fff7ed;
    transform: translateY(-4px);
    outline: none;
}
.picture-card-btn.is-correct { border-color: #16a34a; background: #dcfce7; transform: scale(1.04); }
.picture-card-btn.is-wrong { border-color: #dc2626; background: #fee2e2; animation: card-shake 0.35s ease; }
.picture-card-btn:disabled { cursor: default; }
@keyframes card-shake {
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}
.quiz-feedback { min-height: 1.5em; font-weight: 900; margin-bottom: 12px; }
.quiz-feedback.correct { color: #16a34a; }
.quiz-feedback.retry { color: #ea580c; }
.dialog-close-btn {
    cursor: pointer;
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    border: none;
    border-bottom: 4px solid #b45309;
    background: var(--gold);
    color: var(--navy);
    font-weight: 900;
    font-size: 1rem;
    font-family: var(--font);
}

/* ───── HUD 우주 지도 버튼 ───── */
.solar-quick-btn {
    pointer-events: auto;
    position: relative;
    z-index: 2;
    cursor: pointer;
    background: linear-gradient(135deg, #312e81, #1e1b4b);
    color: #fef08a;
    border: 2px solid #facc15;
    border-radius: 999px;
    padding: 7px 14px;
    font-family: var(--font);
    font-weight: 900;
    font-size: 0.9rem;
    box-shadow: 0 5px 0 rgba(15, 23, 42, 0.45);
}
.solar-quick-btn:hover { transform: translateY(-2px); }
.solar-quick-btn.earth-return {
    background: linear-gradient(135deg, #0ea5e9, #10b981);
    color: #ffffff;
    border-color: #bae6fd;
}

/* ───── 행성 도착 한글 + 영어 대형 배너 ───── */
.arrival-banner {
    position: absolute;
    left: 50%;
    top: 15%;
    transform: translateX(-50%);
    z-index: 25;
    text-align: center;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(49, 46, 129, 0.92));
    border: 3px solid var(--gold);
    border-radius: 26px;
    padding: 14px 32px;
    min-width: min(82%, 520px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
    pointer-events: none;
}
.arrival-banner.show {
    @media (prefers-reduced-motion: no-preference) {
        animation: arrival-drop 0.48s cubic-bezier(0.22, 1, 0.36, 1);
    }
}
@keyframes arrival-drop {
    from { opacity: 0; transform: translate(-50%, -18px) scale(0.92); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.arrival-kicker {
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    color: #38bdf8;
}
.arrival-title {
    margin: 4px 0;
    font-size: clamp(1.35rem, 2.7vw, 2.15rem);
    font-weight: 900;
    color: #fef08a;
    text-shadow: 0 3px 0 #7c2d12;
}
.arrival-sub {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
}

/* ───── 우주 옷 고르기 & 태양계 지도 모달 ───── */
dialog.space-dialog {
    margin: auto;
    max-width: min(92vw, 560px);
    width: 100%;
    border-radius: 26px;
    border: 4px solid var(--gold);
    background: linear-gradient(180deg, #0f172a, #1e1b4b);
    color: #f8fafc;
    padding: 22px 24px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.72);
}
dialog.space-dialog.wide { max-width: min(94vw, 760px); }
dialog.space-dialog::backdrop {
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(6px);
}
.space-dialog-head { text-align: center; margin-bottom: 16px; }
.space-dialog-kicker {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.18);
    border: 1px solid #38bdf8;
    color: #7dd3fc;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.space-dialog-head h2 { font-size: clamp(1.15rem, 2.2vw, 1.55rem); color: #fef08a; }
.space-dialog-sub { font-size: 0.9rem; color: #cbd5e1; margin-top: 4px; }

.outfit-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.outfit-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 14px;
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    background: rgba(30, 41, 59, 0.9);
    color: #f8fafc;
    font-family: var(--font);
    text-align: center;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.outfit-card:hover,
.outfit-card.is-highlighted {
    transform: translateY(-4px);
    border-color: var(--gold);
    background: rgba(49, 46, 129, 0.95);
    box-shadow: 0 12px 24px rgba(250, 204, 21, 0.22);
}
.outfit-emoji { font-size: 3rem; line-height: 1.1; }
.outfit-card strong { font-size: 1.15rem; color: #fde047; }
.outfit-card span:last-child { font-size: 0.85rem; color: #cbd5e1; }

.solar-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    gap: 10px;
}
.solar-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.solar-action-btn {
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 12px;
    border: 2px solid #94a3b8;
    background: #1e293b;
    color: #f8fafc;
    font-family: var(--font);
    font-weight: 800;
    font-size: 0.86rem;
}
.solar-action-btn.earth {
    border-color: #4ade80;
    background: #14532d;
    color: #dcfce7;
}
.solar-action-btn:hover { filter: brightness(1.12); }

.solar-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
@media (max-width: 620px) {
    .solar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.solar-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 10px;
    border-radius: 18px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background: rgba(30, 41, 59, 0.88);
    color: #f8fafc;
    font-family: var(--font);
    text-align: center;
    transition: transform 0.14s ease, border-color 0.14s ease;
}
.solar-card:hover:not(:disabled),
.solar-card.is-highlighted:not(:disabled) {
    transform: translateY(-3px);
    border-color: var(--gold);
    background: rgba(49, 46, 129, 0.96);
}
.solar-card.is-current {
    border-color: #38bdf8;
    background: rgba(14, 116, 144, 0.45);
}
.solar-card:disabled {
    cursor: not-allowed;
    opacity: 0.56;
}
.solar-card-icon { font-size: 2rem; line-height: 1.1; }
.solar-card-title { font-size: 0.96rem; font-weight: 900; color: #fef08a; }
.solar-card-en { font-size: 0.72rem; font-weight: 700; color: #94a3b8; letter-spacing: 0.05em; }
.solar-card-pill {
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    background: rgba(56, 189, 248, 0.18);
    color: #7dd3fc;
}
.solar-card-pill.done { background: rgba(74, 222, 128, 0.22); color: #86efac; }
.solar-card-pill.locked { background: rgba(248, 113, 113, 0.18); color: #fca5a5; }

