/* The share sheet (public/share.js) — on Create and on a song's page — and the song page's share link and invitation.
   The system's: Unbounded Light / Bold, BG Dark on BG Lite and BG Bright, white and grey pill buttons, Main Light for
   what is said; the channels' marks in white. */
.ace-share { --as-bg: var(--bg-dark, #101010); --as-lite: var(--bg-lite, #1d1d1d); --as-bright: var(--bg-bright, #2c2c2c);
  margin: auto; width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 28px 28px 26px;
  background: var(--as-bg); color: #fff; border: 1px solid var(--as-bright); border-radius: 30px; box-shadow: 0 30px 100px rgba(0, 0, 0, .6);
  font: 300 12px/1.5 var(--font, 'Unbounded', -apple-system, 'PingFang SC', sans-serif); }
.ace-share[open] { animation: as-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes as-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.ace-share::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
.ace-share * { box-sizing: border-box; }
.ace-share [hidden] { display: none !important; }
:where(.ace-share) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; } /* (no weight: a button's own look wins) */
:where(.ace-share) button:disabled { opacity: .4; cursor: default; }
.ace-share :focus-visible { outline: 2px solid var(--main-light, #94a8ff); outline-offset: 2px; }
.ace-share svg { display: block; }

.as-x { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; opacity: .6; transition: opacity .15s, background-color .15s; }
.as-x svg { width: 16px; height: 16px; }
@media (hover: hover) { .as-x:hover { opacity: 1; background: var(--as-lite); } }
.as-title { margin: 0; font-size: 16px; line-height: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
/* the link copied as it opened (public/share.js): a green tick pops in left of the title, draws itself, and a ring of light
   leaves it — once */
.as-ok { position: relative; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--check, #6fe36f); color: #000; display: grid; place-items: center;
  box-shadow: 0 0 12px rgba(111, 227, 111, .55); }
.as-ok svg { width: 14px; height: 14px; }
.as-ok::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--check, #6fe36f); opacity: 0; pointer-events: none; }
.as-ok.bling { animation: as-ok-pop .55s cubic-bezier(.34, 1.56, .64, 1) backwards; }
.as-ok.bling::after { animation: as-ok-ring .8s cubic-bezier(.2, .8, .2, 1) .2s; }
@keyframes as-ok-pop { from { transform: scale(0) rotate(-30deg); box-shadow: 0 0 0 rgba(111, 227, 111, 0); } 60% { box-shadow: 0 0 22px rgba(111, 227, 111, .9); } }
@keyframes as-ok-ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(2.4); } }
@media (prefers-reduced-motion: reduce) { .as-ok.bling, .as-ok.bling::after { animation: none; } }
.as-song { position: relative; display: flex; flex-direction: column; align-items: center; gap: 20px; margin: 24px 0 22px; min-width: 0; text-align: center; }
/* the cover, a card of glass in the middle (public/glass-card.js / .css: its lean, its glass, the gold dust behind it) */
.as-card { width: 160px; height: 160px; border-radius: 20px; flex-shrink: 0; box-shadow: 0 24px 50px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .1); }
.as-card img, .as-cover-none { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; background: var(--as-lite); }
.as-song > div:last-child { min-width: 0; max-width: 100%; }

.as-song strong { display: block; font-size: 14px; line-height: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-song span { display: block; margin-top: 3px; font-size: 10px; color: rgba(255, 255, 255, .5); }

/* the channels: a row that slides; an arrow floats over an end while there is more past it, the row fading under it */
.as-rail { position: relative; margin: 0 -28px; }
.as-channels { display: flex; gap: 4px; overflow-x: auto; padding: 4px 24px 6px; scrollbar-width: none; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 24px; }
.as-channels::-webkit-scrollbar { display: none; }
.as-channels.fade-l { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 64px); mask-image: linear-gradient(to right, transparent 0, #000 64px); }
.as-channels.fade-r { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 64px); mask-image: linear-gradient(to left, transparent 0, #000 64px); }
.as-channels.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%); }
.as-option { flex: 0 0 68px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0; scroll-snap-align: start; }
.as-option span { font-size: 10px; line-height: 12px; color: rgba(255, 255, 255, .7); white-space: nowrap; transition: color .15s; }
@media (hover: hover) { .as-option:hover span { color: #fff; } }
.as-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; font-style: normal; transition: transform .18s, background-color .18s; }
@media (hover: hover) { .as-option:hover .as-icon { transform: translateY(-2px); background: var(--as-lite); } }
.as-option:active .as-icon { transform: scale(.96); }
.as-icon svg { width: 26px; height: 26px; fill: #fff; } /* (white, no disc under it: its own fill on hover) */
.as-arrow { position: absolute; top: 18px; z-index: 1; width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center;
  background: var(--as-bright); box-shadow: 0 4px 14px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .15s, background-color .15s; }
.as-arrow svg { width: 14px; height: 14px; }
.as-arrow.on { opacity: 1; pointer-events: auto; }
@media (hover: hover) { .as-arrow:hover { background: var(--hover-dark, #3a3a3a); } }
.as-prev { left: 14px; } .as-next { right: 14px; }

/* Download's menu (as Create's .menu) */
.as-menu { position: absolute; z-index: 2; min-width: 160px; padding: 6px; border-radius: 14px; background: var(--as-lite); border: 1px solid var(--as-bright);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6); transform-origin: top center; animation: as-menu-in .14s cubic-bezier(.2, .8, .2, 1); } /* (opening as Create's menus do) */
@keyframes as-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .as-menu { animation: none; } }
.as-menu a { display: block; padding: 9px 12px; border-radius: 8px; font-size: 11px; color: #fff; text-decoration: none; white-space: nowrap; }
.as-menu a:focus-visible { background: var(--as-bright); outline: none; }
@media (hover: hover) { .as-menu a:hover { background: var(--as-bright); outline: none; } }
.as-menu a { position: relative; overflow: hidden; }
.as-menu a.wait { cursor: progress; } /* (the song still being made: public/share.js) — a sheen runs across the item */
.as-menu a.wait::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 200%; pointer-events: none; /* (a tile moved by exactly one: no seam) */
  background: linear-gradient(100deg, transparent 0 25%, rgba(255,255,255,.14) 50%, transparent 75% 100%) 0 0 / 50% 100% repeat-x; animation: as-sheen 1.6s linear infinite; }
@keyframes as-sheen { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .as-menu a.wait::after { animation: none; } }

/* the link, and the one way to copy it */
.as-link { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding: 6px 6px 6px 16px; border: 1px solid var(--as-bright); border-radius: 16px; }
.as-link input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: rgba(255, 255, 255, .6); font: 300 11px var(--font, 'Unbounded', sans-serif); text-overflow: ellipsis; }
.as-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 20px; font-size: 12px; white-space: nowrap; transition: background-color .15s, color .15s; }
.as-btn svg { width: 14px; height: 14px; }
.as-white { background: #fff; color: #000; }
@media (hover: hover) { .as-white:hover:not(:disabled) { background: var(--hover-light, #e4e4e4); } }
.as-gray { background: var(--as-bright); color: #fff; }
@media (hover: hover) { .as-gray:hover:not(:disabled) { background: var(--hover-dark, #3a3a3a); } }
.as-copy { flex-shrink: 0; overflow: hidden; }
.as-copy.done { background: #fff; color: #000; }
/* Publish (public/share.js song.publish): no channels, no link row — a word that the community is on the way, and Discord */
.as-publish .as-rail, .as-publish .as-link { display: none; }
/* ...on a wall of covers drifting slowly by, under a veil dark enough to read on (behind everything in the sheet: z-index -1 in
   its own stacking context, the top layer's) */
.as-wall { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; pointer-events: none; }
.as-wall-in { position: absolute; inset: -30% -20%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; transform: rotate(-8deg); }
.as-wall::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 55%, rgba(16, 16, 16, .78), rgba(16, 16, 16, .92)); }
.as-wall-col { display: flex; flex-direction: column; gap: 10px; animation: as-wall var(--t, 80s) linear infinite var(--d, normal); }
.as-wall-col i { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 10px; }
.as-wall-col img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); } /* (a little over: the mashup reel's covers have a frame drawn round them) */
@keyframes as-wall { from { transform: translateY(0); } to { transform: translateY(calc(-50% - 5px)); } } /* (one copy and its gap: the second where the first was) */
@media (prefers-reduced-motion: reduce) { .as-wall-col { animation: none; } }
.as-community { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.as-community h3 { margin: 0; font-size: 14px; line-height: 17px; font-weight: 700; }
.as-community p { margin: 0; max-width: 340px; font-size: 12px; line-height: 20px; color: rgba(255, 255, 255, .6); }
.as-community-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.as-community .as-btn { text-decoration: none; }
.as-discord { background: #5865f2; color: #fff; transition: filter .15s; } /* Discord's own blurple */
@media (hover: hover) { .as-discord:hover { filter: brightness(1.1); } }
.as-community .as-btn:focus-visible { outline: 2px solid var(--main-light, #94a8ff); outline-offset: 3px; }
/* what happens: a toast as the page's (public/app.css .toast), at the foot of the window — in the sheet (the top layer) */
.as-toast { position: fixed; left: 50%; bottom: 40px; z-index: 1; translate: -50% 8px; display: flex; align-items: center; gap: 10px; min-height: 44px;
  width: max-content; max-width: min(460px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 16px; background: rgba(36, 36, 38, .86);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 12px 40px rgba(0, 0, 0, .5); font-size: 12px; line-height: 1.45; color: #fff;
  opacity: 0; transition: opacity .2s ease, translate .2s ease; }
.as-toast.on { opacity: 1; translate: -50% 0; }
.as-toast svg { flex-shrink: 0; width: 16px; height: 16px; }
.as-toast span { min-width: 0; overflow-wrap: anywhere; }

/* phones: a sheet from the bottom */
@media (max-width: 560px) {
  .ace-share { width: 100vw; max-width: 100vw; margin: auto 0 0; padding: 24px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; border-bottom: 0; }
  .ace-share[open] { animation: as-up .26s cubic-bezier(.2, .8, .2, 1); }
  @keyframes as-up { from { transform: translateY(40px); opacity: .6; } }
  .as-rail { margin: 0 -20px; } .as-channels { padding-inline: 16px; scroll-padding-inline: 16px; }
  .as-arrow { display: none; }
  .as-toast { bottom: auto; top: calc(16px + env(safe-area-inset-top)); } /* (the sheet takes the foot) */
}
@media (prefers-reduced-motion: reduce) { .ace-share[open], .as-icon, .as-arrow, .as-toast { animation: none; transition: none; } }

/* ---------- the song page ---------- */
/* Share: a quiet line under Make a cover of this (anyone may pass the song on) */
.sp-share { margin-top: 14px; align-self: center; display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: rgba(255, 255, 255, .5); transition: color .15s; }
.sp-share svg { width: 14px; height: 14px; }
@media (hover: hover) { .sp-share:hover { color: #fff; } }
/* the invitation (signed out): floats up from the bottom as the page opens and stays; a pill on wide screens, a bar
   across a phone. Its call: Main Blue with a light that keeps running through it (the Shine colours) and a soft glow */
.sp-invite { position: fixed; left: 50%; bottom: 24px; z-index: 40; translate: -50% 0; width: max-content; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 10px; border-radius: 30px; background: rgba(29, 29, 29, .92);
  border: 1px solid var(--bg-bright, #2c2c2c); box-shadow: 0 16px 50px rgba(0, 0, 0, .55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .3s ease, transform .35s cubic-bezier(.2, .8, .2, 1); }
.sp-invite[hidden] { display: none; }
.sp-invite .sp-invite-go { position: relative; overflow: hidden; isolation: isolate; color: #fff; font-weight: 400;
  background: linear-gradient(100deg, var(--main, #2950ff) 0%, #4f6dff 30%, #94a8ff 40%, #c9b8ff 46%, #ffbf78 50%, #ff8a5c 52%, #c9b8ff 56%, #94a8ff 60%, #4f6dff 70%, var(--main, #2950ff) 100%) 0 0 / 300% 100%;
  box-shadow: inset 0 0 8px rgba(148, 168, 255, .9), 0 0 24px rgba(41, 80, 255, .55); animation: sp-flow 3.2s linear infinite; transition: box-shadow .2s, transform .2s cubic-bezier(.2, .8, .2, 1); }
.sp-invite .sp-invite-go::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--main, #2950ff); opacity: .15; } /* (the words stay readable over the light) */
.sp-invite .sp-invite-go span { text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
@media (hover: hover) { .sp-invite .sp-invite-go:hover { box-shadow: inset 0 0 10px rgba(201, 184, 255, 1), 0 0 36px rgba(41, 80, 255, .8); transform: translateY(-1px); opacity: 1; } }
.sp-invite .sp-invite-go:focus-visible { outline: 2px solid var(--main-light, #94a8ff); outline-offset: 3px; }
@keyframes sp-flow { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.song-page:has(~ .sp-invite) { padding-bottom: 110px; } /* (room under the words for the invitation that stays over them) */
/* the words fade out well above the window's foot, into black under the invitation (fixed: it stays as the page scrolls) */
.song-page:has(~ .sp-invite)::after { content: ''; position: fixed; left: max(424px, calc(50% - 112px)); right: 0; bottom: 0; z-index: 30; height: 300px; pointer-events: none; /* (over the words' column only: the page is 1040 wide, centred, the words 408 in) */
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .55) 35%, rgba(0, 0, 0, .9) 65%, #000 85%); }
@media (max-width: 860px) { .song-page:has(~ .sp-invite)::after { left: 0; height: 200px; } } /* (one column: across the width) */
.sp-invite.on { opacity: 1; transform: none; pointer-events: auto; }
.sp-invite img { width: 40px; height: 40px; border-radius: 20px; object-fit: cover; flex-shrink: 0; }
.sp-invite p { margin: 0; font-size: 12px; line-height: 16px; white-space: nowrap; }
.sp-invite p span { display: block; font-size: 10px; line-height: 14px; color: rgba(255, 255, 255, .5); }
.sp-invite .btn { flex-shrink: 0; height: 40px; padding: 0 18px; }
@media (max-width: 560px) {
  .sp-invite { left: 0; right: 0; bottom: 0; translate: none; width: auto; max-width: none; border-radius: 20px 20px 0 0; border-width: 1px 0 0;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom)) 16px; gap: 10px; }
  .sp-invite img { display: none; }
  .sp-invite p { white-space: normal; flex: 1; min-width: 0; }
  .sp-invite p span { display: none; }
  .sp-invite .btn { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) { .sp-invite { transition: opacity .2s; transform: none; } .sp-invite .sp-invite-go { animation: none; background-position: 50% 0; } }

@media (max-width: 520px) {
  .song-body .top { height: auto; min-height: 68px; padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  .song-body .top-r { flex-wrap: wrap; gap: 8px; margin-left: auto; }
  .song-body .logo { font-size: 13px; }
  .song-body .top-r .btn { font-size: 9px; padding: 0 10px; }
}
