/* KEKE STATION 전용 (공통 틀은 style.css = BONE SHOP 과 같은 톤) */
:root {
  --bone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 32'%3E%3Cpath fill-rule='evenodd' d='M26 1a15 15 0 1 0 0 30 15 15 0 0 0 0-30zm0 6l2.6 5.4 5.9.8-4.3 4.1 1 5.8L26 19.3l-5.2 2.8 1-5.8-4.3-4.1 5.9-.8z'/%3E%3C/svg%3E");
}
html, body { background: #14123a; }
.cproxy { position: fixed; left: 0; top: 0; width: 1px; height: 1px; pointer-events: none; opacity: 0; }

/* 우주선 말풍선 */
.sb { position: absolute; left: 0; top: 0; transform-origin: 50% 100%; pointer-events: none; will-change: transform; }
.sb-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px 7px 6px; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 rgba(7,19,29,.2), 0 8px 16px rgba(7,19,29,.25); }
.sb-in::after { content: ''; position: absolute; left: 50%; bottom: -9px; margin-left: -9px; border: 9px solid transparent; border-bottom: 0; border-top-color: #fff; }
.sb-top { display: flex; align-items: center; gap: 5px; height: 26px; }
.sb-face { font-size: 24px; line-height: 26px; }
.sb-hearts { display: flex; gap: 2px; }
.sb-hearts i { width: 15px; height: 14px; background: #ff4d6d; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21S1 14 1 7.2A5.7 5.7 0 0 1 12 5a5.7 5.7 0 0 1 11 2.2C23 14 12 21 12 21z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21S1 14 1 7.2A5.7 5.7 0 0 1 12 5a5.7 5.7 0 0 1 11 2.2C23 14 12 21 12 21z'/%3E%3C/svg%3E") center/contain no-repeat; transition: background .2s; }
.sb-hearts i.off { background: #d9deea; }
.sb.low .sb-hearts i:not(.off) { animation: hb .5s ease-in-out infinite alternate; }
@keyframes hb { to { transform: scale(1.3); } }
.sb-sz { display: flex; gap: 2px; margin-left: 2px; }
.sb-sz b { width: 8px; height: 8px; border-radius: 50%; background: #ffb800; box-shadow: inset 0 0 0 1.5px #c77f00; }
.sb-svc { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 106px; }
.sv { position: relative; width: 48px; height: 48px; border-radius: 15px; background: #eef3ff; box-shadow: inset 0 0 0 3px #b9c7ee, 0 3px 0 rgba(7,19,29,.18); font-size: 28px; line-height: 48px; text-align: center; pointer-events: none; overflow: hidden; touch-action: manipulation; }
.sb.dock .sv { pointer-events: auto; cursor: pointer; width: 50px; height: 50px; line-height: 50px; }
.sb.dock .sv:not(.done):not(.run) { animation: svp 1s ease-in-out infinite; background: #fff6d6; box-shadow: inset 0 0 0 3px #ffc62e, 0 3px 0 rgba(7,19,29,.18); }
@keyframes svp { 50% { transform: scale(1.08); } }
.sb:not(.dock) .sv { width: 34px; height: 34px; line-height: 34px; font-size: 20px; border-radius: 11px; }
.sv::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--p, 0) * 100%); background: rgba(43,196,106,.45); }
.sv span { position: relative; }
.sv.run { box-shadow: inset 0 0 0 3px #2bc46a, 0 3px 0 rgba(7,19,29,.18); }
.sv.done { background: #d8f7e3; box-shadow: inset 0 0 0 3px #2bc46a; }
.sv.done span { opacity: .35; }
.sv.done::after { content: '✔'; position: absolute; inset: 0; color: #1ea65a; font-size: 30px; line-height: inherit; font-weight: 700; }
.sv.hit { animation: hit .18s; }
@keyframes hit { 50% { transform: scale(.86); } }
.sv-p { position: absolute; left: 4px; right: 4px; bottom: 3px; display: flex; gap: 2px; z-index: 1; }
.sv-p b { flex: 1; height: 5px; border-radius: 3px; background: rgba(7,19,29,.25); }
.sv-p b.on { background: #2bc46a; }
.sb.sel .sb-in { box-shadow: 0 0 0 4px #ffd63f, 0 8px 16px rgba(7,19,29,.25); }
.sb.hold { opacity: .0; }

/* 유성·혜성 */
#meteors { position: fixed; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.met { position: absolute; left: 0; top: 0; width: 72px; height: 72px; margin: -36px 0 0 -36px; display: grid; place-items: center; font-size: 46px; pointer-events: auto; cursor: pointer; touch-action: manipulation; will-change: transform; }
.met::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; border: 4px dashed rgba(255,255,255,.85); animation: spin 2.5s linear infinite; }
.met.gold::before { border-color: #ffd63f; }
.met.gold { font-size: 50px; filter: drop-shadow(0 0 10px #ffd63f); }
@keyframes spin { to { transform: rotate(360deg); } }
#shieldBtn { position: fixed; z-index: 8; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); margin-left: -48px; width: 96px; height: 96px; border-radius: 50%; font-size: 50px; background: radial-gradient(circle at 35% 30%, #b8f4ff, #2fd6ee 60%, #1a93b8); box-shadow: 0 7px 0 #0f6f8c, 0 0 0 5px rgba(255,255,255,.7), 0 14px 28px rgba(7,19,29,.4); animation: pulse 0.7s ease-in-out infinite; }
#shieldBtn:active { transform: translateY(5px); }
#shieldBtn.on { animation: none; filter: saturate(.4); }
#blackout { position: fixed; inset: 0; z-index: 7; background: rgba(5,5,25,.55); display: grid; place-items: center; font-size: 110px; pointer-events: none; animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .7; } }
.pop.comicB { font-size: 34px; }
.fly { z-index: 9; }

.sb:not(.dock) .sb-svc { flex-wrap: nowrap; gap: 3px; }
.sb:not(.dock) .sb-in { padding: 3px 6px 4px; gap: 2px; border-radius: 14px; }
.sb:not(.dock) .sb-top { height: 22px; }
.sb:not(.dock) .sb-face { font-size: 19px; }
.sb:not(.dock) .sv { width: 28px; height: 28px; line-height: 28px; font-size: 17px; border-radius: 9px; }
.sb:not(.dock) .sb-sz { display: none; }

#speedL { position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0; background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.55) 0 1.2deg, transparent 1.2deg 7deg); -webkit-mask: radial-gradient(circle, transparent 38%, #000 80%); mask: radial-gradient(circle, transparent 38%, #000 80%); }
#speedL.on { animation: spl .5s ease-out; }
@keyframes spl { 0% { opacity: .9; transform: scale(1.15); } 100% { opacity: 0; transform: scale(1); } }

.met.hole::before { border-color: #c8a8ff; animation-duration: .8s; }
.met.hole { font-size: 54px; filter: drop-shadow(0 0 12px #9b5cff); }
.met.pirate::before { border-color: #ff9a3d; }
.met.pirate { font-size: 52px; }
.up.lock { opacity: .55; }




.sv.fav::after { content: '💖'; position: absolute; right: -2px; top: -4px; font-size: 16px; line-height: 1; }
.sv.fav.done::after { content: '✔'; right: 0; top: 0; font-size: 30px; line-height: 50px; }

body::after { content: ''; position: fixed; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, transparent 52%, rgba(6,4,30,.55) 100%); }


.sb-k { font-size: 22px; line-height: 26px; }
.sb:not(.dock) .sb-k { font-size: 17px; }
/* HUD 크게 */
#hud #score { transform: scale(1.22); transform-origin: 50% 0; }
#hud #dayBox { transform: scale(1.25); transform-origin: 0 0; }
#hud #totalBox { transform: scale(1.25); transform-origin: 100% 0; }
#hud .tl .ic-btn { width: 54px; height: 54px; }




/* 오늘의 목표를 크게 */
#hud #score { transform: scale(1.5) !important; transform-origin: 50% 0 !important; }
#goalV { font-size: 17px !important; color: #fff !important; font-weight: 700 !important; }
#goalV::before { content: '🎯 '; }

#hud #totalBox { transform: translateY(58px) scale(1.25) !important; }
#hud #comboB { margin-top: 62px; }
#hud #score { transform: scale(1.4) !important; }

#tutDim { position: fixed; inset: 0; z-index: 44; pointer-events: none; opacity: 0; transition: opacity .25s; background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(5,5,30,0) 0, rgba(5,5,30,0) var(--r, 90px), rgba(5,5,30,.74) calc(var(--r, 90px) + 70px)); }
#tutDim.on { opacity: 1; }
body.tut-goal #hud #score { transform: scale(1.5) !important; transform-origin: 65% 0 !important; filter: drop-shadow(0 0 14px #ffd23f); z-index: 46; }
.sb-sz b { background: var(--sz, #ffb800) !important; box-shadow: none !important; width: 10px !important; height: 10px !important; }
.sb:not(.dock) .sv { width: 38px !important; height: 38px !important; line-height: 38px !important; font-size: 24px !important; }

/* 서비스 3종: 색 + 모양 + 아이콘 (연료=주황 원, 수리=파랑 육각, 식량=초록 사각) */
.sb .sv.t0, #legend .sv.t0, #questBox .sv.t0 { border-radius: 50% !important; background: #ffe6cc !important; box-shadow: inset 0 0 0 5px #ff8a1f, 0 3px 0 rgba(7,19,29,.2) !important; }
.sb .sv.t1, #legend .sv.t1 { border-radius: 0 !important; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M25 6h50l24 44-24 44H25L1 50z' fill='%23e3efff' stroke='%232f8cff' stroke-width='9' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% 100% no-repeat !important; box-shadow: none !important; clip-path: polygon(25% 3%, 75% 3%, 99% 50%, 75% 97%, 25% 97%, 1% 50%); }
.sb .sv.t2, #legend .sv.t2 { border-radius: 7px !important; background: #d9f7e3 !important; box-shadow: inset 0 0 0 5px #34c46a, 0 3px 0 rgba(7,19,29,.2) !important; }
.sb.dock .sv:not(.done):not(.run) { animation: svp 1s ease-in-out infinite; }
.sb .sv.done::after { background: rgba(255,255,255,.55); }
.sb-in { box-shadow: 0 0 0 4px var(--szc, #fff), 0 4px 0 rgba(7,19,29,.18), 0 8px 16px rgba(7,19,29,.25) !important; }
.sb-in::after { border-top-color: #fff; }
#legend { position: fixed; left: 10px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 5; display: none; gap: 6px; padding: 6px 8px; border-radius: 16px; background: rgba(7,19,29,.55); pointer-events: none; }
body.playing #legend { display: flex; }
#legend .sv { position: relative !important; width: 38px !important; height: 38px !important; line-height: 38px !important; font-size: 22px !important; text-align: center; animation: none !important; overflow: visible; }
#legend .sv::before { display: none; }
#tutRing { position: fixed; z-index: 45; pointer-events: none; transform: translate(-50%, -50%); border: 6px solid #fff; border-radius: 50%; opacity: 0; box-shadow: 0 0 22px currentColor; animation: ringp .9s ease-in-out infinite; }
#tutRing.on { opacity: 1; }
@keyframes ringp { 50% { transform: translate(-50%, -50%) scale(1.15); } }

/* 하단 서비스 버튼 3개 (큼직하게) */
#svcBar { position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 7; display: none; justify-content: center; gap: 16px; pointer-events: none; }
body.playing #svcBar { display: flex; }
.svb { pointer-events: auto; position: relative; width: 98px; height: 98px; font-size: 54px; line-height: 98px; text-align: center; touch-action: manipulation; transition: transform .08s; filter: drop-shadow(0 6px 0 rgba(7,19,29,.28)); }
.svb:active, .svb.hit { transform: translateY(5px) scale(.96); }
.svb.t0 { border-radius: 50%; background: #ffe6cc; box-shadow: inset 0 0 0 9px #ff8a1f; }
.svb.t1 { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M25 6h50l24 44-24 44H25L1 50z' fill='%23e3efff' stroke='%232f8cff' stroke-width='9' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% 100% no-repeat; clip-path: polygon(25% 3%, 75% 3%, 99% 50%, 75% 97%, 25% 97%, 1% 50%); filter: none; }
.svb.t2 { border-radius: 20px; background: #d9f7e3; box-shadow: inset 0 0 0 9px #34c46a; }
.svb.want { animation: wantp .7s ease-in-out infinite; }
@keyframes wantp { 50% { transform: scale(1.1); filter: drop-shadow(0 0 16px #fff6a0) drop-shadow(0 6px 0 rgba(7,19,29,.28)); } }
.svb.shake { animation: shk .35s; }
@keyframes shk { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.svb.t1.shake, .svb.t1.want { }
#shieldBtn { bottom: calc(132px + env(safe-area-inset-bottom, 0px)) !important; }
#legend { display: none !important; }
.sb-sz { display: none !important; }
/* 말풍선·아이콘 크게 */
.sb .sv { width: 62px !important; height: 62px !important; line-height: 62px !important; font-size: 36px !important; }
.sb-svc { max-width: 150px !important; gap: 6px !important; }
.sb-face { font-size: 28px !important; }
.sb-hearts i { width: 20px !important; height: 18px !important; }
#tutDim { background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(5,5,30,0) 0, rgba(5,5,30,0) var(--r, 90px), rgba(5,5,30,.4) calc(var(--r, 90px) + 70px)) !important; }

.sb .sv { width: 54px !important; height: 54px !important; line-height: 54px !important; font-size: 32px !important; }
.sb-svc { max-width: 124px !important; gap: 4px !important; }

/* 성장 단계 · 퀘스트 알약 */
#lvBox, #questBox { position: fixed; left: 14px; z-index: 6; display: none; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 22px; background: rgba(7,19,29,.62); color: #fff; font: 700 22px/1 Fredoka, sans-serif; pointer-events: none; }
body.playing #lvBox { display: flex; top: 188px; }
body.playing #questBox:not([hidden]) { display: flex; top: 240px; }
#lvBox .lv-i, #questBox .q-i { font-size: 24px; font-style: normal; }
#lvBox b { color: #ffd23f; min-width: 22px; }
.lv-bar { width: 54px; height: 10px; border-radius: 5px; background: rgba(255,255,255,.25); overflow: hidden; }
.lv-bar span { display: block; height: 100%; background: linear-gradient(90deg, #ffd23f, #ff8a1f); border-radius: 5px; transition: width .3s; }
#questBox .sv { position: relative !important; width: 32px !important; height: 32px !important; line-height: 32px !important; font-size: 19px !important; animation: none !important; display: inline-block; }
#questBox.done { background: rgba(43,196,106,.8); }

#questBox .sv.t0 { border-radius: 50% !important; background: #ffe6cc !important; box-shadow: inset 0 0 0 4px #ff8a1f !important; }
#questBox .sv.t1 { border-radius: 0 !important; background: #cfe3ff !important; box-shadow: none !important; clip-path: polygon(25% 3%, 75% 3%, 99% 50%, 75% 97%, 25% 97%, 1% 50%); outline: 0; }
#questBox .sv.t2 { border-radius: 6px !important; background: #d9f7e3 !important; box-shadow: inset 0 0 0 4px #34c46a !important; }
.de-lv { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0; font: 700 24px Fredoka, sans-serif; }
.de-lv i { font-style: normal; font-size: 28px; }
.lv-bar.big { width: 140px; height: 16px; border-radius: 8px; background: rgba(7,19,29,.18); }

#upTabs { display: flex; gap: 6px; justify-content: center; margin: 6px 0 4px; }
#upTabs button { flex: 1; min-width: 0; height: 52px; border-radius: 14px; background: #eef2fb; font-size: 24px; position: relative; box-shadow: 0 3px 0 rgba(7,19,29,.14); }
#upTabs button b { display: block; font-size: 11px; color: #5a6a86; line-height: 11px; margin-top: -2px; }
#upTabs button.on { background: #ffd23f; box-shadow: 0 3px 0 #c98f00; }
.sb-tag { font-size: 22px; line-height: 26px; }
.svb.jam { filter: grayscale(1) brightness(.7) !important; animation: shk .3s infinite !important; }

body[data-buff="aurora"]::before { content: ''; position: fixed; inset: 0; z-index: 4; pointer-events: none; background: linear-gradient(115deg, rgba(255,106,213,.0), rgba(255,106,213,.28), rgba(79,227,255,.22), rgba(255,106,213,0)); animation: aur 3s ease-in-out infinite alternate; }
body[data-buff="eclipse"]::before { content: ''; position: fixed; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(circle at 50% 40%, transparent 30%, rgba(40,50,120,.45)); }
body[data-buff="festival"]::before { content: ''; position: fixed; inset: 0; z-index: 4; pointer-events: none; background: repeating-linear-gradient(90deg, rgba(255,214,63,.16) 0 10px, transparent 10px 40px); animation: fes .8s linear infinite; }
@keyframes aur { to { transform: translateX(40px); opacity: .6; } }
@keyframes fes { to { background-position: 40px 0; } }

#convoyBox { position: fixed; left: 14px; z-index: 6; display: none; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 22px; background: rgba(47,140,255,.78); color: #fff; font: 700 22px/1 Fredoka, sans-serif; pointer-events: none; }
body.playing #convoyBox:not([hidden]) { display: flex; top: 292px; }
#convoyBox.bad { background: rgba(255,77,77,.78); }

/* 알약 3개를 한 줄로 (말풍선을 가리지 않게) */
body.playing #lvBox { top: 172px !important; left: 14px !important; height: 38px !important; padding: 0 9px !important; font-size: 19px !important; gap: 5px !important; }
body.playing #questBox:not([hidden]) { top: 172px !important; left: 142px !important; height: 38px !important; padding: 0 9px !important; font-size: 19px !important; }
body.playing #convoyBox:not([hidden]) { top: 172px !important; left: 232px !important; height: 38px !important; padding: 0 9px !important; font-size: 19px !important; }
.lv-bar { width: 38px !important; }

body.playing #convoyBox:not([hidden]) { top: 216px !important; left: 14px !important; }

/* 도감 · 업적 */
#dexUI { z-index: 60; }
#dexUI .panel { width: min(92vw, 420px); max-height: 82vh; overflow: auto; padding: 14px; }
.dex-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.dex-tabs button { flex: 1; height: 54px; border-radius: 16px; background: #eef2fb; font-size: 28px; box-shadow: 0 3px 0 rgba(7,19,29,.14); }
.dex-tabs button.on { background: #ffd23f; box-shadow: 0 3px 0 #c98f00; }
.dex-tabs .dex-x { flex: 0 0 54px; background: #ffb3b3; font-size: 22px; }
.dex-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dc { position: relative; aspect-ratio: 1; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 3px #cfe0ff, 0 3px 0 rgba(7,19,29,.12); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dc b { font-size: 34px; line-height: 1; font-weight: 400; }
.dc small { font-size: 12px; font-weight: 700; color: #5a6a86; margin-top: 2px; }
.dc i { position: absolute; right: 6px; top: 3px; font-style: normal; font: 700 12px Fredoka, sans-serif; color: #fff; background: #ff7a1a; border-radius: 8px; padding: 1px 5px; }
.dc.lk { background: #e8ecf5; box-shadow: inset 0 0 0 3px #d3d9e8; filter: grayscale(1); opacity: .75; }
.dc.t0 { border-radius: 50%; } .dc.t2 { border-radius: 10px; }

#rivalBox { position: fixed; right: 14px; z-index: 6; display: none; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 18px; background: rgba(7,19,29,.62); pointer-events: none; }
body.playing #rivalBox:not([hidden]) { display: flex; top: 224px; }
#rivalBox .q-i { font-size: 22px; font-style: normal; }
.rv-bar { position: relative; width: 74px; height: 12px; border-radius: 6px; background: rgba(255,255,255,.25); }
.rv-me { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #6dff9a, #2bc46a); }
.rv-rv { position: absolute; top: -4px; width: 6px; height: 20px; margin-left: -3px; border-radius: 3px; background: #ff5c7a; box-shadow: 0 0 6px #ff5c7a; }
#rivalBox.lead { box-shadow: 0 0 0 2px #6dff9a; }
.de-lv.rv { font-size: 20px; gap: 14px; margin: 2px 0; }
.rv-r { background: #eef2fb; border-radius: 12px; padding: 2px 10px; }
.rv-r.win { background: #d8f7e3; }
#btnPrestige { margin: 0 auto 10px; display: flex; font-size: 22px; background: #ffe6a8; }
#btnPrestige[hidden] { display: none; }

.dc.sel { box-shadow: inset 0 0 0 4px #ffd23f, 0 3px 0 rgba(7,19,29,.12); }
.dex-tabs button { font-size: 24px; }

/* 단순 HUD: 코인 + 별 3개 + 일시정지/홈만. 시간은 10초 남았을 때만 */
body.playing #totalBox, body.playing #lvBox, body.playing #questBox, body.playing #rivalBox, body.playing #convoyBox, body.playing #legend, body.playing #comboB, body.playing #goalV, body.playing #hud #dayBox .dn { display: none !important; }
body.playing #hud #dayBox { display: none !important; }
body.playing #hud #dayBox.late { display: flex !important; top: 150px; left: 14px; }
#bubbles > .dim { opacity: .5; }
#dayEnd #btnNext { position: sticky; bottom: 4px; z-index: 3; box-shadow: 0 0 0 6px rgba(255,255,255,.85), 0 6px 14px rgba(0,0,0,.35); }
#bubbles > .urgent { filter: drop-shadow(0 0 10px #ffd23f); z-index: 5; }
.svb.need { animation: needp .6s ease-in-out infinite alternate; }
@keyframes needp { from { transform: scale(1); } to { transform: scale(1.14); filter: drop-shadow(0 0 14px #ffd23f); } }
body.playing .svb:not(.need) { opacity: .55; }

body.playing #svcBar { pointer-events: none; }
body.playing #svcBar .svb { pointer-events: none; opacity: .85; }
#bubbles .sv { pointer-events: none !important; }
