/* Same palette and card language as the other Hoodimong games (cream cards, stitch lines, Jua). */
:root {
  --cream: #f6eee3; --paper: #fffaf3; --ink: #3b3029; --muted: #8b7d70; --line: #eadccb;
  --coral: #e8846a; --coral-dark: #c96a52; --gold: #e9b44c; --stitch: #e0c6a8;
  --shadow: 0 6px 18px rgba(92, 66, 40, .14);
  --head: "Jua", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --body: -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--cream) var(--bg, url(assets/bg/bg_04_house_interior.jpg)) center / cover no-repeat fixed; color: var(--ink); font: 15px/1.45 var(--body); overscroll-behavior: none; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
body::before { content: ""; position: fixed; inset: 0; background: rgba(246, 238, 227, .74); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: -1; transition: background .4s; }
body.night::before { background: rgba(38, 33, 58, .62); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }

#app { max-width: 480px; height: 100dvh; margin: 0 auto; position: relative; overflow: hidden; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 10px 14px calc(10px + var(--safe-b)); gap: 8px; }

.icon-btn { width: 44px; height: 44px; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); display: grid; place-items: center; flex: none; }
.icon-btn img { width: 30px; height: 30px; }
.icon-btn:active { transform: scale(.94); }
.lang-btn { width: 40px; font: 15px/1 var(--head); color: var(--coral-dark); }
.sheet .lang-btn { width: 52px; }

/* ---------- song list ---------- */
.topbar { display: flex; align-items: center; gap: 8px; }
.brand { flex: 1; display: flex; flex-direction: column; line-height: 1.05; }
.brand b { font: 27px/1 var(--head); color: var(--coral-dark); }
.brand small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.choir { display: flex; justify-content: center; align-items: flex-end; gap: 2px; height: 118px; margin-top: 4px; }
.choir img { width: 70px; animation: sway 1.3s ease-in-out infinite; transform-origin: 50% 100%; }
.choir img:nth-child(2n) { animation-delay: -.65s; }
.songs { display: flex; flex-direction: column; gap: 10px; overflow: auto; padding-bottom: 6px; }
.song { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; text-align: left; background: var(--paper); border-radius: 22px; padding: 10px 12px; box-shadow: var(--shadow); position: relative; }
.song::after { content: ""; position: absolute; inset: 5px; border: 2px dashed var(--stitch); border-radius: 18px; pointer-events: none; }
.song .face { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; }
.song .face img { width: 58px; }
.song b { font: 20px/1.15 var(--head); display: block; }
.song small { color: var(--muted); font-size: 12.5px; display: block; }
.song .meta { font-size: 12px; color: #8a6a4c; margin-top: 2px; }
.song .stars { color: var(--gold); letter-spacing: 1px; }
.song .grade { font: 30px/1 var(--head); color: var(--coral-dark); min-width: 34px; text-align: center; }
.song .grade.none { color: var(--line); }
.song:active { transform: scale(.98); }

/* ---------- play ---------- */
.playbar { display: flex; align-items: center; gap: 8px; }
.now { flex: 1; min-width: 0; }
.now small { display: block; font: 15px var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 6px; border-radius: 3px; background: rgba(255, 250, 243, .7); overflow: hidden; margin-top: 4px; }
.progress i { display: block; height: 100%; width: 0; background: var(--coral); border-radius: 3px; }
.pscore { min-width: 92px; text-align: right; line-height: 1.05; background: var(--paper); border-radius: 14px; padding: 5px 10px; box-shadow: var(--shadow); }
.pscore b { font: 18px var(--head); display: block; }
.pscore small { font-size: 11px; color: var(--coral-dark); }
body.night .now small { color: #fffaf3; }

.stage { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; height: 92px; background: linear-gradient(180deg, transparent 0 62%, rgba(232, 214, 192, .55) 62% 100%); border-radius: 18px; }
.stage img { width: 74px; margin: 0 auto -2px; transform-origin: 50% 100%; animation: bob var(--beat, .6s) ease-in-out infinite; }
.stage img.hop { animation: hop .32s cubic-bezier(.2, .9, .3, 1.3); }
.stage img.oops { animation: oops .35s ease; filter: saturate(.5); }

.road { flex: 1; min-height: 0; position: relative; border-radius: 22px; overflow: hidden; background: rgba(255, 250, 243, .55); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6); }
body.night .road { background: rgba(40, 34, 64, .55); }
.road canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.judge { position: absolute; left: 0; right: 0; top: 46%; text-align: center; font: 30px var(--head); pointer-events: none; text-shadow: 0 2px 0 #fffaf3, 0 0 10px #fffaf3; }
.judge.show { animation: pop .5s ease forwards; }
.judge .perfect { color: var(--coral-dark); }
.judge .good { color: #6f9a5a; }
.judge .miss { color: #9a8e86; }
.judge small { display: block; font-size: 16px; color: var(--muted); }

.pads { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.pad { display: grid; place-items: center; height: 64px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); position: relative; touch-action: none; }
.pad img { width: 50px; height: 50px; object-fit: contain; }
.pad.down { transform: translateY(2px) scale(.95); box-shadow: 0 2px 6px rgba(92, 66, 40, .2), 0 0 0 3px var(--c) inset; }

/* ---------- sheets ---------- */
.overlay { position: fixed; inset: 0; z-index: 30; background: rgba(59, 48, 41, .42); display: grid; place-items: end center; animation: fade .2s ease; }
.sheet { width: min(480px, 100%); background: var(--paper); border-radius: 28px 28px 0 0; padding: 18px 20px calc(20px + var(--safe-b)); box-shadow: 0 -8px 30px rgba(60, 40, 25, .25); animation: rise .28s cubic-bezier(.2, .9, .3, 1.1); text-align: center; max-height: 92dvh; overflow: auto; }
.sheet .eyebrow { font-size: 12px; letter-spacing: .5px; color: var(--muted); }
.sheet h2 { font: 26px/1.25 var(--head); margin: 4px 0 6px; }
.sheet p { margin: 6px 0; color: #5d4f44; }
.sheet .actor { display: flex; justify-content: center; align-items: flex-end; gap: 2px; min-height: 96px; margin: 4px 0; }
.sheet .actor img { width: 66px; }
.sheet .big { font: 64px/1 var(--head); color: var(--coral-dark); margin: 2px 0; }
.sheet .steps { text-align: left; margin: 10px 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.sheet .steps li { background: #fff3e2; border-radius: 14px; padding: 8px 12px; font-size: 14px; color: #6d4f35; display: flex; gap: 8px; align-items: center; }
.sheet .steps img { width: 30px; height: 30px; object-fit: contain; flex: none; }
.sheet .tip { background: #fff3e2; border-radius: 14px; padding: 8px 12px; font-size: 13.5px; color: #7a5a3c; }
.sheet .result { display: flex; justify-content: center; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.sheet .result span { background: #fff3e2; border-radius: 14px; padding: 6px 12px; font: 15px var(--head); }
.btn { width: 100%; height: 54px; border-radius: 18px; font: 21px var(--head); margin-top: 10px; }
.btn.primary { background: linear-gradient(180deg, #ef977d, var(--coral)); color: #fff; box-shadow: 0 5px 0 var(--coral-dark); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--coral-dark); }
.btn.ghost { background: #f3e8da; color: #6d5a49; }
.setting { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); text-align: left; gap: 8px; }
.setting small { display: block; color: var(--muted); font-size: 11.5px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 36px; height: 36px; border-radius: 12px; background: #f3e8da; font: 20px var(--head); }
.stepper output { min-width: 62px; text-align: center; font: 16px var(--head); }
.switch { width: 52px; height: 30px; border-radius: 15px; background: #ddd0c0; position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--coral); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.toast { position: fixed; left: 50%; top: 14px; transform: translate(-50%, -140%); background: #3b3029; color: #fff; padding: 10px 16px; border-radius: 14px; z-index: 40; font-size: 14px; transition: transform .25s ease; max-width: 90vw; text-align: center; }
.toast.show { transform: translate(-50%, 0); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-3px); } }
@keyframes bob { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-3px) scaleY(1.02); } }
@keyframes hop { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-22%) scale(1.06, .96); } 100% { transform: translateY(0) scale(1); } }
@keyframes oops { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-5%) rotate(-4deg); } 70% { transform: translateX(5%) rotate(4deg); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 25% { transform: scale(1.12); opacity: 1; } 60% { transform: scale(1); opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }

body.reduced *, body.reduced *::before, body.reduced *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
@media (max-height: 700px) { .stage { height: 70px; } .stage img { width: 56px; } .pad { height: 54px; } .choir { height: 90px; } .choir img { width: 56px; } }
