/* ScribbleSong Studio: the ScribbleSong look (navy, soft corner light, glass, hairlines, Bricolage Grotesque) in mint and magenta */
@font-face{font-family:"Bricolage Grotesque";src:url("../fonts/bricolage-grotesque-v9-latin-300.woff2") format("woff2");font-weight:300;font-display:swap}
@font-face{font-family:"Bricolage Grotesque";src:url("../fonts/bricolage-grotesque-v9-latin-regular.woff2") format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:"Bricolage Grotesque";src:url("../fonts/bricolage-grotesque-v9-latin-600.woff2") format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:"Bricolage Grotesque";src:url("../fonts/bricolage-grotesque-v9-latin-700.woff2") format("woff2");font-weight:700;font-display:swap}
@font-face{font-family:"Bricolage Grotesque";src:url("../fonts/bricolage-grotesque-v9-latin-800.woff2") format("woff2");font-weight:800;font-display:swap}
:root{
  color-scheme:dark;
  --bg:#0A0E1A; --panel:rgba(22,28,48,.78); --panelSolid:#151B2F; --raise:#222A47; --well:#0E1324;
  --line:rgba(255,255,255,.11); --line2:rgba(255,255,255,.2);
  --ink:#F2F5FF; --mute:#AEB7D2; --faint:#8C97B6;
  --solid:#F2F5FF; --solidInk:#0B1020; --danger:#FF7A6E; --mint:#6FF2D6; --pink:#FF7CC0;
  --font:"Bricolage Grotesque",ui-rounded,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --safeT:env(safe-area-inset-top,0px); --safeB:env(safe-area-inset-bottom,0px);
}
*,*::before,*::after{box-sizing:border-box}
*{touch-action:manipulation}
[hidden]{display:none !important}
html{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-text-size-adjust:100%;min-height:100%;background:var(--bg)}
.legaldoc{-webkit-user-select:text;user-select:text}
html,body{height:100%;margin:0}
body{background:transparent;color:var(--ink);font-family:var(--font);-webkit-font-smoothing:antialiased;overflow:hidden}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
a{color:inherit}
svg{display:block}
:focus-visible{outline:2px solid var(--solid);outline-offset:2px}
h1,h2,h3{margin:0;letter-spacing:-.02em}
.icon{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;color:var(--ink);flex:none}
.icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.icon.ghost{color:var(--mute)}
.icon.ghost:active{background:rgba(255,255,255,.08)}

/* background light: mint and magenta for Studio */
.orbs{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:0}
/* like ScribbleSong: solid navy at the top and bottom (status bar and home indicator), so the light fades in and out
   instead of stopping at a hard edge; the light lives in the middle */
.orbs::after{content:'';position:absolute;left:0;right:0;top:0;height:260px;background:linear-gradient(to bottom,rgb(10,14,26) 0,rgb(10,14,26) 110px,rgba(10,14,26,.85) 140px,rgba(10,14,26,.55) 175px,rgba(10,14,26,.25) 215px,rgba(10,14,26,0) 260px);z-index:1}
.orbs::before{content:'';position:absolute;left:0;right:0;bottom:0;height:240px;background:linear-gradient(to top,rgb(10,14,26) 0,rgb(10,14,26) 90px,rgba(10,14,26,.85) 120px,rgba(10,14,26,.55) 155px,rgba(10,14,26,.25) 195px,rgba(10,14,26,0) 240px);z-index:1}
.orbs i{position:absolute;width:75vmax;height:75vmax;border-radius:50%;filter:blur(80px)}
.orbs i:nth-child(1){left:-34vmax;top:-16vmax;background:radial-gradient(circle,hsl(var(--hA,168) 85% 58% / .42),transparent 65%);transition:background 1.2s}
.orbs i:nth-child(2){right:-38vmax;bottom:-30vmax;background:radial-gradient(circle,hsl(var(--hB,326) 90% 66% / .4),transparent 65%);transition:background 1.2s}
.orbs i:nth-child(3){left:-20vmax;bottom:-46vmax;background:radial-gradient(circle,hsl(44 95% 62% / .18),transparent 65%)}

/* screens */
.screen{position:fixed;inset:0;z-index:1;display:flex;flex-direction:column;gap:14px;padding:calc(var(--safeT) + 8px) 16px calc(var(--safeB) + 14px);overflow:auto;max-width:620px;margin:0 auto}
.top{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:48px}
.brand{display:flex;align-items:center;gap:9px;font-size:1.2rem;letter-spacing:-.02em}
.brand img{border-radius:8px}
.brand .sub2{font-weight:700;color:var(--mint)}
.intro h1{font-size:clamp(1.7rem,7.5vw,2.2rem);font-weight:300;letter-spacing:-.035em;margin-top:10px}
.sub{color:var(--mute);line-height:1.45;margin:8px 0 0}
.fine{color:var(--faint);font-size:.8rem;line-height:1.4;margin:10px 0 0}
.lead{color:var(--mute);font-size:.92rem;line-height:1.45;margin:0 0 6px}
.tlink{color:var(--mute);text-decoration:underline;text-underline-offset:3px;font-size:inherit}
.legallinks{display:flex;gap:18px;font-size:.8rem;color:var(--faint);margin:6px 0 0}
.foot{margin-top:auto;padding-top:20px}

/* buttons */
.big{width:100%;min-height:52px;border-radius:16px;font-weight:700;font-size:1rem;padding:0 20px;display:flex;align-items:center;justify-content:center;gap:9px;text-decoration:none}
.big.solid,.pill.solid{background:var(--solid);color:var(--solidInk)}
.big.danger{background:var(--danger);color:#1A0B0B}
.big:disabled{opacity:.38;cursor:default}
.sheet .big{margin-top:14px}
.gate{position:fixed;inset:0;z-index:40;display:grid;place-items:center;padding:24px 18px;overflow:auto;background:rgba(6,9,18,.82);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px)}
.gatecard{max-width:420px;width:100%;display:flex;flex-direction:column;gap:14px;align-items:flex-start;padding:26px 22px;border-radius:28px;background:var(--panelSolid);border:1px solid var(--line);box-shadow:0 30px 80px rgba(0,0,0,.5)}
.gatecard img{border-radius:18px;width:64px;height:64px}
.gatecard h1{font-size:1.9rem;font-weight:300;letter-spacing:-.035em}
.agree{display:flex;gap:10px;align-items:flex-start;line-height:1.45;color:var(--mute);font-size:.92rem}
.agree input{width:22px;height:22px;margin:0;flex:none;accent-color:var(--mint)}
.scrim{position:fixed;inset:0;z-index:20;background:rgba(5,8,16,.55);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:21;max-width:560px;margin:0 auto;max-height:86vh;overflow:auto;padding:12px 18px calc(var(--safeB) + 18px);border-radius:26px 26px 0 0;background:var(--panelSolid);border:1px solid var(--line);border-bottom:0;box-shadow:0 -20px 60px rgba(0,0,0,.45)}
.sheet header{display:flex;align-items:center;justify-content:space-between;min-height:48px;margin:0 -6px 6px 0}
.sheet h2{font-size:1.32rem;font-weight:700;letter-spacing:-.035em}
.legalview{position:fixed;inset:0;z-index:70;background:var(--bg);overflow:auto;padding:calc(14px + var(--safeT)) 18px calc(32px + var(--safeB))}
.legaldoc{max-width:680px;margin:0 auto}
.legaldoc h1{font-size:clamp(1.8rem,8vw,2.3rem);font-weight:700;letter-spacing:-.035em;margin:24px 0 4px}
.legaldoc .eff{color:var(--mute);font-size:.9rem;margin:0 0 18px}
.legaldoc .summary{background:var(--panelSolid);border:1px solid var(--line);border-radius:16px;padding:14px 16px;margin:0 0 8px;line-height:1.55}
.legaldoc .summary b{display:block;margin-bottom:4px}
.legaldoc h2{font-size:1.1rem;font-weight:700;margin:26px 0 8px}
.legaldoc p,.legaldoc li{line-height:1.65;color:#DCE1F2}
.legaldoc p{margin:0 0 12px}
.legaldoc ul{margin:0 0 12px;padding-left:1.2em}
.legaldoc .caps{text-transform:uppercase;font-size:.84rem;letter-spacing:.02em}
.updatebar{position:fixed;left:12px;right:12px;top:calc(var(--safeT) + 8px);z-index:60;display:flex;align-items:center;justify-content:space-between;gap:10px;max-width:520px;margin:0 auto;padding:10px 10px 10px 16px;border-radius:18px;background:var(--panelSolid);border:1px solid var(--line2);box-shadow:0 14px 40px rgba(0,0,0,.45);font-weight:600}
.toast{position:fixed;left:50%;top:calc(var(--safeT) + 58px);pointer-events:none;transform:translateX(-50%);z-index:80;max-width:min(92vw,420px);margin:0;padding:12px 16px;border-radius:16px;background:var(--solid);color:var(--solidInk);font-weight:600;font-size:.92rem;text-align:center;box-shadow:0 14px 40px rgba(0,0,0,.45)}


/* Home: the three ways in */
.home{position:relative;z-index:1;min-height:100%;max-width:560px;margin:0 auto;display:flex;flex-direction:column;gap:14px;padding:calc(var(--safeT) + 14px) 16px calc(var(--safeB) + 16px)}
.home .brand{font-size:1.35rem;margin:4px 0 6px}
.home h1{font-size:clamp(1.8rem,8vw,2.3rem);font-weight:300;letter-spacing:-.035em;line-height:1.1}
.doors{display:flex;flex-direction:column;gap:12px;margin-top:6px}
.door{display:grid;grid-template-columns:56px 1fr 20px;align-items:center;gap:14px;padding:16px;border-radius:22px;text-decoration:none;background:var(--panel);border:1px solid var(--line2);-webkit-backdrop-filter:blur(22px) saturate(140%);backdrop-filter:blur(22px) saturate(140%);transition:transform .12s}
.door:active{transform:scale(.985)}
.door img{border-radius:14px}
.door b{display:block;font-size:1.15rem;font-weight:700;letter-spacing:-.01em}
.door span{display:block;color:var(--mute);font-size:.9rem;line-height:1.4;margin-top:3px}
.door svg{width:20px;height:20px;fill:none;stroke:var(--faint);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.door.draw{border-color:color-mix(in srgb,#8E7CFF 40%,var(--line2))}
.door.loop{border-color:color-mix(in srgb,#FF6B8B 40%,var(--line2))}
.door.studio{border-color:color-mix(in srgb,var(--mint) 40%,var(--line2))}
.home .how{color:var(--mute);font-size:.9rem;line-height:1.5;margin:4px 2px 0}
body.homepage{overflow:auto}

.songs h2{font-size:1.05rem;font-weight:700;margin:14px 2px 0}
.songlist{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.song{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;padding:12px 12px 12px 16px;border-radius:18px;background:var(--panel);border:1px solid var(--line)}
.song b{display:block;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.song small{display:block;color:var(--faint);font-size:.8rem;margin-top:2px}
.song .open2{display:flex;gap:6px}
.song .open2 a{min-height:38px;padding:0 10px;border-radius:99px;display:inline-flex;align-items:center;font-weight:700;font-size:.86rem;text-decoration:none;background:var(--raise);color:var(--ink)}
.song .open2 a.has{background:var(--solid);color:var(--solidInk)}

.song{grid-template-columns:1fr}
.song .open2{justify-content:flex-start}

.song{position:relative}
.song .more{position:absolute;right:6px;top:6px;width:40px;height:40px;border-radius:12px;color:var(--mute);display:grid;place-items:center}
.song .more svg{width:20px;height:20px;fill:currentColor}
.song > div:first-child{padding-right:40px}
.scrim{position:fixed;inset:0;z-index:30;background:rgba(5,8,16,.55)}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:31;max-width:560px;margin:0 auto;background:var(--panelSolid);border:1px solid var(--line2);border-bottom:0;border-radius:26px 26px 0 0;padding:18px 18px calc(24px + var(--safeB))}
.sheet header{display:flex;align-items:center;justify-content:space-between;min-height:44px}
.sheet h2{font-size:1.2rem}
.big.danger{background:var(--danger);color:#1A0B0B;margin-top:12px}

/* small rounded buttons: the update bar, the library */
.pill{min-height:40px;border-radius:99px;padding:0 16px;font-weight:700;font-size:.94rem;display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:none;white-space:nowrap}
.pill.outline,.big.outline{border:1px solid var(--line2)}
.pill:disabled{opacity:.5;cursor:default}

/* Home: one row under the doors opens the library */
.librow{display:grid;grid-template-columns:44px 1fr 20px;align-items:center;gap:14px;width:100%;padding:12px 16px;margin-top:6px;border-radius:18px;text-align:left;background:var(--panel);border:1px solid var(--line)}
.librow:active{transform:scale(.985)}
.libic{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:var(--raise)}
.libic svg{width:22px;height:22px;fill:none;stroke:var(--ink);stroke-width:1.8;stroke-linejoin:round}
.librow b{display:block;font-weight:700}
.librow small{display:block;color:var(--faint);font-size:.82rem;margin-top:2px}
.librow .chev{width:20px;height:20px;fill:none;stroke:var(--faint);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* the library: songs and sounds, search, filters, backup */
.libview{position:fixed;inset:0;z-index:15;overflow:auto;background:var(--bg);padding:calc(var(--safeT) + 8px) 16px calc(var(--safeB) + 24px)}
.libview > *{max-width:560px;margin-left:auto;margin-right:auto}
.libbar{display:flex;align-items:center;justify-content:space-between;min-height:48px}
.libbar h2{font-size:1.25rem;font-weight:700}
.seg{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin-top:8px;border-radius:14px;background:var(--well);border:1px solid var(--line)}
.seg button{min-height:40px;border-radius:10px;font-weight:700;color:var(--mute)}
.seg button[aria-selected="true"]{background:var(--raise);color:var(--ink)}
.search{display:flex;align-items:center;gap:10px;margin-top:12px;padding:0 14px;min-height:46px;border-radius:14px;background:var(--well);border:1px solid var(--line)}
.search svg{width:18px;height:18px;flex:none;fill:none;stroke:var(--faint);stroke-width:2;stroke-linecap:round}
.search input{flex:1;min-width:0;border:0;outline:0;background:none;color:var(--ink);font:inherit;font-size:16px;-webkit-user-select:text;user-select:text}
.search input::placeholder{color:var(--faint)}
.chips{display:flex;gap:6px;margin-top:10px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{min-height:34px;padding:0 14px;border-radius:99px;font-weight:700;font-size:.86rem;color:var(--mute);border:1px solid var(--line2);flex:none}
.chip[aria-pressed="true"]{background:var(--solid);color:var(--solidInk);border-color:transparent}
.libview .songlist,.soundlist{margin-top:12px}
.soundlist{list-style:none;padding:0;display:flex;flex-direction:column;gap:8px}
.sound{display:grid;grid-template-columns:40px 1fr 44px 40px;align-items:center;gap:10px;padding:10px 6px 10px 12px;border-radius:18px;background:var(--panel);border:1px solid var(--line)}
.ltype{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--raise)}
.ltype svg{width:20px;height:20px;fill:none;stroke:var(--ink);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ltext{min-width:0}
.ltext b{display:block;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ltext small{display:block;color:var(--faint);font-size:.8rem;margin-top:2px}
.lplay{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:var(--raise)}
.lplay svg{width:18px;height:18px;fill:var(--ink)}
.sound .more{width:40px;height:40px;border-radius:12px;color:var(--mute);display:grid;place-items:center}
.sound .more svg{width:20px;height:20px;fill:currentColor}
.libview .empty{color:var(--mute);line-height:1.5;margin-top:18px;text-align:center;padding:0 12px}
.backup{margin-top:28px;padding-top:18px;border-top:1px solid var(--line)}
.backup h3{font-size:1rem;font-weight:700}
.backup .how{color:var(--mute);font-size:.9rem;line-height:1.5;margin:6px 0 0}
.bbtns{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.namein{width:100%;min-height:50px;margin-top:6px;padding:0 14px;border-radius:14px;border:1px solid var(--line2);background:var(--well);color:var(--ink);font:inherit;font-size:16px;-webkit-user-select:text;user-select:text}
.big.outline{margin-top:12px}
.problist{margin:10px 0 0;padding:10px 12px;border-radius:12px;background:var(--well);border:1px solid var(--line);color:var(--mute);font-size:.72rem;line-height:1.45;white-space:pre-wrap;word-break:break-word;max-height:180px;overflow:auto;-webkit-user-select:text;user-select:text}

/* Library: open a song file from another phone or an iPad */
.libopen{margin-top:12px;width:100%}
