:root {
  --cy: #6fe3ff; --cy2: #9fb5ff; --amb: #ffb54d; --red: #ff5d6c;
  --pnl: linear-gradient(135deg, rgba(10, 34, 64, .26), rgba(4, 10, 26, .12));
  --edge: rgba(111, 227, 255, .3);
  --glow: 0 0 12px rgba(111, 227, 255, .35);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --cut: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: #e9f6ff; user-select: none; -webkit-user-select: none; touch-action: none; font-synthesis: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; background: none; padding: 0; }
[hidden] { display: none !important; }
svg { width: 100%; height: 100%; fill: currentColor; display: block; }

/* 화면 가장자리 어둡게 + 아주 옅은 주사선 */
#vig { position: fixed; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(ellipse at 50% 46%, transparent 62%, rgba(0, 4, 14, .4) 100%); }
#vig::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(120, 220, 255, .035) 0 1px, transparent 1px 3px); mix-blend-mode: screen; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: .82; }
#hud > * { pointer-events: auto; }
.tag { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: .18em; color: var(--cy); opacity: .9; text-transform: uppercase; }
.tag::before { content: ''; width: 6px; height: 6px; background: var(--cy); box-shadow: var(--glow); transform: rotate(45deg); flex: none; }
.pnl { background: var(--pnl); clip-path: var(--cut); position: relative; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.pnl::before { content: ''; position: absolute; inset: 0; pointer-events: none; clip-path: var(--cut); border: 1px solid var(--edge); }
.pnl::after { content: ''; position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-left: 2px solid var(--cy); border-top: 2px solid var(--cy); clip-path: polygon(0 0, 100% 0, 0 100%); pointer-events: none; filter: drop-shadow(0 0 4px var(--cy)); }

/* 가운데 조준 레티클 */
#reticle { position: fixed; left: 50%; top: 46%; width: 150px; height: 150px; margin: -75px 0 0 -75px; pointer-events: none !important; fill: none; stroke: var(--cy); stroke-width: 1.2; opacity: .4; filter: drop-shadow(0 0 3px rgba(111, 227, 255, .6)); }
#reticle .r1 { stroke-dasharray: 2 6; opacity: .7; }
#reticle .spin { stroke-width: 2; animation: spin var(--rs, 18s) linear infinite; transform-origin: 0 0; }
#reticle .dot { fill: var(--cy); stroke: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.ic { width: 44px; height: 44px; display: grid; place-items: center; background: var(--pnl); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); box-shadow: inset 0 0 0 1px var(--edge); color: var(--cy); }
.ic svg { width: 22px; height: 22px; }
.ic b { font-size: 20px; font-weight: 700; }
#btnPause { position: absolute; left: 12px; top: calc(12px + var(--safe-t)); }
#region { position: absolute; left: 64px; right: 128px; top: calc(10px + var(--safe-t)); padding: 8px 12px 9px; max-width: 360px; }
#region b { display: block; font-size: 19px; font-weight: 700; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: var(--glow); }
#region small { display: block; font-size: 13px; color: #b9d6ff; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#region #odo { color: #7f9cc8; }
#pills { position: absolute; right: 12px; top: calc(12px + var(--safe-t)); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.pill { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; background: var(--pnl); clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px); box-shadow: inset 0 0 0 1px var(--edge); font-size: 14px; font-weight: 700; }
.pill i { width: 16px; height: 16px; color: var(--amb); }
#galc i { color: var(--cy2); }
#galc b { font-size: 13px; }
#side { position: absolute; left: 12px; top: calc(118px + var(--safe-t)); display: flex; flex-direction: column; gap: 8px; }

/* 속도 */
#spd { position: absolute; left: 12px; right: 128px; bottom: calc(150px + var(--safe-b)); padding: 9px 12px 10px; max-width: 380px; }
#spd b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin-top: 2px; color: #fff; text-shadow: 0 0 14px rgba(111, 227, 255, .55); white-space: nowrap; }
#spd b.fast { color: #ffe3a8; text-shadow: 0 0 16px rgba(255, 181, 77, .7); }
#spd #perSec { display: block; font-size: 13px; color: #b9d6ff; margin-top: 4px; white-space: nowrap; }
#spdBar { position: relative; height: 8px; margin: 8px 0 22px; background: repeating-linear-gradient(90deg, rgba(111, 227, 255, .22) 0 2px, transparent 2px 6px); }
#spdBar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--cy), #b48cff 55%, var(--amb)); box-shadow: 0 0 10px rgba(111, 227, 255, .8); transition: width .12s; }
#spdBar .m { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #fff; opacity: .8; }
#spdBar .ml { position: absolute; top: 12px; transform: translateX(-50%); font-size: 13px; font-style: normal; color: #9fc4e8; white-space: nowrap; }

/* 가속·감속 */
#ctl { position: absolute; right: 12px; bottom: calc(150px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hb { position: relative; display: grid; place-items: center; align-content: center; gap: 2px; border-radius: 50%; touch-action: none; -webkit-touch-callout: none; color: var(--cy); isolation: isolate; }
.hb::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, var(--cy) 0 18%, transparent 18% 25%, var(--cy) 25% 43%, transparent 43% 50%, var(--cy) 50% 68%, transparent 68% 75%, var(--cy) 75% 93%, transparent 93%); -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%, #000 69%, transparent 70%); mask: radial-gradient(circle, transparent 62%, #000 63%, #000 69%, transparent 70%); opacity: .75; animation: spin 14s linear infinite; }
.hb::after { content: ''; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(40, 110, 170, .3), rgba(6, 16, 36, .25)); box-shadow: inset 0 0 0 1px var(--edge); z-index: -1; }
.hb i, .hb span { position: relative; z-index: 1; }
.hb i { width: 26px; height: 26px; }
.hb span { font-size: 13px; font-weight: 700; letter-spacing: .12em; }
#bDn { width: 66px; height: 66px; }
#bDn i { width: 16px; height: 16px; }
#bUp { width: 104px; height: 104px; color: #fff; }
#bUp i { width: 36px; height: 36px; }
#bUp::before { opacity: 1; filter: drop-shadow(0 0 6px var(--cy)); }
.hb.on { transform: scale(.95); }
.hb.on::before { animation-duration: .9s; }
#bUp.on::after { background: radial-gradient(circle at 50% 40%, rgba(120, 220, 255, .75), rgba(40, 70, 200, .7)); box-shadow: 0 0 30px rgba(111, 227, 255, .8); }

/* 목표 카드 */
#card { position: absolute; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); max-width: 560px; margin: 0 auto; padding: 9px 10px 10px 14px; }
#card .tag { color: var(--amb); }
#card .tag::before { background: var(--amb); }
.crow { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
#cIc { width: 32px; height: 32px; flex: none; color: var(--cy2); }
#card.found #cIc { color: var(--amb); }
.ci { flex: 1; min-width: 0; }
#cName { display: block; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cDist { display: block; font-size: 15px; color: #cfe6ff; margin-top: 1px; font-weight: 500; }
.cr { display: flex; gap: 12px; margin-top: 5px; font-size: 13px; color: #b9d6ff; flex-wrap: wrap; }
.cr > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cr i { width: 14px; height: 14px; color: var(--amb); flex: none; }
#cEta i { color: var(--cy); }
#btnGo { flex: none; width: 76px; height: 58px; opacity: .92; clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); background: linear-gradient(180deg, #ffbe5c, #ff7a2e); color: #1a0d00; font-size: 22px; font-weight: 700; letter-spacing: .12em; box-shadow: 0 0 22px rgba(255, 150, 60, .5); }
#btnGo:active { filter: brightness(1.15); }
#btnGo.on { background: linear-gradient(180deg, #3d5a7a, #1f3048); color: var(--cy); font-size: 16px; }

/* 천체 표지 */
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.lbl { position: absolute; left: 0; top: -15px; height: 30px; pointer-events: auto; display: flex; align-items: center; gap: 7px; padding: 4px 8px 4px 0; text-align: left; white-space: nowrap; text-shadow: 0 1px 4px #000, 0 0 2px #000; }
.lbl i { width: 12px; height: 12px; margin-left: -6px; border: 1.5px solid rgba(111, 227, 255, .75); transform: rotate(45deg); flex: none; }
.lbl b { font-size: 13px; font-weight: 500; color: #dff3ff; }
.lbl small { font-size: 13px; color: #8fb4d8; }
.lbl.found i { border-color: var(--amb); }
.lbl[data-cat="solar"] i, .lbl[data-cat="star"] i { border-radius: 50%; transform: none; }
.lbl.tgt i { width: 34px; height: 34px; margin-left: -17px; border: 0; border-radius: 0; transform: none; background:
  linear-gradient(var(--amb), var(--amb)) 0 0 / 10px 2px no-repeat, linear-gradient(var(--amb), var(--amb)) 0 0 / 2px 10px no-repeat,
  linear-gradient(var(--amb), var(--amb)) 100% 0 / 10px 2px no-repeat, linear-gradient(var(--amb), var(--amb)) 100% 0 / 2px 10px no-repeat,
  linear-gradient(var(--amb), var(--amb)) 0 100% / 10px 2px no-repeat, linear-gradient(var(--amb), var(--amb)) 0 100% / 2px 10px no-repeat,
  linear-gradient(var(--amb), var(--amb)) 100% 100% / 10px 2px no-repeat, linear-gradient(var(--amb), var(--amb)) 100% 100% / 2px 10px no-repeat;
  filter: drop-shadow(0 0 5px var(--amb)); animation: lock 1.6s ease-in-out infinite; }
.lbl.tgt b { color: #ffd9a3; font-weight: 700; font-size: 14px; }
.lbl.tgt small { color: #ffc27a; }
@keyframes lock { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
#tgtArrow { position: fixed; left: 0; top: 0; width: 0; height: 0; border-left: 20px solid var(--amb); border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin: -11px 0 0 -10px; pointer-events: none; filter: drop-shadow(0 0 6px var(--amb)); z-index: 4; }

/* 목록 */
.sheetwrap { position: fixed; inset: 0; background: rgba(0, 4, 14, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 30; }
.sheet { width: 100%; max-width: 560px; height: 76vh; background: linear-gradient(180deg, rgba(10, 26, 52, .97), rgba(4, 10, 24, .98)); box-shadow: inset 0 0 0 1px var(--edge); clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%, 0 18px); display: flex; flex-direction: column; padding-bottom: var(--safe-b); }
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid rgba(111, 227, 255, .2); }
#listTabs { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
#listTabs::-webkit-scrollbar { display: none; }
#listTabs button { flex: none; padding: 9px 13px; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px); background: rgba(111, 227, 255, .08); color: #b9d6ff; font-size: 14px; font-weight: 500; }
#listTabs button.on { background: rgba(111, 227, 255, .25); color: #fff; font-weight: 700; box-shadow: inset 0 -2px 0 var(--cy); }
#btnCloseList { flex: none; }
#listBody { flex: 1; overflow-y: auto; padding: 6px 10px 20px; touch-action: pan-y; }
.li { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 8px; border-bottom: 1px solid rgba(111, 227, 255, .08); text-align: left; min-height: 52px; }
.li > i { width: 20px; height: 20px; color: var(--cy2); flex: none; }
.li b { flex: 1; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li small { font-size: 13px; color: #8fb4d8; white-space: nowrap; }
.li em { width: 18px; height: 18px; color: var(--amb); opacity: 0; flex: none; }
.li.found em { opacity: 1; }
.li.found > i { color: var(--amb); }

/* 알림 */
#toast { position: fixed; left: 50%; top: 24%; transform: translate(-50%, -10px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 10px 22px; background: linear-gradient(90deg, transparent, rgba(10, 34, 64, .8) 15%, rgba(10, 34, 64, .8) 85%, transparent); border-top: 1px solid var(--amb); border-bottom: 1px solid var(--amb); transition: .35s; white-space: nowrap; z-index: 25; max-width: 94vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast i { width: 18px; height: 18px; color: var(--amb); flex: none; }
#toast b { color: var(--amb); font-weight: 700; font-size: 14px; letter-spacing: .14em; }
#toast span { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }

/* 첫 실행 안내 */
#onb { position: fixed; inset: 0; z-index: 40; background: rgba(0, 4, 14, .4); }
#onb .ob { position: absolute; left: 16px; right: 16px; top: 34%; text-align: center; text-shadow: 0 2px 10px #000; }
#onbTxt { display: block; font-size: 22px; font-weight: 700; }
#onbDots { display: flex; justify-content: center; gap: 6px; margin: 14px 0 8px; }
#onbDots i { width: 8px; height: 8px; transform: rotate(45deg); background: rgba(255, 255, 255, .3); }
#onbDots i.on { background: var(--cy); }
#onbTap { font-size: 13px; opacity: .7; }
#onb[data-step="1"] .ob, #onb[data-step="3"] .ob { top: 22%; }
#finger { position: absolute; width: 56px; height: 56px; margin: -10px 0 0 -14px; border-radius: 50% 50% 50% 8px; background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 8px rgba(255, 255, 255, .18), 0 6px 18px rgba(0, 0, 0, .5); }
#finger.f0 { animation: swipe 1.6s ease-in-out infinite; }
#finger.f1, #finger.f2, #finger.f3 { animation: tap 1s ease-in-out infinite; }
#finger.f4 { display: none; }
@keyframes swipe { 0%, 100% { transform: translateX(-70px); } 50% { transform: translateX(70px); } }
@keyframes tap { 0%, 100% { transform: scale(1); } 50% { transform: scale(.82); } }
#nogl { position: fixed; inset: 0; display: grid; place-items: center; font-size: 20px; }

@media (max-height: 680px) and (orientation: portrait) {
  #spd, #ctl { bottom: calc(132px + var(--safe-b)); }
  #spd b { font-size: 24px; }
  #bUp { width: 88px; height: 88px; }
  #reticle { width: 110px; height: 110px; margin: -55px 0 0 -55px; }
}

/* 영상용 (?promo=1): 누르는 버튼만 숨기고 계기판은 보인다 */
body.promo #side, body.promo #ctl, body.promo #btnGo, body.promo #btnPause { display: none !important; }
body.promo #region { left: 12px; }

/* 가로 전용 (2026-11-09 사용자 지시) */
#rot { display: none; position: fixed; inset: 0; z-index: 100; background: #02060f; color: var(--cy); flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 24px; }
#rot i { width: 74px; height: 74px; border: 3px solid var(--cy); border-radius: 12px; animation: rotph 2.2s ease-in-out infinite; box-shadow: var(--glow); }
#rot b { font-size: 20px; font-weight: 700; color: #e9f6ff; }
@keyframes rotph { 0%, 30% { transform: rotate(0deg) scale(.8, 1.2); } 60%, 100% { transform: rotate(-90deg) scale(.8, 1.2); } }
@media (orientation: portrait) and (pointer: coarse) { #rot { display: flex; } }

/* 가로 배치 */
@media (orientation: landscape) {
  #region { max-width: 330px; right: auto; width: 330px; }
  #side { top: calc(12px + var(--safe-t)); left: calc(64px + 330px + 12px); flex-direction: row; }
  #card { left: calc(12px + env(safe-area-inset-left, 0px)); right: auto; width: min(380px, 40vw); margin: 0; }
  #spd { left: calc(min(380px, 40vw) + 24px + env(safe-area-inset-left, 0px)); right: auto; bottom: calc(12px + var(--safe-b)); width: min(340px, 33vw); max-width: none; }
  #ctl { right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(10px + var(--safe-b)); flex-direction: row; align-items: flex-end; }
  #reticle { top: 44%; }
  #toast { top: 20%; }
}
@media (orientation: landscape) and (max-height: 520px) {
  #region { padding: 6px 10px 7px; width: 280px; }
  #region b { font-size: 16px; }
  #side { left: calc(64px + 280px + 12px); }
  #spd { padding: 6px 10px 6px; }
  #spd b { font-size: 21px; }
  #spdBar { margin: 5px 0 18px; }
  #bUp { width: 86px; height: 86px; }
  #bDn { width: 58px; height: 58px; }
  #card { padding: 6px 8px 7px 12px; }
  #cName { font-size: 16px; }
  #btnGo { width: 66px; height: 50px; font-size: 19px; }
  #reticle { width: 110px; height: 110px; margin: -55px 0 0 -55px; }
}
body.promo #spd { width: min(380px, 36vw); }

#zoomB { position: absolute; right: calc(14px + env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; }
#zoomB .ic b { font-size: 26px; line-height: 1; }
body.promo #zoomB { display: none !important; }
