:root { --bs: var(--kit-btn-scale, 1); --ink: #2f3550; --muted: #7a809c; --accent: #8b7cf6; --pink: #ff8fb8; --hud: #4b4f73; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { font-family: "Pretendard Variable", "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; background: #f6f1ff; color: var(--ink); word-break: keep-all; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
body.dark { --hud: #f1efff; background: #232857; }
.hidden { display: none !important; }

#stage { position: fixed; inset: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; will-change: transform; }

.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 10px) 14px 8px; pointer-events: none; }
.top > * { pointer-events: auto; }
#accountSlot { margin-left: auto; }
body.playing .top { display: none; }

.screen { position: fixed; inset: 0; z-index: 10; }
#home { display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 64px) 16px calc(env(safe-area-inset-bottom) + 14px); pointer-events: none; }
#home > * { pointer-events: auto; }
.hero { text-align: center; }
/* 첫 화면 제목: 블록 조각 그림 대신 '블록 팝' 글자를 통째로 (2026-10-24) */
.top h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.title-word { margin: 14px auto 4px; font-size: 52px; font-weight: 900; line-height: 1.1; letter-spacing: -1px; color: #ff5c8a; text-shadow: 0 6px 20px rgba(139, 124, 246, .3); animation: bob 2.4s ease-in-out infinite; }
.title-sub { margin: 0 auto 12px; font-size: 15px; font-weight: 800; color: var(--muted); }
body.dark .title-word { color: #ffd1e1; text-shadow: 0 6px 22px rgba(0, 0, 0, .35); }
body.dark .title-sub { color: #c9c6ea; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.best { margin: 0 auto; display: inline-block; padding: 6px 14px; border-radius: 99px; background: rgba(255, 255, 255, .82); font-weight: 800; font-size: 14px; color: #c2477a; box-shadow: 0 4px 14px rgba(90, 80, 150, .1); }
.best:empty { display: none; }
.spacer { flex: 1; min-height: 20px; pointer-events: none !important; }
.panel { width: 100%; max-width: 440px; margin: 0 auto; padding: 14px; border-radius: 24px; background: rgba(255, 255, 255, .92); border: 1px solid #ece8f4; box-shadow: 0 14px 40px rgba(80, 70, 140, .16); display: grid; gap: 8px; max-height: 70vh; overflow-y: auto; }
.big { padding: calc(13px * var(--bs)) 12px; border-radius: calc(16px * var(--bs)); border: 0; font: inherit; font-weight: 900; font-size: calc(16px * var(--bs)); cursor: pointer; transition: transform .1s; line-height: 1.3; }
.big:active { transform: scale(.97); }
.big small { display: block; font-size: 12.5px; font-weight: 700; opacity: .9; }
.big.primary { color: #fff; background: linear-gradient(135deg, #ff8fb8, #8b7cf6); box-shadow: 0 8px 20px rgba(139, 124, 246, .32); font-size: calc(19px * var(--bs)); padding: calc(15px * var(--bs)) 12px; }
.big.ghost { background: #fff; color: var(--accent); border: 1.5px solid #e4def5; padding-top: calc(9px * var(--bs)); padding-bottom: calc(9px * var(--bs)); font-size: calc(14px * var(--bs)); }
.big.daily { color: #fff; background: linear-gradient(135deg, #ffb54d, #ff6b8b); box-shadow: 0 8px 20px rgba(255, 120, 110, .28); }
.howto { border-radius: 16px; background: #faf8ff; border: 1px solid #ece8f4; padding: 8px 12px; }
.howto summary { cursor: pointer; font-weight: 900; font-size: 14px; color: #5b5f86; padding: 2px 0; }
.howto ul { margin: 6px 0 2px; padding-left: 18px; font-size: 13.5px; line-height: 1.6; color: #565c7c; }
.howto li { margin: 2px 0; }
.gear { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.gear b { color: #5b5f86; }

/* 게임 화면 */
#play { pointer-events: none; }
#play button { pointer-events: auto; }
.hud { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 4px; }
.round { width: calc(42px * var(--bs)); height: calc(42px * var(--bs)); flex: none; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .88); color: #6b6f92; font-size: calc(17px * var(--bs)); font-weight: 900; box-shadow: 0 4px 12px rgba(60, 50, 110, .15); cursor: pointer; display: grid; place-items: center; padding: 0; font-family: inherit; }
.round:active { transform: scale(.94); }
@media (pointer: coarse) { .round { min-width: 44px; min-height: 44px; } }
/* 양쪽 버튼 묶음: 같은 너비로 나눠 가져서 점수가 가운데에 (오른쪽은 🎵 배경 음악 + 🔊 효과음) */
.hud-side { flex: 1 1 0; display: flex; gap: 6px; min-width: max-content; }
.hud-side.r { justify-content: flex-end; }
.round.off { opacity: .5; filter: grayscale(1); }
.score { text-align: center; color: var(--hud); min-width: 0; }
.score b { display: block; font-size: 38px; font-weight: 900; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.score b.bump { animation: bump .25s ease-out; }
.score small { display: block; margin-top: 3px; font-size: 13px; font-weight: 800; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes bump { 40% { transform: scale(1.14); } }
/* 콤보 표시 (자리는 늘 잡아 둠 → 판 크기가 안 흔들림) */
.combo { display: flex; align-items: center; justify-content: center; gap: 5px; height: 22px; margin-top: 3px; visibility: hidden; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.combo.on { visibility: visible; opacity: 1; }
.score .combo b { display: inline-block; font-size: 13px; font-weight: 900; line-height: 20px; padding: 0 9px; border-radius: 99px; background: linear-gradient(90deg, #ff8a3d, #ff4f8b); color: #fff; letter-spacing: 0; }
.combo span { font-size: 11.5px; font-weight: 800; opacity: .85; overflow: hidden; text-overflow: ellipsis; }
.score .combo.ending b { animation: comboEnd 1s ease-in-out infinite; }
.combo.ending span { color: #ff4f8b; opacity: 1; }
body.dark .combo.ending span { color: #ff9cc2; }
@keyframes comboEnd { 50% { opacity: .45; transform: scale(.94); } }
.pops { position: absolute; left: 0; right: 0; top: 0; height: 0; text-align: center; }
.pop { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; font-weight: 900; font-size: 30px; color: #ff4f8b; text-shadow: 3.0px 0.0px 0 #fff, 2.6px 1.5px 0 #fff, 1.5px 2.6px 0 #fff, 0.0px 3.0px 0 #fff, -1.5px 2.6px 0 #fff, -2.6px 1.5px 0 #fff, -3.0px 0.0px 0 #fff, -2.6px -1.5px 0 #fff, -1.5px -2.6px 0 #fff, -0.0px -3.0px 0 #fff, 1.5px -2.6px 0 #fff, 2.6px -1.5px 0 #fff, 0 5px 14px rgba(120, 60, 120, .3); animation: pop 1.1s ease-out forwards; pointer-events: none; }
/* 글자 테두리는 그림자로 (예전 -webkit-text-stroke 는 한글 획이 조각처럼 갈라져 보였음) */
.pop.small { font-size: 20px; color: #8b5cf6; text-shadow: 2.5px 0.0px 0 #fff, 2.2px 1.2px 0 #fff, 1.3px 2.2px 0 #fff, 0.0px 2.5px 0 #fff, -1.2px 2.2px 0 #fff, -2.2px 1.2px 0 #fff, -2.5px 0.0px 0 #fff, -2.2px -1.2px 0 #fff, -1.3px -2.2px 0 #fff, -0.0px -2.5px 0 #fff, 1.3px -2.2px 0 #fff, 2.2px -1.3px 0 #fff, 0 4px 10px rgba(120, 60, 120, .25); }
.pop.gold { color: #f08c00; }
.pop.big2 { font-size: 36px; color: #ff6b00; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -46px) scale(1); } }

/* 결과 창 */
.res-big { text-align: center; margin: 4px 0 6px; }
.res-big b { display: block; font-size: 46px; font-weight: 900; letter-spacing: -1px; color: #8b5cf6; line-height: 1.1; }
.res-big small { display: block; color: var(--muted); font-weight: 700; font-size: 13.5px; margin-top: 4px; }
.res-new { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 99px; background: linear-gradient(90deg, #ffd43b, #ff8fb8); color: #fff; font-weight: 900; font-size: 14px; }
.res-actions .kit-btn { min-height: 48px; }
.ad-slot { margin: 10px 0 0; min-height: 0; }

@media (prefers-reduced-motion: reduce) { .title-word, .pop, .score b.bump, .score .combo.ending b { animation: none; } }
@media (max-width: 340px) { .combo span { display: none; } }
@media (max-height: 640px) { .title-word { font-size: 36px; margin-top: 6px; } .title-sub { display: none; } #home { padding-top: calc(env(safe-area-inset-top) + 54px); } .score b { font-size: 30px; } }

/* ---------- 🎬 첫 화면 배경 (kit/title.css 위에 블록 팝 색·모눈·떠다니는 블록 조각, 2026-11-10) ---------- */
#title { --lt-a: #ff5c8a; --lt-b: #ffa63d; --lt-ink: #2f3550; --lt-muted: #7a809c; --lt-brand: #ff5c8a; --lt-sh: #e0446f; --lt-glow: rgba(255, 92, 138, .38); --lt-bgc: #fff3f8;
  background-image: linear-gradient(#ffe0ec 2px, transparent 2px), linear-gradient(90deg, #ffe0ec 2px, transparent 2px); background-size: 46px 46px; background-position: -1px -1px; }
#title .lt-o { filter: drop-shadow(0 6px 10px rgba(200, 60, 110, .2)); }
#title .bp-e { font-size: 40px; }
#title .b1 { top: 9%; left: 7%; --r: -10deg; }
#title .b2 { top: 16%; right: 9%; --r: 12deg; }
#title .b3 { top: 31%; left: 8%; --r: 8deg; }
#title .b4 { top: 12%; left: 38%; }
@media (min-width: 600px) { #title .b4 { top: 5%; left: 42%; } }
#title .b5 { bottom: 17%; right: 7%; --r: -8deg; }
#title .b6 { bottom: 10%; left: 9%; --r: 10deg; }
#title .b7 { bottom: 6%; right: 16%; --r: 6deg; }
#title .e1 { top: 31%; right: 12%; }
#title .e2 { bottom: 17%; left: 12%; font-size: 36px; }
#title .e3 { bottom: 3%; left: 45%; font-size: 32px; }
@media (orientation: landscape) and (max-height: 500px) {
  #title .bp-blk svg { width: auto; height: 34px; }
  #title .b4 svg { height: 17px; } #title .b6 svg { height: 51px; }
  #title .bp-e { font-size: 28px; }
  #title .b4 { top: 5%; left: 22%; }
  #title .e3 { left: 30%; bottom: 5%; }
  #title .b2 { top: 30%; right: 6%; }
  #title .b3 { top: 40%; left: 5%; }
  #title .e1 { top: 58%; right: 14%; }
  #title .e2 { bottom: 30%; left: 16%; }
}
/* 낮은 세로 휴대폰(360×640 등): 아래 블록이 작은 단추 줄 뒤에 숨지 않게 더 아래로 */
@media (orientation: portrait) and (max-height: 700px) {
  #title .b5 { bottom: 2%; right: 4%; }
  #title .b6 { bottom: 2%; left: 5%; }
  #title .b7 { bottom: 3%; right: 30%; }
  #title .e2 { display: none; }
  #title .e3 { left: 26%; bottom: 3%; }
}
