:root {
  --ink: #07131d;
  --cream: #f7e6c2;
  --cyan: #2fd6ee;
  --gold: #ffc62e;
  --pink: #ff5c7a;
  --orange: #ff8a1f;
  --panel: rgba(255, 255, 255, 0.95);
  --shadow: 0 10px 30px rgba(7, 19, 29, 0.25);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --lens: 300px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: #3d9cf5; color: var(--ink); font-family: 'Fredoka', 'Jua', system-ui, sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; -webkit-touch-callout: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; background: none; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
i { display: inline-block; flex: none; font-style: normal; }
svg { display: block; }

/* 아이콘 */
.i-play { width: 0; height: 0; border-left: 22px solid currentColor; border-top: 14px solid transparent; border-bottom: 14px solid transparent; margin-left: 4px; }
.i-pause { width: 16px; height: 18px; border-left: 5px solid currentColor; border-right: 5px solid currentColor; }
.i-sound { width: 24px; height: 22px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%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 24'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%3E%3C/svg%3E") center/contain no-repeat; }
.btn-sound.off .i-sound { opacity: .35; }
.i-out { width: 12px; height: 12px; border-top: 2.5px solid currentColor; border-right: 2.5px solid currentColor; margin-left: 4px; }
.i-again { width: 22px; height: 22px; border: 4px solid currentColor; border-top-color: transparent; border-radius: 50%; }
.i-share { width: 20px; height: 20px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 16a3 3 0 0 0-2.4 1.2l-6.7-3.4a3 3 0 0 0 0-1.6l6.7-3.4A3 3 0 1 0 15 7l-6.7 3.4a3 3 0 1 0 0 3.2L15 17a3 3 0 1 0 3-1z'/%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 24'%3E%3Cpath d='M18 16a3 3 0 0 0-2.4 1.2l-6.7-3.4a3 3 0 0 0 0-1.6l6.7-3.4A3 3 0 1 0 15 7l-6.7 3.4a3 3 0 1 0 0 3.2L15 17a3 3 0 1 0 3-1z'/%3E%3C/svg%3E") center/contain no-repeat; }
.i-home { width: 22px; height: 20px; background: currentColor; clip-path: polygon(50% 0, 100% 45%, 86% 45%, 86% 100%, 14% 100%, 14% 45%, 0 45%); }
.i-crown { width: 20px; height: 16px; background: var(--gold); clip-path: polygon(0 100%, 0 20%, 25% 55%, 50% 0, 75% 55%, 100% 20%, 100% 100%); }
.i-star { width: 22px; height: 22px; background: linear-gradient(180deg, #fff1b0, #ffc62e); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.i-grid { width: 20px; height: 20px; background: radial-gradient(circle, currentColor 0 3.5px, transparent 4px) 0 0 / 10px 10px; }
.i-left, .i-right { width: 14px; height: 14px; border: solid currentColor; border-width: 0 0 4px 4px; transform: rotate(45deg); margin-left: 5px; }
.i-right { transform: rotate(-135deg); margin-left: -5px; }
.i-flag { width: 18px; height: 20px; background: linear-gradient(90deg, #07131d 0 3px, transparent 3px), conic-gradient(from 90deg at 50% 50%, #fff 0 25%, #07131d 0 50%, #fff 0 75%, #07131d 0) 3px 0 / 8px 8px no-repeat; background-size: auto, 15px 12px; }
.i-lock { width: 22px; height: 26px; position: relative; }
.i-lock::before { content: ''; position: absolute; left: 4px; top: 0; width: 14px; height: 14px; border: 3.5px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0; box-sizing: border-box; }
.i-lock::after { content: ''; position: absolute; left: 0; bottom: 0; width: 22px; height: 15px; border-radius: 4px; background: currentColor; }

/* 버튼 */
.big-btn { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 200px; height: 68px; padding: 0 34px; border-radius: 999px; font-size: 30px; font-weight: 700; color: #fff; background: linear-gradient(180deg, #ffb13b, #ff7a1a); box-shadow: 0 7px 0 #c4520a, 0 14px 28px rgba(196, 82, 10, .35); text-shadow: 0 2px 0 rgba(0,0,0,.18); transition: transform .08s; animation: pulse 1.6s ease-in-out infinite; }
.big-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 #c4520a; }
.big-btn:disabled { filter: grayscale(1); opacity: .6; animation: none; }
.big-btn.small { min-width: 120px; height: 56px; padding: 0 26px; font-size: 24px; }
.mid-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; min-width: 52px; padding: 0 16px; border-radius: 18px; font-size: 19px; font-weight: 700; background: #fff; box-shadow: 0 5px 0 rgba(7,19,29,.18), 0 8px 18px rgba(7,19,29,.12); }
.mid-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(7,19,29,.18); }
.ic-btn { position: relative; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: rgba(255,255,255,.92); box-shadow: 0 4px 0 rgba(7,19,29,.15); touch-action: manipulation; }
.ic-btn::before { content: ''; position: absolute; inset: -8px; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.share-big { background: linear-gradient(180deg, #4fd2ff, #1f8cf0); box-shadow: 0 7px 0 #135ea8, 0 14px 28px rgba(19,94,168,.35); height: 56px; font-size: 22px; min-width: 0; width: 100%; max-width: 300px; }
.share-big:active { box-shadow: 0 2px 0 #135ea8; }

/* 화면 */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; z-index: 10; }
.screen.dim { background: rgba(7, 19, 29, .45); justify-content: center; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.row { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.row.col { flex-direction: column; gap: 22px; }

#menu { justify-content: space-between; padding: calc(24px + var(--safe-t)) 16px calc(20px + var(--safe-b)); pointer-events: none; }
#menu > * { pointer-events: auto; }
.logo-wrap { display: flex; flex-direction: column; align-items: center; animation: drop .7s cubic-bezier(.2,1.6,.4,1) both; pointer-events: none !important; }
.logo-img { width: min(76vw, 420px); height: auto; filter: drop-shadow(0 10px 20px rgba(7,19,29,.3)); }
.logo-img + .logo { display: none; }
.logo { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: .82; font-weight: 700; letter-spacing: -1px; }
.logo span { font-size: clamp(56px, 16vw, 110px); color: var(--cream); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 5px 6px 0 var(--cyan); }
@keyframes drop { from { transform: translateY(-60px) scale(.8); opacity: 0; } }
.best-m { margin-top: 6px; padding: 6px 16px; border-radius: 999px; background: rgba(7,19,29,.55); color: #fff; font-size: 17px; display: flex; gap: 8px; align-items: center; }
.best-m b { color: var(--gold); font-size: 20px; font-variant-numeric: tabular-nums; }
.best-m .sep { width: 1px; height: 16px; background: rgba(255,255,255,.4); }
.menu-bottom { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.studio { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px; background: var(--ink); color: var(--cream); font-weight: 700; font-size: 13px; letter-spacing: 1px; box-shadow: 0 4px 12px rgba(7,19,29,.3); }
.hub-link { position: absolute !important; left: calc(14px + var(--safe-l)); top: calc(14px + var(--safe-t)); z-index: 20; }
.chal-m { display: flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 999px; background: #fff; font-size: 18px; box-shadow: 0 4px 0 rgba(7,19,29,.15); animation: pulse 1.4s infinite; }

/* 스테이지 고르기 */
#pick { display: flex; align-items: center; gap: 14px; }
#pick .arrow { width: 52px; height: 52px; border-radius: 50%; }
#pick .arrow:disabled { opacity: .35; }
#tile { position: relative; width: 132px; height: 104px; border-radius: 24px; background: rgba(255,255,255,.95); box-shadow: 0 6px 0 rgba(7,19,29,.18), 0 10px 22px rgba(7,19,29,.18); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
#tile .th { position: absolute; left: 10px; top: 10px; width: 28px; height: 28px; }
#tile .num { font-size: 44px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
#tile .num.boss { color: #ff4d6d; }
#tile .st { display: flex; gap: 3px; }
#tile .st i { width: 22px; height: 22px; background: #d6dbe6; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
#tile .st i.on { background: linear-gradient(180deg, #fff1b0, #ffc62e); }
#tile.lock .num, #tile.lock .st { opacity: .25; }
#tile .lk { position: absolute; color: #8d99a6; }
#tile .bs { position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { position: absolute; }
#touchzone { inset: 0; pointer-events: auto; z-index: 1; }
#hud .tl { left: calc(12px + var(--safe-l)); top: calc(12px + var(--safe-t)); display: flex; gap: 10px; z-index: 6; pointer-events: auto; }
#obj { left: 50%; top: calc(12px + var(--safe-t)); transform: translateX(-50%); display: flex; gap: 6px; z-index: 3; }
.chip { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px 0 6px; border-radius: 999px; background: rgba(7,19,29,.58); color: #fff; font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip svg { width: 30px; height: 30px; }
.chip.done { background: rgba(43,196,106,.85); }
.chip.warn { background: rgba(255,59,92,.85); animation: pulse .5s infinite; }
.chip.bump { animation: cbump .3s ease-out; }
@keyframes cbump { 40% { transform: scale(1.25); } }
.chip .pips { display: flex; gap: 3px; margin-left: 2px; }
.chip .pips b { width: 9px; height: 14px; border-radius: 3px; background: #ff4d6d; }
.chip .pips b.off { background: rgba(255,255,255,.25); }
#score { right: calc(14px + var(--safe-r)); top: calc(14px + var(--safe-t)); font-size: 30px; font-weight: 700; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 rgba(7,19,29,.35); font-variant-numeric: tabular-nums; z-index: 3; }
#ammo { left: calc(14px + var(--safe-l)); bottom: calc(14px + var(--safe-b)); display: flex; align-items: center; gap: 2px; padding: 6px 10px; border-radius: 16px; background: rgba(7,19,29,.5); z-index: 3; }
#ammo svg { width: 16px; height: 40px; }
#ammo svg.used { opacity: .22; }
#ammo b { color: #fff; font-size: 22px; margin-left: 4px; }
#ammo.low { box-shadow: 0 0 0 3px #ff4d6d; }
#wind { right: calc(14px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px 0 8px; border-radius: 16px; background: rgba(7,19,29,.5); color: #fff; font-size: 20px; font-weight: 700; z-index: 3; }
#wind svg { width: 30px; height: 30px; }
#wind .arr { width: 34px; height: 20px; }
#hitmark { left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; opacity: 0; z-index: 4; }
#hitmark::before, #hitmark::after { content: ''; position: absolute; left: 50%; top: 50%; width: 46px; height: 6px; margin: -3px -23px; border-radius: 3px; background: linear-gradient(90deg, currentColor 0 34%, transparent 34% 66%, currentColor 66%); transform: rotate(45deg); color: #fff; filter: drop-shadow(0 0 2px #000); }
#hitmark::after { transform: rotate(-45deg); }
#hitmark.on { animation: hm .35s ease-out; }
#hitmark.head::before, #hitmark.head::after { color: #ff3b5c; }
@keyframes hm { 0% { opacity: 1; transform: scale(1.6); } 40% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1); } }
#hand { width: 64px; height: 64px; margin: -6px 0 0 -18px; z-index: 4; animation: handTap 1.4s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
#hand svg { width: 64px; height: 64px; }
@keyframes handTap { 0%, 100% { transform: translate(14px, 22px) scale(1); } 40% { transform: translate(0, 0) scale(.88); } 60% { transform: translate(0, 0) scale(.88); } }

/* 조준경 */
#scope { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0; display: grid; place-items: center; }
#scope .lens { position: relative; width: var(--lens); height: var(--lens); border-radius: 50%; box-shadow: 0 0 0 200vmax rgba(6, 12, 20, .93), inset 0 0 0 6px #10161f, inset 0 0 0 9px #2fd6ee, inset 0 0 40px 14px rgba(0,0,0,.45); }
#scope .ch { position: absolute; background: rgba(10,16,24,.85); }
#scope .ch.h { left: 6%; right: 6%; top: 50%; height: 2px; margin-top: -1px; background: linear-gradient(90deg, rgba(10,16,24,.9) 0 40%, transparent 40% 60%, rgba(10,16,24,.9) 60%); }
#scope .ch.v { top: 6%; bottom: 6%; left: 50%; width: 2px; margin-left: -1px; background: linear-gradient(180deg, rgba(10,16,24,.9) 0 40%, transparent 40% 60%, rgba(10,16,24,.9) 60%); }
#scope .dot { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #ff3b5c; box-shadow: 0 0 0 1.5px #fff; }
#scope .ticks { position: absolute; left: 50%; top: 50%; width: 2px; height: 40%; margin-left: -1px; background: repeating-linear-gradient(180deg, transparent 0 10%, rgba(10,16,24,.75) 10% 11.5%); }
#mark { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; border-radius: 50%; border: 3px solid #ffb13b; box-shadow: 0 0 0 1.5px rgba(0,0,0,.4), inset 0 0 0 1.5px rgba(0,0,0,.25); transition: border-color .1s, transform .1s; }
#mark.on { border-color: #ff3b5c; background: rgba(255,59,92,.35); transform: scale(1.25); }
#mark.bonus { border-color: #ffd23f; background: rgba(255,210,63,.3); }
#mark.doll { border-color: #ff8fd0; background: rgba(255,143,208,.45); }
#dist { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); color: #fff; font-size: 17px; font-weight: 700; padding: 1px 9px; border-radius: 10px; background: rgba(7,19,29,.55); font-variant-numeric: tabular-nums; }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 4; background: #fff; opacity: 0; }

/* 떠오르는 점수 */
#pops { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
.pop { position: absolute; transform: translate(-50%, 0); font-size: 26px; font-weight: 700; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; white-space: nowrap; animation: popUp 1s ease-out forwards; text-align: center; line-height: 1.05; }
.pop small { display: block; font-size: 17px; color: #ffe14d; }
.pop.head { color: #ffe14d; font-size: 30px; }
.pop.head small { color: #ff8fa3; }
.pop.big { font-size: 36px; color: #9be15d; }
@keyframes popUp { 0% { transform: translate(-50%, 10px) scale(.6); opacity: 0; } 18% { transform: translate(-50%, -10px) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -64px) scale(1); opacity: 0; } }

/* 시작 배너 */
#banner { position: fixed; left: 50%; top: 36%; transform: translate(-50%, -50%); z-index: 7; pointer-events: none; opacity: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#banner .bn { display: flex; align-items: center; gap: 10px; font-size: 64px; font-weight: 700; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; line-height: 1; }
#banner .bn svg { width: 54px; height: 54px; }
#banner .bo { display: flex; gap: 8px; }
#banner.show { animation: banner 2s ease-out forwards; }
#banner.clear .bn { color: #9be15d; font-size: 72px; }
#banner.fail .bn { color: #ff8fa3; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(.95); } }

/* 결과 */
#over { justify-content: flex-start; padding: calc(10px + var(--safe-t)) 14px calc(10px + var(--safe-b)); overflow-y: auto; }
#over .panel { margin-top: auto; flex: none; }
.panel { width: min(100%, 400px); background: var(--panel); border-radius: 28px; padding: 16px 16px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: var(--shadow); animation: pop .45s cubic-bezier(.2,1.5,.4,1) both; }
.colA, .colB { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.stage-tag { display: flex; align-items: center; gap: 8px; padding: 4px 16px 4px 8px; border-radius: 999px; background: #eef2f8; font-size: 24px; font-weight: 700; }
.stage-tag svg { width: 30px; height: 30px; }
.stars-o { display: flex; gap: 6px; align-items: flex-end; }
.stars-o i { width: 54px; height: 54px; background: #d6dbe6; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.stars-o i:nth-child(2) { width: 66px; height: 66px; }
.stars-o i.on { background: linear-gradient(180deg, #fff1b0, #ffc62e 60%, #ff9f1c); animation: starIn .45s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes starIn { from { transform: scale(2.2) rotate(-40deg); opacity: 0; } }
.fail-o svg { width: 74px; height: 74px; }
.big-num { font-size: 54px; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.mini { display: flex; gap: 14px; font-size: 19px; font-weight: 700; flex-wrap: wrap; justify-content: center; }
.mini span { display: flex; align-items: center; gap: 4px; }
.mini svg { width: 28px; height: 28px; }
.mini small { color: #2bc46a; font-size: 16px; }
.acts { flex-wrap: nowrap; gap: 8px; }
.acts .mid-btn { height: 52px; min-width: 52px; padding: 0 12px; }
.tot { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 700; }
.tot .i-crown { width: 26px; height: 20px; }
.badge { padding: 3px 12px; border-radius: 999px; background: linear-gradient(90deg, #ff5c7a, #ffb13b); color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 2px; animation: pulse 1s infinite; }
.chal-o { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.chal-o em { font-style: normal; font-weight: 700; padding: 2px 10px; border-radius: 8px; color: #fff; }
.chal-o em.win { background: #2bc46a; } .chal-o em.lose { background: #8d99a6; }
.over-card { width: 100%; max-width: 150px; border-radius: 16px; box-shadow: 0 6px 18px rgba(7,19,29,.25); cursor: pointer; }
#hofForm { width: 100%; }
.share-row { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }

#toast { position: fixed; left: 50%; bottom: calc(30px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; padding: 10px 18px; border-radius: 16px; background: #fff; font-weight: 700; z-index: 40; pointer-events: none; transition: .3s; box-shadow: 0 6px 20px rgba(7,19,29,.25); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#nogl { display: none; }
body.nogl #nogl { display: grid; position: fixed; inset: 0; place-items: center; font-size: 24px; }
body.loading #btnPlay { opacity: .6; animation: none; }

/* 낮은 화면 (가로·작은 폰) */
@media (max-height: 700px) {
  .logo-img { width: min(64vw, 330px); }
  .big-btn { height: 58px; font-size: 26px; }
  #tile { width: 118px; height: 90px; } #tile .num { font-size: 38px; }
  .menu-bottom { gap: 10px; }
  .big-num { font-size: 44px; }
  .stars-o i { width: 44px; height: 44px; } .stars-o i:nth-child(2) { width: 54px; height: 54px; }
  .over-card { max-width: 120px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  #menu { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: min-content; align-content: center; justify-items: center; column-gap: 20px; row-gap: 8px; padding: calc(10px + var(--safe-t)) calc(20px + var(--safe-r)) calc(10px + var(--safe-b)) calc(20px + var(--safe-l)); }
  #menu > :not(.menu-bottom):not(.hub-link) { grid-column: 1; }
  #menu > .menu-bottom { grid-column: 2; grid-row: 1 / span 5; align-self: center; }
  .logo-img { width: min(40vw, 300px); }
  #menu .hof-inline { margin-top: 0 !important; }
  #over { justify-content: center; }
  #over .panel { width: min(100%, 760px); flex-direction: row; align-items: stretch; gap: 16px; padding: 14px 16px; }
  #over .colA, #over .colB { flex: 1; justify-content: center; gap: 8px; }
  .big-num { font-size: 40px; }
  .stars-o i { width: 38px; height: 38px; } .stars-o i:nth-child(2) { width: 46px; height: 46px; }
  .over-card { max-width: 84px; }
  .share-row { flex-direction: row; justify-content: center; }
  .share-row .share-big { width: auto; flex: 1; max-width: 220px; height: 52px; font-size: 20px; }
  #over .hof-open { min-height: 44px; }
  #banner .bn { font-size: 48px; }
  .chip { height: 36px; font-size: 19px; } .chip svg { width: 26px; height: 26px; }
  #ammo svg { height: 32px; width: 13px; }
}
@media (max-aspect-ratio: 1/1) { #obj { top: calc(70px + var(--safe-t)); } }
@media (max-width: 380px) { .acts .mid-btn { padding: 0 9px; min-width: 46px; } .big-btn.small { min-width: 96px; padding: 0 18px; } .chip { padding: 0 9px 0 4px; font-size: 18px; } .chip svg { width: 24px; height: 24px; } }

/* 미션 */
.kc-wrap.nohand .kc-hand, .kc-wrap.nohand .kc-dot, .kc-wrap.nohand .kc-trail { display: none; }
.kc-wrap.nohand .kc-icon { transform: translate(-50%, -50%); animation: pulse .8s ease-in-out infinite; }
.chip.big { height: 50px; font-size: 26px; padding: 0 16px 0 8px; } .chip.big svg { width: 40px; height: 40px; }
.chip.c-run { background: rgba(122,92,255,.85); padding: 0 12px; }
.chip .gt { display: flex; align-items: center; }
.play-row { flex-wrap: nowrap; gap: 10px; }
.endless { height: 60px; padding: 0 14px; gap: 6px; background: linear-gradient(180deg, #a48bff, #7a5cff); color: #fff; box-shadow: 0 5px 0 #5a3fd0; }
.endless .i-inf { font-size: 34px; font-weight: 700; line-height: 1; }
.endless b { font-size: 16px; }
#tile .bs { width: 32px; height: 32px; }
.mini b { font-size: 22px; }
@media (max-width: 380px) { #btnPlay { min-width: 150px; padding: 0 22px; } }

/* 반격 로봇: 하트·경고·피격 */
#hearts { right: calc(14px + var(--safe-r)); top: calc(56px + var(--safe-t)); display: flex; gap: 2px; z-index: 3; }
#hearts i { width: 30px; height: 30px; filter: drop-shadow(0 2px 2px rgba(7,19,29,.35)); }
#hearts i svg { width: 100%; height: 100%; }
#hearts i.off { opacity: .25; filter: grayscale(1); }
#hearts.beat i:first-child { animation: hbeat .8s ease-in-out infinite; }
@keyframes hbeat { 0%, 40%, 100% { transform: scale(1); } 15% { transform: scale(1.35); } 30% { transform: scale(1.12); } }
body.lastheart #hud::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 70px 10px rgba(255, 30, 60, .45); animation: hbeatV .8s ease-in-out infinite; }
@keyframes hbeatV { 0%, 40%, 100% { opacity: .35; } 15% { opacity: 1; } }
#hurt { position: fixed; inset: 0; pointer-events: none; z-index: 8; opacity: 0; }
#hurt.on { animation: hurtF .6s ease-out; }
#hurt.l { background: linear-gradient(90deg, rgba(255,30,60,.75), transparent 35%); }
#hurt.r { background: linear-gradient(270deg, rgba(255,30,60,.75), transparent 35%); }
#hurt.t { background: radial-gradient(ellipse at center, transparent 45%, rgba(255,30,60,.7)); }
@keyframes hurtF { 0% { opacity: 1; } 100% { opacity: 0; } }
#threatInd { position: absolute; display: none; z-index: 4; pointer-events: none; }
#threatInd.ring { display: block; width: 66px; height: 66px; margin: -33px; border-radius: 50%; border: 4px solid #ff3b5c; box-shadow: 0 0 calc(var(--k) * 24px) #ff3b5c; animation: tring .5s ease-in-out infinite; }
#threatInd.arrow { display: block; width: 0; height: 0; margin: -16px 0 0 -14px; border-left: 30px solid #ff3b5c; border-top: 16px solid transparent; border-bottom: 16px solid transparent; transform: rotate(var(--a)); filter: drop-shadow(0 0 6px #ff3b5c); animation: tblink .35s step-end infinite; }
@keyframes tring { 50% { transform: scale(1.18); } }
@keyframes tblink { 50% { opacity: .35; } }
#replayB { position: fixed; inset: 0; pointer-events: none; z-index: 8; border: 0 solid #ff3b5c; transition: border-width .2s; }
#replayB.on { border-width: 8px; animation: tblink .5s step-end infinite; }
.pop .pd svg { width: 11px; height: 22px; vertical-align: -5px; }
