/* 아이스 녹아웃 화면 스타일 (밝고 귀여운 겨울 느낌) */
: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: 42px; height: 42px; 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; }
.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(132px + 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: 96px; height: 96px; 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: 20px; 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: 74px; height: 74px; }
body.pc .dash b { font-size: 15px; }
body.pc .powers { bottom: 110px; }

#stick { position: fixed; z-index: 6; width: 120px; height: 120px; margin: -60px 0 0 -60px; 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: 54px; height: 54px; 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: 84px; height: 84px; bottom: calc(18px + env(safe-area-inset-bottom)); }
  .powers { bottom: 116px; }
}

/* 창 안 (설정·결과·놀이 방법) */
.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: 130px; transform: none; bottom: calc(40px + env(safe-area-inset-bottom)); white-space: normal; text-align: left; line-height: 1.4; }
