/* Chordville site — a white page; the accent is the deep violet of the game's logo.
   Contrast (on white): text 17.9:1, text-2 10.8:1, text-3 6.2:1 (5.6:1 on the tinted panels), accent 7.3:1, white on accent 7.3:1,
   note text 10.2:1, like 5.7:1, danger 6.5:1 — all AA; the stars are symbols at 3.7:1 (3:1 needed).
   Saturation is kept for the accent alone; surfaces are near-neutral warm greys. Type: Pretendard, nothing under 14px. */
:root {
  --bg:#ffffff; --soft:#f6f5f2; --soft-2:#eceae5;
  --line:#e7e5e0; --line-strong:#cfccc5;
  --text:#18171a; --text-2:#3f3c45; --text-3:#635f68;
  --accent:#5b3cc4; --accent-hover:#4a2fa8; --accent-ink:#ffffff; --accent-soft:#f1edff; --accent-line:#c8bbf5;
  --note:#e4dbff; --note-line:#a690f0; --note-ink:#2f1a7a; --note-tail:#f1edff;
  --star:#b8770a; --like:#c2255c; --danger:#b4233c; --danger-soft:#fdf0f2;
  --key-white:#ffffff; --key-white-down:#e4dbff; --key-black:#1f1d22; --key-black-down:#5b5566; --key-line:#cfccc5;
  /* the night sky of the game's icon (about page only); text on it: white and sky-text, both AA */
  --sky-1:#1d1640; --sky-2:#2e2366; --sky-3:#4a3a8c; --sky-text:#ddd6f7; --sky-line:rgba(255,255,255,.28);
  --scrim:rgba(24,23,26,.45);
  --radius:12px;
  color-scheme:light;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { -webkit-text-size-adjust:100%; background:var(--bg); overflow-x:clip; }
/* the footer sits at the bottom of the window even when a page is short */
body { margin:0; min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; background:var(--bg); color:var(--text);
  font:16px/1.65 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Hiragino Sans', 'PingFang SC', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans KR', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', 'Malgun Gothic', system-ui, sans-serif;
  word-break:keep-all; overflow-wrap:anywhere; -webkit-font-smoothing:antialiased; }
body.composing { padding-bottom:calc(100px + env(safe-area-inset-bottom)); }
main { flex:1 0 auto; width:100%; max-width:640px; margin:0 auto; padding:0 20px; }
.top { width:100%; }
a { color:inherit; }
button, input, select, textarea { font:inherit; color:inherit; }
b, strong { font-weight:650; }
img.px, .brand img, .appIcon, .heroWm, .foot img { image-rendering:pixelated; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
h1, h2, h3 { letter-spacing:-.015em; }
h2 { margin:0 0 14px; font-size:20px; font-weight:750; line-height:1.35; }
h2 small { font-size:14px; font-weight:500; color:var(--text-3); margin-left:6px; letter-spacing:0; }

/* header: icon + wordmark, the three pages, language (one row on wide screens, the pages under it on phones) */
.top { position:sticky; top:0; z-index:6; background:var(--bg); border-bottom:1px solid var(--line); box-shadow:0 1px 0 rgba(24,23,26,.02); }
.bar { max-width:640px; margin:0 auto; padding:12px 20px 0; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 12px; }
.brand { display:flex; align-items:center; gap:10px; text-decoration:none; padding:2px 0; }
.brand .name { font-size:18px; font-weight:800; letter-spacing:-.01em; color:var(--text); }
/* dropdown (js/ui.js): a button and a floating list */
.dd { position:relative; display:inline-block; }
.ddBtn { appearance:none; display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; min-height:44px; padding:8px 14px;
  border:1px solid var(--line-strong); border-radius:10px; background:var(--bg); color:var(--text); font-size:15px; font-weight:600; cursor:pointer; text-align:left;
  transition:border-color .15s, background-color .15s; }
.ddBtn:hover { background:var(--soft); }
.ddBtn:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.dd.open .ddBtn { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.ddCap { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ddChev { width:12px; height:8px; flex:0 0 auto; color:var(--text-3); transition:transform .15s; }
.dd.open .ddChev { transform:rotate(180deg); }
.ddList { position:absolute; z-index:20; top:calc(100% + 6px); left:0; min-width:100%; max-height:300px; overflow:auto; margin:0; padding:6px; list-style:none;
  background:var(--bg); border:1px solid var(--line); border-radius:12px; box-shadow:0 12px 32px rgba(24,23,26,.14); }
.ddOpt { padding:9px 12px; border-radius:8px; font-size:15px; color:var(--text-2); cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ddOpt.act { background:var(--soft); color:var(--text); }
.ddOpt[aria-selected="true"] { color:var(--accent); font-weight:700; }
.dd.chipDD .ddBtn { border-radius:999px; min-height:38px; padding:6px 14px; font-size:14px; color:var(--text-2); }
.lang .ddList { left:auto; right:0; min-width:150px; }
.tabs { order:3; width:100%; display:flex; gap:24px; }
.tab { padding:12px 0 6px; border-bottom:3px solid transparent; color:var(--text-3); font-size:16px; font-weight:700; text-decoration:none; }
.tab:hover { color:var(--text); }
.tab.cur { color:var(--text); border-bottom-color:var(--accent); }
.view { padding-top:24px; }
#home.view { padding-top:0; }
h2.center { text-align:center; }

/* buttons */
.btn { appearance:none; display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--line-strong); background:var(--bg); color:var(--text);
  border-radius:10px; padding:8px 16px; min-height:44px; cursor:pointer; white-space:nowrap; touch-action:manipulation; font-size:15px; font-weight:650; text-decoration:none;
  transition:background-color .15s, border-color .15s, color .15s; }
.btn:hover { background:var(--soft); }
.btn:active { background:var(--soft-2); }
.btn.primary { background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
.btn.primary:hover { background:var(--accent-hover); border-color:var(--accent-hover); }
.btn.ghost { border-color:transparent; background:var(--soft); }
.btn.ghost:hover { background:var(--soft-2); }
.btn.danger { color:var(--danger); }
.btn.cur { background:var(--accent-soft); border-color:var(--accent); color:var(--accent-hover); box-shadow:inset 0 0 0 1px var(--accent); }
.btn:disabled { opacity:.4; cursor:default; }
.btn:focus-visible, .tab:focus-visible, .tin:focus-visible, .title:focus-visible, .lang select:focus-visible, .cpBar:focus-visible, .spot:focus-visible, .brand:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.btn.wide { width:100%; margin-top:16px; }
/* buttons that share a row may fold their words (long words in German, Russian…) instead of running off the screen */
.tools .btn, .sect.more .btn, .dock .btn, #cpDrafts .btn, .stores .store .st b { min-width:0; white-space:normal; line-height:1.25; text-align:center; overflow-wrap:normal; word-break:normal; hyphens:auto; }
.tools .btn, .sect.more .btn { padding-left:10px; padding-right:10px; }
/* a row of tools wraps whole buttons rather than breaking words */
.tools { flex-wrap:wrap; }
.tools .btn { flex:1 1 auto; }
@media (max-width:399px) { .dock .btn { padding:6px 8px; font-size:15px; } }
/* a note starting on a beat is at least its beat wide minus a margin, wider when its name needs it (Соль) */
.cpNote:not(.tail) { left:50%; right:auto; transform:translateX(-50%); width:max-content; min-width:calc(100% - 14px); padding:0 4px; z-index:1; }
@media (max-width:399px) { .cpNote:not(.tail) { min-width:calc(100% - 6px); left:50%; right:auto; } }
/* note names never break */
.cpNote, .cpKey span { white-space:nowrap; overflow-wrap:normal; word-break:keep-all; }
@media (max-width:399px) { .cpNote { left:3px; right:3px; letter-spacing:-.02em; } .cpNote.tail { right:3px; } .cpKey { font-size:14px; } }
.btn.chip { border-radius:999px; min-height:38px; padding:6px 14px; font-size:14px; }
.btn.round { width:44px; padding:0; border-radius:50%; font-size:22px; line-height:1; }
.btn.text { border:0; background:none; min-height:32px; padding:4px 0; font-size:14px; font-weight:600; color:var(--text-3); }
.btn.text:hover { color:var(--text); background:none; text-decoration:underline; }
.btn.text.danger { color:var(--danger); }

/* home: a night-sky hero (the app icon's sky) with the store buttons and a phone frame for a screenshot */
.hero { position:relative; margin:16px 0 0; padding:36px 16px 40px; color:#fff; overflow:hidden;
  background:linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, var(--sky-3) 100%); border-radius:24px; }
.sky i { position:absolute; width:3px; height:3px; border-radius:50%; background:#fff; opacity:.75; animation:twinkle 4s ease-in-out infinite; }
.sky i:nth-child(1) { left:8%; top:12%; } .sky i:nth-child(2) { left:22%; top:30%; animation-delay:-1s; } .sky i:nth-child(3) { left:38%; top:8%; animation-delay:-2s; }
.sky i:nth-child(4) { left:61%; top:18%; animation-delay:-.5s; } .sky i:nth-child(5) { left:78%; top:9%; animation-delay:-3s; } .sky i:nth-child(6) { left:90%; top:28%; animation-delay:-1.5s; }
.sky i:nth-child(7) { left:13%; top:58%; animation-delay:-2.5s; } .sky i:nth-child(8) { left:86%; top:52%; animation-delay:-.8s; } .sky i:nth-child(9) { left:52%; top:40%; animation-delay:-3.4s; }
.sky i:nth-child(10) { left:70%; top:70%; animation-delay:-1.2s; } .sky i:nth-child(11) { left:30%; top:78%; animation-delay:-2.2s; } .sky i:nth-child(12) { left:95%; top:82%; animation-delay:-.2s; }
.sky i:nth-child(3n) { width:5px; height:5px; box-shadow:0 0 8px rgba(255,255,255,.7); }
@keyframes twinkle { 0%, 100% { opacity:.25; } 50% { opacity:.9; } }
@media (prefers-reduced-motion: reduce) { .sky i { animation:none; } }
.heroIn { position:relative; display:flex; flex-direction:column; align-items:center; gap:32px; text-align:center; }
.heroWm { display:block; margin:0 auto 12px; max-width:100%; height:auto; }
.hero h1 { margin:0 0 10px; font-size:28px; line-height:1.3; font-weight:800; color:#fff; }
.lead { margin:0 auto 24px; max-width:30em; color:var(--sky-text); font-size:16px; }
.stores { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.store { display:flex; align-items:center; gap:10px; min-width:140px; padding:9px 14px 9px 12px; border-radius:12px; background:#fff; color:var(--text); text-decoration:none; text-align:left; }
.store svg { width:26px; height:26px; fill:currentColor; flex:0 0 auto; }
.store .st small { display:block; font-size:14px; line-height:1.2; color:var(--text-3); }
.store .st b { display:block; font-size:17px; line-height:1.3; font-weight:700; }
.store.soon { background:transparent; color:#fff; box-shadow:inset 0 0 0 1px var(--sky-line); }
.store.soon .st small { color:var(--sky-text); font-weight:700; }
/* store buttons: one row of two equal buttons; under 360px wide, two full rows of the same width */
@media (max-width:519px) { .stores { flex-wrap:nowrap; gap:8px; } .store { min-width:0; flex:1 1 0; gap:8px; padding:8px 10px; } .store svg { width:22px; height:22px; } .store .st b { font-size:15px; } }
@media (max-width:359px) { .stores { flex-direction:column; align-items:stretch; } .store { flex:none; width:100%; justify-content:center; padding:9px 12px; } }
.fine { margin:16px 0 0; font-size:14px; color:var(--sky-text); }

/* phone frames: a portrait screenshot from img/shots/, or the night sky and the icon until one is there */
.phone { flex:0 0 auto; width:220px; padding:10px; border-radius:38px; background:#121019; box-shadow:0 20px 50px rgba(10,6,30,.35), inset 0 0 0 1px rgba(255,255,255,.08); }
.phone .screen { position:relative; aspect-ratio:9 / 19.5; border-radius:29px; overflow:hidden;
  background:url("img/icon-64.png") center / 64px 64px no-repeat, linear-gradient(180deg, var(--sky-2), var(--sky-3)); image-rendering:pixelated; }
.phone .screen img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; image-rendering:auto; }
.phone.small { width:150px; padding:7px; border-radius:26px; }
.phone.small .screen { border-radius:20px; }

.block { padding:48px 0 8px; }
.feats { display:grid; gap:20px; }
.feat { display:flex; align-items:center; gap:20px; padding:20px; border:1px solid var(--line); border-radius:20px; background:var(--bg); }
.featText { flex:1; min-width:0; }
.fi { width:44px; height:44px; border-radius:12px; background:var(--accent-soft); display:grid; place-items:center; margin-bottom:12px; }
.fi svg { width:24px; height:24px; fill:none; stroke:var(--accent); stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.feat h3 { margin:0 0 4px; font-size:18px; font-weight:750; line-height:1.4; }
.feat p { margin:0; font-size:15px; color:var(--text-2); }
@media (max-width:519px) { .feat { flex-direction:column; align-items:stretch; } .feat .phone.small { align-self:center; } }
.web { margin-top:40px; padding:28px 22px; border-radius:20px; background:var(--soft); }
.web p { margin:0 0 18px; color:var(--text-2); }
.ctaRow { display:flex; gap:10px; flex-wrap:wrap; }
.ctaRow .btn { flex:1 1 180px; min-height:48px; }

/* page heads: a segmented control + the composer chip */
.pageHead { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; flex-wrap:wrap; }
.seg { display:flex; gap:8px; flex-wrap:wrap; }
#catSeg { margin-bottom:8px; }
#catSeg .btn { border-radius:999px; min-height:38px; padding:6px 16px; font-size:14px; }

.row { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.row.wrap { flex-wrap:wrap; }
.row.end { justify-content:flex-end; margin:20px 0 0; }
.label { font-size:14px; font-weight:650; color:var(--text-2); margin:18px 0 8px; display:block; }
.note { font-size:14px; color:var(--text-3); margin:24px 0 32px; line-height:1.7; }
.note b { color:var(--text-2); }
.tin { flex:1; min-width:0; background:var(--bg); border:1px solid var(--line-strong); border-radius:10px; padding:9px 12px; min-height:44px; font-size:16px; }
.tin.area { width:100%; resize:vertical; font:14px/1.5 ui-monospace, Consolas, monospace; word-break:break-all; }
.stars { color:var(--star); letter-spacing:2px; font-size:16px; white-space:nowrap; }
.tag { color:var(--text-3); font-weight:650; }
.code { flex:1; min-width:0; font:14px/1.5 ui-monospace, Consolas, monospace; background:var(--soft); border-radius:8px; padding:9px 12px; word-break:break-all; user-select:all; }

/* songs: rows like a music app */
.songs { display:flex; flex-direction:column; }
.song { display:flex; align-items:flex-start; gap:14px; padding:16px 0; border-bottom:1px solid var(--line); }
.song .play { flex:0 0 auto; width:48px; height:48px; min-height:0; padding:0; border-radius:50%; border:0; background:var(--soft); color:var(--text); font-size:16px; }
.song .play:hover { background:var(--soft-2); }
.song.on .play { background:var(--accent); color:var(--accent-ink); }
.song .body { flex:1; min-width:0; }
.song .nm { font-size:17px; font-weight:750; line-height:1.4; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.song.on .nm { color:var(--accent); }
.song .meta, .song .band { font-size:14px; color:var(--text-3); }
.song .meta .who { color:var(--text-2); font-weight:650; }
.song .acts { display:flex; gap:16px; margin-top:4px; flex-wrap:wrap; }
.song .acts .btn.text.cur { color:var(--accent); text-decoration:underline; text-underline-offset:4px; }
.song.open { flex-wrap:wrap; }
.bandEdit { flex:0 0 100%; margin-top:2px; padding:14px; border-radius:14px; background:var(--soft); }
.bandEdit .tools .btn.ghost { background:var(--bg); border-color:var(--line-strong); white-space:nowrap; }
@media (max-width:399px) { .bandEdit { padding:10px; } .bandEdit .stage { gap:4px; } .bandEdit .spot { padding:10px 1px 8px; } .bandEdit .spot b { font-size:14px; } }
@media (max-width:359px) { .bandEdit { margin-left:-12px; margin-right:-12px; flex-basis:calc(100% + 24px); padding:10px 6px; } .bandEdit .stage { gap:3px; } .bandEdit .spot { padding:10px 0 8px; } .bandEdit .spot b { letter-spacing:-.03em; } }
.bandEdit .stage { margin-bottom:6px; }
.bandEdit .spot { background:var(--bg); }
.bandEdit .pickGroup .label { margin-top:10px; }
.song.open { grid-column:1 / -1; }
.song .like { flex:0 0 auto; border:0; background:none; min-height:48px; padding:0 4px; font-size:16px; font-weight:650; color:var(--text-3); }
.song .like:hover { background:none; color:var(--like); }
.song .like.on { color:var(--like); }
.empty { grid-column:1 / -1; text-align:center; padding:56px 0 40px; }
.empty p { margin:0 0 18px; color:var(--text-3); font-size:16px; }
.song.skel { align-items:center; }
.song.skel .play, .song.skel .lines { display:block; background:var(--soft); border-radius:50%; width:48px; height:48px; animation:skel 1.2s ease-in-out infinite; }
.song.skel .lines { border-radius:8px; width:auto; flex:1; height:44px; max-width:280px; }
@keyframes skel { 50% { opacity:.5; } }
@media (prefers-reduced-motion: reduce) { .song.skel span { animation:none; } }

/* composer: sections divided by space */
.modes { display:grid; grid-template-columns:1fr 1fr; gap:4px; background:var(--soft-2); padding:4px; border-radius:12px; flex:1 1 220px; }
.modes .btn { border:0; background:none; min-height:38px; color:var(--text-3); box-shadow:none; }
.modes .btn.cur { background:var(--bg); color:var(--text); box-shadow:0 1px 3px rgba(24,23,26,.14); }
.sect { padding:16px 0 24px; border-bottom:1px solid var(--line); }
.titleRow { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.title { flex:1; min-width:0; border:0; border-bottom:2px solid var(--line); background:none; padding:6px 0; font-size:24px; font-weight:800; letter-spacing:-.02em; border-radius:0; }
.title:focus { border-bottom-color:var(--accent); outline:none; }
#cpDrafts { margin:0; }
#cpDrafts .draftDD { flex:1 1 160px; min-width:0; }
#cpDrafts .ddBtn { min-height:40px; }
@media (max-width:399px) { #cpDrafts .draftDD { flex-basis:100%; } #cpDrafts .btn { flex:1; } }
#cpDrafts .btn { min-height:40px; font-size:14px; padding:6px 14px; }
#cpPages .btn { min-height:36px; padding:4px 14px; font-size:14px; border-radius:999px; }
.cpBars { display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; margin:4px 0 0; }
.cpBar { appearance:none; background:var(--bg); border:1px solid var(--line-strong); border-radius:var(--radius); padding:8px 4px; cursor:pointer; text-align:center; min-width:0; transition:border-color .15s, background-color .15s; }
.cpBar:hover { background:var(--soft); }
.cpBar small { display:block; font-size:14px; color:var(--text-3); line-height:1.3; }
.cpBar b { display:block; font-size:18px; font-weight:750; color:var(--text); line-height:1.4; overflow:hidden; white-space:nowrap; }
.cpBar.on { background:var(--accent-soft); border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.chordPanel { position:relative; margin-top:12px; padding:10px; border-radius:14px; background:var(--accent-soft); border:1px solid var(--accent-line); }
.chordPanel::before { content:''; position:absolute; top:-8px; left:calc(var(--ax, 12.5%) - 8px); width:14px; height:14px; background:var(--accent-soft);
  border-left:1px solid var(--accent-line); border-top:1px solid var(--accent-line); transform:rotate(45deg); border-radius:3px 0 0 0; }
.cpTitle { font-size:14px; font-weight:700; color:var(--accent-hover); margin:0 2px 10px; }
.chords { display:grid; grid-template-columns:repeat(6, 1fr); gap:6px; }
.chords .btn { padding:6px 0; min-height:40px; font-size:15px; border-color:var(--accent-line); }
.chords .btn:hover { background:#fff; border-color:var(--accent); }
.chords .btn.cur { background:var(--accent); border-color:var(--accent); color:var(--accent-ink); box-shadow:none; }

.cpLane { display:grid; grid-template-columns:repeat(8, 1fr); gap:4px; height:148px; margin:0 0 14px; }
.cpSlot { position:relative; background:var(--soft); border-radius:8px; cursor:pointer; transition:background-color .1s; }
.cpSlot:not(.beat) { background:#fbfaf8; box-shadow:inset 0 0 0 1px var(--line); }
.cpSlot.sel { box-shadow:inset 0 0 0 2px var(--accent); }
.cpSlot.ph { background:var(--accent-soft); }
.cpNote { position:absolute; left:7px; right:7px; height:26px; border-radius:7px; display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:750; font-style:normal; color:var(--note-ink); background:var(--note); box-shadow:inset 0 0 0 1px var(--note-line); }
.cpNote.tail { left:-4px; right:7px; border-radius:0 7px 7px 0; background:var(--note-tail); box-shadow:inset 0 1px 0 var(--note-line), inset -1px 0 0 var(--note-line), inset 0 -1px 0 var(--note-line); }
.cpOct { display:flex; align-items:center; justify-content:center; gap:16px; margin:0 0 12px; }
.cpOct span { min-width:140px; text-align:center; font-weight:650; color:var(--text-2); font-size:15px; }

/* the piano, as in the game: a pressed key only changes colour, a ♪ rises from it, chord tones get a dot, black keys stay put */
.cpKeys { position:relative; display:flex; height:168px; background:var(--key-line); border:1px solid var(--key-line); border-radius:12px; gap:1px; overflow:hidden;
  user-select:none; -webkit-user-select:none; touch-action:none; }
.cpKey { position:relative; flex:1; background:var(--key-white); color:var(--text-2); cursor:pointer;
  display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:8px; padding-bottom:14px; font-size:15px; font-weight:650; transition:background-color .15s; }
.cpKey b { width:8px; height:8px; border-radius:50%; background:transparent; }
.cpKey.ct b { background:var(--accent); }
.cpKey.down { background:var(--key-white-down); transition:none; }
.cpKey .bk { position:absolute; top:0; right:-13px; width:24px; height:98px; background:var(--key-black); border-radius:0 0 6px 6px; z-index:2; cursor:pointer; transition:background-color .15s; }
.cpKey .bk.down { background:var(--key-black-down); transition:none; }
.keypop { position:absolute; left:0; right:0; bottom:64px; text-align:center; color:var(--accent); font-size:22px; font-weight:700; font-style:normal; pointer-events:none; z-index:3; animation:keyPop .6s ease-out forwards; }
.bk .keypop { bottom:auto; top:48px; left:-8px; right:-8px; }
@keyframes keyPop { from { transform:translateY(0); opacity:1; } to { transform:translateY(-28px); opacity:0; } }
@media (prefers-reduced-motion: reduce) { .keypop { animation:none; opacity:0; } }
.tools { margin:14px 0 0; }
.tools .btn { flex:1; }
.hints { margin:14px 0 0; padding:12px 14px 12px 32px; font-size:14px; color:var(--text-2); background:var(--soft); border-radius:10px; line-height:1.6; }
.hints:empty { display:none; }

/* the session */
.stage { display:grid; grid-template-columns:repeat(5, 1fr); gap:6px; margin-bottom:10px; }
.spot { appearance:none; border:1px dashed var(--line-strong); background:var(--bg); border-radius:var(--radius); padding:14px 2px 10px; cursor:pointer; text-align:center; min-width:0; }
.spot small { display:block; font-size:14px; color:var(--text-3); line-height:1.3; }
.spot b { display:block; font-size:15px; font-weight:750; line-height:1.6; color:var(--text-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.spot .role { display:block; font-size:14px; color:var(--accent); font-weight:650; min-height:1.4em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.spot.on { border-style:solid; background:var(--soft); }
.spot.on b { color:var(--text); }
.spot.sel { border:1px solid var(--accent); background:var(--accent-soft); box-shadow:inset 0 0 0 1px var(--accent); }
.bandNote { font-size:14px; color:var(--text-3); margin:0 0 8px; }
.pickGroup .label { margin:14px 0 8px; }
.chips { display:flex; flex-wrap:wrap; gap:6px; }
.chips .btn { min-height:40px; padding:6px 14px; border-radius:999px; font-size:15px; }
.cpCols { display:flex; flex-direction:column; }
.cpLeft, .cpRight { display:contents; }
.sect.more { order:5; display:flex; flex-wrap:wrap; gap:8px; border-bottom:0; }
.sect.more .btn { flex:1 1 auto; }

/* the main actions stay at the bottom while composing */
.dock { position:fixed; left:0; right:0; bottom:0; z-index:5; padding:12px 20px calc(12px + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.97); border-top:1px solid var(--line); }
.dockIn { max-width:600px; margin:0 auto; display:flex; gap:8px; }
.dock .btn { flex:1; min-height:52px; font-size:16px; border-radius:12px; }

/* footer */
.foot { flex-shrink:0; width:100%; max-width:640px; margin:24px auto 0; padding:24px 20px 40px; border-top:1px solid var(--line); display:flex; align-items:center; gap:12px; font-size:14px; color:var(--text-3); }
.foot b { color:var(--text); }
.foot .copy { margin-left:auto; }
@media (max-width:399px) { .foot { flex-wrap:wrap; } .foot .copy { margin-left:44px; width:100%; } }

/* dialogs and the toast */
dialog { border:0; border-radius:16px; background:var(--bg); color:var(--text); box-shadow:0 16px 48px rgba(24,23,26,.2); padding:24px; width:min(460px, calc(100vw - 32px)); }
dialog::backdrop { background:var(--scrim); }
.dlgHead { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:8px; }
.dlgHead h2 { margin:6px 0 0; }
.x { appearance:none; flex:0 0 auto; width:40px; height:40px; margin:-4px -8px 0 0; border:0; border-radius:50%; background:none; color:var(--text-2); cursor:pointer; display:grid; place-items:center; }
.x:hover { background:var(--soft); }
.x:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.x svg { width:16px; height:16px; }
.toast { position:fixed; left:0; right:0; margin:0 auto; width:fit-content; bottom:24px; max-width:calc(100vw - 32px); background:var(--text); color:#fff;
  border-radius:10px; padding:10px 16px; font-size:14px; opacity:0; pointer-events:none; transition:opacity .2s; z-index:10; }
body.composing .toast { bottom:96px; }
.toast.show { opacity:1; }

/* ---------- wide screens ---------- */
@media (min-width:960px) {
  main, .bar, .foot { max-width:1080px; }
  main, .bar { padding-left:32px; padding-right:32px; }
  .bar { flex-wrap:nowrap; padding-top:10px; }
  .tabs { order:0; width:auto; margin:0 auto 0 32px; gap:28px; }
  .tab { padding:18px 0 8px; }
  /* about: text left, the phone right; features alternate sides */
  .hero { margin-top:28px; padding:64px 64px 72px; border-radius:32px; }
  .heroIn { flex-direction:row; justify-content:space-between; text-align:left; gap:48px; }
  .heroText { flex:1; max-width:520px; }
  .heroWm { margin:0 0 16px; }
  .hero h1 { font-size:38px; }
  .lead { margin-left:0; font-size:18px; }
  .stores { justify-content:flex-start; }
  .phone.big { width:280px; margin-right:24px; }
  .block > h2 { font-size:30px; margin-bottom:8px; }
  .feats { gap:0; }
  .feat { justify-content:center; gap:96px; padding:40px 0; border:0; border-radius:0; border-bottom:1px solid var(--line); }
  .feat:last-child { border-bottom:0; }
  .feat:nth-child(even) { flex-direction:row-reverse; }
  .featText { flex:0 1 420px; }
  .fi { width:52px; height:52px; border-radius:14px; margin-bottom:16px; }
  .feat h3 { font-size:26px; margin-bottom:8px; }
  .feat p { font-size:18px; }
  .phone.small { width:220px; padding:9px; border-radius:36px; }
  .phone.small .screen { border-radius:28px; }
  .web { display:flex; align-items:center; gap:40px; padding:36px 40px; }
  .web > div:first-child { flex:1; }
  .web p { margin:0; }
  .web .ctaRow { flex:0 0 320px; flex-direction:column; }
  .web .ctaRow .btn { flex:0 0 auto; }
  /* songs: two columns of rows */
  .songs { display:grid; grid-template-columns:1fr 1fr; column-gap:40px; }
  /* composer: the song's bars on the left, the melody on the right */
  .cpCols { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1.15fr); column-gap:56px; align-items:start; }
  .cpLeft, .cpRight { display:block; }
  .cpCols.band { grid-template-columns:minmax(0, 1fr); max-width:760px; margin:0 auto; }
  .cpCols.band .cpRight { display:none; }
  .dock { padding-left:32px; padding-right:32px; }
  .dockIn { max-width:1016px; justify-content:space-between; }
  .dock .btn { flex:0 1 280px; }
}
