/* Mixtape Gorillaz core: player, waveform, track list, cover play buttons, track manager. */
:root {
  --mg-accent: var(--accent, #f39c12);
  --mg-ink: var(--accent-ink, #1b1b1b);
  --mg-bar: var(--bar, #1f1f1f);
  --mg-line: var(--line, #e1e1e1);
  --mg-muted: var(--muted, #6f6f6f);
  --mg-head: var(--head, "Oswald", "Arial Narrow", Arial, sans-serif);
}

/* ---------- Icons drawn with CSS ---------- */
.ico { display: block; width: 14px; height: 14px; background: currentColor; clip-path: polygon(18% 6%, 94% 50%, 18% 94%); }
.is-playing > .ico, .playing .mb-play .ico, .tl-row.playing .tl-play .ico, .st-row.playing .st-play .ico {
  clip-path: none; background: linear-gradient(90deg, currentColor 0 34%, transparent 34% 66%, currentColor 66%);
}
.mb-prev .ico { clip-path: polygon(10% 8%, 24% 8%, 24% 46%, 90% 8%, 90% 92%, 24% 54%, 24% 92%, 10% 92%); }
.mb-next .ico { clip-path: polygon(90% 8%, 76% 8%, 76% 46%, 10% 8%, 10% 92%, 76% 54%, 76% 92%, 90% 92%); }
.mb-mute .ico { clip-path: polygon(6% 34%, 30% 34%, 62% 8%, 62% 92%, 30% 66%, 6% 66%); width: 16px; height: 16px; }
.mgbar.muted .mb-mute .ico { opacity: .45; }

/* ---------- Play button on release covers ---------- */
.card { position: relative; container-type: inline-size; }
.cplay { position: absolute; z-index: 2; right: 10px; top: calc(100cqw - 56px); width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--mg-accent); color: var(--mg-ink); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.35); opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.cplay .ico { width: 16px; height: 16px; margin-left: 2px; }
.cplay.is-playing .ico { margin-left: 0; }
.card:hover .cplay, .card:focus-within .cplay, .cplay.is-current { opacity: 1; transform: none; }
@media (hover: none) { .cplay { opacity: 1; transform: none; width: 40px; height: 40px; top: calc(100cqw - 48px); right: 8px; } }

/* ---------- Waveform player (release page) ---------- */
.wave-player { --wave-played: var(--mg-accent); --wave-rest: rgba(255,255,255,.72); --wave-hover: rgba(243,156,18,.55);
  display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px 16px; align-items: center; margin-top: 18px; }
.wp-big { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--mg-accent); color: var(--mg-ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 22px rgba(0,0,0,.4); transition: transform .12s; }
.wp-big:hover { transform: scale(1.05); }
.wp-big .ico { width: 22px; height: 22px; margin-left: 4px; }
.wp-big.is-playing .ico { margin-left: 0; }
.wp-info { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; min-width: 0; }
.wp-now { font: 500 16px/1.2 var(--mg-head); text-transform: uppercase; letter-spacing: .03em; background: rgba(0,0,0,.78); color: #fff; padding: 6px 9px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-pv { font: 600 11px/1 var(--mg-head); letter-spacing: .1em; text-transform: uppercase; background: var(--mg-accent); color: var(--mg-ink); padding: 6px 8px; }
.wp-wave { grid-column: 1 / -1; position: relative; height: 92px; cursor: pointer; }
.wp-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wp-seek { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.wp-seek:focus-visible { opacity: .01; }
.wp-wave:has(.wp-seek:focus-visible) { outline: 2px solid var(--mg-accent); outline-offset: 3px; }
.wp-t0, .wp-t1 { position: absolute; top: 46px; font: 500 11px/1 var(--mg-head); background: rgba(0,0,0,.82); color: #fff; padding: 3px 5px; pointer-events: none; font-variant-numeric: tabular-nums; }
.wp-t0 { left: 0; color: var(--mg-accent); } .wp-t1 { right: 0; }
.wp-empty { color: #ddd; }

/* ---------- Track list ---------- */
.tl { list-style: none; margin: 0; padding: 6px 0; counter-reset: none; }
.tl-row { display: grid; grid-template-columns: 44px minmax(0,1fr) auto auto; gap: 12px; align-items: center; padding: 6px 16px 6px 10px; cursor: pointer; border-bottom: 1px solid var(--mg-line); font-variant-numeric: tabular-nums; }
.tl-row:last-child { border-bottom: 0; }
.tl-row:hover { background: #f6f6f6; }
.tl-row.on { background: #fff6e6; }
.tl-play { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--mg-bar); display: grid; place-items: center; cursor: pointer; position: relative; }
.tl-play .n { font: 500 14px var(--mg-head); color: var(--mg-muted); }
.tl-play .ico, .tl-play .eq { display: none; }
.tl-row:hover .tl-play .n, .tl-row.on .tl-play .n { display: none; }
.tl-row:hover .tl-play .ico { display: block; }
.tl-row:hover .tl-play, .tl-row.on .tl-play { background: var(--mg-bar); color: #fff; }
.tl-row.on .tl-play { background: var(--mg-accent); color: var(--mg-ink); }
.tl-row.on:not(:hover) .tl-play .ico { display: block; }
.tl-row.playing:not(:hover) .tl-play .ico { display: none; }
.tl-row.playing:not(:hover) .tl-play .eq { display: flex; }
.tl-play .ico { width: 12px; height: 12px; }
.eq { gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: currentColor; animation: mg-eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes mg-eq { 0%,100% { height: 30%; } 50% { height: 100%; } }
.tl-title { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-row.on .tl-title { color: #b36b00; }
.tl-tag { font: 500 10px/1 var(--mg-head); letter-spacing: .1em; text-transform: uppercase; color: var(--mg-muted); border: 1px solid var(--mg-line); padding: 4px 6px; }
.tl-tag.free { color: #0f7a3a; border-color: #bfe3cc; }
.tl-time { color: var(--mg-muted); font-size: 13px; min-width: 3.2em; text-align: right; }

/* ---------- Bottom player bar ---------- */
body.has-mgbar { padding-bottom: 68px; }
.mgbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #f2f2f2; color: #222; border-top: 1px solid #cecece; box-shadow: 0 -4px 18px rgba(0,0,0,.18); font-family: var(--body, Arial, sans-serif); }
.mb-line { display: none; }
.mb-in { max-width: 1240px; margin: 0 auto; height: 62px; padding: 0 14px; display: grid; grid-template-columns: auto minmax(0,1fr) auto 46px minmax(0, 230px) auto; gap: 14px; align-items: center; }
.mb-ctl { display: flex; gap: 4px; align-items: center; }
.mb-ctl button, .mb-mute, .mb-close { border: 0; background: none; color: #333; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.mb-ctl button:hover, .mb-mute:hover, .mb-close:hover { color: var(--mg-accent); }
.mb-ctl button:disabled { opacity: .35; cursor: default; }
.mb-ctl .mb-play { width: 40px; height: 40px; background: var(--mg-bar); color: #fff; }
.mb-ctl .mb-play:hover { background: var(--mg-accent); color: var(--mg-ink); }
.mb-play .ico { width: 14px; height: 14px; margin-left: 2px; }
.playing .mb-play .ico { margin-left: 0; }
.mb-seek { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; font: 500 12px/1 var(--mg-head); font-variant-numeric: tabular-nums; }
.mb-cur { color: var(--mg-accent); min-width: 3.2em; text-align: right; } .mb-dur { min-width: 3.2em; color: #555; }
.mb-range, .mb-volr { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; margin: 0; cursor: pointer; --p: 0%; }
.mb-range::-webkit-slider-runnable-track, .mb-volr::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, var(--mg-accent) var(--p), #c8c8c8 var(--p)); }
.mb-range::-moz-range-track, .mb-volr::-moz-range-track { height: 3px; background: linear-gradient(90deg, var(--mg-accent) var(--p), #c8c8c8 var(--p)); }
.mb-range::-webkit-slider-thumb, .mb-volr::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: var(--mg-accent); margin-top: -4px; border: 0; }
.mb-range::-moz-range-thumb, .mb-volr::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: var(--mg-accent); border: 0; }
.mb-vol { display: flex; align-items: center; gap: 2px; }
.mb-vol .mb-volr { width: 84px; }
.mb-cover { display: block; width: 42px; height: 42px; flex: none; }
.mb-art { display: block; width: 100%; height: 100%; background: #333; }
.mb-meta { min-width: 0; display: grid; gap: 3px; line-height: 1.15; }
.mb-artist, .mb-title { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-artist { font-size: 12px; color: #777; }
.mb-title { font-size: 13px; color: #222; font-weight: 500; }
.mb-artist:hover, .mb-title:hover { color: var(--mg-accent); }
.mb-pv { justify-self: start; font: 600 9px/1 var(--mg-head); letter-spacing: .1em; text-transform: uppercase; background: var(--mg-accent); color: var(--mg-ink); padding: 3px 5px; }
.mb-close { font-size: 22px; line-height: 1; color: #777; }
@media (max-width: 760px) {
  body.has-mgbar { padding-bottom: 64px; }
  .mb-line { display: block; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: #d5d5d5; }
  .mb-fill { height: 100%; width: 0; background: var(--mg-accent); }
  .mb-in { height: 60px; padding: 0 10px; grid-template-columns: 44px minmax(0,1fr) auto auto; gap: 10px; }
  .mb-cover { order: 1; } .mb-meta { order: 2; } .mb-ctl { order: 3; } .mb-close { order: 4; }
  .mb-seek, .mb-vol, .mb-prev { display: none !important; }
  .mb-ctl .mb-play { width: 44px; height: 44px; }
}

/* ---------- Track manager (artist dashboard) ---------- */
.crumbs { margin: 0 0 8px; font-size: 13px; }
.crumbs a { text-decoration: none; color: var(--mg-muted); }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; font: 500 12px/1 var(--mg-head); letter-spacing: .08em; text-transform: uppercase; color: var(--mg-muted); padding: 7px 12px 7px 7px; background: #f2f2f2; }
.steps b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #d9d9d9; color: #444; font-size: 11px; }
.steps li.on { background: var(--mg-bar); color: #fff; } .steps li.on b { background: var(--mg-accent); color: var(--mg-ink); }
.steps li.done b { background: #0f7a3a; color: #fff; }
.sub-h { font: 600 16px/1 var(--mg-head); text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.studio { border: 1px solid var(--mg-line); padding: 16px; margin-bottom: 22px; display: grid; gap: 12px; }
.studio-top { display: grid; grid-template-columns: 76px minmax(0,1fr) auto; gap: 14px; align-items: center; }
.st-cover { width: 76px; height: 76px; overflow: hidden; background: #ddd; }
.st-cover img, .st-cover .art { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; font: 600 10px var(--mg-head); color: #fff; text-align: center; }
.st-title h2 { margin: 2px 0 6px !important; font-size: 24px !important; }
.st-status { font: 600 11px/1 var(--mg-head); letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px; display: inline-block; }
.st-status.draft { background: #fff3d6; color: #8a5a00; } .st-status.live { background: #e3f5ea; color: #0f7a3a; }
.st-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.st-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.st-saved { margin-left: auto; }
.st-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.st-list:empty { display: none; }
.st-row { display: grid; grid-template-columns: 22px 34px 24px minmax(0,1fr) auto auto auto; gap: 8px; align-items: center; background: #fafafa; border: 1px solid var(--mg-line); padding: 6px 8px; }
.st-row.dragging { opacity: .5; border-style: dashed; }
.st-row.busy { opacity: .5; pointer-events: none; }
.st-row.playing { border-color: var(--mg-accent); background: #fff8ec; }
.st-handle { cursor: grab; color: #999; font-size: 16px; letter-spacing: -3px; user-select: none; text-align: center; }
.st-play { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--mg-bar); color: #fff; display: grid; place-items: center; cursor: pointer; }
.st-play .ico { width: 10px; height: 10px; margin-left: 1px; }
.st-num { font: 500 13px var(--mg-head); color: var(--mg-muted); text-align: right; }
input.st-name { border: 1px solid transparent !important; background: transparent !important; padding: 6px !important; font-weight: 500; }
input.st-name:hover { border-color: #ccc !important; background: #fff !important; }
input.st-name:focus { border-color: var(--mg-accent) !important; background: #fff !important; }
.st-meta { font-size: 12px; color: var(--mg-muted); white-space: nowrap; }
.st-wf { color: #b36b00; }
.st-move { display: flex; gap: 2px; }
.st-move button, .st-del { border: 1px solid #ccc; background: #fff; cursor: pointer; font-size: 11px; height: 28px; min-width: 28px; color: #444; }
.st-move button:disabled { opacity: .3; cursor: default; }
.st-del { font: 500 11px var(--mg-head); text-transform: uppercase; letter-spacing: .05em; padding: 0 8px; color: var(--free, #b3122a); border-color: #e8b9c0; }
.dropzone { display: grid !important; justify-items: center; gap: 6px !important; text-align: center; border: 2px dashed #bdbdbd; background: #fbfbfb; padding: 26px 16px; cursor: pointer; text-transform: none !important; letter-spacing: 0 !important; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--mg-accent); background: #fff8ec; }
.dropzone[hidden] { display: none !important; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 2px solid var(--mg-accent); outline-offset: 2px; }
.dropzone b { font: 600 20px/1 var(--mg-head) !important; text-transform: uppercase; }
.dropzone span { font: 14px var(--body, Arial) !important; color: #555; }
.dropzone u { color: #b36b00; }
.dropzone small { max-width: 52ch; }
.dz-ico { width: 38px; height: 38px; background: var(--mg-accent); clip-path: polygon(50% 0, 92% 42%, 64% 42%, 64% 78%, 36% 78%, 36% 42%, 8% 42%); }
.st-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.st-job { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 12px; border: 1px solid var(--mg-line); padding: 8px 10px; font-size: 13px; }
.j-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.j-size { color: var(--mg-muted); }
.j-state { grid-column: 1 / -1; color: #555; }
.st-job.error { border-color: #e8b9c0; background: #fff4f5; } .st-job.error .j-state { color: var(--free, #b3122a); }
.st-job.done .j-state { color: #0f7a3a; }
.j-bar { grid-column: 1 / -1; height: 5px; background: #e6e6e6; }
.j-bar i { display: block; height: 100%; background: var(--mg-accent); transition: width .25s; }
.st-job.error .j-bar, .st-job.done .j-bar i { background: #0f7a3a; }
.st-job.error .j-bar { display: none; }
.j-btns { grid-column: 1 / -1; display: flex; gap: 6px; }
.st-tip { margin: 0; }
.rel-details { border-top: 1px solid var(--mg-line); padding-top: 16px; }
.details-grid { display: grid; grid-template-columns: 170px minmax(0,1fr); gap: 16px; align-items: start; }
.cover-pick { display: grid; gap: 8px; justify-items: start; }
.cover-prev { width: 170px; height: 170px; background: #eee; border: 1px dashed #bbb; display: grid; place-items: center; overflow: hidden; color: #999; font: 500 12px var(--mg-head); text-transform: uppercase; letter-spacing: .08em; }
.cover-prev img { width: 100%; height: 100%; object-fit: cover; }
.filebtn { position: relative; display: inline-flex !important; align-items: center; justify-content: center; border: 2px solid var(--mg-bar); padding: 8px 12px; cursor: pointer; font: 600 12px/1 var(--mg-head) !important; letter-spacing: .05em; text-transform: uppercase; background: #fff; }
.filebtn:hover { border-color: var(--mg-accent); }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.filebtn:focus-within { outline: 2px solid var(--mg-accent); outline-offset: 2px; }
.type-opt span { display: grid; gap: 2px; }
.type-opt b { font: 600 15px/1 var(--mg-head); text-transform: uppercase; }
.type-opt small { font: 12px var(--body, Arial) !important; color: var(--mg-muted); text-transform: none; letter-spacing: 0; }
.type-opt:has(input:checked) { border-color: var(--mg-accent) !important; background: #fff8ec; }
.banner-pick { display: grid; gap: 10px; }
.banner-prev { display: grid; place-items: center; aspect-ratio: 4 / 1; width: 100%; overflow: hidden; background: linear-gradient(120deg, var(--c, #333), #111 75%); color: rgba(255,255,255,.6); font: 500 13px var(--mg-head); text-transform: uppercase; letter-spacing: .1em; }
.banner-prev img { width: 100%; height: 100%; object-fit: cover; }
.banner-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.banner-ctl small { flex: 1 1 260px; }
.photo-prev .avatar, .photo-prev img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.rl { display: flex; gap: 10px; align-items: center; }
.rl .th { width: 44px; height: 44px; flex: none; overflow: hidden; background: #ddd; }
.rl .th img, .rl .th .art { width: 100%; height: 100%; object-fit: cover; font-size: 0; display: block; }
.tag-draft { font: 500 10px/1 var(--mg-head); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; margin-left: 6px; background: #fff3d6; color: #8a5a00; }
@media (max-width: 640px) {
  .studio { padding: 12px; }
  .studio-top { grid-template-columns: 56px minmax(0,1fr); }
  .st-cover { width: 56px; height: 56px; }
  .st-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .st-row { grid-template-columns: 30px minmax(0,1fr) auto; grid-template-areas: "play name del" "play meta move"; row-gap: 2px; }
  .st-handle, .st-num { display: none; }
  .st-play { grid-area: play; } .st-name { grid-area: name; } .st-meta { grid-area: meta; padding-left: 6px; } .st-move { grid-area: move; justify-self: end; } .st-del { grid-area: del; justify-self: end; }
  .details-grid { grid-template-columns: 1fr; }
  .cover-prev { width: 140px; height: 140px; }
  .tl-row { grid-template-columns: 40px minmax(0,1fr) auto; padding-right: 12px; }
  .tl-tag { display: none; }
  .wp-wave { height: 72px; }
  .wp-t0, .wp-t1 { top: 36px; }
  .wp-big { width: 54px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; height: 70%; } .cplay { transition: none; } }

/* ---------- Drag-and-zoom cropper ---------- */
.crop-dialog { width: min(760px, 100%); }
.crop-frame { position: relative; width: 100%; overflow: hidden; background: #111; cursor: grab; touch-action: none; user-select: none; outline: 2px solid var(--mg-accent); outline-offset: -2px; }
.crop-frame.round { max-width: 340px; margin: 0 auto; }
.crop-frame.round::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.55); pointer-events: none; }
.crop-frame.dragging { cursor: grabbing; }
.crop-frame img { position: absolute; left: 0; top: 0; max-width: none !important; pointer-events: none; }
.crop-phone { position: absolute; top: 0; bottom: 0; left: 28.7%; width: 42.6%; border-left: 2px dashed rgba(255,255,255,.85); border-right: 2px dashed rgba(255,255,255,.85); pointer-events: none; box-shadow: 0 0 0 999px rgba(0,0,0,.28); }
.crop-phone b { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font: 600 10px/1 var(--mg-head); letter-spacing: .1em; text-transform: uppercase; background: rgba(0,0,0,.7); color: #fff; padding: 4px 6px; white-space: nowrap; }
.crop-zoom { display: flex !important; align-items: center; gap: 12px; }
.crop-zoom input { flex: 1; accent-color: var(--mg-accent); }
.crop-frame:focus-visible { outline-width: 3px; }
