/* 마리아의 노래 — 화면 모양. 색은 base.css 토큰을 쓴다. */
.ms-body { background: var(--advent); color: var(--cream); overscroll-behavior: none; }
.ms-body .topbar-title { color: var(--cream); }
@media (max-width: 420px) { .ms-body .topbar-title { display: none; } }
.ms-body .play-start .bubble, .ms-body #end .bubble { color: var(--ink); }
.ms-cover { width: 100%; max-width: 440px; aspect-ratio: 4 / 3; border-radius: var(--r-card); overflow: hidden; background: var(--advent-dark); }
.ms-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-lead { max-width: 30em; font-size: 18px; line-height: 1.5; }
.ms-intro { width: 100%; max-width: 520px; text-align: left; }
.ms-tip { margin: 0; padding: 8px 16px; border-radius: 16px; background: var(--advent-dark); font-size: 15px; font-weight: 700; }
.ms-howto { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: var(--cream); color: var(--ink); font-weight: 800; }
.ms-howto img { width: 36px; height: 36px; animation: ms-tap 1s ease-in-out infinite; }
@keyframes ms-tap { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(4px) scale(.94); } }
.ms-keys { margin: 0; font-size: 18px; font-weight: 800; }

/* 놀이 화면: 장면 · 음표 길 · 악기 단추 */
.ms-play { display: grid; grid-template-rows: auto 1fr auto; height: calc(100svh - 80px); min-height: 460px; max-width: 620px; margin: 0 auto; padding: 0 8px 8px; gap: 6px; }
.ms-scene { position: relative; aspect-ratio: 16 / 7; max-height: 28svh; width: 100%; border-radius: 20px; overflow: hidden; background: var(--advent-dark); }
.ms-scene > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; transition: filter .4s; }
.ms-scene.joy > img { filter: brightness(1.12) saturate(1.2); }
.ms-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ms-fx img { position: absolute; width: 34px; height: 34px; animation: ms-rise 1.6s ease-out forwards; }
@keyframes ms-rise { from { transform: translateY(0) scale(.6); opacity: 1; } to { transform: translateY(-140px) scale(1.1); opacity: 0; } }
.ms-hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
.ms-pause { background: var(--cream); color: var(--ink); font-size: 20px; flex: none; width: 48px; height: 48px; }
.ms-joy { position: relative; flex: 1; height: 16px; border-radius: 999px; background: rgba(28, 37, 84, .55); }
.ms-joy i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #FF9DB0, #E5484D); transition: width .15s; }
.ms-joy b { position: absolute; right: -6px; top: 50%; transform: translateY(-50%); color: #FF9DB0; font-size: 26px; line-height: 1; text-shadow: 0 0 6px #fff; }
.ms-scene.joy .ms-joy b { animation: jw-breathe .4s infinite; }
.ms-score { margin: 0; min-width: 72px; padding: 4px 12px; border-radius: 999px; background: rgba(28, 37, 84, .7); font-size: 20px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.ms-banner { position: absolute; left: 0; right: 0; bottom: 10px; margin: 0 auto; width: max-content; max-width: calc(100% - 24px); padding: 8px 18px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 20px; font-weight: 900; box-shadow: 0 5px 0 var(--gold-dark); animation: ms-pop .3s ease-out; }
@keyframes ms-pop { from { transform: scale(.8); opacity: 0; } }

.ms-road { position: relative; min-height: 0; border-radius: 20px; overflow: hidden; background: linear-gradient(#3B1C5A, #5B2C83); touch-action: none; user-select: none; -webkit-user-select: none; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ms-avoid { position: absolute; left: 0; right: 0; height: 50%; pointer-events: none; }
.ms-judge { position: absolute; left: 0; right: 0; top: 30%; margin: 0; text-align: center; font-size: 30px; font-weight: 900; color: var(--gold); text-shadow: 0 3px 0 rgba(0, 0, 0, .35); pointer-events: none; }
.ms-judge.pop { animation: ms-pop .2s ease-out; }
.ms-combo { position: absolute; right: 10px; top: 10px; margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--joy); font-size: 18px; font-weight: 900; pointer-events: none; }
.ms-pausebox { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; background: rgba(28, 37, 84, .7); font-size: 24px; font-weight: 900; }

.ms-pads { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 8px; touch-action: none; }
.ms-pad { position: relative; height: 104px; border: 0; border-radius: 20px; padding: 0; overflow: hidden; background: var(--cream); background: color-mix(in srgb, var(--pad, #999) 26%, var(--cream)); box-shadow: 0 6px 0 var(--pad-deep, #C2A060); cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.ms-pad img { position: absolute; left: 50%; top: 4px; height: 128%; transform: translateX(-50%); transform-origin: 50% 30%; pointer-events: none; transition: transform .08s; } /* 얼굴과 악기가 보이게 위에 맞춤 */
@media (max-width: 520px) { .ms-pad img { height: 150%; } }
.ms-pad span { position: absolute; left: 6px; top: 6px; padding: 1px 8px; border-radius: 999px; background: var(--pad, #999); color: #fff; font-size: 14px; font-weight: 900; }
.ms-pad.on { transform: translateY(4px); box-shadow: 0 2px 0 var(--pad-deep, #C2A060); }
.ms-pad.on img { transform: translateX(-50%) scale(1.08) rotate(-4deg); }
.ms-pad[hidden] { display: none; }
.ms-pad.new { animation: jw-hop .6s 2; }

@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .ms-play { max-width: 760px; }
  .ms-scene { max-height: 30svh; }
  .ms-pad { height: 120px; }
}

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