/* ============================================================
   Soundboard V3 - stylesheet
   ------------------------------------------------------------
   Dark theme: the classic "V3 - Copy" buttons on a dark canvas,
   with the old v2 artwork still showing through as a backdrop.
   - the sound buttons (cards) are the ones from V3 - Copy: a
     translucent panel, 12px radius, and a board-coloured fill
     that sweeps across the card while the sound plays
   - the v2 artwork is a veiled fixed background, with a glow in
     the colour of the board you are looking at
   - board colours come from config/boards.json and arrive on the
     elements as --board-color / --chip-color / --card-color /
     --row-color / --badge-color
   ============================================================ */

/* Registered so the page glow fades smoothly when you switch boards
   (browsers without @property simply snap to the new colour). */
@property --bg-glow {
	syntax: '<color>';
	inherits: true;
	initial-value: #38bdf8;
}

:root {
	/* surfaces - translucent dark, so the artwork stays visible in the gaps
	   between the buttons without washing the buttons out */
	--bg: #0a0f16;
	--bg-top: #131c28;
	--panel: rgba(16, 23, 33, .60);
	--panel-2: rgba(28, 38, 52, .74);
	--panel-3: rgba(255, 255, 255, .14);
	--panel-solid: rgba(14, 20, 29, .97);
	--line: rgba(255, 255, 255, .10);
	--line-strong: rgba(255, 255, 255, .18);

	/* text */
	--text: #e9eef7;
	--text-dim: #c6d2e2;
	--muted: #8ea0b8;

	/* accents */
	--accent: #38bdf8;
	--accent-soft: rgba(56, 189, 248, .18);
	--green: #34d399;
	--danger: #ef4444;
	--gold: #fbbf24;

	/* geometry */
	--radius-lg: 16px;
	--radius: 12px;
	--radius-sm: 10px;
	--topbar-h: 62px;
	--nav-h: 50px;

	/* shadows */
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
	--shadow-md: 0 12px 30px rgba(0, 0, 0, .5);
	--shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);

	/* background: the photo behind the dark veil, plus the glow of the board
	   you are looking at. --art is the backdrop of the active board (from
	   config/boards.json -> "art", served out of V3/images/), --art-prev is
	   the one that was showing a moment ago so the two can cross-fade. */
	--bg-glow: #38bdf8;
	--art: url("/images/Soundboard.jpg");
	--art-prev: url("/images/Soundboard.jpg");
	/* the dark wash that keeps the buttons readable over the photo */
	--art-veil: radial-gradient(125% 100% at 50% 44%, rgba(8, 12, 18, .96) 0%, rgba(8, 12, 18, .92) 44%, rgba(8, 12, 18, .58) 100%);

	--ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

/* .icon-btn/.toast/.results set display, which would beat the UA [hidden]
   rule - keep the attribute authoritative everywhere */
[hidden] { display: none !important; }

html {
	color-scheme: dark;
	/* the canvas: dark gradient, always behind everything
	   (the root background is propagated to the canvas, so it covers
	   the viewport by itself - no background-attachment needed) */
	background:
		radial-gradient(120% 80% at 50% -12%, #1a2635 0%, rgba(26, 38, 53, 0) 62%),
		linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 45%, #070b11 100%);
	/* registered custom property -> the glow cross-fades between boards */
	transition: --bg-glow .42s var(--ease);
}

html, body { margin: 0; height: 100%; }

body {
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
	background: transparent;
	color: var(--text);
	font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* The board artwork behind a dark veil: the photo still shows around the edges,
   while the middle (where the buttons live) stays almost solid so the dark UI
   is easy to read. A 404'd image simply leaves the dark canvas.

   Two layers, so switching boards cross-fades: html::before holds the previous
   photo, body::before paints the new one on top of it and fades in (the
   .art-swap class is toggled from app.js). */
html::before,
body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	background-image: var(--art-veil), var(--art);
	background-position: center, center;
	background-size: cover, cover;
	background-repeat: no-repeat, no-repeat;
}

html::before {
	z-index: -3;
	background-image: var(--art-veil), var(--art-prev);
}

body::before { z-index: -2; }

/* the new backdrop fades in over the previous one; after the animation both
   layers show the same photo again (see applyBoardArt in app.js). Kept short -
   the photo is already cached and decoded, so switching feels immediate. */
body.art-swap::before { animation: art-in .3s var(--ease); }

@keyframes art-in {
	from { opacity: 0; }
}

/* A soft glow in the colour of the board you are looking at; it fades over
   .42s because --bg-glow is a registered property (see @property above).
   Deliberately subtle - the backdrop photo is the star. */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(90% 52% at 50% 2%, color-mix(in srgb, var(--bg-glow) 17%, transparent) 0%, transparent 72%),
		radial-gradient(46% 38% at -2% 104%, color-mix(in srgb, var(--bg-glow) 14%, transparent) 0%, transparent 72%),
		radial-gradient(40% 32% at 102% 98%, color-mix(in srgb, var(--bg-glow) 11%, transparent) 0%, transparent 74%);
}

button, input { font: inherit; color: inherit; }

::selection { background: rgba(56, 189, 248, .30); }

:focus-visible { outline: 2px solid rgba(56, 189, 248, .65); outline-offset: 2px; }

/* ---------------------------------------------------------- topbar */

.topbar {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 0 0 auto;
	height: var(--topbar-h);
	padding: 0 clamp(12px, 2vw, 22px);
	background: rgba(10, 15, 22, .82);
	backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--line);
	z-index: 40;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	white-space: nowrap;
}

.brand-mark {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 10px;
	background: linear-gradient(140deg, var(--accent), #6366f1);
	color: #04121c;
	box-shadow: 0 6px 16px -8px rgba(56, 189, 248, .9);
}

.brand-text { color: var(--muted); font-size: 15px; }
.brand-text b { color: var(--text); margin-left: 3px; }

/* search ------------------------------------------------------ */

.search {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	max-width: 620px;
	margin: 0 auto;
}

.search-icon {
	position: absolute;
	left: 13px;
	display: grid;
	place-items: center;
	color: var(--muted);
	pointer-events: none;
	transition: color .15s;
}

#search {
	width: 100%;
	height: 40px;
	padding: 0 40px 0 38px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--panel);
	color: var(--text);
	outline: none;
	transition: border-color .15s, box-shadow .15s, background .15s;
}

#search:hover { border-color: var(--line-strong); }

#search:focus {
	border-color: var(--accent);
	background: var(--panel-2);
	box-shadow: 0 0 0 3px rgba(56, 189, 248, .15);
}

.search:focus-within .search-icon { color: var(--accent); }

#search::placeholder { color: var(--muted); }

#search::-webkit-search-cancel-button { display: none; }

.icon-btn {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	transition: background .15s, color .15s, transform .1s;
}

.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.icon-btn:active { transform: scale(.92); }

.search .icon-btn { position: absolute; right: 7px; }

/* controls ---------------------------------------------------- */

.controls {
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

/* pill, like the chips in V3 - Copy */
.volume {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 34px;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--panel);
	color: var(--muted);
}

.volume:hover { border-color: var(--line-strong); color: var(--text-dim); }

.volume-icon { display: grid; place-items: center; }

.volume input[type="range"] {
	width: 92px;
	height: 4px;
	-webkit-appearance: none;
	appearance: none;
	background: rgba(255, 255, 255, .18);
	border-radius: 999px;
	outline: none;
	cursor: pointer;
}

.volume input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--accent);
	border: 2px solid #0a0f16;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}

.volume input[type="range"]:focus-visible::-webkit-slider-thumb {
	box-shadow: 0 0 0 3px rgba(56, 189, 248, .3);
}

.volume input[type="range"]::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--accent);
	border: 2px solid #0a0f16;
}

/* the header buttons, straight from V3 - Copy (pills) */
.chip-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 14px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--panel);
	color: var(--text);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: .2px;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s, transform .08s;
}

.chip-btn:hover { background: var(--panel-2); border-color: var(--line-strong); }
.chip-btn:active { transform: translateY(1px); }

.chip-btn.danger { color: #ffb4b4; border-color: rgba(239, 68, 68, .35); }
.chip-btn.danger:hover { background: rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .55); }

.chip-btn.on { background: var(--accent-soft); border-color: var(--accent); color: #bfe9ff; }

.chip-btn:disabled { opacity: .4; cursor: not-allowed; }

#midi-btn::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--line-strong);
	transition: background .15s, box-shadow .15s;
}

#midi-btn.on::before {
	background: var(--green);
	box-shadow: 0 0 0 3px rgba(52, 211, 153, .18);
}

/* ---------------------------------------------------------- board menu */

.board-nav {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	height: var(--nav-h);
	padding: 0 clamp(14px, 2vw, 22px);
	overflow-x: auto;
	overflow-y: hidden;
	border-bottom: 1px solid var(--line);
	background: rgba(10, 15, 22, .6);
	backdrop-filter: blur(10px);
	scrollbar-width: none;
	z-index: 30;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}

.board-nav::-webkit-scrollbar { display: none; }

.nav-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	height: 32px;
	padding: 0 13px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: transparent;
	color: var(--muted);
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background .16s, color .16s, border-color .16s;
}

.nav-chip:hover { color: var(--text); background: var(--panel); border-color: var(--line-strong); }

.nav-chip .dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--chip-color, var(--accent));
}

.nav-chip .count {
	padding: 1px 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .10);
	color: var(--muted);
	font-size: 10.5px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.nav-chip.active {
	color: #fff;
	background: color-mix(in srgb, var(--chip-color, var(--accent)) 22%, transparent);
	border-color: var(--chip-color, var(--accent));
}

.nav-chip.active .count { background: rgba(0, 0, 0, .3); color: #fff; }

/* ---------------------------------------------------------- track + boards */

.track {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
	/* hidden instead of auto: JavaScript can still scroll the strip (goToBoard),
	   but the user cannot wheel/swipe to another board - the menu and the arrow
	   keys are the only way to switch. */
	overflow-x: hidden;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.track::-webkit-scrollbar { display: none; }

.board {
	display: flex;
	flex-direction: column;
	flex: 0 0 100%;
	width: 100%;
	min-width: 100%;
	max-width: 100%;
	height: 100%;
	min-height: 0;
	padding: 16px clamp(14px, 2vw, 26px) 8px;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.board-head {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
	margin-bottom: 12px;
}

.board-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: clamp(16px, 1.5vw, 19px);
	font-weight: 650;
	letter-spacing: -.01em;
}

.board-title::before {
	content: "";
	width: 4px;
	height: 1.05em;
	border-radius: 999px;
	background: var(--board-color, var(--accent));
	box-shadow: 0 0 12px -2px var(--board-color, var(--accent));
}

.board-sub {
	color: var(--muted);
	font-size: 12.5px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.board-hint {
	margin-left: auto;
	flex: 0 0 auto;
	padding: 3px 10px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--panel);
	color: var(--text-dim);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .02em;
	font-variant-numeric: tabular-nums;
}

/* grid -------------------------------------------------------- */

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
	gap: 8px;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	align-content: start;
	padding: 2px 8px 28px 2px;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .2) transparent;
}

.grid::-webkit-scrollbar { width: 10px; }

.grid::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, .16);
	border-radius: 999px;
	border: 3px solid transparent;
	background-clip: content-box;
}

.grid::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .3); background-clip: content-box; }

/* card (the V3 - Copy sound button) --------------------------- */

.card {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 46px;
	padding: 8px 30px 8px 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--panel);
	text-align: left;
	cursor: pointer;
	overflow: hidden;
	-webkit-tap-highlight-color: transparent;
	transition: background .15s, border-color .15s, transform .09s;
}

.card:hover { background: var(--panel-2); border-color: var(--line-strong); }

.card:active { transform: scale(.98); }

.card.is-playing {
	border-color: var(--card-color, var(--accent));
	background: var(--panel-2);
	box-shadow: 0 0 18px -10px var(--card-color, var(--accent));
}

/* playback progress: the board colour sweeps across the card */
.card-bar {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	background: var(--card-color, var(--accent));
	opacity: .22;
	pointer-events: none;
	z-index: 0;
}

.card-name {
	position: relative;
	z-index: 2;
	flex: 1 1 auto;
	min-width: 0;
	color: var(--text);
	font-size: 12.5px;
	font-weight: 500;
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-break: break-word;
}

/* both actions share one right-aligned column, vertically centred: the
   two 18px buttons + 3px gap always fit inside the 46px card, so they can
   never overlap — not even when a two-line name makes the card taller */
.card-actions {
	position: absolute;
	top: 50%;
	right: 6px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	transform: translateY(-50%);
}

.card-stop {
	position: relative;
	display: grid;
	place-items: center;
	width: 18px;
	height: 18px;
	border-radius: 5px;
	background: rgba(239, 68, 68, .9);
	color: #fff;
	opacity: 0;
	transition: opacity .16s, background .16s;
	cursor: pointer;
}

/* the crisp square: absolutely pinned to the centre of the button with
   inset:0 + margin:auto, so it sits dead-centre on both axes no matter
   what (a zero-size text node in the flow used to shift it upwards) */
.card-stop::before {
	content: "";
	position: absolute;
	inset: 0;
	width: 6px;
	height: 6px;
	margin: auto;
	border-radius: 1px;
	background: currentColor;
}

.card:hover .card-stop,
.card.is-playing .card-stop { opacity: 1; }

.card-stop:hover { background: #dc2626; }

.card-fav {
	display: grid;
	place-items: center;
	width: 18px;
	height: 18px;
	border-radius: 5px;
	color: var(--muted);
	font-size: 11px;
	line-height: 1;
	opacity: .35;
	transition: opacity .16s, color .16s, background .16s, transform .12s;
	cursor: pointer;
}

.card:hover .card-fav { opacity: .9; }

.card-fav.on { opacity: 1; color: var(--gold); }

.card-fav:hover { background: rgba(255, 255, 255, .12); transform: scale(1.08); }

/* empty / loading --------------------------------------------- */

.empty {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 48px 16px;
	border: 1px dashed var(--line-strong);
	border-radius: var(--radius-lg);
	background: rgba(255, 255, 255, .03);
	color: var(--muted);
	font-size: 13.5px;
	text-align: center;
}

.empty::before {
	content: "\266A";
	font-size: 22px;
	line-height: 1;
	color: var(--line-strong);
}

.loading {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: auto;
	color: var(--muted);
	font-size: 13.5px;
}

.loading::before {
	content: "";
	width: 15px;
	height: 15px;
	border-radius: 50%;
	border: 2px solid var(--line-strong);
	border-top-color: var(--accent);
	animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- search results */

.results {
	position: fixed;
	top: calc(var(--topbar-h) + 8px);
	left: 50%;
	transform: translateX(-50%);
	width: min(760px, calc(100vw - 32px));
	max-height: calc(100vh - var(--topbar-h) - var(--nav-h) - 40px);
	display: flex;
	flex-direction: column;
	/* solid, so the rows stay readable over the artwork */
	background: var(--panel-solid);
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	backdrop-filter: blur(14px);
	overflow: hidden;
	z-index: 60;
}

.results-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 10px 8px 16px;
	border-bottom: 1px solid var(--line);
	background: rgba(255, 255, 255, .04);
	color: var(--muted);
	font-size: 12.5px;
	font-weight: 600;
}

.results-list {
	overflow-y: auto;
	padding: 6px;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .2) transparent;
}

.result {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 9px 12px 9px 14px;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	text-align: left;
	cursor: pointer;
	transition: background .12s;
}

.result::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 3px;
	height: 60%;
	border-radius: 999px;
	background: var(--row-color, var(--accent));
	transform: translateY(-50%) scaleY(.35);
	transition: transform .16s var(--ease);
}

.result:hover { background: var(--panel-2); }
.result:hover::before { transform: translateY(-50%) scaleY(1); }

.result.active {
	background: color-mix(in srgb, var(--row-color, var(--accent)) 16%, transparent);
}

.result.active::before { transform: translateY(-50%) scaleY(1); }

.result-main {
	flex: 1 1 auto;
	min-width: 0;
	/* title + file name sit on one line (a space between them) and are cut
	   off with an ellipsis when the row is too narrow */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.result-name { color: var(--text); font-size: 13.5px; font-weight: 600; }

.result-name mark {
	background: rgba(56, 189, 248, .3);
	color: #d8f1ff;
	border-radius: 3px;
	padding: 0 2px;
}

.result-sub { color: var(--muted); font-size: 11.5px; }

.result-badge {
	flex: 0 0 auto;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 10.5px;
	font-weight: 600;
	color: var(--text);
	background: color-mix(in srgb, var(--badge-color, var(--accent)) 26%, transparent);
	border: 1px solid color-mix(in srgb, var(--badge-color, var(--accent)) 52%, transparent);
}

.result-play {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 1px solid var(--line-strong);
	background: var(--panel);
	color: var(--muted);
	font-size: 9px;
	transition: background .16s, border-color .16s, color .16s;
}

.result:hover .result-play,
.result.active .result-play {
	background: var(--accent);
	border-color: transparent;
	color: #04121c;
}

.results-empty {
	padding: 30px 16px;
	text-align: center;
	color: var(--muted);
	font-size: 13px;
}

/* ---------------------------------------------------------- toast */

.toast {
	position: fixed;
	bottom: calc(22px + env(safe-area-inset-bottom, 0px));
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: min(90vw, 520px);
	padding: 10px 18px;
	border-radius: 999px;
	border: 1px solid var(--line-strong);
	background: var(--panel-solid);
	color: var(--text);
	font-size: 13px;
	font-weight: 600;
	box-shadow: var(--shadow-md);
	z-index: 80;
	animation: toast-in .2s var(--ease);
}

/* status LED (survives textContent updates) */
.toast::before {
	content: "";
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--green);
	box-shadow: 0 0 0 3px rgba(52, 211, 153, .16);
}

@keyframes toast-in {
	from { opacity: 0; transform: translate(-50%, 10px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 1024px) {
	.grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }
}

@media (max-width: 900px) {
	.brand-text { display: none; }
	.volume input[type="range"] { width: 72px; }
}

@media (max-width: 720px) {
	:root { --topbar-h: 108px; --nav-h: 48px; }
	.topbar {
		flex-wrap: wrap;
		align-content: center;
		gap: 8px 10px;
		padding: 10px 12px;
	}
	.brand { order: 1; }
	.controls { order: 2; margin-left: auto; }
	.search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
	.board { padding: 14px 12px 6px; }
	.board-sub, .board-hint { display: none; }
	.grid { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 8px; }
	.card { min-height: 48px; padding: 8px 28px 8px 11px; }
	.card-stop, .card-fav { opacity: .7; }
	.results { top: calc(var(--topbar-h) + 8px); width: calc(100vw - 20px); }
}

@media (max-width: 420px) {
	.chip-btn { padding: 0 11px; }
	.volume { padding: 0 10px; }
	.volume input[type="range"] { width: 58px; }
	.card { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
	.track { scroll-behavior: auto; }
}
