/* Polio. The theme variables are overridden per user from their settings (js/app.js). */
:root {
	--bg: #14161b;
	--panel: #1d2027;
	--text: #e7e9ee;
	--muted: #9aa3b2;
	--accent: #6cc4ff;
	--danger: #ff6b6b;
	--line: color-mix(in srgb, var(--text) 14%, transparent);
	--soft: color-mix(in srgb, var(--text) 6%, transparent);
	--accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
	--radius: 8px;
	--font-size: 15px;
	--ok: #7ee081;
	--warn: #ffd166;
	--shadow: rgb(0 0 0 / .35);
	color-scheme: dark;
}

/* the light theme's defaults for the first paint, before js/app.js applies the user's settings */
@media (prefers-color-scheme: light) {
	:root {
		--bg: #f5f6f8;
		--panel: #ffffff;
		--text: #1b1e24;
		--muted: #5b6472;
		--accent: #0a6fc2;
		--danger: #c62828;
		color-scheme: light;
	}
}
:root[data-theme=light] { --ok: #1e8a43; --warn: #a86b00; --shadow: rgb(0 0 0 / .12); --admin: #8e44ad; }
:root[data-theme=dark] { --ok: #7ee081; --warn: #ffd166; --shadow: rgb(0 0 0 / .35); --admin: #c792ea; }

* { box-sizing: border-box; }

html { font-size: var(--font-size); }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: .8rem; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
[hidden] { display: none !important; }

/* header */
.top {
	display: flex;
	align-items: center;
	gap: 1.2rem;
	padding: .6rem 1.2rem;
	background: var(--panel);
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: 0;
	z-index: 10;
	flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: var(--accent); stroke-width: 1.5; }
/* the name has another on its back, a click on the logo turns it over */
.brand-flip { display: inline-grid; perspective: 400px; }
.brand-flip .face { grid-area: 1 / 1; backface-visibility: hidden; transition: transform .6s cubic-bezier(.45, 1.6, .5, 1); }
.brand-flip .back { transform: rotateY(180deg); }
.brand-flip.flipped .front { transform: rotateY(180deg); }
.brand-flip.flipped .back { transform: rotateY(360deg); }
@media (prefers-reduced-motion: reduce) {
	.brand-flip .face { transition: none; }
}
.brand-flip.still .face { transition: none; }

/* Holio mode (Holi, the festival of colours): the logo's waveform beats and runs through the colours.
   The powder thrown when it is turned on is js/holio.js. */
.holio-powder { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }
@keyframes holio-colours { to { filter: hue-rotate(360deg) saturate(1.6); } }
@keyframes holio-beat { 0%, 100% { transform: scaleY(1); } 30% { transform: scaleY(1.35); } 55% { transform: scaleY(.8); } }
[data-holio] .brand svg { animation: holio-colours 5s linear infinite, holio-beat .9s ease-in-out infinite; transform-origin: 50% 50%; }
@media (prefers-reduced-motion: reduce) {
	[data-holio] .brand svg { animation: none; }
}
#nav { display: flex; gap: .2rem; flex-wrap: wrap; }
#nav a { color: var(--muted); padding: .35rem .7rem; border-radius: var(--radius); }
#nav a:hover { color: var(--text); background: var(--soft); text-decoration: none; }
#nav a.active { color: var(--text); background: var(--accent-soft); }
#nav .nav-admin { display: flex; gap: .2rem; margin-left: .3rem; padding-left: .5rem; border-left: 2px solid color-mix(in srgb, var(--admin) 45%, var(--line)); }
#nav .nav-admin[hidden] { display: none; }
.theme-mode { margin-left: auto; color: var(--muted) !important; font-size: .9rem; }
.who { display: flex; gap: .8rem; align-items: center; color: var(--muted); }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.2rem 4rem; outline: none; }
main.wide { max-width: none; }

/* controls */
button, .button {
	font: inherit;
	color: var(--text);
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: .4rem .85rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	white-space: nowrap;
}
button:hover:not(:disabled), .button:hover { border-color: var(--accent); text-decoration: none; }
button:disabled { opacity: .45; cursor: default; }
button.primary, .button.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--danger); }
button.primary.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger:hover:not(:disabled) { border-color: var(--danger); }
button.link { background: none; border: none; padding: 0; color: var(--accent); }
button.icon { padding: .35rem .55rem; min-width: 2.2rem; justify-content: center; }
button.on { background: var(--accent-soft); border-color: var(--accent); }

input, select, textarea {
	font: inherit;
	color: var(--text);
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: .4rem .6rem;
	min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { width: 100%; min-height: 6rem; resize: vertical; }
input[type=color] { padding: 0; width: 2.6rem; height: 2rem; cursor: pointer; }
input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--accent); }
label { display: block; }
label > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .8rem; }
.field-row input:not([type=color]):not([type=checkbox]), .field-row select { width: 100%; }
.card label > input:not([type=checkbox]):not([type=color]), .card label > select { width: 100%; }
label.row > span { display: inline; margin: 0; }
td input:not([type=checkbox]), td select { width: 100%; min-width: 5rem; }

.card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: calc(var(--radius) * 1.5);
	padding: 1.1rem 1.2rem;
}
.narrow { max-width: 26rem; margin: 3rem auto; }

/* what only admins see is tinted, so they know others do not see it */
:root { --admin: #c792ea; }
button.admin-only, .button.admin-only {
	border-color: color-mix(in srgb, var(--admin) 55%, var(--line));
	background: color-mix(in srgb, var(--admin) 12%, var(--soft));
}
button.admin-only:hover, .button.admin-only:hover { border-color: var(--admin); }
.admin-only-field label > span { color: color-mix(in srgb, var(--admin) 75%, var(--muted)); }
/* a day from the calendar and a 24 hour time */
.wall-input { display: flex; gap: .4rem; }
.wall-day { position: relative; flex: 1; min-width: 0; }
.wall-input input.day, .field-row .wall-input input.day { width: 100%; font-variant-numeric: tabular-nums; }
/* the calendar opens from it, it is never seen itself */
.wall-input input.wall-native, .field-row .wall-input input.wall-native {
	position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none;
}
.wall-input input.time, .field-row .wall-input input.time { width: calc(5ch + 1.8rem); flex: none; font-variant-numeric: tabular-nums; }
.admin-only-field input { border-color: color-mix(in srgb, var(--admin) 55%, var(--line)); }
.admin-only-section > .card, .admin-only-section > h1 + p + .card, .admin-only-section > .stack > .card { border-color: color-mix(in srgb, var(--admin) 45%, var(--line)); }
#nav a.admin-only { color: color-mix(in srgb, var(--admin) 75%, var(--muted)); }
.admin-only-section > h1 { color: color-mix(in srgb, var(--admin) 70%, var(--text)); }

/* the activity log */
.activity { list-style: none; margin: 0; padding: 0; }
.activity-item { display: flex; gap: .4rem .8rem; flex-wrap: wrap; align-items: baseline; padding: .45rem .5rem; border-bottom: 1px solid var(--line); }
.activity-item.admin-only { border-left: 3px solid color-mix(in srgb, var(--admin) 70%, transparent); background: color-mix(in srgb, var(--admin) 7%, transparent); }
.activity-item .mono { min-width: 9.5rem; }
.activity-item > span:nth-child(2) { flex: 1 1 18rem; min-width: 0; }
button.history { color: var(--muted); }
.icon-svg { display: inline-flex; }
.overlay {
	position: fixed; inset: 0; z-index: 60; background: rgb(0 0 0 / .45);
	display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
	background: var(--panel); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.5);
	box-shadow: 0 12px 48px var(--shadow); width: min(42rem, 100%); max-height: min(80vh, 48rem);
	display: flex; flex-direction: column;
}
.modal-head { padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-body { overflow-y: auto; padding: .4rem .8rem .8rem; }

/* states and tags */
.state {
	display: inline-block;
	font-size: .75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: .1rem .5rem;
	border-radius: 99px;
	border: 1px solid currentColor;
}
.state.raw { color: var(--muted); }
.state.wip { color: var(--warn); }
.state.completed { color: var(--ok); }
.state.dead { color: var(--danger); }
.tag {
	display: inline-block;
	font-size: .8rem;
	padding: .05rem .5rem;
	border-radius: 99px;
	background: var(--soft);
	color: var(--muted);
	border: 1px solid transparent;
	cursor: pointer;
}
.tag:hover, .tag.on { border-color: var(--accent); color: var(--text); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.song-item {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: .3rem 1rem;
	padding: .8rem 1rem;
	border-bottom: 1px solid var(--line);
	cursor: pointer;
	border-radius: var(--radius);
}
.song-item:hover, .song-item:focus { background: var(--soft); outline: none; }
.song-item .title { font-weight: 600; font-size: 1.05rem; }
.song-item .sub { color: var(--muted); font-size: .85rem; }
/* admins pick songs for a bulk change */
.song-item.pickable { grid-template-columns: auto 1fr auto; }
.song-item .pick { display: flex; align-items: flex-start; padding: .2rem .3rem 0 0; cursor: pointer; }
.song-item .pick input, .bulk-bar input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--admin); }
.bulk-bar { margin: 0 0 .7rem; padding: .35rem .6rem; gap: .5rem 1rem; border-left: 3px solid color-mix(in srgb, var(--admin) 70%, transparent);
	background: color-mix(in srgb, var(--admin) 7%, transparent); border-radius: var(--radius); }
.bulk-actions { gap: .4rem; flex-wrap: wrap; }
.bulk-actions[hidden] { display: none; }
/* a song's own color: dimmed, fading out over the first sixth of its row, and down from the top of its page */
.song-item.colored { background-image: linear-gradient(to right, color-mix(in srgb, var(--song-color) 30%, transparent), transparent 16.7%); }
.song-tint {
	position: absolute; left: 0; right: 0; top: 0; height: 28rem; z-index: -1; pointer-events: none;
	background: linear-gradient(to bottom, color-mix(in srgb, var(--song-color) 32%, transparent), transparent);
}
.song-item .working, h1 .working { color: var(--muted); font-weight: normal; }
.song-item .meta { text-align: right; color: var(--muted); font-size: .85rem; }
.rating { color: var(--warn); white-space: nowrap; }
.rater { gap: .1rem .2rem; margin-top: .35rem; }
.rater > .muted.small:first-child { margin-right: .4rem; }
.rater > .muted.small:last-child { margin-left: .6rem; }
.rater .star { background: none; border: none; padding: .1rem .2rem; min-width: 0; font-size: 1.25rem; line-height: 1; color: var(--muted); cursor: pointer; }
.rater .stars { display: inline-flex; align-items: center; gap: .1rem; }
.rater .star.on { color: var(--warn); }
.rater .star.preview { color: var(--warn); }
.rater .star.zero:hover { color: var(--text); }
.rater .star.zero, .rater .star.clear { font-size: .85rem; }
.song-item .play-latest { margin-bottom: .35rem; font-size: .85rem; padding: .25rem .6rem; }

/* a page header that stays under the top bar while the list under it scrolls */
.sticky-head {
	position: sticky; top: var(--top-height, 3.2rem); z-index: 5;
	background: var(--bg); margin: -.4rem -1.2rem 0; padding: .4rem 1.2rem .1rem;
	border-bottom: 1px solid transparent;
}
.sticky-head.stuck { border-bottom-color: var(--line); box-shadow: 0 6px 12px -10px rgba(0, 0, 0, .35); }
.sticky-head .chips { margin-bottom: .8rem; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input[type=search] { flex: 1; min-width: 12rem; }
.sorter { gap: .3rem; flex-wrap: nowrap; }
.file-tags { gap: .3rem; margin: .2rem 0; }
.sorter .sort-dir { min-width: 2.2rem; font-size: 1rem; }
.sorter > .sort-label { display: inline; margin: 0; font-size: .85rem; color: var(--muted); white-space: nowrap; }

/* the song's fields, folded away under "Details" */
details.details > summary { cursor: pointer; display: flex; gap: .8rem; align-items: baseline; list-style: none; }
details.details > summary::-webkit-details-marker { display: none; }
details.details > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
details.details[open] > summary::before { transform: rotate(90deg); }
details.details > summary .summary-title { font-weight: 600; }
details.details[open] > summary { margin-bottom: 1rem; }

.file-item {
	padding: .9rem 1rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--panel);
}
.file-item + .file-item { margin-top: .6rem; }
.file-item audio { width: 100%; margin-top: .6rem; }
button.play.on { border-color: var(--accent); }

/* the site's player, at the bottom while a recording is in it */
.global-player {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
	display: flex; align-items: center; gap: .8rem; padding: .5rem 1rem;
	background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .12);
}
.global-player[hidden] { display: none; }
.global-player .player-title { display: flex; flex-direction: column; min-width: 0; max-width: 32%; font-weight: 600; }
.global-player .player-title > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-player .player-body { flex: 1; min-width: 0; }
.global-player audio { width: 100%; display: block; }
.global-player .progress { margin: .8rem 0; }
body.with-player { padding-bottom: 5rem; }
body.with-player #toast { bottom: 5.5rem; }
.file-item .name { font-weight: 600; }
.file-item .name .swatch { display: inline-block; width: .7rem; height: .7rem; margin-right: .4rem; border-radius: 2px;
	vertical-align: baseline; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 25%, transparent); }

/* settings panels fold away */
.settings-panel { margin-top: 1rem; }
.settings-panel > summary .summary-title { font-size: 1.15rem; }
.password-panel { max-width: 30rem; margin-top: 2rem; }
details.nested { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .4rem; }
details.nested .theme-block + .theme-block { border-top: 1px dashed var(--line); padding-top: .8rem; }
.theme-block h3 { margin: 0; }
.theme-block h4 { margin: .4rem 0 0; font-size: .9rem; }
/* a recording in a song: one line, the rest folded out under it */
.file-item.compact { padding: .55rem .8rem; }
.file-head { display: flex; align-items: center; gap: .3rem .6rem; flex-wrap: wrap; }
.file-head .name { cursor: pointer; overflow-wrap: anywhere; }
.file-head .file-fill { flex: 1; }
.file-head .file-sep { color: var(--line); }
.file-more { min-width: 1.8rem; padding: .2rem .4rem; color: var(--muted); }
.file-more .chev { display: inline-block; transition: transform .15s; }
.file-more.open .chev { transform: rotate(90deg); }
.file-body { margin-top: .5rem; padding-left: 2.4rem; }
.file-body .file-actions { margin-top: .5rem; }
.file-actions { flex-wrap: wrap; }
.in-songs { display: inline-flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.in-songs .detach { padding: .05rem .35rem; min-width: 0; font-size: .75rem; line-height: 1.2; }
.admin-actions { gap: .4rem; padding-left: .6rem; border-left: 2px solid color-mix(in srgb, var(--admin) 45%, var(--line)); }
.version-head { margin: 1.4rem 0 .6rem; color: var(--muted); font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
.tag.take { background: var(--accent-soft); color: var(--text); cursor: default; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .85rem; }

.progress { height: .4rem; background: var(--soft); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }

#toast {
	position: fixed;
	left: 50%;
	bottom: 1.5rem;
	transform: translateX(-50%);
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: .6rem 1rem;
	box-shadow: 0 6px 24px var(--shadow);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s;
	z-index: 50;
	max-width: 90vw;
}
#toast.show { opacity: 1; }
#toast.error { border-color: var(--danger); color: var(--danger); }

/* the studio: the waveform editor */
.studio { display: flex; flex-direction: column; gap: .7rem; }
.drop {
	border: 2px dashed var(--line);
	border-radius: calc(var(--radius) * 1.5);
	padding: 3rem 1rem;
	text-align: center;
	color: var(--muted);
}
.drop.over { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.toolbar { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.toolbar .sep { width: 1px; height: 1.6rem; background: var(--line); margin: 0 .3rem; }
.toolbar input[type=number] { width: 5rem; }
.wave-wrap {
	position: relative;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--panel);
	user-select: none;
	touch-action: none;
}
.wave-wrap canvas { display: block; width: 100%; }
.wave-wrap canvas.wave { cursor: text; }
.wave-wrap canvas.wave.on-bound { cursor: ew-resize; }
.lane-label {
	position: absolute;
	left: .4rem;
	font-size: .7rem;
	color: var(--muted);
	pointer-events: none;
	background: color-mix(in srgb, var(--panel) 70%, transparent);
	padding: 0 .3rem;
	border-radius: 4px;
}
.statusbar { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.statusbar b { color: var(--text); font-weight: 500; }
.scroller { height: .9rem; background: var(--soft); border-radius: 99px; position: relative; cursor: pointer; }
.scroller > div { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 99px; min-width: 6px; }
kbd { font: .75rem ui-monospace, monospace; border: 1px solid var(--line); border-radius: 4px; padding: 0 .3rem; background: var(--soft); }

@media (max-width: 640px) {
	.top { gap: .6rem; }
	.theme-mode { margin-left: 0; }
	.song-item { grid-template-columns: 1fr; }
	.song-item .meta { text-align: left; }
	.song-item.pickable { grid-template-columns: auto 1fr; }
	.song-item.pickable .meta { grid-column: 2; }
}
