:root {
  --bone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 32'%3E%3Ccircle cx='9' cy='9' r='8'/%3E%3Ccircle cx='9' cy='23' r='8'/%3E%3Ccircle cx='43' cy='9' r='8'/%3E%3Ccircle cx='43' cy='23' r='8'/%3E%3Crect x='8' y='9' width='36' height='14' rx='6'/%3E%3C/svg%3E");
  --ink: #07131d;
  --cream: #f7e6c2;
  --cyan: #2fd6ee;
  --gold: #ffc62e;
  --pink: #ff5c7a;
  --panel: rgba(255, 255, 255, 0.94);
  --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);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: #2b1a3d; color: var(--ink); font-family: 'Fredoka', 'Jua', system-ui, sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
html:lang(ko) body, html:lang(ja) body { font-family: 'Fredoka', 'Jua', system-ui, sans-serif; }
#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; }
.coin-ic { width: 26px; height: 16px; background: linear-gradient(180deg, #fff1b0, #ffc62e 55%, #d98b00); -webkit-mask: var(--bone) center/contain no-repeat; mask: var(--bone) center/contain no-repeat; }
.card-ic { width: 18px; height: 23px; border-radius: 5px; background: linear-gradient(135deg, #ffe58a, #ffb800); box-shadow: inset 0 0 0 3px #fff7d6, 0 2px 0 rgba(0,0,0,.15); }
.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; transform: rotate(0deg); 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-x { width: 18px; height: 18px; background: linear-gradient(45deg, transparent 42%, currentColor 42% 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, currentColor 42% 58%, transparent 58%); }
.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%); }

/* 버튼 */
.big-btn { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 220px; height: 70px; 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; }
.mid-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; min-width: 52px; padding: 0 18px; 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 { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.9); box-shadow: 0 4px 0 rgba(7,19,29,.15); }
@keyframes pulse { 50% { transform: scale(1.04); } }

/* 화면 */
.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: 18px; }

#menu { justify-content: space-between; padding: calc(28px + var(--safe-t)) 16px calc(26px + 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; }
.logo-img { width: min(78vw, 460px); 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; font-style: italic; letter-spacing: -1px; }
.logo span { font-size: clamp(64px, 18vw, 120px); color: var(--cream); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 5px 6px 0 var(--cyan), 7px 9px 0 var(--ink); transform: skew(-8deg); }
.logo span + span { color: #fff; }
@keyframes drop { from { transform: translateY(-60px) scale(.8); opacity: 0; } }
.best-m { margin-top: 10px; 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; }
.menu-bottom { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.studio { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 999px; background: var(--ink); color: var(--cream); font-weight: 700; font-size: 14px; letter-spacing: 1px; box-shadow: 0 4px 12px rgba(7,19,29,.3); }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { position: absolute; }
#btnPause { left: 14px; top: calc(14px + var(--safe-t)); pointer-events: auto; }
#score { left: 50%; top: calc(10px + var(--safe-t)); transform: translateX(-50%); font-size: 40px; font-weight: 700; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 rgba(7,19,29,.35); font-variant-numeric: tabular-nums; }
#stats { right: 14px; top: calc(14px + var(--safe-t)); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.pill { display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 999px; background: rgba(7,19,29,.55); color: #fff; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
#powers { left: 14px; top: calc(72px + var(--safe-t)); display: flex; flex-direction: column; gap: 8px; }
.pw { position: relative; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-style: normal; font-weight: 700; color: #fff; overflow: hidden; background: rgba(7,19,29,.55); }
.pw::after { content: ''; position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--p) * 100%); background: var(--gold); }
.pw.magnet::before { content: ''; width: 22px; height: 22px; border: 6px solid #ff3b5c; border-top: 0; border-radius: 0 0 14px 14px; }
.pw.double { background: rgba(124, 58, 237, .8); font-size: 18px; }

/* 결과 */
#over { justify-content: flex-end; padding: calc(12px + var(--safe-t)) 16px calc(12px + var(--safe-b)); overflow-y: auto; }
.panel { width: min(100%, 400px); background: var(--panel); border-radius: 28px; padding: 22px 20px 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: var(--shadow); animation: pop .45s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.lbl { font-size: 16px; font-weight: 600; opacity: .55; letter-spacing: 2px; }
.big-num { font-size: 60px; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.badge { padding: 4px 14px; border-radius: 999px; background: linear-gradient(90deg, #ff5c7a, #ffb13b); color: #fff; font-weight: 700; letter-spacing: 2px; animation: pulse 1s infinite; }
.mini { display: flex; gap: 22px; font-size: 20px; }
.mini span { display: flex; align-items: center; gap: 6px; }
.run-cards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.run-cards a { position: relative; width: 52px; height: 52px; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 3px #ffc62e, 0 4px 10px rgba(0,0,0,.2); }
.run-cards a img { width: 100%; height: 100%; object-fit: cover; }
.run-cards a.new::after { content: 'NEW'; position: absolute; right: -2px; top: -2px; font-size: 9px; font-weight: 700; background: var(--pink); color: #fff; padding: 1px 4px; border-radius: 6px; }
.feat-lbl { margin-top: 4px; font-size: 13px; font-weight: 700; letter-spacing: 2px; opacity: .5; }
.feature { width: 100%; border-radius: 18px; overflow: hidden; position: relative; display: block; aspect-ratio: 16/9; box-shadow: 0 6px 16px rgba(7,19,29,.2); }
.feature > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature div { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: linear-gradient(transparent, rgba(7,19,29,.85)); color: #fff; }
.feature .fi { width: 36px; height: 36px; border-radius: 10px; }
.feature b { flex: 1; font-size: 16px; text-align: left; }
.feature span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #ff7a1a; font-size: 14px; }

#nogl { display: none; }
body.nogl #nogl { display: grid; position: fixed; inset: 0; place-items: center; font-size: 24px; }
.hub-link { position: absolute; left: 14px; top: calc(14px + var(--safe-t)); }
.i-grid { width: 20px; height: 20px; background: radial-gradient(circle, currentColor 0 3.5px, transparent 4px) 0 0 / 10px 10px; }
.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; }
.chal-m { margin-top: 8px; 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; }
.rank { padding: 6px 18px; border-radius: 999px; color: #fff; font-family: 'Jua', 'Fredoka', sans-serif; font-size: 20px; box-shadow: 0 3px 0 rgba(0,0,0,.15); }
.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: 230px; border-radius: 16px; box-shadow: 0 6px 18px rgba(7,19,29,.25); cursor: pointer; }
.share-big { background: linear-gradient(180deg, #4fd2ff, #1f8cf0); box-shadow: 0 7px 0 #135ea8, 0 14px 28px rgba(19,94,168,.35); }
.share-big:active { box-shadow: 0 2px 0 #135ea8; }
#toast { position: fixed; left: 50%; bottom: calc(30px + var(--safe-b)); top: auto; 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); }
.best-m .sep { width: 1px; height: 16px; background: rgba(255,255,255,.4); }
body.loading #btnPlay { opacity: .6; animation: none; }
#over .row { gap: 8px; flex-wrap: nowrap; }
#over .row .mid-btn { height: 48px; min-width: 48px; padding: 0 13px; font-size: 17px; }
#over .row .mid-btn { white-space: nowrap; }
@media (max-height: 760px) { #over .panel { gap: 8px; padding: 16px 16px 14px; } #over .big-num { font-size: 48px; } #over .over-card { max-width: 170px; } }
@media (max-height: 640px) { #over .over-card { max-width: 120px; } }
@media (max-width: 400px) { #over .row { gap: 6px; } #over .row .mid-btn { padding: 0 10px; font-size: 16px; } }
.hub-link, #btnPause { width: 54px !important; height: 54px !important; border-radius: 16px !important; top: calc(16px + env(safe-area-inset-top, 0px)) !important; left: calc(14px + env(safe-area-inset-left, 0px)) !important; z-index: 20 !important; touch-action: manipulation; }
.hub-link::before, #btnPause::before { content: ''; position: absolute; inset: -14px; }
.hub-link .i-grid { transform: scale(1.15); }
.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%); vertical-align: -3px; margin-right: 2px; }
@keyframes popUp { 0% { transform: translate(-50%, 10px) scale(.6); opacity: 0; } 20% { transform: translate(-50%, -10px) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -70px) scale(1); opacity: 0; } }
.pop small { font-size: 20px; color: #ffe14d; margin-left: 6px; }
.pop { position: absolute; left: 0; top: 0; transform: translate(-50%, 0); font-size: 30px; font-weight: 700; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; white-space: nowrap; animation: popUp .9s ease-out forwards; }

/* ---------- KEKE BOWL ---------- */
#btnMenuHud { position: absolute; left: calc(78px + env(safe-area-inset-left, 0px)); top: calc(16px + var(--safe-t)); width: 54px; height: 54px; border-radius: 16px; pointer-events: auto; z-index: 20; touch-action: manipulation; }
#btnMenuHud::before { content: ''; position: absolute; inset: -10px; }
#touchzone { position: absolute; inset: 0; pointer-events: auto; z-index: 1; touch-action: none; }
#hud button { z-index: 20; }
#trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
#trail polyline { fill: none; stroke: rgba(255,255,255,.85); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(7,19,29,.4)); }
#trail circle { fill: rgba(255,255,255,.35); stroke: #fff; stroke-width: 3; }
#trail.curve polyline { stroke: #ffe14d; }

#board { left: 50%; top: calc(82px + var(--safe-t)); transform: translateX(-50%); display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(7,19,29,.55); }
.fr { width: 31px; height: 38px; border-radius: 7px; background: rgba(255,255,255,.92); display: flex; flex-direction: column; overflow: hidden; font-variant-numeric: tabular-nums; }
.fr.f10 { width: 42px; }
.fr .mk { display: flex; justify-content: flex-end; height: 17px; font-size: 12px; font-weight: 700; line-height: 17px; }
.fr .mk span { flex: 1; text-align: center; max-width: 14px; }
.fr .mk span + span { box-shadow: -1px 0 0 rgba(7,19,29,.15); }
.fr .mk .x { color: #ff4d6d; } .fr .mk .s { color: #1f8cf0; }
.fr b { flex: 1; font-size: 15px; text-align: center; line-height: 19px; border-top: 1px solid rgba(7,19,29,.12); }
.fr.cur { background: #fff3b0; box-shadow: inset 0 0 0 2px #ffb13b; }
.fr.done b { color: var(--ink); }
#score { left: 50%; top: calc(128px + var(--safe-t)); transform: translateX(-50%); font-size: 40px; font-weight: 700; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 rgba(7,19,29,.35); font-variant-numeric: tabular-nums; line-height: 1.1; }
#score.bump { animation: sbump .3s ease-out; }
@keyframes sbump { 40% { transform: translateX(-50%) scale(1.25); } }
#rack { right: calc(14px + env(safe-area-inset-right, 0px)); top: calc(16px + var(--safe-t)); width: 58px; height: 52px; }
#rack i { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(7,19,29,.5); transition: .25s; }
#rack i.down { background: rgba(255,255,255,.18); box-shadow: none; transform: scale(.8); }
#rack i.gold { background: radial-gradient(circle at 35% 35%, #fff6c8, #ffc62e 60%, #c98a00); }
#swipeHint { left: 50%; bottom: calc(14% + var(--safe-b)); width: 80px; height: 180px; margin-left: -40px; z-index: 3; pointer-events: none; }
#swipeHint::before { content: ''; position: absolute; left: 50%; bottom: 0; width: 10px; height: 100%; margin-left: -5px; border-radius: 5px; background: linear-gradient(0deg, rgba(255,255,255,.7), rgba(255,255,255,0)); }
#swipeHint i { position: absolute; left: 50%; bottom: 0; width: 44px; height: 44px; margin-left: -22px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 8px rgba(255,255,255,.35), 0 4px 12px rgba(7,19,29,.35); animation: swipe 1.4s ease-in-out infinite; }
@keyframes swipe { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 75% { transform: translateY(-130px); opacity: 1; } 100% { transform: translateY(-140px); opacity: 0; } }

#pops { position: fixed; left: 50%; top: 27%; width: 0; height: 0; z-index: 6; pointer-events: none; }
.pop.big { font-family: 'Jua', 'Fredoka', sans-serif; font-size: 72px; color: #ffe14d; -webkit-text-stroke: 4px var(--ink); animation: popBig 1.6s cubic-bezier(.2,1.4,.4,1) forwards; }
.pop.spare { font-family: 'Jua', 'Fredoka', sans-serif; font-size: 58px; color: #8ff3ff; -webkit-text-stroke: 3px var(--ink); animation: popBig 1.3s cubic-bezier(.2,1.4,.4,1) forwards; }
.pop.num { font-size: 56px; }
.pop.gold { color: #ffd23f; font-size: 34px; top: 70px; }
.pop.miss { color: #c9d3e0; font-size: 44px; }
@keyframes popBig { 0% { transform: translate(-50%, 0) scale(.2) rotate(-12deg); opacity: 0; } 18% { transform: translate(-50%, 0) scale(1.15) rotate(3deg); opacity: 1; } 30% { transform: translate(-50%, 0) scale(1) rotate(0); } 80% { opacity: 1; } 100% { transform: translate(-50%, -40px) scale(1); opacity: 0; } }
#banner { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%); z-index: 7; pointer-events: none; opacity: 0; font-family: 'Jua', 'Fredoka', sans-serif; font-size: 60px; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; white-space: nowrap; display: flex; flex-direction: column; align-items: center; line-height: 1; }
#banner small { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 26px; color: #ffe14d; -webkit-text-stroke: 2px var(--ink); }
#banner.show { animation: banner 2s ease-out forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(.9); } }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 8; }
#flash.on { animation: flash .6s ease-out; }
@keyframes flash { 0% { opacity: 0; } 25% { opacity: .55; } 100% { opacity: 0; } }

.i-strike { width: 20px; height: 20px; background: linear-gradient(45deg, transparent 38%, #ff4d6d 38% 62%, transparent 62%), linear-gradient(-45deg, transparent 38%, #ff4d6d 38% 62%, transparent 62%); }
.i-spare { width: 20px; height: 20px; background: linear-gradient(135deg, #1f8cf0 50%, transparent 50%); border-radius: 3px; box-shadow: inset 0 0 0 2px #1f8cf0; }
.i-gold { width: 12px; height: 26px; background: radial-gradient(circle at 40% 35%, #fff6c8, #ffc62e 60%, #c98a00); clip-path: path('M6 0 C9 0 9.5 3 8.5 6 C8 8 7.5 9 9 12 C12 16 12 22 9 26 L3 26 C0 22 0 16 3 12 C4.5 9 4 8 3.5 6 C2.5 3 3 0 6 0 Z'); }
.best-m .i-strike { margin-left: 2px; }
.mini { gap: 16px; }
@media (min-width: 600px) { #board { top: calc(14px + var(--safe-t)); } #score { top: calc(60px + var(--safe-t)); } }
@media (max-height: 520px) {
  #board { transform: translateX(-50%) scale(.86); transform-origin: 50% 0; }
  #score { top: calc(52px + var(--safe-t)); font-size: 32px; }
  #swipeHint { height: 120px; }
  .pop.big { font-size: 56px; }
}
@media (max-width: 370px) { #board { transform: translateX(-50%) scale(.9); transform-origin: 50% 0; } }
/* 낮은 가로 화면: 결과 패널을 두 줄로 */
@media (max-height: 500px) and (min-width: 600px) {
  #over { justify-content: center; }
  #over .panel { width: min(100%, 720px); flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px 14px; padding: 12px; }
  #over .big-num { font-size: 44px; }
  #over .over-card { max-width: 110px; }
  #menu { padding-top: calc(10px + var(--safe-t)); padding-bottom: calc(10px + var(--safe-b)); }
  .logo-img { width: min(40vw, 300px); }
  .menu-bottom { gap: 8px; }
}

/* ---------- 모드·미션·레인·공 ---------- */
.i-cal { position: relative; width: 26px; height: 26px; border-radius: 6px; background: #fff; box-shadow: inset 0 7px 0 #ff4d6d, 0 0 0 2px rgba(7,19,29,.15); display: grid; place-items: center; font-style: normal; }
.i-cal b { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.i-lock { width: 16px; height: 18px; background: radial-gradient(circle at 50% 30%, transparent 4px, currentColor 4.5px 6.5px, transparent 7px) 0 -3px / 16px 14px no-repeat, linear-gradient(currentColor, currentColor) 0 8px / 16px 10px no-repeat; border-radius: 3px; opacity: .7; }
.i-lane { width: 22px; height: 22px; background: linear-gradient(90deg, #ff8a5c 0 18%, #f7d9a8 18% 82%, #ff8a5c 82%); clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }
.i-ballic { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #8ff3ff, #0fa6c4 55%, #075a70); }
.g-pin { width: 10px; height: 24px; background: #fff; clip-path: path('M5 0 C8 0 8.5 3 7.5 6 C7 8 6.5 9 8 12 C11 16 11 21 8 24 L2 24 C-1 21 -1 16 2 12 C3.5 9 3 8 2.5 6 C1.5 3 2 0 5 0 Z'); filter: drop-shadow(0 0 1px rgba(7,19,29,.6)); }
.g-pin.keep { background: #3dff8a; }
.g-ball { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.35); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.g-ball.on { background: radial-gradient(circle at 35% 30%, #8ff3ff, #0fa6c4 55%, #075a70); box-shadow: none; }
.g-arrow { width: 14px; height: 10px; background: currentColor; clip-path: polygon(0 35%, 60% 35%, 60% 0, 100% 50%, 60% 100%, 60% 65%, 0 65%); opacity: .7; }
.gx { color: #ff4d6d; font-size: 1.2em; }
.goal { display: flex; align-items: center; gap: 10px; }
.goal-g, .goal-s { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }

.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, 380px); }
.mode-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 6px; border-radius: 18px; background: #fff; box-shadow: 0 5px 0 rgba(7,19,29,.18), 0 8px 18px rgba(7,19,29,.12); min-height: 74px; }
.mode-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(7,19,29,.18); }
.mode-btn small { font-size: 12px; font-weight: 700; opacity: .7; white-space: nowrap; font-family: 'Jua', 'Fredoka', sans-serif; }
.mb-ic { width: 40px; height: 32px; display: grid; place-items: center; }
.mb-ic .i-flag { transform: scale(1.3); }
.mb-ic.thumb { width: 52px; height: 32px; border-radius: 8px; background: center/cover no-repeat; box-shadow: inset 0 0 0 2px rgba(7,19,29,.12); }
.mb-ic.thumb.round { width: 34px; height: 34px; border-radius: 50%; background-size: cover; box-shadow: 0 2px 4px rgba(7,19,29,.3); }
.mb-v { position: absolute; top: 4px; right: 6px; display: flex; align-items: center; gap: 1px; font-size: 12px; }
.mb-v .i-star { width: 14px; height: 14px; }
#btnDaily.new::after { content: ''; position: absolute; top: 6px; right: 8px; width: 11px; height: 11px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 0 2px #fff; animation: pulse 1s infinite; }
.best-m .coin-ic { width: 24px; height: 15px; }

/* HUD: 미션·매일 도전 */
#mhud { left: 50%; top: calc(82px + var(--safe-t)); transform: translateX(-50%); display: none; align-items: center; gap: 12px; padding: 6px 14px; border-radius: 999px; background: rgba(7,19,29,.6); color: #fff; font-size: 20px; white-space: nowrap; }
body[data-mode="mission"] #mhud, body[data-mode="daily"] #mhud { display: flex; }
body[data-mode="mission"] #board, body[data-mode="daily"] #board, body[data-mode="mission"] #score, body[data-mode="daily"] #score { display: none; }
#mhudN { display: flex; align-items: center; gap: 4px; font-weight: 700; }
#mhudS { display: flex; gap: 4px; }
#mhudG .goal-s { display: none; }
#mhudG .dsc { font-size: 26px; color: #ffe14d; }
#mhudG.bump { animation: sbump2 .3s ease-out; }
@keyframes sbump2 { 40% { transform: scale(1.2); } }
#rack i.keep { box-shadow: 0 0 0 2px #3dff8a, 0 1px 2px rgba(7,19,29,.5); }
#rack i[hidden] { display: none; }
@media (min-width: 600px) { #mhud { top: calc(14px + var(--safe-t)); } }

/* 미션 결과 */
#mres .panel { gap: 14px; }
.mres-h { display: flex; align-items: center; gap: 8px; font-size: 34px; font-weight: 700; }
.mres-h .i-flag { transform: scale(1.4); margin-right: 6px; }
.mres-h .i-cal { transform: scale(1.4); margin-right: 8px; }
.stars { display: flex; gap: 10px; }
.stars:empty { display: none; }
.stars i { width: 56px; height: 56px; 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 i.on { background: linear-gradient(180deg, #fff1b0, #ffc62e); animation: starIn .5s cubic-bezier(.2,1.6,.4,1) both; }
.stars i.on:nth-child(2) { animation-delay: .15s; } .stars i.on:nth-child(3) { animation-delay: .3s; }
@keyframes starIn { from { transform: scale(0) rotate(-40deg); } }
#mres .goal { font-size: 22px; color: var(--ink); }
#mres.lose .mres-h { opacity: .6; }
.coin-got { display: flex; align-items: center; gap: 6px; font-size: 22px; font-weight: 700; color: #c98a00; }
.coin-got:empty { display: none; }
.big-btn.small { min-width: 120px; height: 60px; font-size: 24px; padding: 0 26px; }

/* 고르기 창 */
.sheet { width: min(100% - 24px, 560px); max-height: min(88vh, 760px); background: var(--panel); border-radius: 26px; padding: 14px; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .35s cubic-bezier(.2,1.5,.4,1) both; }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 0 4px 12px; font-size: 22px; }
.sheet-h b { flex: 1; display: flex; align-items: center; gap: 8px; font-family: 'Jua', 'Fredoka', sans-serif; font-weight: 400; }
.sheet-h b small { display: inline-flex; align-items: center; gap: 3px; font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 16px; opacity: .65; margin-left: 4px; }
.sheet-h .coins { display: flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 999px; background: #fff3c4; font-weight: 700; font-size: 18px; color: #a86f00; }
.sgrid { flex: 1; min-height: 0; align-content: start; display: grid; gap: 10px; overflow-y: auto; padding: 4px; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.sgrid.mis { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.sgrid.lane { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sgrid.ball { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.mt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 16px; background: #fff; box-shadow: inset 0 4px 0 var(--tc), 0 3px 0 rgba(7,19,29,.12); }
.mt-n { font-size: 24px; font-weight: 700; line-height: 1; }
.mt-th { position: absolute; top: 6px; left: 8px; font-size: 15px; }
.mt-g { font-size: 15px; min-height: 24px; display: flex; align-items: center; }
.mt-g .goal-s { font-size: 12px; opacity: .6; margin-left: 4px; }
.mt-g .g-pin { filter: drop-shadow(0 0 1px rgba(7,19,29,.8)); }
.mt-s { display: flex; gap: 2px; }
.mt-s i { width: 16px; height: 16px; 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%); }
.mt-s i.on { background: #ffc62e; }
.mt.lock { opacity: .45; }
.lt { position: relative; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 3px 0 rgba(7,19,29,.12); text-align: left; }
.lt-img { flex: none; display: block; aspect-ratio: 16/9; background: center/cover no-repeat; }
.lt-n { flex: none; line-height: 1.3; padding: 6px 10px 8px; font-family: 'Jua', 'Fredoka', sans-serif; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-need { position: absolute; inset: 0 0 34px; display: flex; align-items: center; justify-content: center; gap: 4px; background: rgba(7,19,29,.55); color: #fff; font-weight: 700; font-size: 18px; }
.lt-need .i-lock { opacity: 1; margin-right: 4px; }
.lt.sel, .bt.sel { box-shadow: 0 0 0 4px #ffc62e, 0 3px 0 rgba(7,19,29,.12); }
.lt.lock .lt-img { filter: grayscale(.7); }
.bt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border-radius: 16px; background: #fff; box-shadow: 0 3px 0 rgba(7,19,29,.12); }
.bt-img { width: 64px; height: 64px; border-radius: 50%; background: center/cover no-repeat; box-shadow: 0 4px 8px rgba(7,19,29,.3); }
.bt-n { font-family: 'Jua', 'Fredoka', sans-serif; font-size: 15px; text-align: center; line-height: 1.15; }
.bt-p { display: flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: #fff3c4; color: #a86f00; font-weight: 700; }
.bt.poor .bt-p { background: #eef0f4; color: #8d99a6; }
.bt.poor .bt-img { filter: grayscale(.6); opacity: .7; }
.bt.shake { animation: shakeX .35s; }
@keyframes shakeX { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* 연속 스트라이크 컷인 */
#cutin { position: fixed; left: 0; right: 0; top: 46%; height: 128px; margin-top: -64px; z-index: 9; pointer-events: none; display: flex; align-items: center; justify-content: center; gap: 14px; opacity: 0; background: linear-gradient(90deg, rgba(255,92,122,0), #ff5c7a 12%, #ffb13b 50%, #ff5c7a 88%, rgba(255,92,122,0)); transform: skewY(-6deg); }
#cutin img { width: 116px; height: 116px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 6px 18px rgba(7,19,29,.35); }
#cutin b { font-family: 'Jua', 'Fredoka', sans-serif; font-size: 64px; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; white-space: nowrap; }
#cutin small { position: absolute; right: 12%; bottom: 6px; font-size: 26px; font-weight: 700; color: #ffe14d; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
#cutin.show { animation: cutin 1.7s cubic-bezier(.2,1,.3,1) forwards; }
#cutin.show img { animation: cutImg 1.7s cubic-bezier(.2,1.3,.4,1) forwards; }
#cutin.show b { animation: cutTxt 1.7s cubic-bezier(.2,1.3,.4,1) forwards; }
@keyframes cutin { 0% { opacity: 0; transform: skewY(-6deg) scaleY(0); } 10% { opacity: 1; transform: skewY(-6deg) scaleY(1); } 82% { opacity: 1; transform: skewY(-6deg) scaleY(1); } 100% { opacity: 0; transform: skewY(-6deg) scaleY(0); } }
@keyframes cutImg { 0% { transform: translateX(-60vw) rotate(-30deg); } 25% { transform: translateX(0) rotate(0); } 85% { transform: translateX(10px); } 100% { transform: translateX(60vw); } }
@keyframes cutTxt { 0% { transform: translateX(60vw) scale(1.4); } 25% { transform: translateX(0) scale(1); } 85% { transform: translateX(-10px); } 100% { transform: translateX(-60vw); } }
@media (max-width: 420px) { #cutin b { font-size: 44px; } #cutin img { width: 90px; height: 90px; } }
@media (max-height: 640px) { .modes { gap: 6px; } .mode-btn { min-height: 60px; padding: 5px 4px 4px; } .mb-ic { height: 26px; } }
@media (max-height: 500px) and (min-width: 600px) { .modes { width: min(100%, 460px); } .mode-btn small { display: none; } .mode-btn { min-height: 48px; } #mres .panel { flex-direction: column; flex-wrap: nowrap; } .stars i { width: 42px; height: 42px; } }
.g-pin { filter: drop-shadow(0 0 1.2px #07131d) drop-shadow(0 0 .6px #07131d); }
@media (max-height: 500px) and (min-width: 600px) {
  #hofMenu { display: none !important; }
  .logo-img { width: min(30vw, 240px); }
  .best-m { margin-top: 4px; }
  #menu .row { display: none; }
  .modes { width: min(100%, 420px); }
}
/* 공용 시범 화살표: 애니메이션의 transform 이 회전(인라인 rotate)을 덮어 가로로만 보이던 것 → scale 속성으로 늘려 회전 유지 */
.kc-trail { animation-name: kcTrailRot !important; }
@keyframes kcTrailRot { 0%, 15% { opacity: 0; scale: 0 1; } 30% { opacity: 1; } 70% { opacity: .9; scale: 1 1; } 100% { opacity: 0; scale: 1 1; } }
