:root {
  --bg: #05070d;
  --surface: #0e121d;
  --surface2: #161b2b;
  --surface3: #1f263b;
  --line: #1c2236;
  --text: #e8ebf5;
  --muted: #8b93b0;
  --accent: rgb(150, 190, 255);
  --accent-rgb: 150, 190, 255;
  --font: 'Inter', 'Noto Sans KR', system-ui, -apple-system, 'Segoe UI', 'Malgun Gothic', sans-serif;
  --r: 12px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
[hidden] { display: none !important; }
button { font-family: inherit; }

/* ---- 풀스크린 3D 무대 ---- */
.stage { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; background: var(--bg); }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; text-decoration: none; }

.title { position: absolute; left: 24px; top: 68px; max-width: min(42ch, 44vw); pointer-events: none; }
h1 { margin: 0 0 4px; font-weight: 700; font-size: clamp(34px, 5vw, 60px); line-height: 1.05; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.charted { margin: 0; color: var(--accent); font-weight: 500; }
.sysline { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.dock { position: absolute; top: 64px; right: 16px; bottom: 68px; width: 380px; overflow: auto; padding: 14px 16px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; scrollbar-width: none; -ms-overflow-style: none; }
.dock::-webkit-scrollbar { display: none; }
.dock.closed { display: none; }

.tabs { display: flex; gap: 2px; padding: 3px; margin-bottom: 16px; background: var(--surface2); border-radius: 12px; }
.tab { flex: 1; padding: 7px 4px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--surface3); color: var(--text); }
.hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.blurb { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.sub { margin: 18px 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }

.viewbar { position: absolute; left: 20px; bottom: 16px; right: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; pointer-events: none; }
.viewbar > * { pointer-events: auto; }
.viewhint { margin-right: 8px; color: var(--muted); font-size: 12px; pointer-events: none; }
.busy { position: absolute; left: 0; right: 0; top: 48%; margin: 0; text-align: center; color: var(--muted); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.busy.on { opacity: 1; }

/* ---- 공통 요소 (플랫) ---- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
input[type=text], input[type=date] { width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--surface2); color: var(--text); font: inherit; font-size: 14px; }
input::placeholder { color: #5d6685; }
.row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--surface2); color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background 0.12s; }
.btn:hover { background: var(--surface3); }
.btn.primary { background: var(--accent); color: #0a0e22; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; }
.btn[aria-pressed=true] { background: var(--accent); color: #0a0e22; }
.viewbar .btn { background: rgba(14, 18, 29, 0.92); }
.viewbar .btn:hover { background: var(--surface3); }
.viewbar .btn[aria-pressed=true] { background: var(--accent); }
.icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.icon:hover { background: var(--surface3); }
.icon[aria-pressed=true] { background: var(--surface3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sheet { margin: 0 0 16px; display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); }
.sheet dt, .sheet dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.sheet dt { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.status { position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 70; max-width: min(520px, calc(100% - 32px)); margin: 0; padding: 9px 16px; border-radius: 999px; background: rgba(10, 14, 28, 0.9); border: 1px solid rgba(var(--accent-rgb), 0.35); color: var(--accent); font-size: 13px; text-align: center; pointer-events: none; transition: opacity .2s; backdrop-filter: blur(6px); }
.status:empty { opacity: 0; }

/* 슬라이더 */
.lab-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 4.6rem; gap: 10px; align-items: center; padding: 7px 0; }
.lab-row label { color: var(--muted); font-size: 13px; }
.lab-row output { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; margin: 0; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--surface3); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border: 0; border-radius: 50%; background: var(--accent); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--surface3); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--accent); }
#lab-reset { margin-top: 12px; }

/* 진화 */
#sim-stats { margin-top: 16px; }
#sim-chart, #orrery { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--surface2); }
#orrery { cursor: pointer; aspect-ratio: 1; }
.legend { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 12px; height: 3px; margin: 0 6px 3px 12px; border-radius: 2px; }
.legend i:first-child { margin-left: 0; }
.legend i.hz { height: 10px; background: rgba(90, 200, 140, 0.35); }
.legend i.fl { height: 0; border-top: 2px dotted rgba(160, 200, 255, 0.7); border-radius: 0; }
.species, .log, .plist { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.species li { padding: 5px 0 8px; }
.species li i { display: block; height: 4px; margin-top: 5px; border-radius: 2px; background: var(--accent); }
.log { color: var(--muted); }
.log li { padding: 3px 0; }

/* 행성 목록 */
.plist { margin-top: 4px; }
.plist button { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 10px 10px; margin-bottom: 4px; border: 0; border-radius: 10px; background: var(--surface2); color: var(--text); text-align: left; cursor: pointer; }
.plist button:hover { background: var(--surface3); }
.plist button.on { background: var(--surface3); box-shadow: inset 0 0 0 1px var(--accent); }
.plist .dot { width: 12px; height: 12px; border-radius: 50%; }
.plist .nm { font-weight: 500; font-size: 13px; }
.plist .sm { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.plist .tag { padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #0a0e22; font-size: 11px; font-weight: 600; }

/* ---- 아래쪽 설명 ---- */
.about { max-width: 1180px; margin: 0 auto; padding: 56px 24px 0; }
.about h2 { margin: 0 0 12px; font-weight: 700; font-size: 24px; letter-spacing: -0.02em; }
.about p { max-width: 64ch; color: var(--muted); }
.foot { max-width: 1180px; margin: 40px auto 0; padding: 24px 24px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot p { margin: 0; }

@media (max-width: 860px) {
  .title { left: 16px; top: 60px; max-width: 86vw; }
  .dock { top: auto; left: 10px; right: 10px; bottom: 60px; width: auto; max-height: 52vh; }
  .viewbar { left: 12px; }
  .viewhint { display: none; }
  .form { grid-template-columns: 1fr; }
  .lab-row { grid-template-columns: 6rem minmax(0, 1fr) 4.2rem; }
  .about, .foot { padding-left: 16px; padding-right: 16px; }
}

/* ---- 소리 / 우주 탐험 / 기록 카드 ---- */
.tools { display: flex; align-items: center; gap: 8px; }
.tools input[type=range] { width: 76px; accent-color: var(--accent); }
#btn-sound[aria-pressed=false] .wave { opacity: 0.25; }
#btn-sound[aria-pressed=true] { background: var(--accent); color: #0a0e22; }
#hud { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
.stage[data-mode=space] #hud, .stage[data-mode=galaxy] #hud { display: block; }
.stage[data-mode=galaxy] .title, .stage[data-mode=galaxy] #btn-field, .stage[data-mode=galaxy] #btn-spin, .stage[data-mode=galaxy] #btn-orbit, .stage[data-mode=galaxy] #btn-view, .stage[data-mode=galaxy] #btn-space { display: none; }
.foot .credit { font-size: 12px; opacity: .7; }
.stage[data-mode=space] .title > :not(.social), .stage[data-mode=space] #btn-field, .stage[data-mode=space] #btn-spin, .stage[data-mode=space] #btn-view { display: none; }
.logcard { position: absolute; left: 24px; top: 200px; width: 300px; max-height: calc(100% - 320px); overflow: auto; padding: 14px 16px; background: rgba(14, 18, 29, 0.82); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 16px; scrollbar-width: none; }
.logcard::-webkit-scrollbar { display: none; }
.logcard h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.logcard .log { min-height: 0; }
.stage[data-mode=space] .logcard { display: none; }
.pad { position: absolute; left: 16px; bottom: 76px; display: none; flex-direction: column; gap: 8px; }
.stage[data-mode=space] .pad { display: flex; }
.pad button { width: 52px; height: 52px; border: 0; border-radius: 14px; background: rgba(14, 18, 29, 0.92); color: var(--text); font-size: 18px; touch-action: none; }
.pad button:active { background: var(--accent); color: #0a0e22; }
@media (pointer: fine) { .pad { display: none !important; } }
@media (max-width: 860px) {
  .logcard { top: auto; bottom: 64px; left: 10px; right: 10px; width: auto; max-height: 22vh; }
  .stage:has(.dock:not(.closed)) .logcard { display: none; }
  .tools input[type=range] { width: 56px; }
}

.viewbar .btn.primary { background: var(--accent); color: #0a0e22; }
.viewbar .btn.primary:hover { filter: brightness(1.08); }

.lab-row output.val{cursor:text;border-radius:6px;padding:2px 4px;margin:-2px -4px}.lab-row output.val:hover{background:rgba(255,255,255,.08)}
.numedit{width:100%;padding:2px 4px;border-radius:6px;text-align:right;font:inherit;font-size:.92rem}

.themesel { height: 40px; max-width: 128px; border: 0; border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; padding: 0 8px; cursor: pointer; }
.themesel:hover { background: var(--surface3); }
@media (max-width: 560px) { .themesel { max-width: 92px; } }

.photobar { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: none; gap: 8px; z-index: 5; }
.photobar .btn { background: rgba(14, 18, 29, 0.78); backdrop-filter: blur(6px); }
.photobar .btn.primary { background: var(--accent); color: #0a0e22; }
body.photo .photobar { display: flex; }
body.photo .top, body.photo .title, body.photo .viewbar, body.photo .dock, body.photo #hud { opacity: 0; pointer-events: none; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 6; }
.flash.on { opacity: .75; transition: none; }

.species li.clk { cursor: pointer; } .species li.clk:hover span { color: var(--accent); }
.cmodal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(4, 6, 14, .72); padding: 16px; }
.cmodal[hidden] { display: none; }
.ccard { width: min(380px, 100%); max-height: 92vh; overflow: auto; background: #10162b; border: 1px solid var(--surface3); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.ccard.wide { width: min(720px, 100%); }
.ccard canvas { width: 100%; border-radius: 10px; } .ccard h3 { margin: 4px 0 0; font-size: 22px; } .ccard p { margin: 0; font-size: 14px; color: var(--muted, #9aa3c7); } .ccard ul { margin: 0; padding-left: 18px; font-size: 14px; }
.cstats { display: grid; gap: 4px; } .cstats div { display: grid; grid-template-columns: 56px 1fr; align-items: center; font-size: 13px; } .cstats i { display: block; height: 8px; border-radius: 4px; background: var(--accent); }
.dex { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; } .dexi { border: 0; padding: 0; background: var(--surface); border-radius: 10px; color: var(--text); cursor: pointer; overflow: hidden; font: inherit; font-size: 12px; } .dexi canvas { display: block; width: 100%; border-radius: 0; } .dexi span { display: block; padding: 6px; }

.focus { position: absolute; right: 16px; top: 68px; z-index: 6; width: 188px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; background: rgba(14, 18, 29, .94); border: 1px solid var(--surface3); border-radius: 16px; }
.focus[hidden] { display: none; } .focus svg { margin-bottom: -112px; } .fc-mid { height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; } .fc-mid b { font-size: 28px; font-variant-numeric: tabular-nums; } .fc-mid span, .fc-count { font-size: 12px; color: #9aa3c7; margin: 0; }
.focus select { width: 100%; height: 32px; border: 0; border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; } .focus .row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
body.focusing .dock, body.focusing .title { opacity: 0; pointer-events: none; }
.dexq { height: 34px; border: 0; border-radius: 8px; background: var(--surface); color: var(--text); padding: 0 10px; font: inherit; font-size: 13px; } .dexi { border: 2px solid transparent !important; text-align: left; } .dexi em { display: block; padding: 0 6px 6px; font-style: normal; font-size: 11px; color: #9aa3c7; } .ccard .row { display: flex; gap: 8px; flex-wrap: wrap; }
.fc-set { display: flex; gap: 8px; font-size: 12px; color: #9aa3c7; } .fc-set label { display: flex; align-items: center; gap: 4px; } .fc-set input { width: 46px; height: 28px; border: 0; border-radius: 6px; background: var(--surface); color: var(--text); text-align: center; font: inherit; }
.logtabs { display: flex; gap: 4px; margin: 0 0 8px; }
.logtabs button { flex: 1; padding: 4px 0; font: inherit; font-size: 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.logtabs button.on { color: var(--text, #fff); border-color: var(--accent, #6f8fe0); background: rgba(var(--accent-rgb, 111, 143, 224), 0.18); }
.cardmodal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(3, 5, 10, 0.78); backdrop-filter: blur(6px); }
.cardmodal .cm-box { display: flex; flex-direction: column; gap: 14px; max-width: min(560px, 100%); max-height: 100%; align-items: center; }
.cardmodal img { max-width: 100%; max-height: calc(100vh - 120px); border-radius: 14px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6); object-fit: contain; }
.cardmodal .cm-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

#shtoast{display:none;position:fixed;left:50%;bottom:18px;transform:translateX(-50%);z-index:60;padding:8px 14px;border-radius:999px;background:rgba(10,14,28,.85);color:#cfe;font-size:13px;pointer-events:none}

/* 행성 이야기 */
.story { margin: 4px 0 14px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.story summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.story h4 { margin: 12px 0 4px; font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.story p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* 은하 공유 */
.cardmodal .cm-panel { width: min(420px, 100%); max-height: 100%; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; color: var(--text); }
.cm-panel h3 { margin: 0 0 10px; font-size: 16px; }
.cm-panel p { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.cm-panel .cm-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.cm-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.cm-field input { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text); font: inherit; font-size: 14px; }
.visit { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 999px; background: rgba(10,16,30,.82); border: 1px solid rgba(150,215,255,.4); color: #cfe8ff; font-size: 13px; backdrop-filter: blur(6px); white-space: nowrap; }
.visit[hidden] { display: none; }

.gxsearch { display: none; position: absolute; top: 64px; left: 16px; z-index: 30; width: min(300px, calc(100% - 32px)); }
.stage[data-mode=galaxy] .gxsearch { display: block; }
.gxsearch input { width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(10,14,24,.85); color: var(--text); font: inherit; font-size: 13px; backdrop-filter: blur(6px); }
.gxsearch ul { list-style: none; margin: 6px 0 0; padding: 0; border-radius: 12px; overflow: hidden; background: rgba(10,14,24,.92); }
.gxsearch li button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; color: #cfe8ff; font: inherit; font-size: 13px; cursor: pointer; }
.gxsearch li button:hover, .gxsearch li button:focus-visible { background: rgba(150,215,255,.1); }
.gxsearch small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.gxsearch li.none { padding: 8px 12px; color: var(--muted); font-size: 12px; }

.cm-check { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.cm-check input { margin-top: 2px; accent-color: var(--accent); }
.cm-check a, .foot .links a { color: var(--accent); }
.field label small { color: var(--muted); font-weight: 400; }

/* 그래픽 설정 창 */
.gxset .cm-panel { width: min(460px, 100%); }
.gx-info { font-variant-numeric: tabular-nums; }
.gx-pre { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.gx-pre .btn { justify-content: center; }
.gx-sl .lab-row { grid-template-columns: 7.5rem minmax(0, 1fr) 4.4rem; }
.gx-ck .cm-check { margin-top: 8px; }
.gx-gpu { margin-top: 14px; }
.gx-gpu select { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.gx-note { margin: 8px 0 0; }
#hud { transition: none; }

/* 소셜 (pl33): 좋아요·방문·공유 */
.social { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; pointer-events: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 999px; background: rgba(14, 18, 29, 0.78); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; backdrop-filter: blur(6px); }
.pill:hover { background: var(--surface3); }
.pill b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pill.accent { background: var(--accent); border-color: transparent; color: #0a0e22; font-weight: 600; }
.pill.like svg { fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
.pill.like[aria-pressed=true] { color: #ff7a9a; border-color: rgba(255, 122, 154, 0.5); }
.pill.like[aria-pressed=true] svg { fill: currentColor; }
.pill.like.pop svg { transform: scale(1.35); }
.pill.like:disabled { cursor: default; opacity: 1; }
.stage[data-mode=space] .social { margin-top: 0; }
body.photo .social { display: none; }
.make { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.make summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.make[open] summary { margin-bottom: 12px; }
.make .form { margin-bottom: 4px; }
#go-share { width: 100%; }
.sbox { margin: 0 0 18px; }
.sbox h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.sbox .hint { margin-bottom: 10px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--surface2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.tile:hover { background: var(--surface3); }
.tile b { font-size: 13px; font-weight: 600; }
.tile small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.tile:disabled { opacity: .6; cursor: default; }
.socnum { display: flex; gap: 16px; margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.socnum b { color: var(--text); font-size: 18px; }
.vlist { margin: 0 0 8px; padding: 0; list-style: none; font-size: 13px; }
.vlist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.vlist li.none { color: var(--muted); font-size: 12px; justify-content: flex-start; }
.vlist button { padding: 0; border: 0; background: none; color: #cfe8ff; font: inherit; text-align: left; cursor: pointer; }
.vlist button:hover { color: var(--accent); }
.vlist small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.vlist .anon { color: var(--muted); }
.cm-soc { display: flex; gap: 8px; align-items: center; margin: -2px 0 10px; }
.cardmodal .cm-box .cm-row .btn { min-width: 92px; }
.gxsearch li.head { padding: 6px 12px 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
@media (max-width: 860px) {
  .social { margin-top: 8px; }
  .pill { height: 30px; padding: 0 10px; font-size: 12px; }
  .status { bottom: 64px; }
}

/* 주인의 한마디 · 홈 화면 추가 (pl34) */
.omsg { position: relative; display: inline-block; max-width: min(36ch, 100%); margin: 10px 0 0; padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: rgba(14, 18, 29, 0.78); border: 1px solid rgba(var(--accent-rgb), 0.3); font-size: 13px; line-height: 1.5; backdrop-filter: blur(6px); overflow-wrap: anywhere; }
.omsg b { display: block; margin-bottom: 2px; color: var(--accent); font-size: 11px; font-weight: 600; }
.title .omsg { pointer-events: auto; }
.stage[data-mode=space] .title > .omsg { display: none; }
.cm-panel .omsg { display: block; max-width: none; margin: 0 0 4px; }
.msgedit { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.msgedit textarea { width: 100%; resize: vertical; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: inherit; font-size: 14px; }
.msgedit .btn { align-self: flex-start; }
.cm-panel.pwa h3.h2 { margin-top: 18px; }
.cm-panel .steps { margin: 0 0 10px; padding-left: 20px; font-size: 13px; line-height: 1.7; color: var(--text); }
.cm-panel .note { font-size: 12px; }
.cm-panel .ico { display: inline-block; padding: 0 5px; border-radius: 5px; background: var(--surface3); }
body.photo .omsg { display: none; }

/* 화면 조작 '보기' 묶음: 주요 버튼 2개 + 보기 버튼(위로 펼쳐지는 목록). 데스크톱·모바일 공통 */
.vmore { display: inline-flex; gap: 6px; margin-left: auto; position: relative; }
.vmore.dot::after { content: ''; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.vsec { display: none; position: absolute; right: 0; bottom: 44px; min-width: 190px; flex-direction: column; gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.viewbar.open { z-index: 75; }
.viewbar.open .vsec { display: flex; }
.viewbar.open .vmore { background: var(--surface3); }
.vsec .btn { width: 100%; justify-content: flex-start; }
#skyhud { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage[data-mode] #skyhud, body.photo #skyhud { display: none; }
/* 모바일 조이스틱: 터치 기기에서 행성계·은하 화면(행성 화면은 지표 가까이일 때) */
.joy, .joyz { display: none; }
@media (pointer: coarse) {
  .pad { display: none !important; }
  .stage[data-mode=space] .joy, .stage[data-mode=galaxy] .joy, body.m-low .stage:not([data-mode]) .joy { display: block; }
  .stage[data-mode=space] .joyz, .stage[data-mode=galaxy] .joyz { display: flex; }
}
.joy { position: absolute; left: 18px; bottom: calc(var(--tabh, 0px) + 64px); width: 112px; height: 112px; border-radius: 50%; background: rgba(14, 18, 29, 0.5); border: 1px solid rgba(255, 255, 255, 0.14); touch-action: none; z-index: 5; }
.joy i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(var(--accent-rgb), 0.3); border: 1px solid rgba(var(--accent-rgb), 0.7); transition: transform 0.12s; }
.joy.on i { transition: none; background: rgba(var(--accent-rgb), 0.5); }
.joyz { position: absolute; left: 142px; bottom: calc(var(--tabh, 0px) + 66px); flex-direction: column; gap: 8px; z-index: 5; }
.joyz button { width: 46px; height: 46px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px; background: rgba(14, 18, 29, 0.6); color: var(--text); font-size: 15px; touch-action: none; }
.joyz button:active { background: var(--accent); color: #0a0e22; }
body.m-sheet .joy, body.m-sheet .joyz, body.photo .joy, body.photo .joyz { display: none !important; }

/* ===== 오늘의 우주 · 음악 · 모바일 화면 (pl35) ===== */
.music { display: inline-flex; align-items: center; gap: 4px; }
.icon.sm { width: 32px; height: 40px; }
.grab, .mtabs { display: none; }
.today-date { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.fortune .stars { margin: 0 0 6px; color: #ffc65c; font-size: 18px; letter-spacing: 2px; }
.fortune .stars span { color: var(--surface3); }
.fortune .luck { margin: 0 0 12px; font-size: 14px; line-height: 1.65; }
.fortune .sw { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; vertical-align: -1px; }
.fortune .note, .sbox .note { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.sbox h3 small { color: var(--muted); font-weight: 500; font-size: 11px; margin-left: 4px; }
.missions { margin: 0 0 8px; padding: 0; list-style: none; }
.missions li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.missions .ck { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--surface3); color: #0a0e22; font-size: 13px; font-weight: 700; }
.missions li.ok .ck { background: var(--accent); border-color: var(--accent); }
.missions .mt b { display: block; font-size: 13px; font-weight: 600; }
.missions li.ok .mt b { color: var(--muted); text-decoration: line-through; }
.missions .mt small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.missions .mp { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
[data-today-dot] { position: relative; }
[data-today-dot].dot::after { content: ''; position: absolute; top: 6px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: #ff7a9a; }
.more-music { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.more-music .themesel { max-width: none; flex: 1 1 200px; height: 44px; background: var(--surface2); }
.more-music .icon.sm { width: 44px; height: 44px; background: var(--surface2); }
.more-music input[type=range] { flex: 1 1 100%; accent-color: var(--accent); }
a.tile { text-decoration: none; }

@media (max-width: 860px) {
  :root { --tabh: calc(58px + env(safe-area-inset-bottom)); }
  .top { padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
  .brand { font-size: 15px; }
  .tools { gap: 4px; }
  .tools .icon { width: 38px; height: 38px; }
  #btn-panel { display: none; }
  .title { left: 16px; right: 16px; top: calc(56px + env(safe-area-inset-top)); max-width: none; }
  h1 { font-size: clamp(26px, 8vw, 34px); }
  .charted, .sysline { font-size: 12px; }
  /* 아래 탭바 */
  .mtabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: var(--tabh); padding-bottom: env(safe-area-inset-bottom); background: rgba(8, 11, 20, 0.96); border-top: 1px solid var(--line); }
  .mtabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 11px; -webkit-tap-highlight-color: transparent; }
  .mtabs button svg { width: 22px; height: 22px; }
  .mtabs button.on { color: var(--accent); }
  .mtabs [data-today-dot].dot::after { top: 6px; right: calc(50% - 18px); }
  /* 끌어올리는 패널 (시트) */
  .dock, .dock.closed { display: block; position: fixed; top: auto; left: 0; right: 0; bottom: var(--tabh); width: auto; max-height: none; height: min(54svh, 560px); padding: 0 16px 20px; border-radius: 18px 18px 0 0; border-bottom: 0; z-index: 40; overscroll-behavior: contain; transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .dock.closed { transform: translateY(calc(100% + var(--tabh))); visibility: hidden; transition: transform 0.25s ease-in, visibility 0s 0.25s; }
  .dock.full { height: calc(100svh - var(--tabh) - 52px - env(safe-area-inset-top)); }
  .dock .tabs { display: none; }
  .grab { display: flex; position: sticky; top: 0; z-index: 3; justify-content: center; margin: 0 -16px 6px; padding: 10px 0 12px; background: var(--surface); cursor: grab; touch-action: none; }
  .grab i { width: 40px; height: 5px; border-radius: 3px; background: var(--surface3); }
  .tiles .tile { min-height: 72px; }
  .btn, .btn.small { min-height: 40px; }
  /* 화면 조작 버튼: 한 줄로 옆으로 밀어서 */
  /* 화면 조작: 주요 버튼 2개 + '보기' 버튼(자기장·시점·자전·공전·설명은 위로 펼쳐지는 목록) */
  .viewbar { left: 0; right: 0; bottom: calc(var(--tabh) + 8px); flex-wrap: nowrap; padding: 0 12px; transition: opacity 0.2s; }
  .viewbar .btn { flex: none; height: 40px; }
  .vsec { right: 12px; bottom: 48px; }
  .vsec .btn { height: 44px; }
  .status { max-width: calc(100% - 24px); }
  .viewhint { display: none; }
  body.m-sheet .viewbar, body.m-sheet .pad { opacity: 0; pointer-events: none; }
  body.m-sheet-full .title { opacity: 0; pointer-events: none; }
  .pad { bottom: calc(var(--tabh) + 58px); }
  .status { bottom: calc(var(--tabh) + 58px); }
  body.m-sheet .status { bottom: auto; top: calc(60px + env(safe-area-inset-top)); }
  .visit { top: calc(8px + env(safe-area-inset-top)); max-width: calc(100% - 24px); font-size: 12px; }
  .visit span { overflow: hidden; text-overflow: ellipsis; }
  .gxsearch { top: calc(56px + env(safe-area-inset-top)); left: 12px; width: calc(100% - 24px); }
  .focus { top: calc(56px + env(safe-area-inset-top)); right: 10px; }
  .logcard { display: none; }
  .cardmodal { padding: 12px; }
  .cardmodal img { max-height: calc(100svh - 150px); }
  .cardmodal .cm-row .btn { flex: 1 1 40%; }
  body.photo .mtabs { display: none; }
  .about, .foot { padding-bottom: calc(var(--tabh) + 24px); }
}

/* 터치: 버튼 두 번 누름 확대·지연 없애기, 캔버스·조작부 글자 선택 막기 */
button, .btn, .tile, .pill, .tab, .mtabs button { touch-action: manipulation; }
#gl, #hud, .viewbar, .mtabs, .pad, .grab { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* 로그인 (pl39) */
.icon.acct { position: relative; }
.icon.acct.on::after { content: ''; position: absolute; right: 6px; bottom: 6px; width: 8px; height: 8px; border-radius: 50%; background: #5fe0a0; box-shadow: 0 0 0 2px var(--bg); }
.gbtn { white-space: nowrap; gap: 8px; background: #fff !important; color: #1f1f1f !important; }
.cm-panel details.danger { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.cm-panel details.danger summary { cursor: pointer; color: #ff8fa3; font-size: 12px; }
.cm-panel details.danger .btn { margin-top: 6px; color: #ff8fa3; }
.cm-panel .vlist { max-height: 40vh; overflow: auto; }
