/* 별빛 수호대 — 화면 모양 (창은 다른 Leapinity 게임처럼 흰 둥근 카드) */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #101530; color: #fff; font-family: "Pretendard Variable", Pretendard, -apple-system, "Malgun Gothic", sans-serif; word-break: keep-all; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
#cv { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; image-rendering: pixelated; }
.hidden { display: none !important; }

.top { position: fixed; top: 0; left: 0; right: 0; z-index: 9060; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 14px) 8px calc(env(safe-area-inset-left) + 14px); pointer-events: none; }
.top > * { pointer-events: auto; }
.top h1 { margin: 0; font-size: 16px; font-weight: 900; color: #fff; padding: 7px 14px; border-radius: 99px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); letter-spacing: -.3px; }
#accountSlot { margin-left: auto; }
body.playing .top, body.boot .top { display: none; }

#home { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; padding: calc(env(safe-area-inset-top) + 62px) 16px calc(env(safe-area-inset-bottom) + 12px); overflow-y: auto; }
.hero { text-align: center; margin-top: 4vh; }
.title-star { margin: 0; font-size: 34px; color: #ffe27a; text-shadow: 0 0 18px #ffd84a; animation: tw 2.4s ease-in-out infinite; }
@keyframes tw { 50% { opacity: .55; transform: scale(.9); } }
.title-word { margin: 2px 0 6px; font-size: clamp(38px, 11vw, 64px); font-weight: 900; letter-spacing: -2px; background: linear-gradient(180deg, #fff6c4, #ffd84a 55%, #ff9ad1); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #3a1f66) drop-shadow(0 0 18px rgba(176, 122, 255, .5)); }
.title-sub { margin: 0; font-size: 15px; font-weight: 700; color: #d6dcff; }
.best { margin: 10px 0 0; font-size: 14px; color: #c9cfee; }
.best b { color: #ffe27a; }
.spacer { flex: 1; min-height: 16px; }
.panel { width: 100%; max-width: 400px; display: grid; gap: 9px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.big { width: 100%; padding: 14px 16px; border-radius: 18px; border: 0; font: inherit; font-size: 18px; font-weight: 900; cursor: pointer; transition: transform .1s; }
.big:active { transform: scale(.97); }
.big small { font-size: 12px; font-weight: 700; opacity: .8; margin-left: 4px; }
.big.primary { background: linear-gradient(135deg, #ff7ab8, #8b6cff); color: #fff; box-shadow: 0 6px 0 #4a2f99, 0 10px 24px rgba(139, 108, 255, .45); font-size: 22px; padding: 16px; }
.big.ghost { background: rgba(255, 255, 255, .94); color: #3d2f7a; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.howto { background: rgba(16, 20, 50, .82); border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; padding: 10px 14px; font-size: 14px; color: #dfe3ff; }
.howto summary { cursor: pointer; font-weight: 800; }
.howto ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }
.credit { text-align: center; margin: 4px 0 0; font-size: 12px; }
.credit a { color: rgba(220, 225, 255, .75); text-decoration: none; }

.pause { position: fixed; z-index: 30; top: calc(env(safe-area-inset-top) + 16px); right: calc(env(safe-area-inset-right) + 8px); width: 44px; height: 44px; border-radius: 14px; border: 0; background: rgba(255, 255, 255, .9); color: #3d2f7a; font-size: 18px; font-weight: 900; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); cursor: pointer; }
/* 🎵 음악 단추 (2026-10-31): 첫 화면은 위 띠 바로 아래 오른쪽(좁은 휴대폰에서 띠가 넘치지 않게), 판 중에는 멈춤 단추 왼쪽에. 꺼지면 흐리게 */
.mus-top { position: fixed; top: calc(env(safe-area-inset-top) + 62px); right: calc(env(safe-area-inset-right) + 14px); width: 40px; height: 40px; padding: 0; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .12); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.mus-run { display: none; right: calc(env(safe-area-inset-right) + 60px); }
body.playing .mus-run { display: block; }
.mus.off { opacity: .55; }
.banner { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 134px); z-index: 25; transform: translate(-50%, -10px); max-width: min(92vw, 560px); padding: 9px 18px; border-radius: 99px; background: rgba(255, 255, 255, .95); color: #3d2f7a; font-weight: 900; font-size: 15px; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.banner.on { opacity: 1; transform: translate(-50%, 0); }
.banner.big { background: linear-gradient(135deg, #ff4a7a, #8b3fd0); color: #fff; font-size: 18px; }

/* 창 */
#layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.ov { position: fixed; inset: 0; display: grid; place-items: center; padding: calc(env(safe-area-inset-top) + 10px) 12px calc(env(safe-area-inset-bottom) + 10px); background: rgba(10, 10, 35, .55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); pointer-events: auto; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.card { width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto; background: #fff; color: #2f3550; border-radius: 24px; padding: 18px 16px 16px; box-shadow: 0 22px 60px rgba(0, 0, 0, .45); text-align: center; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(14px) scale(.98); } }
.ov-pick .card, .ov-up .card { max-width: 520px; }
.ov-kicker { margin: 0; font-size: 13px; font-weight: 900; color: #8b6cff; }
.card h2 { margin: 2px 0 12px; font-size: 22px; font-weight: 900; letter-spacing: -.5px; }
.muted { color: #7a809a; font-size: 13px; margin: 6px 0; }
.cards { display: grid; gap: 8px; margin-bottom: 10px; }
.cards.grid { grid-template-columns: 1fr 1fr; }
.pick { position: relative; display: flex; gap: 10px; align-items: center; text-align: left; width: 100%; padding: 12px; border-radius: 16px; border: 2px solid #ebe6fb; background: linear-gradient(#fff, #f7f4ff); font: inherit; color: inherit; cursor: pointer; box-shadow: 0 3px 0 #e2dcf5; transition: transform .1s, border-color .1s; }
.pick:hover, .pick:focus-visible { border-color: #8b6cff; outline: none; }
.pick:active { transform: scale(.98); }
.pick:disabled { cursor: default; }
.pick.sel { border-color: #ff7ab8; }
.pk-emoji { font-size: 34px; width: 44px; text-align: center; flex: none; }
.pk-body { display: grid; gap: 2px; min-width: 0; }
.pk-body b { font-size: 16px; font-weight: 900; }
.pk-body em { font-style: normal; font-size: 12px; font-weight: 800; color: #ff5d9e; }
.pk-body small { font-size: 13px; color: #5a6080; line-height: 1.4; }
.pk-body i { font-style: normal; font-size: 11.5px; color: #8b6cff; font-weight: 700; }
.pick kbd { position: absolute; right: 10px; top: 8px; font: 800 11px sans-serif; color: #b9b3d6; }
.pick.sm { flex-direction: column; text-align: center; gap: 4px; padding: 10px 8px; }
.pick.sm .pk-emoji { width: auto; font-size: 30px; }
.pick.sm .pk-body small { font-size: 12px; }
.btn { display: block; width: 100%; margin-top: 8px; padding: 12px; border-radius: 14px; border: 0; font: inherit; font-size: 16px; font-weight: 900; cursor: pointer; }
.btn.primary { background: linear-gradient(135deg, #ff7ab8, #8b6cff); color: #fff; box-shadow: 0 4px 0 #4a2f99; }
.btn.ghost { background: #f1eefa; color: #4a3a8a; }
.btn.danger { background: #fff0f3; color: #d0335a; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.tiny { display: inline-block; width: auto; margin: 0; padding: 7px 12px; font-size: 14px; border-radius: 12px; background: #f1eefa; color: #4a3a8a; }
.btn.tiny.primary { background: linear-gradient(135deg, #ff7ab8, #8b6cff); color: #fff; box-shadow: 0 3px 0 #4a2f99; }
.row2 .btn { margin-top: 8px; }
.gets { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; text-align: left; }
.gets.two { grid-template-columns: 1fr 1fr; }
.gets li { background: #f7f4ff; border-radius: 10px; padding: 6px 10px; font-size: 14px; }
.gets small { color: #8a8fa8; font-weight: 700; }
.evo { display: flex; justify-content: center; align-items: center; gap: 12px; font-size: 40px; margin: 6px 0; }
.evo .to { font-size: 64px; animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { to { filter: drop-shadow(0 0 14px #ffd84a); transform: scale(1.08); } }
.coins { font-weight: 900; color: #c48a1a; margin: 8px 0 0; }
.toggles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 10px 0 2px; font-size: 14px; font-weight: 700; }
.toggles input { accent-color: #8b6cff; width: 18px; height: 18px; vertical-align: -3px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 8px; }
.facts div { background: #f7f4ff; border-radius: 14px; padding: 10px; }
.facts small { display: block; font-size: 12px; color: #8a8fa8; font-weight: 800; }
.facts b { font-size: 22px; font-weight: 900; color: #3d2f7a; }
.rec { margin: 6px 0; padding: 8px; border-radius: 12px; background: #fff7d6; color: #8a5a00; font-weight: 800; font-size: 14px; }
.rec.guest { background: #eef4ff; color: #2f4a8a; }
.dmg { text-align: left; margin: 8px 0 0; font-size: 14px; }
.dmg summary { cursor: pointer; font-weight: 800; color: #6a6f8a; }
.gold-now { margin: 0 0 10px; font-weight: 800; }
.gold-now b { color: #c48a1a; font-size: 18px; }
.ups { display: grid; gap: 7px; text-align: left; }
.up { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; background: #f7f4ff; }
.up-e { font-size: 26px; width: 34px; text-align: center; flex: none; }
.up-b { flex: 1; display: grid; gap: 1px; min-width: 0; }
.up-b b { font-size: 15px; }
.up-b small { font-size: 12.5px; color: #6a6f8a; }
.dots { display: flex; gap: 3px; margin-top: 2px; }
.dots i { width: 14px; height: 6px; border-radius: 3px; background: #ddd6f3; }
.dots i.on { background: linear-gradient(90deg, #ff7ab8, #8b6cff); }
.maxed { font-weight: 900; color: #8b6cff; font-size: 14px; padding: 0 6px; }
.evo-t { width: 100%; border-collapse: collapse; font-size: 13.5px; text-align: left; }
.evo-t td { padding: 6px 4px; border-bottom: 1px solid #eee9fa; }
.howto .evo-t td { border-color: rgba(255, 255, 255, .12); }
.howto .muted { color: #b9bfdc; }

@media (max-height: 520px) and (orientation: landscape) {
  #home { padding-top: calc(env(safe-area-inset-top) + 52px); }
  .hero { margin-top: 0; }
  .title-star { display: none; }
  .title-word { font-size: 40px; }
  .cards:not(.grid) { grid-template-columns: repeat(3, 1fr); }
  .cards:not(.grid) .pick { flex-direction: column; text-align: center; }
  .cards.grid { grid-template-columns: repeat(3, 1fr); }
  .card { max-width: 760px; padding: 12px; }
  .card h2 { margin-bottom: 6px; font-size: 19px; }
  .banner { top: calc(env(safe-area-inset-top) + 122px); }
}

/* ---- 2편·3편 (2026-10-30): 무대·수호대·장비·임무·도감·설정·방법 ---- */
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }
.big.sm { font-size: 15px; padding: 12px 6px; border-radius: 16px; position: relative; }
.big.sm small { display: block; margin: 2px 0 0; }
.big.daily { background: linear-gradient(135deg, #4fc3d8, #3a6ad8); color: #fff; box-shadow: 0 5px 0 #23408a; font-size: 18px; }
.big.daily small { color: #e8fbff; }
.badge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 99px; background: #ff4a7a; color: #fff; font-size: 12px; font-weight: 900; vertical-align: 2px; }
.sub { margin: 12px 0 6px; font-size: 15px; font-weight: 900; text-align: left; color: #3d2f7a; }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stage { display: grid; gap: 2px; justify-items: center; padding: 8px 2px; border-radius: 14px; border: 2px solid #ebe6fb; background: #f7f4ff; font: inherit; color: inherit; cursor: pointer; }
.stage b { font-size: 12.5px; line-height: 1.2; }
.stage small { font-size: 10.5px; color: #7a809a; line-height: 1.2; }
.stage .st-e { font-size: 24px; }
.stage.sel { border-color: #ff7ab8; background: #fff0f7; }
.stage.lock { opacity: .55; cursor: default; }
.st-desc { min-height: 2.6em; }
.seg { display: flex; gap: 6px; margin: 8px 0; padding: 4px; background: #f1eefa; border-radius: 14px; }
.seg button { flex: 1; padding: 8px 4px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-weight: 900; font-size: 14px; color: #6b6f88; cursor: pointer; }
.seg button.on { background: #fff; color: #3d2f7a; box-shadow: 0 2px 0 #dcd5f2; }
.seg button:disabled { opacity: .5; cursor: default; }
.chars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ch { display: grid; gap: 1px; justify-items: center; padding: 8px 3px; border-radius: 14px; border: 2px solid #ebe6fb; background: #fff; font: inherit; color: inherit; cursor: pointer; }
.ch span { font-size: 24px; }
.ch b { font-size: 13px; }
.ch small { font-size: 10.5px; color: #7a809a; line-height: 1.25; }
.ch.sel { border-color: #8b6cff; background: #f4f0ff; }
.ch.lock { opacity: .5; cursor: default; }
.daily-box { text-align: left; background: #eef8ff; border-radius: 16px; padding: 10px 12px; margin: 6px 0; }
.daily-box p { margin: 4px 0; }
.mod small { color: #5a6a8a; }
.lock-t { font-size: 12px; font-weight: 800; color: #8a8fa8; white-space: nowrap; }
.guest-note { margin: 8px 0; padding: 10px; border-radius: 14px; background: #eef4ff; color: #2f4a8a; font-weight: 800; font-size: 13.5px; }
.guest-note p { margin: 0 0 6px; }
.bar { display: block; height: 7px; border-radius: 99px; background: #e6e1f5; overflow: hidden; margin: 3px 0 1px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #8b6cff, #ff7ab8); }
.up.done { opacity: .7; }
.opts { display: grid; gap: 8px; text-align: left; margin-bottom: 6px; }
.slider { display: grid; grid-template-columns: 74px 1fr 34px; align-items: center; gap: 8px; font-weight: 800; }
.slider input { width: 100%; accent-color: #8b6cff; }
.slider b { text-align: right; color: #8b6cff; }
.tog { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: #f7f4ff; font-weight: 800; cursor: pointer; }
.tog input { width: 20px; height: 20px; accent-color: #8b6cff; flex: none; }
.tog small { color: #7a809a; font-weight: 700; }
.slots { display: flex; justify-content: center; gap: 14px; }
.slot { display: grid; justify-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: #7a809a; }
.gchip { position: relative; display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 26px; background: #eef0f6; border: 3px solid #c8cbe0; flex: none; }
.gchip i { position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 9.5px; font-weight: 900; padding: 0 5px; border-radius: 99px; background: #c8cbe0; color: #2f3550; white-space: nowrap; }
.gchip.g1 { border-color: #5ad1ff; background: #eaf8ff; } .gchip.g1 i { background: #5ad1ff; }
.gchip.g2 { border-color: #c47aff; background: #f6edff; } .gchip.g2 i { background: #c47aff; color: #fff; }
.gchip.g3 { border-color: #ffc94a; background: #fff8e0; box-shadow: 0 0 12px rgba(255, 201, 74, .8); } .gchip.g3 i { background: #ffc94a; }
.gchip.empty { color: #b8bcd0; border-style: dashed; }
.chest-row { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px; margin: 8px 0; border-radius: 16px; background: #fff7d6; }
.chest-row > span:nth-child(2) { flex: 1; display: grid; }
.chest-row small { color: #8a6a20; font-size: 12px; }
.chest-row .btn.tiny { margin-left: 4px; }
.big-e { font-size: 30px; }
.glist { display: grid; gap: 8px; text-align: left; min-height: 60px; }
.gitem { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; background: #f7f4ff; flex-wrap: wrap; }
.gitem.eq { outline: 2px solid #8b6cff; }
.reveal { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.rv { display: grid; justify-items: center; gap: 4px; padding: 12px 6px 8px; border-radius: 16px; background: #f7f4ff; animation: flip .45s ease-out both; }
.rv b { font-size: 13px; } .rv small { font-size: 11px; color: #6a6f8a; }
.rv.g2 { background: #f6edff; } .rv.g3 { background: #fff8e0; box-shadow: 0 0 18px rgba(255, 201, 74, .7); }
@keyframes flip { from { transform: rotateY(90deg) scale(.8); opacity: 0; } }
.dex { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; text-align: left; }
.dx { padding: 8px 10px; border-radius: 12px; background: #f7f4ff; display: grid; }
.dx b { font-size: 13.5px; } .dx small { font-size: 11.5px; color: #6a6f8a; }
.dx.no { background: #f0f0f4; color: #a0a4b8; }
.dx.boss { background: #fff0f3; } .dx.boss.no { background: #f6eef0; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.si { display: grid; justify-items: center; gap: 3px; padding: 10px 6px; border-radius: 16px; background: #f7f4ff; }
.si.eq { outline: 2px solid #8b6cff; }
.si b { font-size: 13px; } .si small { font-size: 11px; color: #6a6f8a; min-height: 2.4em; }
.guide { text-align: left; font-size: 14px; line-height: 1.6; }
.guide h3 { margin: 12px 0 2px; font-size: 15px; color: #3d2f7a; }
.guide p { margin: 0; color: #4a5070; }
@media (max-width: 380px) { .stages { grid-template-columns: repeat(3, 1fr); } .chars { grid-template-columns: 1fr 1fr; } .dex { grid-template-columns: 1fr; } }
/* 움직임 줄이기 */
body.calm *, body.calm *::before, body.calm *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
