/* 아이스 녹아웃 화면 스타일 (밝고 귀여운 겨울 느낌) */
:root { --ink: #23365a; --sky: #46a9e6; --pink: #ff7aa2; --blue: #3f9bf0; --line: #d6ecfb; }
* { 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; color: var(--ink); background: #7fd0f5; word-break: keep-all; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.hidden { display: none !important; }
button { font: inherit; }
.kit-root { --kit-accent: #3f9bf0; --kit-accent2: #6fd3ff; }

#cv { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }
#zone { position: fixed; inset: 0; z-index: 5; touch-action: none; }

/* 처음 화면 */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 8px; pointer-events: none; }
.top > * { pointer-events: auto; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); box-shadow: 0 4px 14px rgba(20, 60, 110, .18); display: grid; place-items: center; cursor: pointer; color: var(--ink); padding: 0; }
.round-btn svg { width: 22px; height: 22px; }
.round-btn:active { transform: scale(.94); }

.home { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 0 14px max(14px, env(safe-area-inset-bottom)); pointer-events: none; }
.home-card { pointer-events: auto; width: 100%; max-width: 400px; padding: 18px 18px 16px; border-radius: 28px; background: rgba(255, 255, 255, .93); backdrop-filter: blur(8px); box-shadow: 0 18px 50px rgba(20, 70, 130, .25); border: 2px solid #fff; display: grid; gap: 10px; text-align: center; animation: up .35s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.logo { margin: 0; font-size: 34px; font-weight: 900; letter-spacing: -1.5px; line-height: 1.1; }
.logo span:first-child { color: #3f9bf0; }
.logo span:last-child { color: #ff6b9a; }
.tag { margin: -2px 0 2px; color: #5c7393; font-weight: 700; font-size: 14px; }
.grp { display: grid; gap: 8px; padding: 10px; border-radius: 20px; background: #f0f8ff; border: 1.5px solid var(--line); }
.grp h2 { margin: 0; font-size: 15px; display: flex; justify-content: center; align-items: baseline; gap: 6px; }
.grp h2 small { color: #7b90ad; font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { border: 0; border-radius: 16px; padding: 14px 10px; font-weight: 900; font-size: 17px; cursor: pointer; color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); transition: transform .08s; }
.btn:active { transform: translateY(2px) scale(.98); box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.btn.pink { background: linear-gradient(180deg, #ff9cbc, #ff6b9a); }
.btn.blue { background: linear-gradient(180deg, #6cc4ff, #3f8ff0); }
.btn.gold { background: linear-gradient(180deg, #ffe08a, #ffbb3d); color: #6b4300; }
.btn.white { background: #fff; color: #3f7fd0; border: 2px solid var(--line); box-shadow: 0 4px 0 #d6ecfb; }
.btn.wide { width: 100%; font-size: 19px; padding: 16px; }

/* 가로 화면: 카드를 오른쪽에 */
@media (orientation: landscape) and (min-width: 640px) {
  .home { left: auto; top: 0; bottom: 0; width: min(420px, 46vw); align-items: center; padding: 64px 16px 16px 0; }
  .home-card { max-height: calc(100vh - 80px); overflow-y: auto; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .home { padding-top: 56px; }
  .home-card { gap: 6px; padding: 12px 14px; }
  .logo { font-size: 26px; }
  .tag { display: none; }
  .btn { padding: 10px; font-size: 15px; }
  .btn.wide { padding: 11px; font-size: 16px; }
  .grp { padding: 8px; gap: 6px; }
}

/* 게임 화면 위 */
.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hud-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 10px 0; }
.hud-top .round-btn { pointer-events: auto; flex: none; }
.hud-mid { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: center; }
.scores { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.sc { --c: #999; display: flex; align-items: center; gap: 4px; padding: 3px 8px 3px 4px; border-radius: 99px; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(20, 60, 110, .15); font-size: 12px; font-weight: 800; max-width: 128px; transition: opacity .3s, transform .3s; }
.sc i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--c); }
.sc b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sc span { color: #ffb400; letter-spacing: -1px; flex: none; }
.sc span u { text-decoration: none; color: #d4e2ef; }
.sc.me { box-shadow: 0 0 0 2px var(--c), 0 2px 8px rgba(20, 60, 110, .15); }
.sc.out { opacity: .45; transform: scale(.94); }
.round-lbl { font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(20, 60, 110, .5); }

.banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: 52px; font-weight: 900; color: #fff; -webkit-text-stroke: 2px #2f7fd0; text-shadow: 0 6px 0 #2f7fd0, 0 10px 24px rgba(20, 60, 110, .35); white-space: nowrap; text-align: center; opacity: 0; letter-spacing: -1px; }
/* 좁은 휴대폰에서 긴 글(👑 왕관이 옮겨 갔어요! 등)이 화면 밖으로 잘리지 않게: 글자 크기를 화면 너비에 맞추고, 그래도 길면 두 줄로 (2026-11-08) */
.banner { font-size: min(52px, 10.5vw); width: max-content; max-width: 94vw; white-space: normal; word-break: keep-all; }
.banner.num { font-size: 104px; }
.banner small { display: block; font-size: 20px; -webkit-text-stroke: 0; text-shadow: 0 2px 6px rgba(20, 60, 110, .6); margin-top: 8px; letter-spacing: 0; }
.banner.show { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.banner.num { font-size: 104px; -webkit-text-stroke-width: 3px; }
.banner.pink { -webkit-text-stroke-color: #e8467f; text-shadow: 0 6px 0 #e8467f, 0 10px 24px rgba(120, 20, 60, .3); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.4); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.spect { position: absolute; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 8px 16px; border-radius: 99px; background: rgba(35, 54, 90, .78); color: #fff; font-weight: 800; font-size: 14px; white-space: nowrap; }

.hint { position: absolute; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(20, 60, 110, .6); white-space: nowrap; transition: opacity .6s; }
.powers { position: absolute; right: 14px; bottom: calc(36px + 96px * var(--kit-btn-scale, 1) + env(safe-area-inset-bottom)); display: grid; gap: 6px; justify-items: end; }
.pw { padding: 5px 10px; border-radius: 99px; font-size: 13px; font-weight: 900; color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); animation: up .25s ease-out; }
.pw.speed { background: #ff9f1c; } .pw.heavy { background: #8b5cf6; } .pw.grip { background: #22b573; }

.dash { pointer-events: auto; position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: calc(26px + env(safe-area-inset-bottom)); width: calc(96px * var(--kit-btn-scale, 1)); height: calc(96px * var(--kit-btn-scale, 1)); border-radius: 50%; border: 0; padding: 0; background: radial-gradient(circle at 35% 30%, #ffb3cf, #ff6b9a 70%); box-shadow: 0 6px 0 #d94b7d, 0 10px 24px rgba(200, 50, 100, .35); color: #fff; cursor: pointer; touch-action: none; display: grid; place-items: center; }
.dash b { position: relative; font-size: calc(20px * var(--kit-btn-scale, 1)); font-weight: 900; text-shadow: 0 2px 0 rgba(160, 30, 80, .4); }
.dash svg { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); }
.dash .ring-bg { fill: none; stroke: rgba(255, 255, 255, .45); stroke-width: 6; }
.dash .ring { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 100 100; }
.dash.wait { filter: grayscale(.7) brightness(.95); }
.dash.press { transform: translateY(4px); box-shadow: 0 2px 0 #d94b7d; }
.dash.ready b { animation: ready 1s ease-in-out infinite; }
@keyframes ready { 50% { transform: scale(1.08); } }
body.pc .dash { width: calc(74px * var(--kit-btn-scale, 1)); height: calc(74px * var(--kit-btn-scale, 1)); }
body.pc .dash b { font-size: calc(15px * var(--kit-btn-scale, 1)); }
body.pc .powers { bottom: calc(36px + 74px * var(--kit-btn-scale, 1)); }

/* 조이스틱·대시 버튼은 프로필의 '버튼 크기'(--kit-btn-scale: 0.8~1.5)에 맞춰 커지고 작아짐 */
#stick { position: fixed; z-index: 6; width: calc(120px * var(--kit-btn-scale, 1)); height: calc(120px * var(--kit-btn-scale, 1)); margin: calc(-60px * var(--kit-btn-scale, 1)) 0 0 calc(-60px * var(--kit-btn-scale, 1)); border-radius: 50%; background: rgba(255, 255, 255, .22); border: 3px solid rgba(255, 255, 255, .7); pointer-events: none; opacity: 0; transition: opacity .15s; }
#stick.on { opacity: 1; }
#stick i { position: absolute; left: 50%; top: 50%; width: calc(54px * var(--kit-btn-scale, 1)); height: calc(54px * var(--kit-btn-scale, 1)); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #cfe9ff); box-shadow: 0 4px 12px rgba(20, 60, 110, .3); transform: translate(-50%, -50%); }

@media (orientation: landscape) and (max-height: 500px) {
  .banner { font-size: 40px; }
  .dash { width: calc(84px * var(--kit-btn-scale, 1)); height: calc(84px * var(--kit-btn-scale, 1)); bottom: calc(18px + env(safe-area-inset-bottom)); }
  .powers { bottom: calc(32px + 84px * var(--kit-btn-scale, 1)); }
}

/* 창 안 (설정·결과·놀이 방법) */
.seg { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.seg button { min-width: 44px; padding: 9px 12px; border-radius: 12px; border: 1.5px solid #dbe9f6; background: #fff; font-weight: 900; font-size: 15px; color: #3f6fa8; cursor: pointer; }
.seg button.on { background: linear-gradient(180deg, #6cc4ff, #3f8ff0); color: #fff; border-color: transparent; }
.seg button:disabled { cursor: default; }
.seg button:disabled:not(.on) { opacity: .45; }
.set-row { display: grid; gap: 6px; margin: 10px 0; text-align: center; }
.set-row > span { font-weight: 800; font-size: 14px; color: #5c7393; }
.how { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.how li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 14px; background: #f3f9ff; font-size: 14px; line-height: 1.5; }
.how li i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; color: #fff; background: #3f9bf0; font-size: 14px; }
.res-title { margin: 0; font-size: 28px; text-align: center; }
.res-list { display: grid; gap: 6px; margin: 12px 0 4px; }
.res-row { --c: #999; display: grid; grid-template-columns: 26px 18px 1fr auto auto; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 14px; background: #f5f9fd; font-weight: 800; font-size: 14px; }
.res-row.me { background: #fff4d6; box-shadow: inset 0 0 0 2px #ffd36b; }
.res-row .rk { font-weight: 900; color: #7b90ad; }
.res-row .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--c); }
.res-row .st { color: #ffb400; }
.res-row .ko { color: #5c7393; font-size: 12px; }
.res-gold { text-align: center; font-weight: 900; font-size: 18px; color: #c98200; margin: 10px 0 0; }

/* 넓은 화면: 점수판 크게 */
@media (min-width: 900px) and (min-height: 600px) {
  .sc { font-size: 15px; padding: 5px 12px 5px 6px; max-width: 170px; }
  .sc i { width: 18px; height: 18px; }
  .round-lbl { font-size: 14px; }
}
/* 터치 화면: 안내 글을 왼쪽 아래로 (대시 버튼과 안 겹치게) */
body:not(.pc) .hint { left: 16px; right: calc(34px + 96px * var(--kit-btn-scale, 1)); transform: none; bottom: calc(40px + env(safe-area-inset-bottom)); white-space: normal; text-align: left; line-height: 1.4; }

/* 얼음판 고르기 (그림 + 이름 칩) */
.seg.maps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.seg.maps button { min-width: 0; padding: 7px 4px; font-size: 13px; line-height: 1.2; display: grid; justify-items: center; gap: 2px; word-break: keep-all; }
.seg.maps button i { font-style: normal; font-size: 18px; }
/* 밀어낸 소식 줄 (왼쪽 위) */
.feed { position: absolute; left: 10px; top: 110px; display: grid; gap: 4px; justify-items: start; pointer-events: none; }
.feed .fd { display: flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; background: rgba(35, 54, 90, .62); color: #fff; font-size: 13px; font-weight: 800; animation: fdIn .25s ease-out; max-width: 46vw; white-space: nowrap; overflow: hidden; }
.feed .fd b { color: #fff; border-bottom: 2px solid var(--c, #fff); overflow: hidden; text-overflow: ellipsis; }
.feed .fd span { opacity: .85; }
@keyframes fdIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .feed .fd { animation: none; } }
/* 규칙 고르기 (2칸) + 설명 */
.seg.rules { grid-template-columns: repeat(2, 1fr); }
.rule-desc { display: block; font-size: 12px; color: #7a8fab; font-weight: 700; margin-top: 2px; }
/* 손짓 (이모티콘) */
.hud-side { display: grid; gap: 8px; flex: none; }
.hud-side .round-btn { pointer-events: auto; }
.emo-btn { font-size: 22px; line-height: 1; }
.emo-bar { position: absolute; right: 10px; top: calc(max(8px, env(safe-area-inset-top)) + 112px); display: grid; grid-template-columns: repeat(3, 46px); gap: 6px; padding: 8px; border-radius: 18px; background: rgba(255, 255, 255, .95); box-shadow: 0 8px 24px rgba(20, 60, 110, .25); pointer-events: auto; z-index: 5; }
.emo-bar button { width: 46px; height: 46px; border: 0; border-radius: 12px; background: #eef6ff; font-size: 26px; cursor: pointer; }
.emo-bar button:active { transform: scale(.9); }
.emo-bar.hidden { display: none; }
.sc.crown { box-shadow: 0 0 0 3px #ffc93c; }
/* 처음 화면 버튼 3개 줄 */
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.row3 .btn { padding-left: 4px; padding-right: 4px; white-space: nowrap; }
/* 결과 창: 새 업적 */
.res-ach { display: grid; gap: 4px; justify-items: center; margin: 4px 0 8px; padding: 10px; border-radius: 14px; background: linear-gradient(180deg, #fff7d6, #ffeaa8); color: #7a5200; font-weight: 800; animation: achIn .5s cubic-bezier(.2, 1.6, .4, 1); }
.res-ach i { font-style: normal; color: #c98a00; }
@keyframes achIn { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .res-ach { animation: none; } }
/* 🏅 내 기록 */
.rec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 12px; }
.rec-st { display: grid; justify-items: center; padding: 8px 2px; border-radius: 12px; background: #eef6ff; }
.rec-st b { font-size: 18px; color: #2f5f9a; }
.rec-st small { font-size: 11px; color: #6b819e; font-weight: 700; white-space: nowrap; }
.ach-list { display: grid; gap: 6px; max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.ach { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #f4f6fa; opacity: .75; }
.ach.got { background: linear-gradient(180deg, #fff8dc, #ffefb8); opacity: 1; }
.ach .ai { font-size: 24px; text-align: center; filter: grayscale(1); }
.ach.got .ai { filter: none; }
.ach b { display: block; font-size: 14px; color: #33415c; }
.ach small { display: block; font-size: 12px; color: #6b7a90; }
.ach .ag { font-weight: 900; color: #c98a00; font-size: 13px; }
.ach .bar { display: block; height: 5px; margin-top: 4px; border-radius: 9px; background: #dfe6f0; overflow: hidden; }
.ach .bar u { display: block; height: 100%; background: #5fb8ff; }

/* 판 중 버튼: 손가락으로 누르기 쉽게 44px 이상 (2026-11-01) */
@media (pointer: coarse) { .round-btn { width: 44px; height: 44px; } }

/* ⚡ 빠른 대전 단추 (2026-11-03) */
.qm-go { min-height: 48px; }
.qm-note { margin: -2px 0 0; font-size: 12px; color: #7b90ad; font-weight: 700; }
.btn { min-height: 44px; }

/* ---------- 🎬 첫 화면 배경 (kit/title.css 위에 아이스 녹아웃 색·물결·얼음판·떠다니는 공과 펭귄, 2026-11-10) ---------- */
#title { --lt-a: #3f9bf0; --lt-b: #ff6f9e; --lt-ink: #23365a; --lt-muted: #4f6b8c; --lt-brand: #2f8fe0; --lt-sh: #c94f86; --lt-glow: rgba(63, 155, 240, .38); --lt-bgc: #46a9e6;
  --lt-fade: radial-gradient(ellipse at 50% 46%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, .6) 34%, rgba(255, 255, 255, 0) 60%);
  background-image: radial-gradient(ellipse at 50% 46%, #bfe8fb 0, #7cc8f0 45%, #3d9ad8 100%); }
#title .lt-pill { color: #2f4f78; }
#title .ip-wave { position: absolute; left: 0; right: 0; height: 20px; opacity: .7;
  background-image: radial-gradient(circle at 10px 20px, transparent 8px, rgba(255, 255, 255, .5) 9px, transparent 11px); background-size: 20px 20px; }
#title .w1 { top: 6%; } #title .w2 { top: 24%; left: 60%; } #title .w3 { bottom: 14%; } #title .w4 { bottom: 3%; right: 50%; }
#title .ip-ice { position: absolute; left: 50%; top: 46%; width: min(92vw, 720px); height: min(70vh, 560px); transform: translate(-50%, -50%); border-radius: 48%;
  background: linear-gradient(160deg, #f6fdff, #dff3fc); box-shadow: 0 0 0 10px rgba(255, 255, 255, .35), 0 20px 40px rgba(15, 60, 110, .25); }
#title .lt-o { filter: drop-shadow(0 6px 10px rgba(15, 60, 110, .28)); }
#title .ip-e { font-size: 44px; }
#title .i1 { top: 8%; left: 4%; --r: -8deg; }
#title .i2 { top: 5%; left: 9%; font-size: 40px; }
#title .i3 { top: 16%; right: 9%; }
#title .i4 { top: 34%; left: 7%; }
#title .i5 { top: 5%; left: 33%; font-size: 34px; }
#title .i6 { top: 31%; right: 9%; font-size: 38px; }
#title .i7 { bottom: 17%; right: 9%; }
#title .i8 { bottom: 9%; left: 10%; }
#title .i9 { bottom: 4%; right: 8%; --r: 10deg; }
#title .i10 { bottom: 7%; right: 13%; font-size: 34px; }
#title .i11 { bottom: 17%; left: 12%; font-size: 28px; }
@media (orientation: landscape) and (max-height: 500px) {
  #title .ip-e { font-size: 30px; } #title .i2, #title .i6 { font-size: 30px; } #title .i5, #title .i10 { font-size: 26px; } #title .i11 { font-size: 22px; }
  #title .lt-o svg { width: 40px; height: 40px; } #title .i1 svg, #title .i9 svg { width: 64px; height: 38px; }
  #title .i4 { top: 40%; left: 4%; } #title .i6 { top: 40%; right: 5%; } #title .i5 { top: 3%; left: 22%; }
  #title .i3 { top: 22%; right: 5%; } #title .i7 { bottom: 22%; right: 5%; } #title .i11 { bottom: 24%; left: 5%; }
}
