/* 공 피하기 대결: 어두운 남색 화면 + 밝은 하얀 공 (게임 자체 모양, 키트 창은 kit.css) */
:root { --p1: #4da3ff; --p2: #ff5a6a; --ink: #eef2ff; --sub: #aab4e0; --card: rgba(18, 26, 68, .88); --line: rgba(150, 170, 255, .22); --gold: #ffd84d; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; background: #070c24; color: var(--ink); word-break: keep-all; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
.hidden { display: none !important; }
#cv { position: fixed; inset: 0; display: block; touch-action: none; }
button { font: inherit; color: inherit; }

/* 위 막대 (처음 화면) */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 12px 8px; }
.top h1 { margin: 0; font-size: 16px; font-weight: 900; color: var(--ink); opacity: .9; white-space: nowrap; }
body.playing .top { display: none; }

/* 처음 화면 */
.screen { position: fixed; inset: 0; z-index: 3; }
#home { overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: calc(64px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
.hero { text-align: center; margin: 8px 0 14px; }
.title-word { margin: 0; font-size: clamp(34px, 10vw, 54px); font-weight: 900; letter-spacing: -1.5px; line-height: 1.1; color: #fff; text-shadow: 0 0 18px rgba(140, 180, 255, .55), 0 3px 0 #1d2a6b; }
.title-sub { margin: 8px 0 0; color: var(--sub); font-weight: 700; font-size: 15px; }
.best { margin: 8px 0 0; min-height: 20px; color: var(--gold); font-weight: 800; font-size: 14px; }
.panel { width: 100%; max-width: 440px; margin-top: auto; display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); backdrop-filter: blur(6px); }
.big { min-height: 64px; border: 0; border-radius: 18px; padding: 12px 16px; font-size: 20px; font-weight: 900; cursor: pointer; display: grid; gap: 2px; }
.big small { font-size: 13px; font-weight: 700; opacity: .85; }
.big.primary { color: #0b1030; background: linear-gradient(135deg, #ffffff, #cfe2ff); box-shadow: 0 6px 0 #6f86c9; }
.big.primary:active { transform: translateY(3px); box-shadow: 0 3px 0 #6f86c9; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { min-height: 92px; border-radius: 16px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .06); cursor: pointer; display: grid; place-items: center; gap: 2px; padding: 10px 6px; text-align: center; }
.mode:active { transform: scale(.97); }
.mode .mi { font-size: 26px; line-height: 1; }
.mode b { font-size: 16px; }
.mode small { font-size: 12px; color: var(--sub); }
.m-cpu { box-shadow: inset 0 -3px 0 rgba(77, 163, 255, .5); }
.m-duo { box-shadow: inset 0 -3px 0 rgba(255, 90, 106, .5); }
.howto { border-radius: 14px; background: rgba(255, 255, 255, .05); padding: 0 12px; }
.howto summary { min-height: 44px; display: flex; align-items: center; gap: 6px; font-weight: 800; cursor: pointer; list-style: none; color: var(--sub); }
.howto summary::before { content: '❓'; }
.howto summary::-webkit-details-marker { display: none; }
.howto ul { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; color: #d6dcf7; }
.howto b { color: #fff; }
.credit { margin: 4px 0 12px; font-size: 13px; color: var(--gold); font-weight: 800; }
.gear { margin: 0; min-height: 18px; text-align: center; font-size: 13px; color: var(--sub); }
.gear b { color: var(--ink); }

/* 판 화면 */
#play { pointer-events: none; }
#play > * { pointer-events: auto; }
.hud { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 10px 6px; }
.round { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .08); font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.times { flex: 1; display: flex; gap: 8px; justify-content: center; min-width: 0; }
.tbox { flex: 1; max-width: 200px; min-width: 0; border-radius: 14px; padding: 4px 10px; background: rgba(255, 255, 255, .06); border: 2px solid; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.tbox small { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbox b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tbox b::after { content: '초'; font-size: 12px; margin-left: 2px; }
.tbox.p1 { border-color: var(--p1); color: #bfe0ff; }
.tbox.p2 { border-color: var(--p2); color: #ffc9cf; }
.tbox.out { opacity: .5; }
.tbox.score b::after { content: '점'; }
body[data-mode="solo"] .tbox.p2 { border-color: var(--gold); color: #fff1b8; }
.banner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: clamp(40px, 14vw, 80px); font-weight: 900; color: #fff; text-shadow: 0 0 24px rgba(140, 180, 255, .8); pointer-events: none !important; white-space: nowrap; }
.banner.small { font-size: clamp(22px, 7vw, 36px); color: var(--gold); text-shadow: 0 0 16px rgba(255, 216, 77, .6); }
.banner.pop { animation: pop .5s ease-out; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.pops { position: absolute; inset: 0; pointer-events: none !important; }

/* 휴대폰 단추 */
.ctrl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px max(10px, env(safe-area-inset-bottom)); touch-action: none; user-select: none; -webkit-user-select: none; }
.pad { display: flex; gap: 10px; }
.pb { width: 72px; height: 64px; border-radius: 18px; border: 2px solid; background: rgba(255, 255, 255, .07); font-size: 24px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pad.p1 .pb { border-color: var(--p1); color: #bfe0ff; }
.pad.p2 .pb { border-color: var(--p2); color: #ffc9cf; }
.pb.on { background: rgba(255, 255, 255, .28); transform: scale(.95); }
/* 혼자·컴퓨터 대결: 1P 단추를 양쪽 끝으로 (◀ 왼쪽 아래, ▶ 오른쪽 아래) */
body[data-mode="solo"] .pad.p2, body[data-mode="cpu"] .pad.p2 { display: none; }
body[data-mode="solo"] .pad.p1, body[data-mode="cpu"] .pad.p1 { width: 100%; justify-content: space-between; }
body[data-mode="solo"] .pb, body[data-mode="cpu"] .pb { width: 96px; }
.keys { position: absolute; left: 0; right: 0; bottom: 6px; margin: 0; text-align: center; font-size: 13px; color: var(--sub); pointer-events: none !important; }
body.touch .keys { display: none; }
body:not(.touch) .ctrl { display: none; }
@media (max-width: 380px) { .pb { width: 62px; height: 60px; } .pad { gap: 8px; } .tbox { padding: 4px 8px; } .tbox b { font-size: 19px; } }

/* 결과·고르기 창 (키트 창 안) */
.res-who { font-size: 30px; font-weight: 900; text-align: center; margin: 4px 0; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.res-grid.g3 { grid-template-columns: 1fr 1fr 1fr; }
.kit-root .kit-actions .kit-btn { white-space: nowrap; }
.res-grid > div { border-radius: 14px; padding: 10px; text-align: center; border: 2px solid #e6e9f6; display: grid; gap: 2px; }
.res-grid b { font-size: 24px; }
.res-grid small { color: #7a809c; font-weight: 700; }
.res-grid .r1 { border-color: #9cc9ff; } .res-grid .r2 { border-color: #ffb0b8; }
.res-grid .win { background: #fff8d6; }
.res-new { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 99px; background: #ffd84d; color: #5a4200; font-weight: 900; font-size: 13px; }
.diff { display: grid; gap: 8px; margin-top: 10px; }
.diff button { min-height: 56px; border-radius: 14px; border: 1.5px solid #e3e0fb; background: #fff; font-weight: 900; font-size: 17px; cursor: pointer; color: #2f3550; }
.diff button small { display: block; font-size: 12px; font-weight: 700; color: #7a809c; }
.ad-slot:empty { display: none; }

/* ---------- 🎬 첫 화면 배경 (kit/title.css 위에 공 피하기 대결 색·무늬·떠다니는 그림, 2026-11-10) ---------- */
#title { --lt-a: #2f8cff; --lt-b: #ff4d6a; --lt-ink: #1a2350; --lt-muted: #4c5687; --lt-brand: #3a6fe0; --lt-sh: #2860c8; --lt-glow: rgba(77,163,255,.45);
  --lt-bgc: #0b1438; background-image: linear-gradient(180deg,#0b1438 0%,#16245c 60%,#22357a 100%);
  --lt-fade: radial-gradient(ellipse at 50% 46%,rgba(255,255,255,0.96) 0,rgba(255,255,255,0.78) 38%,rgba(255,255,255,0) 75%); }
#title .lt-o { filter: drop-shadow(0 6px 10px rgba(0,0,20,.45)); }
#title .stars { position: absolute;left:0;top:0;width:2px;height:2px;border-radius:50%;box-shadow:0px 847px 0 0px rgba(255,255,255,0.49),1050px 490px 0 0px rgba(255,255,255,0.84),1087px 499px 0 0px rgba(255,255,255,0.76),1176px 223px 0 0px rgba(255,255,255,0.81),1005px 50px 0 0px rgba(255,255,255,0.65),1328px 743px 0 1px rgba(255,255,255,0.68),1329px 633px 0 0px rgba(255,255,255,0.73),1313px 836px 0 0px rgba(255,255,255,0.57),1206px 306px 0 1px rgba(255,255,255,0.54),617px 271px 0 0px rgba(255,255,255,0.71),1050px 808px 0 1px rgba(255,255,255,0.53),807px 468px 0 0px rgba(255,255,255,0.48),1309px 50px 0 0px rgba(255,255,255,0.57),957px 850px 0 0px rgba(255,255,255,0.46),584px 261px 0 0px rgba(255,255,255,0.63),479px 489px 0 0px rgba(255,255,255,0.50),1305px 421px 0 0px rgba(255,255,255,0.76),913px 475px 0 0px rgba(255,255,255,0.80),1353px 365px 0 0px rgba(255,255,255,0.51),845px 323px 0 0px rgba(255,255,255,0.60),1144px 807px 0 1px rgba(255,255,255,0.88),112px 374px 0 1px rgba(255,255,255,0.40),1435px 202px 0 0px rgba(255,255,255,0.44),658px 545px 0 1px rgba(255,255,255,0.95),1274px 819px 0 0px rgba(255,255,255,0.94),1096px 253px 0 1px rgba(255,255,255,0.51),109px 1px 0 0px rgba(255,255,255,0.50),1067px 450px 0 0px rgba(255,255,255,0.50),1270px 216px 0 0px rgba(255,255,255,0.93),170px 450px 0 1px rgba(255,255,255,0.94),917px 848px 0 1px rgba(255,255,255,0.94),271px 891px 0 0px rgba(255,255,255,0.79),383px 205px 0 0px rgba(255,255,255,0.72),75px 708px 0 0px rgba(255,255,255,0.81),717px 30px 0 1px rgba(255,255,255,0.95),188px 633px 0 0px rgba(255,255,255,0.37),1272px 792px 0 0px rgba(255,255,255,0.97),1101px 386px 0 0px rgba(255,255,255,0.82),1270px 366px 0 0px rgba(255,255,255,0.61),1277px 514px 0 0px rgba(255,255,255,0.75),1058px 308px 0 0px rgba(255,255,255,0.62),286px 287px 0 0px rgba(255,255,255,1.00),911px 802px 0 0px rgba(255,255,255,0.48),929px 125px 0 0px rgba(255,255,255,0.71),1111px 870px 0 0px rgba(255,255,255,0.47),643px 153px 0 0px rgba(255,255,255,0.69),809px 466px 0 0px rgba(255,255,255,0.59),1081px 24px 0 0px rgba(255,255,255,0.70),292px 665px 0 0px rgba(255,255,255,0.50),950px 395px 0 1px rgba(255,255,255,0.85),1185px 842px 0 0px rgba(255,255,255,0.79),1381px 23px 0 0px rgba(255,255,255,0.74),1043px 826px 0 1px rgba(255,255,255,0.44),116px 100px 0 1px rgba(255,255,255,0.36),871px 870px 0 1px rgba(255,255,255,0.44),291px 621px 0 0px rgba(255,255,255,0.65),1431px 389px 0 0px rgba(255,255,255,0.85),572px 383px 0 1px rgba(255,255,255,0.50),1163px 896px 0 1px rgba(255,255,255,0.95),733px 112px 0 0px rgba(255,255,255,0.74),246px 72px 0 0px rgba(255,255,255,0.77),801px 442px 0 0px rgba(255,255,255,0.40),595px 289px 0 1px rgba(255,255,255,0.35),595px 84px 0 0px rgba(255,255,255,0.95),1120px 703px 0 0px rgba(255,255,255,0.91),1386px 737px 0 0px rgba(255,255,255,0.72),501px 374px 0 0px rgba(255,255,255,0.67),817px 664px 0 0px rgba(255,255,255,0.76),1050px 814px 0 0px rgba(255,255,255,0.99),631px 448px 0 0px rgba(255,255,255,0.98),515px 73px 0 0px rgba(255,255,255,0.92),1020px 679px 0 0px rgba(255,255,255,0.86),298px 219px 0 0px rgba(255,255,255,0.42),1318px 736px 0 0px rgba(255,255,255,0.81),772px 408px 0 0px rgba(255,255,255,0.72),1258px 249px 0 0px rgba(255,255,255,0.63),569px 173px 0 0px rgba(255,255,255,0.50),1294px 756px 0 0px rgba(255,255,255,0.79),1263px 107px 0 0px rgba(255,255,255,0.95),2px 121px 0 0px rgba(255,255,255,0.36),998px 826px 0 1px rgba(255,255,255,0.49),1364px 644px 0 1px rgba(255,255,255,0.43),902px 15px 0 0px rgba(255,255,255,0.73),1082px 118px 0 0px rgba(255,255,255,0.81),1375px 504px 0 0px rgba(255,255,255,0.86),1012px 675px 0 0px rgba(255,255,255,0.42),65px 564px 0 0px rgba(255,255,255,0.73),361px 205px 0 0px rgba(255,255,255,0.76),1170px 220px 0 0px rgba(255,255,255,0.38),995px 374px 0 0px rgba(255,255,255,0.78),1159px 96px 0 0px rgba(255,255,255,0.68),1185px 391px 0 0px rgba(255,255,255,0.86),1047px 835px 0 0px rgba(255,255,255,0.47),1036px 142px 0 1px rgba(255,255,255,0.97),1375px 52px 0 1px rgba(255,255,255,0.52),1355px 800px 0 0px rgba(255,255,255,0.53),285px 27px 0 0px rgba(255,255,255,0.71),204px 297px 0 0px rgba(255,255,255,0.50),79px 41px 0 1px rgba(255,255,255,0.76),674px 744px 0 0px rgba(255,255,255,0.68),1009px 357px 0 0px rgba(255,255,255,0.98),1110px 885px 0 0px rgba(255,255,255,0.74),1156px 157px 0 1px rgba(255,255,255,0.82),931px 397px 0 0px rgba(255,255,255,0.60),712px 112px 0 1px rgba(255,255,255,0.40),510px 317px 0 0px rgba(255,255,255,0.77),181px 48px 0 1px rgba(255,255,255,0.89),1252px 41px 0 0px rgba(255,255,255,0.56),579px 836px 0 0px rgba(255,255,255,0.36),1430px 189px 0 0px rgba(255,255,255,0.63); }
#title .floor { position: absolute;left:0;right:0;bottom:0;height:9%;background:linear-gradient(180deg,rgba(120,150,255,.25),rgba(120,150,255,.05));border-top:2px solid rgba(160,190,255,.45); }
#title .db-o1 { top:3%; left:12%; }
#title .db-o2 { top:15%; right:14%; }
#title .db-o3 { top:-1%; left:58%; }
#title .db-o4 { top:33%; left:5%; }
#title .db-o5 { top:30%; right:6%; }
#title .db-o6 { bottom:22%; right:10%; }
#title .db-o7 { bottom:24%; left:9%; }
#title .db-o8 { font-size:30px; top:9%; left:36%; }
#title .db-o9 { font-size:24px; bottom:18%; left:42%; }
#title .db-o10 { bottom:6%; left:12%; }
#title .db-o11 { bottom:6%; right:12%; }
#title .db-t11 { display: block; transform: scaleX(-1); }
/* 견본보다 조금 옮김: 공이 로그인한 계정 칩 뒤에, 별이 플레이·작은 단추 뒤에 숨지 않게 */
#title .db-o3 { top: 9%; left: 64%; }
#title .db-o9 { bottom: 17%; left: 24%; }
@media (orientation: landscape) and (max-height: 500px) { #title .db-o9 { bottom: 44%; left: 27%; } }
