/* FLIKVO: black, green, underground. Shared by the app, the share page and the admin. */
@font-face { font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%; src: url(/fonts/archivo-latin-wdth-normal.woff2) format('woff2-variations'); }
@font-face { font-family: 'Archivo'; font-style: italic; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%; src: url(/fonts/archivo-latin-wdth-italic.woff2) format('woff2-variations'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/space-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/space-mono-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #000; --s1: #0b0b0b; --s2: #131313; --s3: #1b1b1b; --line: #1f1f1f; --line2: #2a2a2a;
  --ink: #f2f2ec; --soft: #a8a8a0; --muted: #6b6b65;
  --accent: #ccfe55; --accent-ink: #0a0a0a; --accent-dim: rgba(204, 254, 85, 0.12); --bad: #ff7b7b;
  --mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --player-h: 0px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); font-stretch: 100%; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
/* film grain over everything, very faint */
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.05; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* type */
.logo { font-family: var(--sans); font-weight: 900; font-style: italic; font-stretch: 125%; letter-spacing: -0.03em; font-size: 22px; line-height: 1; text-decoration: none; color: var(--ink); }
.logo b { color: var(--accent); font-weight: 900; }
.display { font-weight: 850; font-stretch: 120%; letter-spacing: -0.035em; line-height: 0.95; margin: 0; text-transform: uppercase; }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--mono); }
.soft { color: var(--soft); } .muted { color: var(--muted); }
h1, h2, h3 { margin: 0; }
h2 { font-size: 22px; font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em; }
h3 { font-size: 15px; font-weight: 750; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 48px; padding: 0 20px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 750; font-size: 15px; font-stretch: 105%; white-space: nowrap; transition: transform .08s, background .15s; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px #3a3a3a; }
.btn.dark { background: var(--s3); color: var(--ink); }
.btn.small { height: 36px; padding: 0 14px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: 0.35; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); flex: none; }
.icon-btn:hover { background: var(--s2); }
.icon-btn svg { width: 22px; height: 22px; }
.round-play { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; transition: transform .08s; }
.round-play:active { transform: scale(0.94); }
.round-play svg { width: 24px; height: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.input { width: 100%; font-size: 16px; color: var(--ink); background: var(--s1); border: 1px solid var(--line2); border-radius: 12px; padding: 13px 14px; outline: none; resize: none; }
.input:focus { border-color: var(--accent); }
.input::placeholder { color: #4d4d48; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.toggle input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--s3); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.toggle input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #777; transition: transform .15s, background .15s; }
.toggle input:checked { background: var(--accent-dim); box-shadow: inset 0 0 0 1px var(--accent); }
.toggle input:checked::after { transform: translateX(18px); background: var(--accent); }
.form-error { margin: 0; color: var(--bad); font-weight: 600; font-size: 14px; }
.form-ok { margin: 0; color: var(--accent); font-weight: 600; font-size: 14px; }

/* covers: an uploaded image, or a generated one */
.cover { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #0d0d0d; flex: none; isolation: isolate; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.gen::before { content: ''; position: absolute; inset: 0; background: var(--g); z-index: -1; }
.cover.gen::after { content: ''; position: absolute; inset: 0; opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.cover .gen-t { position: absolute; left: 9%; right: 9%; bottom: 8%; font-weight: 900; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.03em; line-height: 0.88;
  color: var(--ink); font-size: var(--gs, 22px); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cover .gen-m { position: absolute; left: 9%; top: 8%; font-family: var(--mono); font-size: max(8px, calc(var(--gs, 22px) * 0.36)); letter-spacing: .12em; color: var(--accent); text-transform: uppercase; }

/* track rows */
.tracks { list-style: none; margin: 0; padding: 0; }
.trow { display: grid; grid-template-columns: auto 44px 1fr auto auto; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 12px; cursor: pointer; }
.trow:hover { background: var(--s1); }
.trow .num { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 20px; text-align: right; }
.trow .cover { width: 44px; border-radius: 6px; --gs: 8px; }
.trow .cover .gen-m { display: none; }
.trow .t { min-width: 0; }
.trow .t b { display: block; font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .t span { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .dur { font-family: var(--mono); font-size: 12px; color: var(--soft); }
.trow.playing .t b { color: var(--accent); }
.trow .eq { display: none; }
.trow.playing .num { display: none; }
.trow.playing .eq { display: flex; }
.trow .no-num { width: 0; }
.eq { width: 20px; height: 14px; display: flex; align-items: flex-end; justify-content: flex-end; gap: 2px; }
.eq i { width: 3px; background: var(--accent); height: 30%; border-radius: 1px; transition: height .08s; }
.dl-btn { color: var(--soft); }

/* bottom sheet */
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--s1); border-top: 1px solid var(--line2); border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(var(--safe-b) + 20px); max-height: 88dvh; overflow-y: auto; max-width: 560px; margin: 0 auto; animation: up .18s ease-out; }
.sheet::before { content: ''; display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--line2); margin: 0 auto 14px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@media (min-width: 700px) { .sheet { bottom: 50%; transform: translateY(50%); border-radius: 22px; border: 1px solid var(--line2); animation: none; } }
.sheet { position: fixed; }
.sheet-x { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--soft); background: var(--s2); }
.sheet-x svg { width: 18px; height: 18px; }
.sheet h2 { padding-right: 44px; }
.menu-list { display: flex; flex-direction: column; }
.menu-list button { display: flex; align-items: center; gap: 14px; padding: 14px 4px; font-size: 16px; font-weight: 550; text-align: left; border-bottom: 1px solid var(--line); }
.menu-list button:last-child { border-bottom: 0; }
.menu-list button svg { width: 20px; height: 20px; color: var(--soft); }
.menu-list button.danger { color: var(--bad); } .menu-list button.danger svg { color: var(--bad); }

/* player */
.mini { position: fixed; left: 8px; right: 8px; bottom: calc(var(--safe-b) + 8px); z-index: 40; background: rgba(20,20,20,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line2); border-radius: 16px; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px 8px 8px 8px; max-width: 760px; margin: 0 auto; overflow: hidden; }
.mini .cover { width: 44px; border-radius: 8px; --gs: 8px; }
.mini .cover .gen-m { display: none; }
.mini .t { min-width: 0; cursor: pointer; }
.mini .t b { display: block; font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .t span { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .ctl { display: flex; align-items: center; gap: 2px; }
.mini .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; }
.mini .prog i { display: block; height: 100%; width: 0; background: var(--accent); }
.full { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 10px) 20px calc(var(--safe-b) + 22px); overflow: hidden; }
.full .top { display: flex; align-items: center; justify-content: space-between; }
.full .viz-wrap { flex: 1; position: relative; display: grid; place-items: center; min-height: 200px; }
.full canvas.viz { position: absolute; inset: 0; width: 100%; height: 100%; }
.full .art { position: relative; width: min(58vw, 34dvh, 300px); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.06); transition: transform .1s; --gs: 26px; }
.full .meta { margin: 8px 0 14px; }
.full .meta h2 { font-size: 26px; font-stretch: 118%; text-transform: uppercase; letter-spacing: -0.03em; line-height: 1; }
.full .meta p { margin: 6px 0 0; }
.wave { position: relative; height: 56px; cursor: pointer; touch-action: none; }
.wave canvas { width: 100%; height: 100%; display: block; }
.times { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
.controls { display: flex; align-items: center; justify-content: center; gap: 26px; margin-top: 14px; }
.controls .round-play { width: 68px; height: 68px; }
.controls .round-play svg { width: 28px; height: 28px; }
.controls .icon-btn svg { width: 26px; height: 26px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + var(--player-h) + 22px); transform: translateX(-50%); background: var(--ink); color: #000; font-weight: 650; font-size: 14px;
  padding: 10px 16px; border-radius: 999px; z-index: 90; max-width: calc(100% - 32px); text-align: center; }
.spin { width: 18px; height: 18px; border: 2px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
