/* 낙하산 착지 대결 화면. 밝은 하늘색 + 파스텔, 휴대폰 세로·가로와 PC 모두 */
:root {
  --text: #2f3550; --muted: #6b7190; --line: #e6e9f5;
  --pink: #ff7aa2; --violet: #8b7cf6; --sky: #5fb8ff; --mint: #3fc98a; --gold: #f5a524; --red: #ff4d6d;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; color: var(--text); background: #8fd3ff; word-break: keep-all; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.hidden { display: none !important; }
button { font: inherit; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.screen { position: fixed; inset: 0; }

/* ---------- 처음 화면 ---------- */
#home { display: flex; flex-direction: column; overflow-y: auto; padding-bottom: calc(16px + var(--safe-b)); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: calc(10px + var(--safe-t)) 14px 6px; }
.brand { display: flex; flex-direction: column; line-height: 1.05; padding: 6px 12px; border-radius: 14px; background: rgba(255, 255, 255, .7); font-weight: 900; }
.brand b { color: var(--pink); font-size: 15px; }
.brand span { font-size: 12px; color: var(--violet); }
.home-card { width: min(420px, calc(100% - 28px)); margin: auto auto 10px; padding: 20px 18px 18px; border-radius: 28px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(6px); box-shadow: 0 18px 50px rgba(40, 80, 140, .22); display: grid; gap: 12px; text-align: center; }
.title { margin: 0; font-size: clamp(28px, 8vw, 38px); font-weight: 900; letter-spacing: -1px; color: var(--violet); }
.title span { color: var(--pink); }
.tag { margin: -4px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.best { margin: 0; font-size: 14px; font-weight: 800; color: #b06f00; min-height: 1em; }
.best:empty { display: none; }
.group { display: grid; gap: 6px; padding: 10px; border-radius: 20px; background: #f4f2ff; }
.group small { font-weight: 800; color: var(--violet); font-size: 13px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.btn { border: 1.5px solid var(--line); background: #fff; color: var(--text); border-radius: 16px; padding: 12px 14px; font-weight: 900; font-size: 15px; cursor: pointer; transition: transform .1s, filter .15s; }
.btn:active { transform: scale(.96); }
.btn.big { padding: 15px 12px; font-size: 17px; border-radius: 18px; }
.btn.wide { width: 100%; }
.btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, #ff8fb8, #8b7cf6); box-shadow: 0 6px 16px rgba(139, 124, 246, .32); }
.btn.sky { border: 0; color: #fff; background: linear-gradient(135deg, #6cc6ff, #4f8dfd); box-shadow: 0 6px 16px rgba(79, 141, 253, .3); }
.btn.mint { border: 0; color: #fff; background: linear-gradient(135deg, #5fe0a8, #2fb67c); box-shadow: 0 6px 16px rgba(47, 182, 124, .3); }
.btn.ghost { background: #fff; color: var(--violet); }
@media (orientation: landscape) and (max-height: 520px) {
  .home-card { width: min(560px, calc(100% - 28px)); grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 14px; margin: auto; }
  .home-card .title, .home-card .tag, .home-card .best { grid-column: 1 / -1; }
  .title { font-size: 26px; }
}

/* ---------- 게임 화면 ---------- */
#play { pointer-events: none; }
#play > * { pointer-events: auto; }
.hud-top { position: absolute; left: 0; right: 0; top: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 6px; padding: calc(8px + var(--safe-t)) 10px 0; pointer-events: none !important; }
.hud-top > div { display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.hud-left { justify-content: flex-start; }
.hud-mid { justify-content: center; flex-direction: column; align-items: center; }
.hud-right { justify-content: flex-end; }
.hud-right button { pointer-events: auto; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border-radius: 99px; background: rgba(255, 255, 255, .9); font-weight: 900; font-size: 14px; box-shadow: 0 3px 10px rgba(40, 80, 140, .15); white-space: nowrap; }
.pill.score { color: #b06f00; }
.pill.wind { font-size: 17px; padding: 6px 12px; }
.pill.wind small { font-size: 11px; color: var(--muted); }
.pill.alt { font-size: 22px; padding: 4px 14px; font-variant-numeric: tabular-nums; }
.pill.alt.warn { background: #fff1c2; color: #a26400; }
.pill.alt.danger { background: #ff4d6d; color: #fff; animation: blink .4s infinite alternate; }
@keyframes blink { to { transform: scale(1.08); } }
.arrow { display: inline-block; width: 26px; height: 14px; position: relative; transition: transform .3s; }
.arrow::before { content: ""; position: absolute; left: 0; right: 7px; top: 5px; height: 4px; border-radius: 2px; background: currentColor; }
.arrow::after { content: ""; position: absolute; right: 0; top: 0; border: 7px solid transparent; border-left: 9px solid currentColor; border-right: 0; }
.wind.strong { color: #e0567a; }
.wind.mid { color: #d38a00; }
.wind.calm { color: #2c8f62; }
.icon { border: 0; border-radius: 99px; padding: 7px 11px; background: rgba(255, 255, 255, .9); font-weight: 800; font-size: 13px; color: var(--muted); box-shadow: 0 3px 10px rgba(40, 80, 140, .15); cursor: pointer; }
.icon.off { text-decoration: line-through; }

.banner { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); text-align: center; pointer-events: none !important; font-weight: 900; color: #fff; -webkit-text-stroke: 7px rgba(60, 50, 110, .55); paint-order: stroke fill; text-shadow: 0 4px 0 rgba(47, 53, 80, .3); font-size: clamp(30px, 9vw, 58px); line-height: 1.15; white-space: nowrap; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.banner small { display: block; font-size: .42em; margin-top: 6px; }
.banner.good { color: #fff6c8; }
.banner.bad { color: #ffd6de; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } }
.toast2 { position: absolute; left: 50%; top: calc(108px + var(--safe-t)); transform: translateX(-50%); padding: 8px 14px; border-radius: 14px; background: rgba(47, 53, 80, .82); color: #fff; font-weight: 800; font-size: 14px; pointer-events: none !important; white-space: nowrap; animation: pop2 .25s ease-out; }
@keyframes pop2 { from { transform: translate(-50%, -8px); opacity: 0; } }
.watch { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); padding: 8px 16px; border-radius: 99px; background: rgba(255, 255, 255, .92); font-weight: 900; font-size: 14px; color: var(--violet); pointer-events: none !important; white-space: nowrap; }
.keys { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .7); font-size: 12.5px; font-weight: 700; color: var(--muted); pointer-events: none !important; white-space: nowrap; }
@media (hover: none), (max-width: 760px) { .keys { display: none; } }

/* 조작 버튼 */
.ctrl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 12px calc(14px + var(--safe-b)); pointer-events: none !important; }
.pad { display: flex; gap: 10px; align-items: flex-end; pointer-events: none; }
.cb { pointer-events: auto; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; font-weight: 900; touch-action: none; transition: transform .08s, filter .1s; box-shadow: 0 6px 0 rgba(47, 53, 80, .18), 0 10px 20px rgba(40, 80, 140, .2); }
.cb.on, .cb:active { transform: translateY(3px) scale(.96); filter: brightness(1.08); box-shadow: 0 3px 0 rgba(47, 53, 80, .18); }
.cb.dir { width: 70px; height: 70px; border-radius: 50%; background: rgba(255, 255, 255, .9); }
.cb.dir svg { width: 34px; height: 34px; fill: none; stroke: var(--violet); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.cb.act { width: 78px; height: 78px; border-radius: 50%; background: linear-gradient(135deg, #6cc6ff, #4f8dfd); font-size: 15px; position: relative; }
.cb.act .gauge { position: absolute; left: 14px; right: 14px; bottom: 12px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .35); overflow: hidden; display: none; }
.cb.act.brake .gauge { display: block; }
.cb.act .gauge i { display: block; height: 100%; width: 100%; background: #fff; border-radius: 3px; }
.cb.act .gauge i.low { background: #ffd166; }
.cb.open { width: 96px; height: 96px; border-radius: 50%; background: linear-gradient(135deg, #ff8fb8, #ff4d6d); font-size: 16px; line-height: 1.15; }
.cb.open.ready { animation: pulse .7s infinite alternate; }
.cb.open.done { background: #c7cbe0; box-shadow: none; }
@keyframes pulse { to { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(255, 77, 109, .35); } }
@media (min-width: 900px) and (hover: hover) {
  .cb.dir { width: 62px; height: 62px; }
  .cb.act { width: 70px; height: 70px; }
  .cb.open { width: 86px; height: 86px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .cb.dir { width: 62px; height: 62px; }
  .cb.act { width: 68px; height: 68px; }
  .cb.open { width: 80px; height: 80px; font-size: 14px; }
  .pill.alt { font-size: 18px; }
  .banner { top: 38%; }
}

/* 라운드 결과판 */
.round-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(400px, calc(100% - 28px)); max-height: calc(100% - 40px); overflow-y: auto; padding: 18px 16px 16px; border-radius: 24px; background: rgba(255, 255, 255, .95); box-shadow: 0 20px 60px rgba(40, 60, 120, .3); text-align: center; animation: up .3s ease-out; }
@keyframes up { from { transform: translate(-50%, -40%); opacity: 0; } }
.round-panel h2 { margin: 0 0 4px; font-size: 22px; }
.round-panel .sub { margin: 0 0 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.rp-list { display: grid; gap: 6px; text-align: left; }
.rp { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 14px; background: #f6f5fc; border-left: 6px solid var(--pc, #ccc); }
.rp.me { background: #fff6d6; }
.rp .pl { font-weight: 900; color: var(--muted); text-align: center; }
.rp b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp .why { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.rp .pts { font-weight: 900; color: #b06f00; font-size: 15px; text-align: right; }
.rp .tot { font-weight: 900; font-size: 18px; min-width: 52px; text-align: right; }
.round-panel .next { margin-top: 12px; display: flex; gap: 8px; }
.round-panel .next .btn { flex: 1; }
.round-panel .cd { margin-top: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }

/* 마지막 결과 (키트 창 안) */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 8px; margin: 10px 0 12px; }
.podium div { flex: 1; max-width: 110px; border-radius: 16px 16px 6px 6px; padding: 8px 4px; text-align: center; color: #fff; font-weight: 900; background: var(--pc); }
.podium div b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium div span { font-size: 22px; }
.podium div small { display: block; font-size: 12px; opacity: .9; }
.podium .p1 { min-height: 120px; } .podium .p2 { min-height: 94px; } .podium .p3 { min-height: 76px; } .podium .p4 { min-height: 62px; }
.final-gold { margin: 6px 0 0; padding: 10px; border-radius: 14px; background: #fff6d6; font-weight: 900; color: #8a5a00; text-align: center; }
.final-note { margin: 8px 0 0; text-align: center; font-weight: 800; color: var(--violet); }

/* 하는 법 */
.how { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.how li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: #f6f5fc; 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: var(--c, var(--violet)); }
.rings { display: flex; gap: 4px; justify-content: center; margin: 8px 0 2px; flex-wrap: wrap; }
.rings span { padding: 4px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 900; background: var(--c); color: #2f3550; border: 1.5px solid rgba(47, 53, 80, .15); }
.solo-pick { display: grid; gap: 8px; margin-top: 10px; }
.solo-pick .btn small { display: block; font-size: 12px; font-weight: 700; opacity: .9; margin-top: 2px; }
