: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; background: #3aa8ff; 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; }

/* 카드 모음 */
.sheet { width: min(100% - 32px, 520px); max-height: min(86vh, 720px); background: var(--panel); border-radius: 26px; padding: 16px; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .35s cubic-bezier(.2,1.5,.4,1) both; }
.sheet-h { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 12px; font-size: 22px; }
.sheet-h b { display: flex; align-items: center; gap: 8px; }
#grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; overflow-y: auto; padding: 4px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 16px; background: #f2f4f8; font-size: 12px; font-weight: 600; text-align: center; line-height: 1.2; }
.slot img { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; }
.slot.got { background: linear-gradient(180deg, #fff5d1, #ffe08a); box-shadow: 0 0 0 2px #ffc62e; }
.slot.lock img { filter: brightness(0) opacity(.25); }
.slot.lock span { opacity: .4; font-size: 18px; }

/* 토스트 */
#toast { position: fixed; left: 50%; top: calc(84px + var(--safe-t)); transform: translate(-50%, -30px) scale(.8); opacity: 0; display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 0 0 3px #ffc62e, var(--shadow); z-index: 20; pointer-events: none; transition: .35s cubic-bezier(.2,1.6,.4,1); max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#toast img { width: 56px; height: 56px; border-radius: 14px; }
#toast b { display: block; font-size: 17px; }
#toast em { font-style: normal; font-weight: 700; font-size: 13px; color: #fff; background: var(--pink); padding: 2px 8px; border-radius: 8px; }
#toast em.dup { background: #ffb13b; }

/* 조작 힌트 */
#hint { position: fixed; left: 50%; bottom: calc(18% + var(--safe-b)); transform: translateX(-50%); display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 6px; z-index: 6; pointer-events: none; animation: fade 3.2s both; }
.sw { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.85); position: relative; }
.sw::after { content: ''; position: absolute; left: 50%; top: 50%; border: 12px solid transparent; }
.sw.l { grid-area: 2/1; } .sw.r { grid-area: 2/3; } .sw.u { grid-area: 1/2; } .sw.d { grid-area: 2/2; }
.sw.l::after { border-right: 16px solid var(--ink); transform: translate(-75%, -50%); }
.sw.r::after { border-left: 16px solid var(--ink); transform: translate(-25%, -50%); }
.sw.u::after { border-bottom: 16px solid var(--ink); transform: translate(-50%, -75%); }
.sw.d::after { border-top: 16px solid var(--ink); transform: translate(-50%, -25%); }
@keyframes fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

#count { position: fixed; inset: 0; display: grid; place-items: center; font-size: 120px; font-weight: 700; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; z-index: 30; pointer-events: none; }
#nogl { display: none; }
body.nogl #nogl { display: grid; position: fixed; inset: 0; place-items: center; font-size: 24px; }

@media (min-height: 900px) { .big-btn { height: 78px; } }
@media (max-height: 640px) { .logo span { font-size: 60px; } .big-btn { height: 60px; font-size: 26px; } .menu-bottom { gap: 12px; } .big-num { font-size: 48px; } .feature { aspect-ratio: 21/9; } }

/* 보너스·위험·부활·상점 */
#streak { left: 50%; top: calc(58px + var(--safe-t)); transform: translateX(-50%); font-size: 22px; font-weight: 700; color: #ffe14d; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
#pops { left: 50%; top: 42%; width: 0; height: 0; }
.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; }
.pop small { font-size: 20px; color: #ffe14d; margin-left: 6px; }
@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; } }
#hud::before { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 90px 20px rgba(255, 40, 70, .55); opacity: 0; transition: opacity .2s; }
#hud.danger::before { opacity: 1; animation: blink .5s infinite alternate; }
@keyframes blink { to { opacity: .35; } }
.pw.rocket::before { content: ''; width: 14px; height: 26px; border-radius: 7px 7px 3px 3px; background: linear-gradient(#ff4d4d 0 35%, #fff 35%); box-shadow: 0 6px 0 -2px #ff9a3c; }
.pw.rocket { background: rgba(255, 122, 26, .8); }
.i-up { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 10px solid #2bc46a; }
.i-heart { width: 44px; height: 40px; background: #ff4d6d; clip-path: path('M22 40 L4 21 A10 10 0 0 1 22 7 A10 10 0 0 1 40 21 Z'); }
.revive-btn { position: relative; width: 170px; height: 170px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; box-shadow: var(--shadow); animation: pulse 1s infinite; }
.revive-btn svg { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); transform: rotate(-90deg); }
.revive-btn circle { fill: none; stroke: #ffc62e; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 0; }
#revive.run circle { animation: ring 4s linear forwards; }
@keyframes ring { to { stroke-dashoffset: 289; } }
.revive-btn span { display: flex; align-items: center; gap: 6px; font-size: 24px; font-weight: 700; }
.skip { margin-top: 26px; }
#shopList { display: flex; flex-direction: column; gap: 12px; }
.shop-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 18px; background: #f2f4f8; }
.shop-row .pw { width: 52px; height: 52px; }
.shop-row .pw.magnet { background: rgba(255, 59, 92, .15); }
.shop-row .pw.double { background: rgba(124, 58, 237, .85); }
.pips { flex: 1; display: flex; gap: 5px; }
.pips b { flex: 1; height: 12px; border-radius: 6px; background: #d6dbe6; }
.pips b.on { background: linear-gradient(90deg, #2bc46a, #9be15d); }
.buy { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 14px; background: linear-gradient(180deg, #ffb13b, #ff7a1a); color: #fff; font-weight: 700; font-size: 17px; box-shadow: 0 4px 0 #c4520a; }
.buy.no { filter: grayscale(1); opacity: .5; }
.max { font-weight: 700; color: #2bc46a; padding: 0 10px; }
.gift-ic { width: 20px; height: 20px; border-radius: 5px; background: linear-gradient(90deg, transparent 40%, #ffc62e 40% 60%, transparent 60%), linear-gradient(180deg, #ffc62e 0 26%, transparent 26%), #35c7ff; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.pop .coin-ic { width: 26px; height: 16px; margin-left: 6px; vertical-align: middle; }

.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; }
.i-down { width: 18px; height: 20px; background: currentColor; clip-path: polygon(35% 0, 65% 0, 65% 45%, 90% 45%, 50% 85%, 10% 45%, 35% 45%, 35% 0, 0 100%, 0 88%, 100% 88%, 100% 100%, 0 100%); }
.i-link { width: 22px; height: 12px; border: 3.5px solid currentColor; border-radius: 8px; position: relative; }
.i-link::after { content: ''; position: absolute; left: 4px; right: 4px; top: 50%; height: 3px; margin-top: -1.5px; background: currentColor; }
.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; }
#target { left: 50%; top: calc(88px + var(--safe-t)); transform: translateX(-50%); width: min(60vw, 260px); height: 14px; border-radius: 7px; background: rgba(7,19,29,.45); overflow: visible; }
#target span { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p, 0) * 100%); border-radius: 7px; background: linear-gradient(90deg, #ffb13b, #ff5c7a); }
#target .i-flag { position: absolute; right: -6px; top: -16px; }
#target.done span { background: linear-gradient(90deg, #2bc46a, #9be15d); }
.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; }
.share-sheet { align-items: center; gap: 14px; width: min(100% - 32px, 400px); }
.share-sheet .sheet-h { width: 100%; padding-bottom: 0; }
#shareImg { width: 100%; max-height: 52vh; object-fit: contain; border-radius: 18px; box-shadow: 0 6px 18px rgba(7,19,29,.2); }
#shareImg:not([src]) { display: none; }
.mid-btn.hot { background: linear-gradient(180deg, #ffb13b, #ff7a1a); color: #fff; box-shadow: 0 5px 0 #c4520a; min-width: 90px; }
#shareCopy.ok { background: #2bc46a; color: #fff; }


/* ===== KEKE KART =====' */
.best-m .sep { width: 1px; height: 16px; background: rgba(255,255,255,.4); }
.keys { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
kbd { font-family: inherit; font-size: 13px; font-weight: 700; padding: 4px 9px; border-radius: 8px; background: rgba(255,255,255,.9); box-shadow: 0 3px 0 rgba(7,19,29,.25); }
body.mobile .pc-only { display: none; }
/* 터치 조작 */
#touchzone { position: absolute; inset: 0; pointer-events: auto; display: none; }
body.mobile #touchzone { display: block; }
#stick { position: absolute; left: calc(96px + env(safe-area-inset-left, 0px)); top: calc(100% - 120px - var(--safe-b)); width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%; background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 3px rgba(255,255,255,.5), 0 4px 16px rgba(7,19,29,.25); display: none; pointer-events: none; opacity: .75; }
body.mobile #stick { display: block; }
#stick.on { opacity: 1; }
#knob { position: absolute; left: 37px; top: 37px; width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 3px 8px rgba(7,19,29,.3); }
#stick::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.35); }
.up-dmg::after { content: '⚔'; color: #ff4d6d; } .up-rate::after { content: '≫'; color: #ff7a1a; } .up-mag::after { content: '▤'; color: #1fa8f0; }
.up-reload::after { content: '↻'; color: #2bc46a; } .up-hp::after { content: '♥'; color: #ff4d6d; } .up-speed::after { content: '➤'; color: #2fd6ee; }
.up-crit::after { content: '◎'; color: #ff3b6b; } .up-vamp::after { content: '🦴'; } .up-splash::after { content: '✺'; color: #2fd6ee; }
.up-pierce::after { content: '➶'; color: #7a5cff; } .up-regen::after { content: '✚'; color: #2bc46a; }
#toast { top: auto; bottom: calc(30px + var(--safe-b)); padding: 10px 18px; font-weight: 700; }
html, body { background: #ff8a3d; }
.screen#menu { background: linear-gradient(180deg, rgba(255,138,61,.05), rgba(42,20,10,.35)); }
.best-m .sep { width: 1px; height: 16px; background: rgba(255,255,255,.4); }

/* 아이콘 (카트) */
.i-clock { width: 18px; height: 18px; border-radius: 50%; border: 3px solid currentColor; position: relative; }
.i-clock::before { content: ''; position: absolute; left: 50%; top: 2px; width: 2.5px; height: 6px; margin-left: -1.25px; background: currentColor; border-radius: 2px; }
.i-clock::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 2.5px; margin-top: -1px; background: currentColor; border-radius: 2px; }
.best-m .i-clock { color: #fff; }
.i-lap { width: 20px; height: 20px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; position: relative; transform: rotate(-30deg); }
.i-lap::after { content: ''; position: absolute; right: -6px; top: -2px; border: 5px solid transparent; border-top: 7px solid currentColor; transform: rotate(-10deg); }
.i-spark { width: 22px; height: 22px; background: linear-gradient(135deg, #5cd6ff, #9a7bff 50%, #ff7ab0); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.i-next { width: 0; height: 0; border-left: 16px solid currentColor; border-top: 11px solid transparent; border-bottom: 11px solid transparent; position: relative; margin-right: 8px; }
.i-next::after { content: ''; position: absolute; left: 1px; top: -11px; width: 5px; height: 22px; background: currentColor; }
.i-map { width: 22px; height: 18px; background: currentColor; clip-path: polygon(0 10%, 33% 0, 66% 12%, 100% 2%, 100% 90%, 66% 100%, 33% 88%, 0 98%); }
.i-lock { width: 16px; height: 14px; border-radius: 3px; background: currentColor; position: relative; margin-top: 6px; }
.i-lock::before { content: ''; position: absolute; left: 3px; top: -8px; width: 10px; height: 10px; border: 2.5px solid currentColor; border-bottom: 0; border-radius: 7px 7px 0 0; box-sizing: border-box; }
.i-uturn { width: 90px; height: 90px; border-radius: 50%; background: #ff3b6b; position: relative; box-shadow: 0 0 0 6px #fff, 0 8px 20px rgba(0,0,0,.3); }
.i-uturn::before { content: ''; position: absolute; left: 22px; top: 24px; width: 40px; height: 40px; border: 8px solid #fff; border-left-color: transparent; border-bottom-color: transparent; border-radius: 50%; transform: rotate(-45deg); }
.i-uturn::after { content: ''; position: absolute; left: 14px; top: 46px; border: 12px solid transparent; border-top: 16px solid #fff; }
.medal-b { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffffff, #c9d3de 45%, #8e9aa8); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.medal-b.m1 { background: radial-gradient(circle at 35% 30%, #fff6c2, #ffcf3a 45%, #d99a00); }
.medal-b.m3 { background: radial-gradient(circle at 35% 30%, #ffe2c9, #e39a62 45%, #a85f2c); }
.medal-b.m4 { background: #c8ced6; box-shadow: none; opacity: .6; }

/* 코스 선택 */
#tracks { display: flex; gap: 10px; justify-content: center; }
.trk { position: relative; width: 116px; padding: 8px 6px 7px; border-radius: 18px; background: rgba(255,255,255,.9); display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 5px 0 rgba(7,19,29,.2); transition: transform .12s; }
.trk canvas { width: 72px; height: 50px; }
.trk b { font-family: 'Jua', 'Fredoka', sans-serif; font-weight: 400; font-size: 16px; white-space: nowrap; }
.trk small { font-size: 12px; font-weight: 700; opacity: .65; display: flex; gap: 4px; align-items: center; min-height: 15px; }
.trk small .i-clock { width: 12px; height: 12px; border-width: 2px; }
.trk small .i-clock::before { top: 1px; height: 4px; width: 2px; margin-left: -1px; } .trk small .i-clock::after { width: 3px; height: 2px; }
.trk.on { transform: translateY(-4px); box-shadow: 0 0 0 4px var(--gold), 0 8px 0 rgba(7,19,29,.2); background: #fff; }
.trk.lock { opacity: .7; }
.trk.lock canvas { filter: grayscale(1) opacity(.5); }
.trk .lk { position: absolute; inset: 0; display: grid; place-items: center; color: #07131d; pointer-events: none; }
.trk .lk .i-lock { transform: scale(1.6); }
.trk .md { position: absolute; right: 6px; top: 6px; width: 18px; height: 18px; }
.trk.pop { animation: unlock .8s ease-out 2; }
@keyframes unlock { 50% { transform: translateY(-8px) scale(1.06); box-shadow: 0 0 0 6px #5ce07a, 0 8px 0 rgba(7,19,29,.2); } }
.keys { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.menu-bottom .keys { margin-bottom: -6px; }

/* HUD */
#hud .top { position: absolute; left: 50%; top: calc(8px + var(--safe-t)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0; }
#hud #score { position: static; transform: none; font-size: 34px; color: #fff; -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill; line-height: 1.1; }
#timer { font-size: 18px; font-weight: 700; color: #fff; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; font-variant-numeric: tabular-nums; }
#itemSlot { left: 72px; top: calc(10px + var(--safe-t)); width: 72px; height: 72px; border-radius: 22px; background: rgba(7,19,29,.55); box-shadow: inset 0 0 0 4px rgba(255,255,255,.75), 0 4px 0 rgba(7,19,29,.2); display: grid; place-items: center; }
#itemSlot i { width: 54px; height: 54px; background-size: contain; background-repeat: no-repeat; background-position: center; }
#itemSlot.got { animation: gotItem .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes gotItem { from { transform: scale(1.5); } }
#hud .tr { position: absolute; right: 14px; top: calc(8px + var(--safe-t)); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
#pos { display: flex; align-items: baseline; color: #fff; font-weight: 700; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; line-height: .9; }
#pos b { font-size: 64px; font-style: italic; }
#pos small { font-size: 24px; -webkit-text-stroke: 2px var(--ink); }
#pos.p1 b { color: #ffd23f; } #pos.p2 b { color: #e3ebf3; } #pos.p3 b { color: #ffb47a; }
#pos.bump { animation: posBump .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes posBump { from { transform: scale(1.4); } }
.lap-pill { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(7,19,29,.6); color: #fff; font-size: 20px; font-weight: 700; }
.lap-pill small { font-size: 15px; opacity: .8; }
#mini { position: absolute; left: 14px; bottom: calc(14px + var(--safe-b)); width: 150px; height: 150px; opacity: .92; pointer-events: none; }
#wrong { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); display: none; animation: blink .5s infinite alternate; }
#wrong.show { display: block; }
#drift { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 8px; opacity: 0; transition: opacity .15s; }
#drift.on { opacity: 1; }
#drift i { width: 26px; height: 10px; border-radius: 5px; background: rgba(7,19,29,.45); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
#drift.l1 i:nth-child(1) { background: #4fc3ff; } #drift.l2 i:nth-child(-n+2) { background: #ffa23a; } #drift.l3 i { background: #c46bff; box-shadow: 0 0 10px #c46bff; }
@keyframes blink { to { opacity: .45; } }

/* 아이템 그림 */
.it-missile { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M10 40 L4 52 L18 46Z M24 54 L12 60 L26 58Z' fill='%23ff7a1a'/%3E%3Cg transform='rotate(-40 32 32)'%3E%3Crect x='14' y='26' width='36' height='12' rx='5' fill='%23fff4e0' stroke='%2307131d' stroke-width='3'/%3E%3Ccircle cx='14' cy='26' r='7' fill='%23fff4e0' stroke='%2307131d' stroke-width='3'/%3E%3Ccircle cx='14' cy='38' r='7' fill='%23fff4e0' stroke='%2307131d' stroke-width='3'/%3E%3Ccircle cx='50' cy='26' r='7' fill='%23fff4e0' stroke='%2307131d' stroke-width='3'/%3E%3Ccircle cx='50' cy='38' r='7' fill='%23fff4e0' stroke='%2307131d' stroke-width='3'/%3E%3Crect x='16' y='28' width='32' height='8' fill='%23fff4e0'/%3E%3C/g%3E%3C/svg%3E"); }
.it-banana { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M32 14 C20 30 14 44 8 52 C18 48 26 40 32 30 C38 40 46 48 56 52 C50 44 44 30 32 14Z' fill='%23ffd23f' stroke='%2307131d' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M32 30 C30 42 30 50 32 58 C34 50 34 42 32 30Z' fill='%23ffe98a' stroke='%2307131d' stroke-width='3' stroke-linejoin='round'/%3E%3Crect x='29' y='6' width='6' height='10' rx='2' fill='%237a5a2a'/%3E%3C/svg%3E"); }
.it-magnet { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M12 10 H26 V34 A6 6 0 0 0 38 34 V10 H52 V34 A20 20 0 0 1 12 34Z' fill='%23ff3b5c' stroke='%2307131d' stroke-width='3' stroke-linejoin='round'/%3E%3Crect x='12' y='10' width='14' height='10' fill='%23e8edf3' stroke='%2307131d' stroke-width='3'/%3E%3Crect x='38' y='10' width='14' height='10' fill='%23e8edf3' stroke='%2307131d' stroke-width='3'/%3E%3C/svg%3E"); }
.it-boost { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M36 4 L14 36 H30 L26 60 L50 26 H34Z' fill='%23ffd23f' stroke='%2307131d' stroke-width='3.5' stroke-linejoin='round'/%3E%3C/svg%3E"); }
#itemSlot i, .tbtn.item { background-image: var(--ic, none); }
.tbtn.item.on, .tbtn.item:active { background-color: rgba(255,177,59,.85); }

/* 배너·팝업 */
#banner { position: fixed; left: 50%; top: 32%; transform: translate(-50%, -50%); z-index: 7; pointer-events: none; display: flex; align-items: center; gap: 12px; font-size: 64px; font-weight: 700; font-style: italic; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; opacity: 0; white-space: nowrap; }
#banner.count { font-size: 140px; }
#banner.go { color: #5ce07a; font-size: 130px; }
#banner small { font-size: 40px; }
#banner .i-flag { transform: scale(2.4); margin: 0 18px; }
#banner.show { animation: banner 1.1s ease-out forwards; }
#banner.long { animation-duration: 2.2s; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(.9); } }
#pops { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
#pops .pop { position: absolute; left: 50%; top: 58%; font-size: 30px; font-weight: 700; color: #ffe14d; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; transform: translate(-50%, -50%); animation: popUp 1s ease-out forwards; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
#pops .pop.b2 { color: #ffa23a; } #pops .pop.b3 { color: #d48bff; font-size: 36px; } #pops .pop.hit { color: #ff5c7a; } #pops .pop.lap { color: #5ce07a; top: 46%; font-size: 40px; }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 30% { transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -160%); } }
#speed { position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: 0; background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.55) 0 .6deg, transparent .6deg 7deg); -webkit-mask: radial-gradient(circle at 50% 50%, transparent 32%, #000 75%); mask: radial-gradient(circle at 50% 50%, transparent 32%, #000 75%); transition: opacity .2s; }
#speed.on { opacity: .55; animation: spin 0.25s linear infinite; }
@keyframes spin { to { transform: rotate(4deg); } }
body.shake #c { animation: shake .3s; }
@keyframes shake { 25% { transform: translate(-6px, 3px); } 50% { transform: translate(5px, -4px); } 75% { transform: translate(-3px, 2px); } }

/* 터치 조작 (카트) */
.tbtns { display: none; }
body.mobile .tbtns { display: block; position: absolute; inset: 0; pointer-events: none; }
.tbtn { position: absolute; pointer-events: auto; border-radius: 50%; background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 3px rgba(255,255,255,.6), 0 4px 14px rgba(7,19,29,.25); touch-action: none; }
.tbtn.on, .tbtn:active { background: rgba(255,255,255,.5); }
.tbtn.drift { width: 104px; height: 104px; right: calc(26px + env(safe-area-inset-right, 0px)); bottom: calc(30px + var(--safe-b)); background: rgba(47,214,238,.5); }
.tbtn.drift::after { content: ''; position: absolute; inset: 26px 22px; border-radius: 50%; border: 5px solid #fff; border-left-color: transparent; transform: rotate(20deg); }
.tbtn.drift::before { content: ''; position: absolute; left: 26px; top: 26px; border: 8px solid transparent; border-right: 12px solid #fff; transform: rotate(40deg); }
.tbtn.item { width: 74px; height: 74px; right: calc(140px + env(safe-area-inset-right, 0px)); bottom: calc(40px + var(--safe-b)); background-color: rgba(255,177,59,.55); background-position: center; background-size: 50px; background-repeat: no-repeat; }
.tbtn.item.empty { opacity: .45; }
.tbtn.brake { width: 54px; height: 54px; right: calc(52px + env(safe-area-inset-right, 0px)); bottom: calc(150px + var(--safe-b)); }
.tbtn.brake::after { content: ''; position: absolute; left: 50%; top: 50%; border: 10px solid transparent; border-top: 14px solid #fff; transform: translate(-50%, -25%); }
body.mobile #mini { left: calc(14px + env(safe-area-inset-left, 0px)); bottom: auto; top: calc(84px + var(--safe-t)); width: 100px; height: 100px; }
body.mobile #drift { bottom: calc(14px + var(--safe-b)); }
body.mobile #itemSlot { width: 60px; height: 60px; left: 68px; }
body.mobile #itemSlot i { width: 44px; height: 44px; }

/* 결과 (카트) */
.mini small { font-size: 13px; opacity: .6; }
.parts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.parts span { display: flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: #eef1f6; font-weight: 700; font-size: 15px; }
.parts span:empty { display: none; }
.parts #ptMult { background: var(--ink); color: var(--gold); }
#standings { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
#standings li { display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 10px; background: #f2f4f8; font-size: 14px; }
#standings li.me { background: linear-gradient(90deg, #fff3c4, #ffe58a); box-shadow: inset 0 0 0 2px #ffcf3a; }
#standings li b { width: 16px; text-align: center; }
#standings li .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
#standings li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#standings li em { font-style: normal; font-size: 12px; opacity: .6; font-variant-numeric: tabular-nums; }
.over-card { width: 100%; max-width: 220px; 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; }
.mid-btn.next { background: linear-gradient(180deg, #7cf08a, #2bc46a); color: #fff; box-shadow: 0 5px 0 #1b8a48; }

/* 가로 화면 (휴대폰) */
@media (max-height: 520px) {
  #menu { padding-top: calc(10px + var(--safe-t)); padding-bottom: calc(10px + var(--safe-b)); }
  .logo-img { width: auto; height: 30vh; }
  .best-m { margin-top: 4px; font-size: 14px; padding: 4px 12px; } .best-m b { font-size: 16px; }
  .menu-bottom { gap: 8px; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; }
  #tracks { width: 100%; }
  .trk { width: 104px; padding: 5px 4px; } .trk canvas { width: 56px; height: 36px; } .trk b { font-size: 14px; }
  .menu-bottom .keys { display: none; }
  .big-btn { height: 56px; min-width: 180px; font-size: 24px; }
  .menu-bottom .row { flex-wrap: nowrap; }
  .studio { position: absolute; right: 14px; top: calc(14px + var(--safe-t)); padding: 6px 12px; font-size: 12px; }
  #over { justify-content: center; }
  #over .panel { width: min(100%, 720px); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 12px 14px; align-items: center; justify-items: center; }
  #over .panel > * { grid-column: 1; }
  #over .panel > #overCard { grid-column: 2; grid-row: 1 / span 5; max-width: 150px; }
  #over .panel > .share-big { grid-column: 2; grid-row: 6; height: 52px; min-width: 0; width: 100%; font-size: 22px; }
  #over .panel > .row { grid-column: 2; grid-row: 7 / span 2; }
  #over .panel > #hofForm { grid-column: 1; }
  #over .panel > #overCard { grid-row: 1 / span 4; }
  #over .panel > .share-big { grid-row: 5; }
  #over .panel > .row { grid-row: 6 / span 3; }
  .big-num { font-size: 40px; } .mini { font-size: 16px; gap: 14px; } .rank { font-size: 16px; padding: 3px 14px; }
  #standings li { font-size: 12px; padding: 2px 6px; }
  #over .row .mid-btn { height: 44px; min-width: 44px; padding: 0 12px; }
  #pos b { font-size: 48px; }
  #hud #score { font-size: 26px; } #timer { font-size: 15px; }
}
.tbtn.item, .tbtn.item.on, .tbtn.item:active { background-image: var(--ic, none); }
#boneN { position: absolute; left: 152px; top: calc(28px + var(--safe-t)); color: #fff; font-weight: 700; font-size: 18px; background: rgba(7,19,29,.55); }
#boneN.max { background: linear-gradient(90deg, #ffb13b, #ff7a1a); }
body.mobile #boneN { left: 136px; top: calc(22px + var(--safe-t)); }
@media (min-height: 521px) and (max-height: 780px) {
  .over-card { max-width: 140px; } #over .panel { gap: 8px; padding: 14px 16px; } .big-num { font-size: 48px; }
  #standings li { font-size: 12px; padding: 2px 6px; }
}

/* 버튼이 화면 터치 영역에 가려지지 않게 */
#hud #touchzone { z-index: 1; }
#hud button, #hud .ic-btn, #hud .tbtn, #hud a { z-index: 6; }

/* 단순 조작: 좌우 누르기 */
#stick, #tDrift, #tBrake, #tItem { display: none !important; }
.pad { display: none; position: absolute; bottom: calc(26px + var(--safe-b, 0px)); width: 92px; height: 92px; border-radius: 50%; background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 3px rgba(255,255,255,.55); pointer-events: none; z-index: 2; transition: transform .08s, background .08s; }
body.mobile .pad { display: block; }
.pad.l { left: calc(24px + env(safe-area-inset-left, 0px)); } .pad.r { right: calc(24px + env(safe-area-inset-right, 0px)); }
.pad::after { content: ''; position: absolute; left: 50%; top: 50%; border: 18px solid transparent; }
.pad.l::after { border-right: 26px solid #fff; transform: translate(-72%, -50%); }
.pad.r::after { border-left: 26px solid #fff; transform: translate(-28%, -50%); }
.pad.on { background: rgba(255,210,63,.55); transform: scale(1.08); }

/* 미니맵 크게 */
#mini { width: 230px !important; height: 230px !important; background: rgba(7,19,29,.18); border-radius: 22px; }
body.mobile #mini { width: 160px !important; height: 160px !important; }
@media (max-height: 480px) { body.mobile #mini { width: 120px !important; height: 120px !important; } }

/* 코스 8개: 가로로 넘기기 */
#tracks { flex-wrap: nowrap !important; overflow-x: auto; justify-content: safe center !important; max-width: 100%; padding: 4px 8px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#tracks::-webkit-scrollbar { display: none; }
#tracks > * { flex: 0 0 auto; }

/* 좌우 표시: 경주 시작 잠깐 + 누를 때만 */
body.mobile .pad { opacity: 0; transition: opacity .3s, transform .08s, background .08s; }
body.mobile .pad.on { opacity: .9; }
body.mobile.pad-hint .pad { opacity: .75; }

/* 왼쪽 위 버튼(게임 목록·일시정지): 크게, 누르는 범위 넓게 */
.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); }

/* ===== 엉뚱 업데이트: 모드·차고·날씨·아이템 ===== */
.emo { font-style: normal; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; line-height: 1; }
#itemSlot i.emo { display: grid; place-items: center; font-size: 44px; width: auto; height: auto; background: none; }
body.mobile #itemSlot i.emo { font-size: 36px; }
.tbtn.item { font-size: 36px; display: grid; place-items: center; }
#modes { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.mode { display: flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.82); box-shadow: 0 3px 0 rgba(7,19,29,.18); font-size: 14px; }
.mode i { font-style: normal; font-size: 18px; }
.mode b { font-family: 'Jua', 'Fredoka', sans-serif; font-weight: 400; }
.mode.on { background: var(--ink); color: #fff; box-shadow: 0 0 0 3px var(--gold); }
#tracks { max-width: 100%; overflow-x: auto; justify-content: flex-start; padding: 6px 8px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
#tracks::-webkit-scrollbar { display: none; }
#tracks .trk { flex: none; scroll-snap-align: center; }
@media (min-width: 900px) { #tracks { max-width: 880px; } }
#tracks.cups, #tracks.daily { justify-content: center; }
.trk.cup .cup-ic { font-style: normal; font-size: 34px; line-height: 50px; height: 50px; }
.trk .tdot { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; font-style: normal; font-size: 10px; color: #fff; box-shadow: inset 0 0 0 2px rgba(7,19,29,.3); }
.daily-card { width: 230px !important; flex-direction: column; }
.daily-card .rule { display: flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; background: linear-gradient(90deg, #ff5c7a, #ffb13b); color: #fff; font-family: 'Jua', sans-serif; font-size: 16px; }
.daily-card .rule i { font-style: normal; font-size: 18px; }
.streak { margin-left: 6px; color: #ff5c3a; }
.garage-btn { position: absolute; left: 70px; top: calc(14px + var(--safe-t)); height: 46px; padding: 0 14px 0 8px; border-radius: 14px; background: rgba(255,255,255,.92); box-shadow: 0 4px 0 rgba(7,19,29,.15); display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 18px; }
.garage-btn .emo { font-size: 26px; }
.garage-btn b::before { content: ''; display: inline-block; width: 22px; height: 14px; margin-right: 4px; background: linear-gradient(180deg, #fff1b0, #ffc62e 55%, #d98b00); -webkit-mask: var(--bone) center/contain no-repeat; mask: var(--bone) center/contain no-repeat; }
.sheet.garage { width: min(100% - 24px, 640px); max-height: min(88vh, 620px); background: var(--panel); border-radius: 26px; padding: 14px; display: flex; flex-direction: column; }
.sheet.garage .sheet-h { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 10px; }
.wallet { display: flex; align-items: center; gap: 6px; font-size: 24px; font-weight: 700; }
#kartList { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; overflow-y: auto; padding: 4px; }
.kcard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border-radius: 18px; background: #f2f4f8; box-shadow: 0 4px 0 rgba(7,19,29,.12); }
.kcard .big { font-size: 46px; }
.kcard b { font-family: 'Jua', sans-serif; font-weight: 400; font-size: 17px; }
.kcard.on { background: linear-gradient(180deg, #fff6d6, #ffe08a); box-shadow: 0 0 0 3px #ffc62e, 0 4px 0 rgba(7,19,29,.12); }
.kcard.lock { opacity: .75; } .kcard.lock .big { filter: grayscale(.6); }
.kcard.can { opacity: 1; box-shadow: 0 0 0 3px #5ce07a, 0 4px 0 rgba(7,19,29,.12); }
.kcard.shake { animation: hofShake .3s; }
.stats { display: grid; grid-template-columns: 18px 1fr 18px 1fr; gap: 3px 6px; width: 100%; align-items: center; font-size: 12px; }
.stats > i { font-style: normal; text-align: center; }
.bar { height: 7px; border-radius: 4px; background: #dde2ea; overflow: hidden; display: block; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #2fd6ee, #7a5cff); border-radius: 4px; }
.kcard em { font-style: normal; font-weight: 700; }
.kcard .price { display: flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--ink); color: var(--gold); }
.kcard .sel { position: absolute; right: 8px; top: 6px; width: 26px; height: 26px; border-radius: 50%; background: #2bc46a; color: #fff; display: grid; place-items: center; }
.earn { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 700; padding: 3px 14px; border-radius: 999px; background: var(--ink); color: var(--gold); }
.earn:empty { display: none; }
.tags { display: flex; gap: 4px; }
.tag { display: flex; align-items: center; gap: 3px; padding: 3px 9px; border-radius: 999px; background: rgba(7,19,29,.6); color: #fff; font-size: 18px; font-weight: 700; }
.tag small { font-size: 12px; opacity: .8; }
#slowTint { position: fixed; inset: 0; pointer-events: none; z-index: 3; background: radial-gradient(circle, transparent 45%, rgba(80,140,255,.45)); opacity: 0; transition: opacity .3s; }
#slowTint.on { opacity: 1; }
#paint { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0; }
#paint i { position: absolute; border-radius: 50% 42% 55% 47%; transform: translate(-50%, -50%); filter: blur(1px); box-shadow: 0 0 0 1.4vmin rgba(255,255,255,.15) inset; }
#paint.on { animation: paintFade 3.5s ease-in forwards; }
@keyframes paintFade { 0% { opacity: 0; transform: scale(1.2); } 6% { opacity: .96; transform: scale(1); } 70% { opacity: .9; } 100% { opacity: 0; } }
#banner small { margin-left: 6px; }
@media (max-height: 520px) {
  #modes { width: 100%; gap: 4px; } .mode { padding: 4px 9px; font-size: 12px; } .mode i { font-size: 15px; }
  .garage-btn { left: 66px; top: calc(10px + var(--safe-t)); height: 40px; font-size: 15px; }
  .daily-card { width: 200px !important; }
  #kartList { grid-template-columns: repeat(3, 1fr); }
  .kcard { padding: 6px; } .kcard .big { font-size: 34px; }
}
/* 가로 휴대폰: 왼쪽 로고·명예의 전당, 오른쪽 모드·코스·출발 */
@media (max-height: 520px) and (min-aspect-ratio: 3/2) {
  #menu { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 62%); grid-template-rows: auto auto auto 1fr; column-gap: 10px; align-items: start; justify-items: center; padding: calc(56px + var(--safe-t)) 12px calc(8px + var(--safe-b)); }
  #menu > .logo-wrap { grid-column: 1; grid-row: 1; }
  #menu > .logo-wrap .logo-img { height: 24vh; }
  #menu > .hof-inline { grid-column: 1; grid-row: 2; width: 100%; max-width: 300px; margin-top: 4px; }
  #menu > .best-m { grid-column: 1; grid-row: 3; }
  #menu > .chal-m { grid-column: 1; grid-row: 4; }
  #menu > .menu-bottom { grid-column: 2; grid-row: 1 / span 4; align-self: center; width: 100%; }
  #menu #tracks { width: 100%; }
}
#pops { width: auto !important; height: auto !important; }
