/* 지붕으로 가는 길 — 화면 모양. 색은 base.css 토큰을 쓴다. */
.rc-body { background: var(--field); overscroll-behavior: none; }
.rc-cover { width: 100%; max-width: 440px; aspect-ratio: 4 / 3; border-radius: var(--r-card); overflow: hidden; background: var(--sky); }
.rc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-lead { max-width: 30em; font-size: 18px; line-height: 1.5; }
.rc-intro { width: 100%; max-width: 520px; text-align: left; }
.rc-howto { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: var(--cream); font-weight: 800; }
.rc-howto img { width: 36px; height: 36px; animation: rc-press 1.4s ease-in-out infinite; }
@keyframes rc-press { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(8px, 10px) scale(.92); } }
.rc-kbd { margin: 0; font-size: 14px; opacity: .8; }

/* 놀이 화면: 세로 = 위 띠 · 지도 · 블록 판, 가로·PC = 지도 왼쪽 / 띠·블록 판 오른쪽 */
.rc-play { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 6px; height: calc(100svh - 82px); min-height: 640px; max-width: 1100px; margin: 0 auto; padding: 0 8px 8px; }
.rc-hud { display: flex; align-items: center; gap: 8px; }
.rc-pause { background: var(--cream); color: var(--ink); font-size: 18px; flex: none; width: 46px; height: 46px; }
.rc-lvl { flex: 1; min-width: 0; line-height: 1.25; }
.rc-lvl b { display: block; font-size: 19px; font-weight: 900; }
.rc-lvl span { display: block; font-size: 13px; font-weight: 700; opacity: .85; }
.rc-total { margin: 0; flex: none; display: flex; align-items: center; gap: 4px; padding: 4px 14px 4px 8px; border-radius: 999px; background: var(--cream); font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rc-total i { width: 28px; height: 28px; background: center / contain no-repeat url(../../assets/ui/icon/star-done.webp); }
.rc-mapwrap { min-height: 0; display: flex; align-items: center; justify-content: center; }
.rc-map { position: relative; border-radius: 18px; overflow: hidden; background: #EBD3A0; box-shadow: 0 6px 0 rgba(28, 37, 84, .15); }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rc-banner { position: absolute; left: 0; right: 0; top: 44%; margin: 0 auto; width: max-content; max-width: calc(100% - 20px); padding: 8px 18px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 18px; font-weight: 900; text-align: center; box-shadow: 0 5px 0 var(--gold-dark); pointer-events: none; animation: rc-pop .3s ease-out; z-index: 3; }
@keyframes rc-pop { from { transform: scale(.8); opacity: 0; } }
.rc-say { position: absolute; left: 6px; right: 6px; top: 6px; display: flex; z-index: 4; }
.rc-say .say-row { margin: 0; align-items: center; animation: rc-pop .25s ease-out; }
.rc-say .say-fig { width: 36px; height: 44px; flex: none; }
.rc-say .bubble { font-size: 15px; line-height: 1.35; padding: 6px 10px; }
.rc-say:empty { display: none; }
.rc-win, .rc-pausebox { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 12px; background: rgba(28, 37, 84, .62); color: var(--cream); text-align: center; }
.rc-pausebox { gap: 16px; font-size: 24px; font-weight: 900; }
.rc-win-stars { margin: 0; font-size: 46px; line-height: 1; letter-spacing: 4px; animation: rc-pop .4s ease-out; }
.rc-win-stars .on { color: var(--gold); text-shadow: 0 3px 0 var(--gold-dark); }
.rc-win-stars .off { color: rgba(255, 246, 227, .3); }
.rc-win-big { margin: 0; font-size: 26px; font-weight: 900; }
.rc-win-sub { margin: 0; font-size: 15px; font-weight: 700; }
.rc-win-story { margin: 0; max-width: 18em; font-size: 16px; font-weight: 700; line-height: 1.45; }

/* 블록 판 */
.rc-ctl { display: grid; gap: 6px; align-content: start; width: 100%; max-width: 640px; margin: 0 auto; }
.rc-prog { padding: 8px; border-radius: 16px; background: rgba(255, 246, 227, .92); }
.rc-prog-head { margin: 0 0 4px; display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 800; }
.rc-prog-head b { font-variant-numeric: tabular-nums; }
.rc-prog-head b.full { color: var(--joy); }
.rc-tray { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; height: clamp(98px, 12svh, 190px); overflow-y: auto; padding-top: 5px; } /* 높이 고정: 블록을 놓아도 지도 크기가 흔들리지 않게 */
.rc-empty { margin: 0; align-self: center; width: 100%; text-align: center; font-size: 14px; font-weight: 700; opacity: .65; }
.rc-chip { position: relative; width: 48px; height: 48px; border: 0; border-radius: 14px; flex: none; display: grid; place-items: center; align-content: center; cursor: pointer; background: #3E86E8; color: #fff; box-shadow: 0 3px 0 #2B5FB0; font-weight: 900; }
.rc-chip i { font-style: normal; font-size: 26px; line-height: 1; }
.rc-chip small { font-size: 9px; line-height: 1; margin-top: 1px; }
.rc-chip--climb { background: #F29A32; box-shadow: 0 3px 0 #C0731B; }
.rc-chip--lower { background: #D9383F; box-shadow: 0 3px 0 #A52A30; }
.rc-chip.on { outline: 4px solid var(--gold); outline-offset: 1px; transform: translateY(-3px); }
.rc-rep { flex: 1 1 100%; border: 3px dashed #4FA35A; border-radius: 16px; padding: 4px; background: rgba(124, 199, 123, .18); }
.rc-rep.on { border-style: solid; background: rgba(124, 199, 123, .34); }
.rc-rephead { display: flex; align-items: center; gap: 6px; }
.rc-head { height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: #3E9E4F; color: #fff; box-shadow: 0 3px 0 #2B7A3A; display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 16px; cursor: pointer; }
.rc-head i { font-style: normal; font-size: 24px; line-height: 1; }
.rc-step { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--cream); color: var(--ink); font-size: 24px; font-weight: 900; line-height: 1; cursor: pointer; box-shadow: 0 3px 0 rgba(28, 37, 84, .18); }
.rc-del { font-size: 18px; margin-left: auto; }
.rc-n { min-width: 40px; text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; }
.rc-repbody { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 2px 2px; min-height: 8px; }
.rc-slot { min-width: 48px; height: 48px; padding: 0 10px; border: 3px dashed #4FA35A; border-radius: 14px; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #2B7A3A; }
.rc-pal { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.rc-b { min-width: 60px; min-height: 50px; padding: 3px 6px; border: 0; border-radius: 16px; display: grid; place-items: center; align-content: center; gap: 0; cursor: pointer; background: #3E86E8; color: #fff; box-shadow: 0 4px 0 #2B5FB0; font-weight: 900; }
.rc-b i { font-style: normal; font-size: 26px; line-height: 1; }
.rc-b span { font-size: 13px; line-height: 1.1; }
.rc-b--repeat { background: #3E9E4F; box-shadow: 0 4px 0 #2B7A3A; }
.rc-b--climb { background: #F29A32; box-shadow: 0 4px 0 #C0731B; }
.rc-b--lower { background: #D9383F; box-shadow: 0 4px 0 #A52A30; min-width: 100px; }
.rc-b:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(28, 37, 84, .3); }
.rc-b.dim { opacity: .45; }
.rc-acts { display: flex; gap: 8px; }
.rc-acts .btn, .rc-acts .btn-gold { flex: 1; padding: 0 12px; font-size: 16px; min-height: 50px; }
.rc-acts .rc-go { flex: 1.5; font-size: 20px; }
.rc-acts button:disabled { opacity: .5; cursor: default; }
.rc-help.pulse { animation: rc-glow 1s ease-in-out infinite; }
@keyframes rc-glow { 50% { box-shadow: 0 0 0 6px rgba(246, 183, 60, .7), 0 4px 0 rgba(28, 37, 84, .18); } }
.busy .rc-pal, .busy .rc-tray { pointer-events: none; }

/* 상 내리는 장면 */
.rc-cut { display: grid; gap: 12px; justify-items: center; align-content: center; max-width: 640px; min-height: calc(100svh - 82px); margin: 0 auto; padding: 8px 12px 20px; text-align: center; }
.rc-cut-pic img { display: block; width: 100%; max-height: 52svh; border-radius: var(--r-card); box-shadow: 0 6px 0 rgba(28, 37, 84, .15); }
.rc-cut-pic img.in { animation: rc-fade .7s ease-out; }
@keyframes rc-fade { from { opacity: 0; transform: scale(1.04); } }
.rc-cut-txt { margin: 0; padding: 12px 18px; border-radius: 18px; background: var(--cream); font-size: 20px; font-weight: 800; line-height: 1.5; }

/* 끝 화면 */
.rc-tally { width: 100%; max-width: 440px; display: grid; gap: 12px; padding: 16px; border-radius: var(--r-card); background: var(--cream); text-align: center; }
.rc-tally img { width: 100%; border-radius: 16px; }
.rc-verse { margin: 0; padding: 14px 16px; border-radius: 16px; background: var(--lake); color: var(--cream); font-size: 18px; font-weight: 700; line-height: 1.5; text-align: left; }
.rc-verse cite { display: block; margin-top: 6px; font-size: 15px; font-style: normal; color: var(--gold); }
.rc-jesus { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.5; }
.rc-pnote { margin: 12px auto 24px; font-size: 11px; opacity: .7; text-align: center; }

/* 가로 휴대폰·PC: 지도 왼쪽, 띠와 블록 판 오른쪽 */
@media (min-aspect-ratio: 5 / 4) {
  .rc-play { grid-template-columns: minmax(0, 1fr) minmax(300px, 490px); grid-template-rows: auto minmax(0, 1fr); min-height: 0; column-gap: 12px; }
  .rc-mapwrap { grid-column: 1; grid-row: 1 / 3; }
  .rc-hud { grid-column: 2; grid-row: 1; }
  .rc-ctl { grid-column: 2; grid-row: 2; overflow-y: auto; min-height: 0; margin: 0; max-width: none; }
  .rc-cut { grid-template-columns: 1fr 1fr; gap: 16px; max-width: 900px; align-items: center; }
  .rc-cut-pic img { max-height: calc(100svh - 120px); }
  .rc-cut-txt, .rc-cut .btn-gold { grid-column: 2; }
  .rc-cut-pic { grid-column: 1; grid-row: 1 / 3; }
}
@media (min-aspect-ratio: 5 / 4) and (min-height: 521px) { .rc-tray { height: 190px; } }
@media (min-aspect-ratio: 5 / 4) and (max-height: 520px) {
  .rc-play { row-gap: 4px; }
  .rc-ctl { gap: 6px; }
  .rc-pal { gap: 5px; flex-wrap: nowrap; }
  .rc-b { min-height: 52px; min-width: 52px; padding: 2px 4px; border-radius: 14px; } .rc-b--climb { min-width: 64px; } .rc-b--lower { min-width: 78px; }
  .rc-b i { font-size: 22px; } .rc-b span { font-size: 11px; word-break: keep-all; }
  .rc-tray { height: 82px; } .rc-pause { width: 44px; height: 44px; } .rc-prog { padding: 6px 8px; } .rc-prog-head { font-size: 13px; margin-bottom: 2px; } .rc-lvl span { font-size: 12px; } .rc-lvl b { font-size: 17px; }
  .rc-acts .btn, .rc-acts .btn-gold { min-height: 46px; }
  .rc-cut-txt { font-size: 17px; padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) { .rc-howto img, .rc-help.pulse, .rc-cut-pic img.in, .rc-banner, .rc-win-stars { animation: none; } }
