:root {
  --ink: #fdf6ea;
  --ink-soft: rgba(253, 246, 234, .7);
  --glass: rgba(26, 22, 52, .42);
  --line: rgba(255, 255, 255, .16);
  --gold: #f2c230;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: #14122a; color: var(--ink); font-family: Pretendard, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
.stage { position: fixed; inset: 0; touch-action: none; }
.stage canvas { display: block; }

.top { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); pointer-events: none;
  text-shadow: 0 1px 8px rgba(10, 6, 30, .55); }
.place { pointer-events: auto; }
.placeBtn { display: flex; flex-direction: column; align-items: flex-start; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; text-align: left; }
.name { font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.name::after { content: ' ▾'; font-size: 11px; color: var(--ink-soft); }
.where { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.places { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.places button { display: flex; flex-direction: column; align-items: flex-start; padding: 9px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; min-width: 168px; text-align: left; }
.places small { font-size: 11px; font-weight: 400; color: var(--ink-soft); margin-top: 1px; }
.places .here { border-color: var(--gold); }
body.leaving .stage { opacity: 0; transition: opacity .4s; }
.clock { text-align: right; }
.time { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.phase { font-size: 12px; color: var(--gold); margin-top: 2px; }
.count { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.hint { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); text-align: center;
  font-size: 13px; line-height: 1.6; color: var(--ink-soft); pointer-events: none; transition: opacity 1.2s; text-shadow: 0 1px 8px rgba(10, 6, 30, .6); }
.hint.off { opacity: 0; }

.actions { position: fixed; left: 0; right: 0; bottom: max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.actions > * { pointer-events: auto; }
.note { font-size: 13px; color: var(--gold); text-shadow: 0 1px 8px rgba(10, 6, 30, .7); }
button { font: inherit; color: inherit; border: 1px solid var(--line); background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); cursor: pointer; }
.main { min-width: 168px; padding: 12px 22px; border-radius: 999px; font-size: 15px; font-weight: 600; }
.main:disabled { opacity: .6; cursor: default; }
.sub { padding: 7px 14px; border-radius: 999px; font-size: 12px; color: var(--ink-soft); }
[hidden] { display: none !important; }

/* ── Seb's: 지금 나오는 곡 (유튜브 약관대로 재생기는 200x200 이상 보이게) ── */
.np { position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(24px, env(safe-area-inset-bottom)); width: 256px; padding: 8px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.np-player { position: relative; width: 240px; height: 200px; border-radius: 8px; overflow: hidden; background: #000; }
.np-player iframe { display: block; }
.np-tap { position: absolute; inset: auto 12px 12px; padding: 8px; border-radius: 999px; font-size: 13px; }
.np-season { margin-top: 8px; font-size: 11px; color: var(--gold); }
.np-title { font-size: 13px; font-weight: 600; margin-top: 2px; }
@media (max-width: 640px) { .np { bottom: auto; top: calc(86px + env(safe-area-inset-top)); } }

.jb { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); max-height: min(78vh, 640px); overflow: auto;
  padding: 16px; border-radius: 18px; background: rgba(20, 16, 40, .86); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.jb header { display: flex; justify-content: space-between; align-items: center; }
.jb header p { font-size: 16px; font-weight: 700; }
.jb header button { padding: 6px 12px; border-radius: 999px; font-size: 12px; }
.jb-note { font-size: 12px; color: var(--ink-soft); margin: 6px 0 12px; }
.jb-season { margin-bottom: 14px; }
.jb-season > p { font-size: 12px; font-weight: 700; color: var(--c); margin-bottom: 6px; }
.jb-season button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 9px 12px; margin-bottom: 6px; border-radius: 10px; font-size: 14px; }
.jb-season button small { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }
.jb-season button.on { border-color: var(--c); box-shadow: inset 3px 0 0 var(--c); }

/* 피아노 건반: 흰 건반 14개 위에 검은 건반 */
.keys { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); display: flex; width: min(560px, calc(100vw - 32px)); height: 120px; }
.keys button { border-radius: 0 0 6px 6px; padding: 0; border: 1px solid rgba(0, 0, 0, .5); -webkit-backdrop-filter: none; backdrop-filter: none; touch-action: none; }
.keys .w { flex: 1; background: #f4efe2; }
.keys .b { width: 0; flex: 0 0 0; position: relative; z-index: 1; overflow: visible; border: 0; background: none; }
.keys .b::before { content: ''; position: absolute; top: 0; left: calc(-1 * min(16px, 2.2vw)); width: min(32px, 4.4vw); height: 74px; background: #15131a; border-radius: 0 0 4px 4px; }
.keys .w.down { background: #ffd98a; }
.keys .b.down::before { background: #7a5a20; }
