/* Hidden panels, popovers, cards, the context menu and the playlist panel are `display: none`: an opacity-0 layer with
   a backdrop blur is still painted and rastered (~100 ms of GPU raster per load for two of them), a visibility-hidden one
   still styled and laid out. They enter and leave by transitions from @starting-style with `display` transitioning
   (allow-discrete), so a closing element stays drawn until its exit ends; a toggle mid-way reverses from where it is. */

:root {
	--bar-row: 52px;
	--timeline-h: 18px;
	--bar-h: calc(var(--bar-row) + var(--timeline-h));
	--gutter: 16px;
	--glass: rgba(16, 16, 24, 0.58);
	--glass-strong: rgba(16, 16, 24, 0.8);
	--glass-border: rgba(255, 255, 255, 0.09);
	--glass-hi: rgba(255, 255, 255, 0.06);
	--blur: blur(18px) saturate(150%);
	--text: #f3f3f7;
	--dim: rgba(255, 255, 255, 0.64);
	--faint: rgba(255, 255, 255, 0.38);
	--accent: #e8317d;
	--accent2: #8e54e9;
	/* solid fills everywhere; the gradient is the toggle switches' only */
	--accent-hover: #f0478e;
	--accent-press: #cc2a6c;
	--accent-soft: rgba(232, 49, 125, 0.16);
	--on-accent: #fff;
	--grad: linear-gradient(90deg, #8e54e9, #e8317d);
	--radius: 16px;
	--radius-s: 10px;
	--ease: cubic-bezier(0.2, 0.8, 0.2, 1);
	--ease-in: cubic-bezier(0.4, 0, 1, 1);
	--dur: 180ms;
	--dur-out: 160ms;
	--shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--bar-pad-l: calc(var(--gutter) + env(safe-area-inset-left, 0px));
	--bar-pad-r: calc(var(--gutter) + env(safe-area-inset-right, 0px));
	/* the panels' glass, shared by the settings panel, the popovers, the cards and the context menu */
	--panel-bg: var(--glass-strong);
	--panel-blur: var(--blur);
	--panel-border: 1px solid var(--glass-border);
	--panel-shadow: var(--shadow);
	/* motion-soft's fade length */
	--soft: 150ms;
	/* Everything that opens from the bar sits --popup-gap above the bar's top edge, shown or not. --popup-bottom: from the
	   viewport's bottom; --popup-host-bottom: from the bottom of a bar item holding the popup (centred in the bar's row). */
	--popup-gap: 10px;
	--popup-bottom: calc(var(--bar-h) + var(--safe-bottom) + 1px + var(--popup-gap));
	--popup-host-bottom: calc(50% + var(--timeline-h) + (var(--bar-row) - var(--bar-row-lift)) / 2 + 1px + var(--popup-gap));
}

html {
	background: #111;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}
/* the chrome stays unselectable, what people read can be selected (Safari reads only the prefixed form) */
.card > .cardInner, .lcText, .lcReply, .lcPinnedText, .lcAboutText, .liveUpNext, #randomReplayInfo, .hotkey-help-sections { user-select: text; -webkit-user-select: text; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: #000; color: var(--text); font: 13px/1.4 system-ui, BlinkMacSystemFont, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.icon { width: 1em; height: 1em; vertical-align: -0.125em; flex: none; }
a { color: inherit; }

#stage { position: fixed; inset: 0; overflow: hidden; contain: layout; }
#view { display: block; width: 100%; height: 100%; touch-action: none; }
#body:not(.showControls) #view { cursor: none; }
.orthoFullscreen { position: absolute; width: 1.5%; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; display: none; }
.orthoFullscreen.available { display: block; }
.orthoFullscreen svg { width: 100%; height: 100%; fill: #fff; display: block; }
.orthoFullscreen .exitFullscreen, .orthoFullscreen.inFullscreen .enterFullscreen { display: none; }
.orthoFullscreen.inFullscreen .exitFullscreen { display: block; }
#body:not(.showControls) .orthoFullscreen svg { display: none; }
/* too small in the mini view (~6 px) */
html.overlay.collapsed .orthoFullscreen.available { display: none; }

#hud { position: fixed; right: 8px; bottom: calc(var(--bar-h) + 8px); white-space: pre; pointer-events: none; text-shadow: 0 0 3px #000; font-size: 11px; color: #aaa; display: none; }
#loading { position: fixed; right: var(--gutter); top: 12px; white-space: pre; text-align: right; pointer-events: none; text-shadow: 0 0 3px #000; color: #aaa; z-index: 5; }
#error { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; padding: 16px; background: rgba(0, 0, 0, 0.6); z-index: 100000000; }
#drop { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; font-size: 18px; background: rgba(0, 0, 0, 0.55); border: 3px dashed #888; pointer-events: none; z-index: 100000001; }

/* hud.js's DOM canvases, placed by matrix3d */
#hudLayer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
#hudLayer > * { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
#hudLayer > .hidden { display: none; }
#restartButton { pointer-events: auto; cursor: pointer; }

.glass, .panel, .popover > *, .card > .cardInner, #playlistContent, .glassButton {
	background: var(--glass);
	-webkit-backdrop-filter: var(--blur);
	backdrop-filter: var(--blur);
	border: 1px solid var(--glass-border);
	box-shadow: var(--shadow);
}
.glassButton { color: var(--text); border-radius: 999px; padding: 8px 16px; cursor: pointer; transition: background var(--dur) var(--ease), transform var(--dur) var(--ease); }
.glassButton:hover { background: var(--glass-strong); }
.glassButton:active { transform: scale(0.96); }

#controls {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999999;
	display: none;
	padding: 0 var(--bar-pad-r) var(--safe-bottom) var(--bar-pad-l);
	border-top: 1px solid var(--glass-border);
	transition: transform 320ms var(--ease), opacity 320ms var(--ease);
	transform: translateY(calc(100% + 4px));
	opacity: 0;
}
/* the bar's glass on a layer behind its content, not on the bar: an element with a backdrop-filter is the backdrop root
   of everything inside it, so the popovers and cards inside the bar would blur only the bar, not the scene */
#controls::before { content: ''; position: absolute; inset: -1px 0 0 0; z-index: -1; pointer-events: none; background: rgba(8, 8, 12, 0.66); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
#controls.challengeLoaded { display: block; }
.showControls #controls { transform: none; opacity: 1; }
#controls p { margin: 0; }
/* the row's content centred between the timeline's track (11 px into the bar) and the bar's bottom edge */
#barRow { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: var(--bar-row); box-sizing: border-box; padding-bottom: var(--bar-row-lift); }
:root { --bar-row-lift: 7px; }
#barLeft, #barRight { display: flex; align-items: center; gap: 4px; min-width: 0; }
#barLeft { flex: 1 1 auto; }
#barRight { flex: none; }

.barButton {
	position: relative;
	flex: none;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: var(--radius-s);
	background: transparent;
	color: var(--text);
	font-size: 20px;
	cursor: pointer;
	transition: background var(--dur) var(--ease), transform 120ms var(--ease), color var(--dur) var(--ease);
}
.barButton:hover { background: rgba(255, 255, 255, 0.1); }
.barButton:active { transform: scale(0.92); }
.barButton:focus-visible, .chip:focus-visible, .tab-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.barButton:disabled { opacity: 0.35; cursor: default; }
.barButton.active, .popoverHost.open > .barButton { color: #fff; background: rgba(232, 49, 125, 0.35); }
.barButton.pill { width: auto; min-width: 48px; padding: 0 10px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; gap: 4px; }
.songEffectiveSpeed { color: #ffcf66; font-size: 11px; display: none; }
.songEffectiveSpeed.on { display: inline; }
.barButton.hiddenObjects { color: #ffcf66; max-width: 260px; gap: 6px; }
.barButton.hiddenObjects .icon { font-size: 16px; }
.hiddenObjectsText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barButton.hiddenObjects[hidden] { display: none; }
@media (max-width: 640px) {
	.hiddenObjectsText { display: none; }
	.barButton.hiddenObjects { min-width: 40px; padding: 0; }
}
/* ?stream=1 (a stream's browser source): the scene alone, no cursor */
html.stream #controls, html.stream #homeButton, html.stream #loading, html.stream #skipIntro, html.stream #randomReplay, html.stream #previewPicker, html.stream .hotkey-notification, html.stream #ctxMenu, html.stream .orthoFullscreen { display: none !important; }
html.stream, html.stream * { cursor: none !important; }
.playlistOnly, .overlayOnly { display: none !important; }
.playlistOpen .playlistOnly { display: inline-flex !important; }
html.overlay .overlayOnly { display: inline-flex !important; }
.controlsFullscreen .exitFullscreen, .controlsFullscreen.inFullscreen .enterFullscreen { display: none; }
.controlsFullscreen.inFullscreen .exitFullscreen { display: inline; }

/* play / pause: three 3 x 20 px capsules morph between two bars and an outlined triangle of side 17 px whose vertical
   edge is the left pause bar. Translate + rotate only (scale would squash the caps). The bar's box sits on whole pixels
   (Chrome snaps a transformed box's fractional offset): its centre is 0.5 px left of the button's, which every
   translate adds back. */
.playButton { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.playButton:hover { background: rgba(255, 255, 255, 0.18); }
.playButton .bar { position: absolute; left: 50%; top: 50%; width: 3px; height: 20px; margin: -10px 0 0 -2px; border-radius: 1.5px; background-color: #fff; transition: transform 320ms var(--ease); }
/* pause: bars 4.5 px either side of the centre */
.playButton.pause .bar-1, .playButton.pause .bar-3 { transform: translate(-4px, 0) rotate(0deg); }
.playButton.pause .bar-2 { transform: translate(5px, 0) rotate(0deg); }
/* play: corners from the button's centre top (-4.5, -8.5), bottom (-4.5, 8.5), tip (10.222, 0) (17 * sqrt(3) / 2 =
   14.722 right of the edge); each slanted bar at its edge's midpoint (2.861, -/+4.25) */
.playButton.play .bar-1 { transform: translate(3.361px, -4.25px) rotate(-60deg); }
.playButton.play .bar-2 { transform: translate(3.361px, 4.25px) rotate(60deg); }
.playButton.play .bar-3 { transform: translate(-4px, 0) rotate(0deg); }

#songTime { flex: none; margin: 0 6px 0 4px !important; color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#songProgress { color: var(--text); }
#songBeat:empty { display: none; }
#songBeat b { color: var(--text); font-weight: inherit; }
/* centred: three columns, the sides equal */
#barMid { display: flex; align-items: center; gap: 6px; flex: none; min-width: 0; }
#barRow.centered { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
#barRow.centered > #barRight { justify-self: end; }
/* .held: a map's settings request holds the value */
.barButton.effectsToggle[hidden] { display: none; }
.effectsToggle .effectsIcon { display: inline-flex; }
.barButton.effectsToggle.off { color: var(--dim); }
.barButton.effectsToggle.held { opacity: 0.6; }

/* the chips' cards are absolute: the bar does not grow */
#infoChips { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; }
.chip {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	max-width: 280px;
	box-sizing: border-box;
	height: 44px;
	padding: 4px 10px 4px 6px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.05);
	cursor: default;
	outline: none;
	transition: background var(--dur) var(--ease);
}
.chip:hover, .chip.open, .chip:focus-within { background: rgba(255, 255, 255, 0.12); }
.chip.empty { display: none; }
.chipImage { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex: none; background: rgba(255, 255, 255, 0.06); }
.chipImage.round { border-radius: 50%; }
.chipText { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.chipTitle { font-weight: 650; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chipSub { display: flex; align-items: center; gap: 5px; color: var(--dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chipSub > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.flag { width: 16px; height: 11px; border-radius: 2px; flex: none; }
.flag[src=""], .flag:not([src]) { display: none; }
.diffBadge { flex: none; padding: 0 5px; border-radius: 4px; color: #fff; font-size: 10px; font-weight: 600; line-height: 15px; }
.diffBadge:empty { display: none; }

/* The inner box carries the glass, so it carries the fade: an ancestor's opacity would cut its backdrop blur off. A
   leaving card takes no pointer, so nothing flips under a still pointer. */
.card { position: absolute; left: 0; bottom: var(--popup-host-bottom); width: 340px; max-width: calc(100vw - 2 * var(--gutter)); display: none; z-index: 3; pointer-events: none; transition: display var(--dur-out) allow-discrete; }
/* the hover's bridge from the chip up to its card, over the gap and the timeline */
.card::before { content: ''; position: absolute; left: 0; right: 0; bottom: -44px; height: 46px; }
.card > .cardInner { background: var(--panel-bg); -webkit-backdrop-filter: var(--panel-blur); backdrop-filter: var(--panel-blur); border: var(--panel-border); box-shadow: var(--panel-shadow); border-radius: var(--radius); padding: 14px; transform-origin: 20% 100%; max-height: calc(100vh - var(--bar-h) - 40px); overflow: auto; opacity: 0; transform: translateY(10px) scale(0.98); transition: opacity var(--dur-out) var(--ease-in), transform var(--dur-out) var(--ease-in); }
.chip:hover > .card, .chip.open > .card, .chip:focus-within > .card { display: block; pointer-events: auto; transition: display 220ms allow-discrete; }
.chip:hover > .card > .cardInner, .chip.open > .card > .cardInner, .chip:focus-within > .card > .cardInner { opacity: 1; transform: none; transition: opacity 220ms var(--ease), transform 220ms var(--ease); }
@starting-style {
	.chip:hover > .card > .cardInner, .chip.open > .card > .cardInner, .chip:focus-within > .card > .cardInner { opacity: 0; transform: translateY(10px) scale(0.98); }
}
.chip.empty > .card { display: none !important; }
.cardHead { display: flex; gap: 12px; align-items: center; }
.cardHead > img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; background: rgba(255, 255, 255, 0.06); }
.cardHead > img.round { border-radius: 50%; }
.cardSub .flag { vertical-align: -1px; }
.cardTitle { font-size: 16px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.cardTitle a { text-decoration: none; }
.cardTitle a:hover { text-decoration: underline; }
.cardSub { color: var(--dim); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.cardBadges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.badge { padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.warn { background: rgba(255, 80, 80, 0.3); color: #ffd0d0; }
.badge.ranked { background: rgba(255, 196, 0, 0.25); color: #ffe08a; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.stat { padding: 7px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); min-width: 0; }
.stat b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { display: block; color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.stat.pp b { color: #a8b1ff; }
.stat.good b { color: #8ff0a4; }
.stat.bad b { color: #ff9c9c; }
.mapStats { display: flex; flex-direction: column; gap: 3px; margin-top: 12px; color: var(--dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mapStat { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-height: 18px; }
.mapStat > .icon, .statIcon { width: 14px; height: 14px; flex: none; color: var(--faint); }
.mapStat > :first-child:not(.icon):not(.statIcon) { margin-left: 20px; }
.statIcon { display: inline-block; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.mapStat b { color: var(--text); font-weight: 650; }
.mapStat .sep { color: var(--faint); }
.mapType { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 20px; box-sizing: border-box; border: 2px solid; border-radius: 6px; }
.mapType img { width: 15px; height: 13px; object-fit: contain; }
.cardLines { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; color: var(--dim); font-size: 12px; }
.cardLines b { color: var(--text); font-weight: 600; }
.cardLinks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cardLinks a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); text-decoration: none; font-size: 12px; transition: background var(--dur) var(--ease); }
.cardLinks a:hover { background: rgba(255, 255, 255, 0.16); }
.cardLinks .linkLogo { width: 16px; height: 16px; object-fit: contain; flex: none; }

#timeline { position: relative; height: var(--timeline-h); margin: 0 2px; cursor: pointer; touch-action: none; }
#timelineTrack { position: absolute; left: 0; right: 0; top: 7px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.16); transition: height 140ms var(--ease), top 140ms var(--ease); overflow: hidden; }
#timeline:hover #timelineTrack, #timeline.active #timelineTrack { top: 5.5px; height: 7px; }
#timelineBuffered { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, 0.28); transition: width 300ms linear; }
#timelineBuffered.done { display: none; }
#playhead { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); }
#timelineKnob { position: absolute; top: 9px; left: 0; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(232, 49, 125, 0.5); transform: scale(0); transition: transform 140ms var(--ease); pointer-events: none; z-index: 3; }
#timeline:hover #timelineKnob, #timeline.active #timelineKnob { transform: scale(1); }
/* The hover zone only grows on hover (the raised graph takes the pointer), so no pointer position can toggle it: an
   element leaving hit testing on hover would flip the hover every frame. The sinking graph takes no pointer. */
#timelineGraph { position: absolute; left: 0; right: 0; bottom: calc(100% - 4px); height: 84px; pointer-events: none; opacity: 0; transform: translateY(6px); transition: opacity var(--dur-out) var(--ease-in), transform var(--dur-out) var(--ease-in), visibility 0s linear var(--dur-out); visibility: hidden; }
#timeline:hover #timelineGraph, #timeline.active #timelineGraph { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity 180ms var(--ease), transform 220ms var(--ease), visibility 0s; }
#timelineGraph::before { content: ''; position: absolute; left: calc(-1 * var(--bar-pad-l) - 2px); right: calc(-1 * var(--bar-pad-r) - 2px); top: -10px; bottom: -8px; background: rgba(8, 8, 12, 0.74); border-top: 1px solid var(--glass-border); }
#timelineGraph canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
#timelinePlayedClip { position: absolute; left: 0; top: 0; bottom: 0; width: 0; overflow: hidden; }
#timelinePlayedClip canvas { width: var(--track-w, 100vw); }
/* the markers at rest cross-fade with the raised graph's */
#timelineMarkers { position: absolute; left: 0; top: -6px; width: 100%; height: 14px; z-index: 2; pointer-events: none; transition: opacity var(--dur-out) var(--ease); }
#timeline:hover #timelineMarkers, #timeline.active #timelineMarkers { opacity: 0; transition: opacity 120ms var(--ease-in); }
#timelineHover { position: absolute; bottom: calc(100% + 86px); left: 0; display: none; padding: 5px 9px; border-radius: 9px; background: var(--glass-strong); border: 1px solid var(--glass-border); color: #fff; font-size: 12px; white-space: pre; pointer-events: none; font-variant-numeric: tabular-nums; transform: translate(-50%, 6px); opacity: 0; z-index: 4; transition: opacity var(--dur-out) var(--ease-in), transform var(--dur-out) var(--ease-in), display var(--dur-out) allow-discrete; }
#timelineHover.timelineHoverActive { display: block; opacity: 1; transform: translate(-50%, 0); transition: opacity 180ms var(--ease), transform 220ms var(--ease), display 220ms allow-discrete; }
@starting-style {
	#timelineHover.timelineHoverActive { opacity: 0; transform: translate(-50%, 6px); }
}
#timelineHover .dim { color: var(--dim); }

.popoverHost { position: relative; }
.popover { position: absolute; right: -6px; bottom: var(--popup-host-bottom); display: none; z-index: 3; }
.popover > * { box-shadow: none; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.popover { width: 260px; padding: 12px; border-radius: var(--radius); background: var(--panel-bg); -webkit-backdrop-filter: var(--panel-blur); backdrop-filter: var(--panel-blur); border: var(--panel-border); box-shadow: var(--panel-shadow); }
/* a leaving popover takes no pointer */
.popover { opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity var(--dur-out) var(--ease-in), transform var(--dur-out) var(--ease-in), display var(--dur-out) allow-discrete; }
.popover.open, .popoverHost.open > .popover { display: block; opacity: 1; transform: none; pointer-events: auto; transition: opacity 200ms var(--ease), transform 200ms var(--ease), display 200ms allow-discrete; }
@starting-style {
	.popover.open, .popoverHost.open > .popover { opacity: 0; transform: translateY(8px); }
}
.popoverTitle { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 8px; font-weight: 650; }
.popoverTitle output { color: var(--dim); font-variant-numeric: tabular-nums; }
.presetRow { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.presetRow button { border: 0; border-radius: 999px; padding: 3px 9px; background: rgba(255, 255, 255, 0.08); font-size: 12px; cursor: pointer; transition: background var(--dur) var(--ease); }
.presetRow button:hover { background: rgba(255, 255, 255, 0.16); }
.presetRow button.active { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.presetRow button.active:hover { background: var(--accent-hover); }
.presetRow button.modifier { font-weight: 700; }
#speedSlider { width: 100%; }
#volumeSliderContainer { width: 330px; max-width: calc(100vw - 2 * var(--gutter)); }
#volumeSliderContainer .row { padding: 4px; gap: 10px; }
#volumeSliderContainer .rowLabel { white-space: nowrap; }
#volumeSliderContainer .row .settingRange { width: 140px; flex: none; }
#volumeSliderContainer .rowValue { min-width: 40px; }
#volumeSliderContainer:not(.mixed) .volMixer { display: none; }
.segmented.volumeMode { margin: 0; flex: none; border: 1px solid rgba(255, 255, 255, 0.12); }
.segmented.volumeMode button { padding: 4px 12px; font-size: 12px; }
.segmented.volumeMode button:hover:not(.active) { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.segmented.volumeMode button.active { background: var(--accent); color: var(--on-accent); }
.segmented.volumeMode button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.panel { border-radius: 18px; }
#settingsContainer {
	position: fixed;
	right: var(--gutter);
	bottom: var(--popup-bottom);
	width: min(620px, calc(100vw - 2 * var(--gutter)));
	height: min(580px, calc(100vh - var(--bar-h) - 40px));
	display: none;
	flex-direction: column;
	z-index: 100000000;
	background: var(--panel-bg);
	-webkit-backdrop-filter: var(--panel-blur);
	backdrop-filter: var(--panel-blur);
	border: var(--panel-border);
	box-shadow: var(--panel-shadow);
	transform-origin: 90% 100%;
	overflow: hidden;
	/* a leaving panel takes no pointer */
	opacity: 0;
	transform: translateY(12px) scale(0.985);
	pointer-events: none;
	transition: opacity 180ms var(--ease-in), transform 180ms var(--ease-in), display 180ms allow-discrete;
}
#settingsContainer.settingsActive { display: flex; opacity: 1; transform: none; pointer-events: auto; transition: opacity 200ms var(--ease), transform 240ms var(--ease), display 240ms allow-discrete; }
@starting-style {
	#settingsContainer.settingsActive { opacity: 0; transform: translateY(12px) scale(0.985); }
}
.panelHeader { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 6px 18px; flex: none; }
.panelTitle { font-size: 15px; font-weight: 700; }
.iconButton { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: transparent; font-size: 16px; cursor: pointer; transition: background var(--dur) var(--ease); }
.iconButton:hover { background: rgba(255, 255, 255, 0.1); }
.tab-container { display: flex; flex: 1; min-height: 0; }
.tab-buttons { flex: none; width: 150px; display: flex; flex-direction: column; gap: 2px; padding: 4px 8px 12px; overflow-y: auto; }
.tab-button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--dim); cursor: pointer; text-align: left; font-size: 13px; font-weight: 550; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.tab-button .icon { font-size: 16px; }
.tab-button:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.tab-button.active { background: var(--accent-soft); color: #fff; box-shadow: inset 0 0 0 1px var(--accent); }
.tab-content { flex: 1; min-width: 0; overflow-y: auto; padding: 0 12px 16px 4px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: paneIn 220ms var(--ease); }
@keyframes paneIn { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }
.tab-pane h3 { margin: 14px 10px 4px; color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.tab-pane h3:first-child { margin-top: 4px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; padding: 4px 10px; border-radius: 10px; transition: background var(--dur) var(--ease); }
.row:hover { background: rgba(255, 255, 255, 0.04); }
.rowLabel { flex: 1 1 auto; min-width: 0; color: var(--text); display: flex; align-items: center; gap: 8px; }
.rowValue { flex: none; min-width: 42px; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; font-size: 12px; }
.row.range .settingRange { flex: 0 1 190px; min-width: 90px; }
.rowControls { display: flex; gap: 6px; }
.markerIcon { width: 14px; height: 14px; }
.hint { margin: 2px 10px 6px; color: var(--faint); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.hint.error { color: #ff8a8a; }
.hint:empty { display: none; }
.jumpOption { display: none; }
.jumpOption.on { display: flex; }
.phoneOnly { display: none !important; }
.buttonRow { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 10px; }
.buttonColumn { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 10px; }
.segmented { display: inline-flex; margin: 4px 10px 6px; padding: 3px; border-radius: 11px; background: rgba(255, 255, 255, 0.07); }
.segmented button { border: 0; border-radius: 8px; padding: 6px 12px; background: transparent; color: var(--dim); cursor: pointer; font-weight: 600; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.segmented button.active { background: rgba(255, 255, 255, 0.14); color: #fff; }
.settings-tab-button[hidden] { display: none; }
.segmented.cinemaOffset { flex-wrap: wrap; gap: 2px; margin-top: 0; }
.segmented.cinemaOffset button { padding: 5px 9px; font-size: 12px; font-variant-numeric: tabular-nums; }
.segmented.cinemaOffset button:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.cinemaOffsetRow #cinemaOffsetValue { min-width: 120px; }
.row[hidden], .hint[hidden], .modEnvLinks[hidden] { display: none; }
/* a switch row toggles from anywhere on it */
.row:has(> .switch) { cursor: pointer; }
.inlineLink { display: inline; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.35); text-underline-offset: 2px; cursor: pointer; }
.inlineLink:hover { color: #fff; text-decoration-color: var(--accent); }
.hint.tabLink { margin-top: 6px; }
.envPartsAll { display: inline-flex; gap: 4px; }
.sectionAll { padding: 1px 8px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.07); color: var(--dim); font: inherit; font-size: 10.5px; letter-spacing: 0.04em; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.sectionAll:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.sectionAll:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sectionAll[hidden] { display: none; }
.envPartGroup + .envPartGroup { margin-top: 2px; }
.envPartGroupRow .rowLabel b { font-weight: 600; }
.envPartsMixed { color: var(--faint); font-size: 11px; }
.envPartRow { min-height: 30px; padding-top: 1px; padding-bottom: 1px; padding-left: 24px; font-size: 12.5px; }
.envPartRow .switch { transform: scale(0.85); transform-origin: right center; }
.rowReset { display: none; flex: none; width: 20px; height: 20px; margin-left: -2px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--faint); cursor: pointer; align-items: center; justify-content: center; transition: color var(--dur) var(--ease), background var(--dur) var(--ease); }
.row.changed .rowReset { display: inline-flex; }
.rowReset:hover { color: #fff; background: rgba(232, 49, 125, 0.3); }
.rowReset:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tab-pane h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 18px; }
.sectionReset { visibility: hidden; padding: 1px 8px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.07); color: var(--dim); font: inherit; font-size: 10.5px; letter-spacing: 0.04em; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
h3.changed .sectionReset { visibility: visible; }
.sectionReset:hover { background: rgba(232, 49, 125, 0.3); color: #fff; }
.sectionReset:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.panelToast { position: absolute; left: 50%; bottom: 12px; z-index: 21; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 7px 8px 7px 14px; border-radius: 12px; background: rgba(28, 28, 40, 0.97); border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); font-size: 12px; transform: translate(-50%, 8px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur); }
.panelToast.shown { opacity: 1; transform: translate(-50%, 0); visibility: visible; pointer-events: auto; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s; }
.panelToast .settingButton { padding: 4px 10px; }
/* the camera peek: only the adjusted row stays, on its own glass */
#settingsContainer.peek { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: transparent; box-shadow: none; transition: none; }
#settingsContainer.peek * { visibility: hidden; }
#settingsContainer.peek .peekRow, #settingsContainer.peek .peekRow * { visibility: visible; }
#settingsContainer.peek .peekRow { background: var(--panel-bg); -webkit-backdrop-filter: var(--panel-blur); backdrop-filter: var(--panel-blur); box-shadow: var(--panel-shadow); outline: 1px solid var(--glass-border); }
#settingsContainer.peek .tab-content { scrollbar-color: transparent transparent; }
#body.peeking #controls, #body.peeking .orthoFullscreen { opacity: 0 !important; pointer-events: none; transition: opacity 120ms ease; }
#peekFrame { position: fixed; z-index: 99999990; display: none; box-sizing: border-box; border: 2px solid var(--accent); border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.35); pointer-events: none; }
#peekFrame.shown { display: block; }

.settingButton { border: 0; border-radius: 9px; padding: 6px 12px; background: rgba(255, 255, 255, 0.09); color: var(--text); cursor: pointer; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; transition: background var(--dur) var(--ease), transform 120ms var(--ease); }
.settingButton:hover:enabled { background: rgba(255, 255, 255, 0.16); }
.settingButton:active:enabled { transform: scale(0.97); }
.settingButton:disabled { opacity: 0.4; cursor: default; }
.settingButton.primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.settingButton.primary:hover:enabled { background: var(--accent-hover); }
.settingButton.primary:active:enabled { background: var(--accent-press); }
.settingButton:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.linkButton { background: transparent; color: var(--dim); }
/* the page's own chevron (the native arrow box's hover flashed white); the list is panel.js's .selectMenu */
.settingSelect { flex: none; max-width: 190px; border: 1px solid var(--glass-border); border-radius: 9px; padding: 5px 26px 5px 8px; background: rgba(0, 0, 0, 0.35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23ffffffa3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 12px 12px; color: var(--text); cursor: pointer; font-size: 12.5px; -webkit-appearance: none; appearance: none; color-scheme: dark; text-overflow: ellipsis; white-space: nowrap; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.settingSelect:hover:enabled { background-color: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.16); }
.settingSelect:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.settingSelect[aria-expanded=true] { border-color: rgba(232, 49, 125, 0.6); background-color: rgba(255, 255, 255, 0.07); }
.settingSelect option { background: #1b1b22; color: #fff; }
/* the browser's own control parts dark, per element: a root color-scheme unlike the host page's would make the overlay
   iframe opaque */
.panel, .popover, .card, #playlistPanel, .selectMenu, input, select, textarea { color-scheme: dark; }
.selectMenu { position: absolute; z-index: 20; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; padding: 4px; border-radius: 11px; background: rgba(22, 22, 32, 0.97); border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); font-size: 12.5px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
.selectMenu::-webkit-scrollbar { width: 6px; }
.selectMenu::-webkit-scrollbar-thumb { border-radius: 3px; background: rgba(255, 255, 255, 0.22); }
.selectOption { padding: 5px 10px 5px 22px; border-radius: 7px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; position: relative; }
.selectOption.inGroup { padding-left: 30px; }
.selectOption.active { background: rgba(255, 255, 255, 0.09); }
.selectOption.selected { color: #fff; font-weight: 600; }
.selectOption.selected::before { content: ''; position: absolute; left: 9px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--accent); }
.selectOption.disabled { color: var(--faint); cursor: default; }
.selectGroup { padding: 6px 10px 2px; color: var(--faint); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.selectStepper { display: inline-flex; align-items: center; gap: 4px; flex: none; min-width: 0; }
.stepButton { width: 26px; height: 26px; flex: none; padding: 0; border: 1px solid var(--glass-border); border-radius: 8px; background: rgba(255, 255, 255, 0.06); color: var(--text); font-size: 15px; line-height: 1; cursor: pointer; transition: background var(--dur) var(--ease); }
.stepButton:hover { background: rgba(255, 255, 255, 0.14); }
.stepButton:active { transform: scale(0.94); }
.stepButton:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.selectStepper .settingSelect { max-width: 150px; }
input[type=color] { flex: none; width: 34px; height: 24px; padding: 0; border: 0; border-radius: 7px; background: none; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 7px; }
.hlPaint { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.hlPaint .settingSelect { max-width: 112px; }
.hlSwatch { flex: none; width: 34px; height: 24px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 7px; cursor: pointer; }
.hlSwatch[aria-expanded=true] { outline: 2px solid var(--accent); outline-offset: 1px; }
.hlSwatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hlRow[data-mode=gradient] .hlColor, .hlRow:not([data-mode=gradient]) .hlSwatch { display: none; }
/* off keeps the color's place, so the mode lists line up */
.hlRow[data-mode=off] .hlColor { visibility: hidden; }
.hlRow.hlInactive .rowLabel { color: var(--faint); }
.hlEditor { display: flex; flex-direction: column; gap: 8px; margin: 0 10px 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.hlEditor[hidden] { display: none; }
.hlEditorTop { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hlEditorButtons { display: inline-flex; gap: 4px; }
.hlEditorButtons .stepButton:disabled { opacity: 0.35; cursor: default; }
.hlStops { display: flex; flex-wrap: wrap; gap: 6px; }
.hlStops input[hidden] { display: none; }
.hlPreview { height: 10px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.15); }
.schemeGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; padding: 6px 10px; }
.schemeColor { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); cursor: pointer; font-size: 11px; color: var(--dim); }
.schemeColor input[type=color] { width: 44px; height: 30px; }
.notesOnly .lightsColor { opacity: 0.35; }
#colorOverrideDetails { transition: opacity var(--dur) var(--ease); }
#colorOverrideDetails.off { opacity: 0.4; pointer-events: none; }
#resetColors { margin: 10px; }
.profileColor { position: relative; }
.profileColor.unset input[type=color] { opacity: 0.35; }
.profileColor.unset span::after { content: ' (not set)'; color: var(--faint); }
.clearColor { position: absolute; top: 2px; right: 4px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: var(--dim); font-size: 12px; line-height: 18px; cursor: pointer; }
.clearColor:hover { background: rgba(255, 255, 255, 0.24); color: #fff; }
.profileColor.unset .clearColor { display: none; }
#profileColors.notApplied .profileGrid { opacity: 0.55; }

.hsvList { display: flex; flex-direction: column; gap: 3px; padding: 4px 10px; }
.hsvItem { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding: 4px 10px; border: 1px solid transparent; border-radius: 10px; background: rgba(255, 255, 255, 0.04); color: var(--text); text-align: left; cursor: pointer; transition: background var(--dur) var(--ease); }
.hsvItem:hover { background: rgba(255, 255, 255, 0.09); }
.hsvItem.selected { border-color: var(--accent); background: rgba(232, 49, 125, 0.12); }
.hsvName { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hsvItemRow { display: flex; align-items: center; gap: 2px; }
.hsvItemRow > .hsvItem { flex: 1 1 auto; min-width: 0; }
.hsvItemAction { width: 30px; height: 30px; flex: none; font-size: 14px; color: var(--dim); }
.hsvItemAction:hover { color: #fff; }
.hsvTag { flex: none; font-size: 10.5px; color: var(--faint); }
.hsvShared { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px; color: var(--dim); font-size: 12px; }
.hsvImport { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px; }
.hsvImport[hidden], .hsvImport [hidden] { display: none; }
.hsvImport textarea, .hsvImport input, .hsvRaw { width: 100%; box-sizing: border-box; border: 1px solid var(--glass-border); border-radius: 9px; padding: 6px 8px; background: rgba(0, 0, 0, 0.35); color: var(--text); font: 12px/1.35 ui-monospace, Consolas, monospace; user-select: text; }
.hsvMessage.error { color: #ff8a8a; }
.hsvServerRow { display: flex; align-items: center; gap: 4px; padding: 2px 10px; }
.hsvServerRow .iconButton { width: 28px; height: 28px; font-size: 14px; color: var(--dim); }
.hsvServerRow .iconButton[aria-pressed=true] { color: #ffd34d; }
.hsvServer > .settingButton { margin: 6px 10px; }
.hsvEditor { padding-bottom: 12px; }
.hsvEditor > .settingButton { margin: 6px 10px; }
.hsvEditor h4 { margin: 10px 10px 4px; font-size: 12px; color: var(--dim); }
.hsvStatus { margin: 4px 10px; padding: 6px 10px; border-radius: 9px; background: rgba(80, 200, 120, 0.12); color: var(--dim); font-size: 12px; }
.hsvStatus.error { background: rgba(255, 90, 90, 0.14); color: #ffb0b0; }
.hsvStatus .error { color: #ff8a8a; }
.hsvNum { width: 64px; flex: none; border: 1px solid var(--glass-border); border-radius: 7px; padding: 3px 5px; background: rgba(0, 0, 0, 0.35); color: var(--text); font-size: 12px; }
.hsvText { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid var(--glass-border); border-radius: 7px; padding: 4px 6px; background: rgba(0, 0, 0, 0.35); color: var(--text); font: 12px ui-monospace, Consolas, monospace; user-select: text; }
.row > .hsvText { max-width: 220px; }
.hsvVersion, .hsvVector, .hsvColor { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.hsvListEdit { margin: 6px 10px; padding: 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
.hsvListHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 4px; }
.hsvListLabel { color: var(--text); font-size: 12.5px; }
.hsvEnable, .hsvFade { display: inline-flex; align-items: center; gap: 3px; color: var(--dim); font-size: 11.5px; white-space: nowrap; }
.hsvRow { display: flex; align-items: center; gap: 5px; padding: 2px 0; flex-wrap: wrap; }
.hsvRow .iconButton { width: 26px; height: 26px; font-size: 13px; }
.hsvCell { display: inline-flex; align-items: center; gap: 4px; color: var(--faint); font-size: 11px; }
.hsvWide { flex: 1 1 140px; min-width: 120px; }
.hsvAdd { margin-top: 4px; }
.hsvPreview { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.hsvSample { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--dim); }
.hsvSample code { color: var(--text); overflow-wrap: anywhere; user-select: text; }
.hsvSampleLabel { flex: none; width: 92px; color: var(--faint); }
.hsvSwatch { flex: none; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.3); }
.hsvRawBox { margin: 6px 10px; }
.hsvRawBox summary { cursor: pointer; color: var(--dim); font-size: 12px; }
.hsvFaint { color: var(--faint); font-size: 11px; }
.hsvProblems { display: flex; flex-direction: column; gap: 4px; margin: 6px 10px; padding: 6px 10px; border-radius: 9px; background: rgba(255, 90, 90, 0.14); color: #ffd0d0; font-size: 12px; }
.hsvProblems.ok { background: rgba(80, 200, 120, 0.12); color: var(--dim); }
.hsvProblem { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hsvProblem .settingButton { flex: none; margin: 0; padding: 3px 9px; font-size: 11.5px; }
.hsvRules { color: var(--faint); font-size: 11px; }
.hsvRules summary { cursor: pointer; }
.hsvStripHead { margin: 8px 10px 4px; color: var(--dim); font-size: 12px; }
.hsvStrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 4px; padding: 0 10px; }
.hsvStripCell { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; color: var(--faint); font-size: 10.5px; }
.hsvStripCanvas, .hsvModeCanvas, .hsvTextPreview { display: block; width: 100%; height: auto; border-radius: 7px; background: #0b0b12; }
.hsvTabs { display: flex; flex-wrap: wrap; margin: 10px 10px 4px; }
.hsvTabs button { padding: 5px 9px; font-size: 12px; }
.hsvSection { margin: 6px 10px 10px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
.hsvEditor .hsvSection h4, .hsvEditor .hsvStart h4 { margin: 0 0 4px; color: var(--text); font-size: 12.5px; }
.hsvSectionHead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.hsvSectionHead .hsvZoom { margin-left: auto; }
.hsvSection > .row { padding: 4px 0; }
.hsvSection > .settingButton { margin: 6px 6px 0 0; }
.hsvModes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 5px; }
.hsvMode { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 6px; border: 1px solid var(--glass-border); border-radius: 9px; background: rgba(255, 255, 255, 0.04); color: var(--text); text-align: left; cursor: pointer; transition: background var(--dur) var(--ease); }
.hsvMode:hover:not(:disabled) { background: rgba(255, 255, 255, 0.09); }
.hsvMode.selected { border-color: var(--accent); background: rgba(232, 49, 125, 0.12); }
.hsvMode:disabled { cursor: default; }
.hsvModeName { font-size: 12px; font-weight: 600; }
.hsvModeDesc { color: var(--faint); font-size: 10.5px; line-height: 1.3; }
.hsvBarWrap { position: relative; margin: 6px 0 2px; }
.hsvHist { display: block; width: 100%; height: 30px; }
.hsvBar { position: relative; height: 26px; overflow: hidden; border-radius: 6px; background: rgba(255, 255, 255, 0.05); touch-action: none; }
.hsvRegion { position: absolute; top: 0; bottom: 0; box-sizing: border-box; overflow: hidden; border-right: 1px solid rgba(0, 0, 0, 0.55); cursor: pointer; }
.hsvRegion.uncovered { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 4px, transparent 4px 8px); cursor: default; }
.hsvRegion.selected { box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px rgba(0, 0, 0, 0.7); }
.hsvRegionLabel { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); color: #fff; font-size: 10.5px; font-weight: 650; white-space: nowrap; text-shadow: 0 0 3px #000, 0 0 2px #000; pointer-events: none; }
.hsvHandle { position: absolute; top: 0; bottom: 0; z-index: 2; width: 14px; margin-left: -7px; cursor: ew-resize; touch-action: none; }
.hsvHandle::after { content: ''; position: absolute; top: 0; bottom: 0; left: 6px; width: 2px; background: #fff; box-shadow: 0 0 2px #000; }
.hsvHandle:focus-visible { outline: none; }
.hsvHandle:focus-visible::after { left: 4px; width: 6px; background: var(--accent); }
.hsvTip { position: absolute; top: 0; z-index: 3; transform: translateX(-50%); padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.85); color: #fff; font-size: 11px; white-space: nowrap; pointer-events: none; }
.hsvTip[hidden] { display: none; }
.hsvScale { position: relative; height: 14px; color: var(--faint); font-size: 10px; }
.hsvScale span { position: absolute; top: 1px; transform: translateX(-50%); white-space: nowrap; }
.hsvScale span.first { transform: none; }
.hsvScale span.last { transform: translateX(-100%); }
.hsvBarWrap .hint, .hsvSection > .hint { margin: 3px 0; }
.hsvRegionEdit, .hsvDisplay { margin-top: 6px; padding: 6px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.hsvRegionEdit .settingButton, .hsvDisplay .settingButton { margin: 0; padding: 3px 9px; font-size: 11.5px; }
.hsvOpacity { display: inline-flex; align-items: center; gap: 4px; color: var(--dim); font-size: 11.5px; }
.hsvOpacity input { width: 80px; }
.hsvOpacity .rowValue { min-width: 32px; }
.hsvBuilder { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.hsvChips { display: flex; flex-wrap: wrap; gap: 3px; min-height: 30px; padding: 4px; box-sizing: border-box; border: 1px solid var(--glass-border); border-radius: 8px; background: rgba(0, 0, 0, 0.3); }
.hsvChip { padding: 2px 7px; border: 1px solid transparent; border-radius: 6px; background: rgba(255, 255, 255, 0.12); color: var(--text); font-size: 11.5px; white-space: pre; cursor: pointer; }
.hsvChip.tok { background: rgba(60, 140, 255, 0.3); }
.hsvChip.tag { background: rgba(255, 200, 60, 0.16); color: #ffe3a0; font-size: 10.5px; }
.hsvChip.tag.close { opacity: 0.7; }
.hsvChip.unknown { background: rgba(255, 255, 255, 0.05); color: var(--faint); }
.hsvChip.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* a horizontal touch drag moves a chip, a vertical one scrolls the panel */
.hsvChips { position: relative; }
.hsvChip { touch-action: pan-y; }
.hsvChips.dragging .hsvChip { cursor: grabbing; }
.hsvChips.dragging .hsvChip.selected { opacity: 0.55; }
.hsvDropMark { position: absolute; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 6px rgba(232, 49, 125, 0.7); pointer-events: none; }
.hsvTools { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.hsvAddChip, .hsvStyle { padding: 2px 7px; border: 1px solid var(--glass-border); border-radius: 6px; background: rgba(255, 255, 255, 0.05); color: var(--text); font-size: 11px; cursor: pointer; }
.hsvAddChip:hover, .hsvStyle:hover { background: rgba(255, 255, 255, 0.12); }
.hsvAddChip.tok { border-color: rgba(60, 140, 255, 0.55); }
.hsvStyle { min-width: 24px; font-weight: 700; }
.hsvStyle-i { font-style: italic; }
.hsvStyle-u { text-decoration: underline; }
.hsvStyle-s { text-decoration: line-through; }
.hsvTools .settingSelect { padding: 2px 20px 2px 6px; font-size: 11px; background-position: right 5px center; background-size: 10px 10px; }
.hsvDiagram svg { display: block; }
.hsvStart { display: flex; flex-direction: column; gap: 6px; margin: 6px 10px; padding: 8px; border: 1px solid var(--accent); border-radius: 10px; background: rgba(232, 49, 125, 0.06); }
.hsvStart .settingButton { margin: 0 6px 0 0; }

.switch { position: relative; display: inline-block; flex: none; width: 38px; height: 22px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.slider { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.16); transition: background var(--dur) var(--ease); pointer-events: none; }
.slider::before { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); transition: transform var(--dur) var(--ease); }
input:checked + .slider { background: var(--grad); }
input:checked + .slider::before { transform: translateX(16px); }
input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggleButtonLabel { color: var(--text); font-size: 12px; }

input[type=range].settingRange { -webkit-appearance: none; appearance: none; height: 24px; margin: 0; padding: 0; background: transparent; cursor: pointer; touch-action: none; accent-color: var(--accent); }
input[type=range].settingRange::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(var(--accent), var(--accent)) 0 / var(--fill, 0%) 100% no-repeat, rgba(255, 255, 255, 0.16); }
input[type=range].settingRange::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); transition: transform 120ms var(--ease); }
input[type=range].settingRange:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type=range].settingRange::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.16); }
input[type=range].settingRange::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type=range].settingRange::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
@media (pointer: coarse) {
	input[type=range].settingRange { height: 36px; }
	input[type=range].settingRange::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -9px; }
	.row { min-height: 44px; }
}

/* the JD slider's marks: the map's default and the effective one while NJS events change it */
.jdSlider { position: relative; flex: 0 1 190px; min-width: 90px; display: flex; flex-direction: column; }
.row.range .jdSlider .settingRange { flex: none; width: 100%; min-width: 0; }
.jdMarks { position: relative; height: 14px; margin: -4px 8px 0; }
.jdTick { position: absolute; top: 0; width: 1px; height: 5px; background: var(--faint); }
.jdTick.vnjs { background: #ff6b6b; }
.jdPoint { position: absolute; top: 4px; transform: translateX(-50%); font-size: 10px; color: var(--dim); cursor: pointer; white-space: nowrap; }
.jdTick.vnjs .jdPoint { color: #ff6b6b; cursor: default; top: -16px; }
.jdPoint:hover { color: var(--accent); }

.unsupported { opacity: 0.42; }
.unsupported .slider, .unsupported input, .unsupported select { cursor: not-allowed; }

.mapSettingsBanner { flex: none; margin: 0 12px 8px; padding: 8px 8px 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-border); }
.mapSettingsBanner.applied { background: rgba(232, 49, 125, 0.12); border-color: rgba(232, 49, 125, 0.35); }
.mapSettingsBanner[hidden] { display: none; }
.mapSettingsHead { display: flex; align-items: center; gap: 10px; }
.mapSettingsHead > .icon, .mapSettingsHead > i { flex: none; color: var(--dim); font-size: 16px; }
.mapSettingsBanner.applied .mapSettingsHead > .icon, .mapSettingsBanner.applied .mapSettingsHead > i { color: var(--accent); }
.mapSettingsText { flex: 1 1 auto; min-width: 0; font-size: 12px; line-height: 1.35; color: var(--dim); overflow-wrap: anywhere; }
.mapSettingsText b { color: var(--text); font-weight: 650; }
.mapSettingsHead .settingButton { flex: none; }
.mapSettingsHead .settingButton[hidden] { display: none; }
#mapSettingsMore { margin: 4px 0 0 26px; font-size: 11.5px; color: var(--dim); }
#mapSettingsMore[hidden] { display: none; }
#mapSettingsMore summary { cursor: pointer; width: max-content; color: var(--faint); }
#mapSettingsMore summary:hover { color: var(--text); }
#mapSettingsMore summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
#mapSettingsList { list-style: none; margin: 4px 0 2px; padding: 0 8px 0 0; max-height: 132px; overflow-y: auto; scrollbar-width: thin; }
#mapSettingsList li { display: flex; justify-content: space-between; gap: 12px; padding: 1px 0; }
#mapSettingsList li.same, #mapSettingsList li.skipped { color: var(--faint); }
.mapSettingsValue { flex: none; max-width: 60%; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#mapSettingsList li.same .mapSettingsValue, #mapSettingsList li.skipped .mapSettingsValue { color: var(--faint); }
.mapTag { flex: none; padding: 0 6px; border-radius: 6px; background: rgba(232, 49, 125, 0.22); color: #ffd0e2; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; line-height: 16px; text-transform: uppercase; cursor: help; }
.mapTag.vivify { background: rgba(142, 84, 233, 0.28); color: #e2d4ff; }
.row.mapHeld { cursor: default; }
.row.mapHeld .rowReset { display: none; }
.row.mapHeld .switch, .row.mapHeld input, .row.mapHeld select, .row.mapHeld .rowValue, .row.mapHeld .stepButton, .row.mapHeld .hlPaint { opacity: 0.5; }
.row.mapHeld input, .row.mapHeld select, .row.mapHeld .slider { cursor: not-allowed; }

/* a leaving menu takes no pointer */
#ctxMenu { display: none; position: fixed; overflow: hidden; border-radius: 12px; background: var(--panel-bg); -webkit-backdrop-filter: var(--panel-blur); backdrop-filter: var(--panel-blur); border: var(--panel-border); box-shadow: var(--panel-shadow); z-index: 100000002; font-size: 13px; padding: 4px; min-width: 240px; transform-origin: 10px 10px; opacity: 0; transform: scale(0.97); pointer-events: none; transition: opacity 120ms var(--ease-in), transform 120ms var(--ease-in), display 120ms allow-discrete; }
#ctxMenu.open { display: block; opacity: 1; transform: none; pointer-events: auto; transition: opacity 140ms var(--ease), transform 140ms var(--ease), display 140ms allow-discrete; }
@starting-style {
	#ctxMenu.open { opacity: 0; transform: scale(0.97); }
}
@keyframes popIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.panel-menu { display: flex; flex-direction: column; color: #eee; }
.menuitem { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: default; outline: none; }
.menuitem:hover, .menuitem:focus-visible { background: rgba(255, 255, 255, 0.1); }
.menuitem.unsupported:hover { background: none; }
.menuitem-icon { width: 18px; display: inline-flex; justify-content: center; color: var(--dim); }

/* The top left corner fades with the bar. Each chip's glass is on a layer behind it: a chip with a backdrop filter
   would be the backdrop root of its card, whose blur would then see only the chip. */
#corner { position: fixed; left: calc(var(--gutter) + env(safe-area-inset-left, 0px)); top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(var(--gutter) + env(safe-area-inset-right, 0px)); z-index: 99999998; display: flex; align-items: flex-start; gap: 8px; pointer-events: none; opacity: 0; transform: translateY(-6px); transition: opacity 320ms var(--ease), transform 320ms var(--ease); }
.showControls #corner { opacity: 1; transform: none; }
.showControls #corner > #homeButton, .showControls #details > .chip { pointer-events: auto; }
body.startShown #corner, html.startEarly #corner, html.stream #corner { display: none; }
#homeButton { flex: none; box-sizing: border-box; height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 0 15px 0 12px; font-size: 13px; font-weight: 600; text-decoration: none; transition: background var(--dur) var(--ease), transform var(--dur) var(--ease); }
#homeButton .icon { font-size: 15px; }
#homeButton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.overlay #homeButton, html.inFrame #homeButton { display: none; }
#details { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
html.liveMenu #details { display: none; }
#details .chip { flex: 0 1 auto; isolation: isolate; height: 44px; padding: 4px 13px 4px 6px; border-radius: 14px; background: none; cursor: pointer; }
#details .chip::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-border); box-shadow: var(--shadow); pointer-events: none; transition: background var(--dur) var(--ease); }
#details .chip:hover::before, #details .chip.open::before, #details .chip:focus-within::before { background: var(--glass-strong); }
#details .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#details #songChip { max-width: 400px; }
#details #playerChip { max-width: 270px; }
#details .chipTitle { font-size: 13.5px; }
.chipSubTitle { color: var(--dim); font-weight: 500; }
.chipSubTitle:empty, .modeBadge:empty, .chipMapper:empty, #songSubName:empty { display: none; }
.chipSubTitle::before { content: ' '; white-space: pre; }
.modeBadge { flex: none; padding: 0 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); color: var(--text); font-size: 10px; font-weight: 600; line-height: 15px; }
/* the artist and the mapper share the line, both cut with an ellipsis */
#details #songSubName { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chipMapper { display: inline-flex; flex: 0 1 auto; align-items: center; gap: 3px; min-width: 2.6em; overflow: hidden; }
.chipMapper .icon { flex: none; width: 11px; height: 11px; }
.chipMapper > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#songSubName + .chipMapper::before { content: '\00b7'; margin-right: 2px; }
/* the corner's cards open downward, the hover bridge above them */
#details .card { top: calc(100% + 10px); bottom: auto; }
#details .card::before { top: -16px; bottom: auto; }
#details .card > .cardInner { transform-origin: 20% 0; transform: translateY(-10px) scale(0.98); max-height: calc(100vh - var(--bar-h) - 96px - env(safe-area-inset-top, 0px)); }
#details .chip:hover > .card > .cardInner, #details .chip.open > .card > .cardInner, #details .chip:focus-within > .card > .cardInner { transform: none; }
@starting-style {
	#details .chip:hover > .card > .cardInner, #details .chip.open > .card > .cardInner, #details .chip:focus-within > .card > .cardInner { transform: translateY(-10px) scale(0.98); }
}
html.motion-soft #details .card > .cardInner, html.motion-soft #details .chip:hover > .card > .cardInner, html.motion-soft #details .chip.open > .card > .cardInner, html.motion-soft #details .chip:focus-within > .card > .cardInner { transform: none; }
@starting-style {
	html.motion-soft #details .chip:hover > .card > .cardInner, html.motion-soft #details .chip.open > .card > .cardInner, html.motion-soft #details .chip:focus-within > .card > .cardInner { transform: none; }
}
@media (max-width: 520px) {
	/* the cards span the screen under the corner (ui.js sets --corner-bottom) */
	#homeButton { width: 44px; padding: 0; justify-content: center; }
	#homeButton span { display: none; }
	#details { flex: 1 1 auto; flex-direction: column; align-items: stretch; gap: 6px; }
	#details #songChip, #details #playerChip { max-width: none; }
	#details .card { position: fixed; left: calc(var(--gutter) + env(safe-area-inset-left, 0px)); right: calc(var(--gutter) + env(safe-area-inset-right, 0px)); top: calc(var(--corner-bottom, 120px) + 8px); width: auto; }
	#details .card > .cardInner { max-height: calc(100vh - var(--corner-bottom, 120px) - var(--bar-h) - 24px); }
	/* under the corner, which spans the width here */
	#loading, html .playlistOpen #loading { top: calc(var(--corner-bottom, 56px) + 6px); }
}

#skipIntro { position: fixed; left: var(--gutter); bottom: calc(var(--bar-h) + 16px + var(--safe-bottom)); z-index: 99999998; font-size: 13px; font-weight: 600; }
#randomReplay { position: fixed; display: flex; gap: 12px; right: var(--gutter); bottom: calc(var(--bar-h) + 16px + var(--safe-bottom)); padding: 12px; border-radius: var(--radius); max-width: min(320px, calc(100vw - 2 * var(--gutter))); z-index: 10000; animation: popIn 200ms var(--ease); }
#randomReplayInfo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#randomReplayInfo > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#randomReplayNext { font-weight: 700; text-decoration: none; }
#randomReplayImage { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; }
#randomReplayButtons { display: flex; gap: 2px; margin-top: 4px; }
.playlistOpen #randomReplay { display: none !important; }

.hotkey-notification { position: fixed; bottom: calc(var(--bar-h) + 60px); left: 50%; transform: translateX(-50%); background: var(--glass); border: 1px solid var(--glass-border); border-radius: 18px; padding: 18px 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; z-index: 999999999; min-width: 200px; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: opacity 200ms var(--ease), transform 200ms var(--ease); pointer-events: none; }
/* visibility hidden once faded: an opacity-0 layer is still rastered (~100 ms of GPU raster while the page loads) */
.hotkey-notification.hidden { opacity: 0; transform: translateX(-50%) translateY(20px); visibility: hidden; transition: opacity var(--dur-out) var(--ease-in), transform var(--dur-out) var(--ease-in), visibility 0s linear var(--dur-out); }
.hotkey-notification.visible { opacity: 1; transform: translateX(-50%) translateY(0); visibility: visible; }
.hotkey-notification .hotkey-icon { font-size: 34px; color: var(--accent); display: flex; }
.hotkey-notification .hotkey-text { font-size: 17px; font-weight: 600; color: #fafafa; text-align: center; white-space: nowrap; }
.hotkey-notification .hotkey-note { font-size: 11px; color: rgba(255, 255, 255, 0.4); text-align: center; margin-top: 2px; }
.hotkey-notification.withLink { pointer-events: auto; }
.hotkey-notification.withLink .hotkey-note { display: none; }
.hotkey-notification .hotkey-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.hotkey-notification.withNote { max-width: min(360px, calc(100vw - 2 * var(--gutter))); box-sizing: border-box; }
.hotkey-notification.withNote .hotkey-text { white-space: normal; }
.hotkey-notification.withNote .hotkey-note { font-size: 12.5px; line-height: 1.4; color: var(--dim); }
.hotkey-notification .hotkey-note kbd { display: inline-block; padding: 2px 5px; font-family: inherit; font-size: 10px; font-weight: 600; color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 3px; margin: 0 2px; }

.hotkey-help-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); z-index: 2147483000; display: flex; align-items: center; justify-content: center; transition: opacity 0.3s ease; }
.hotkey-help-overlay.hidden { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity 0.3s ease, visibility 0s 0.3s; }
.hotkey-help-overlay.visible { opacity: 1; pointer-events: all; visibility: visible; }
.hotkey-help-content { width: 80%; height: 80%; max-width: 1100px; max-height: 860px; background: var(--glass-strong); border-radius: 22px; border: 1px solid var(--glass-border); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.hotkey-help-header { padding: 24px 32px; border-bottom: 1px solid var(--glass-border); display: flex; justify-content: space-between; align-items: center; }
.hotkey-help-header h1 { font-size: 26px; font-weight: 700; color: #fafafa; margin: 0; display: flex; align-items: center; gap: 14px; }
.hotkey-help-header h1 .icon { color: var(--accent); }
.hotkey-help-close { background: none; border: none; color: #fafafa; font-size: 24px; cursor: pointer; padding: 5px 10px; border-radius: 8px; transition: background 0.2s ease, color 0.2s ease; display: flex; }
.hotkey-help-close:hover { background: rgba(232, 49, 125, 0.2); color: var(--accent); }
.hotkey-help-sections { flex: 1; overflow-y: auto; padding: 28px 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 26px; align-content: start; }
.hotkey-help-section h2 { font-size: 17px; font-weight: 650; color: var(--accent); margin: 0 0 12px 0; display: flex; align-items: center; gap: 10px; }
.hotkey-help-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.hotkey-help-table tr { background: rgba(255, 255, 255, 0.04); transition: background 0.2s ease; }
.hotkey-help-table tr:hover { background: rgba(232, 49, 125, 0.1); }
.hotkey-help-table td { padding: 10px 14px; }
.hotkey-help-table td:first-child { border-radius: 10px 0 0 10px; }
.hotkey-help-table td:last-child { border-radius: 0 10px 10px 0; }
.hotkey-keys { white-space: nowrap; width: 40%; color: #fafafa; }
.hotkey-keys kbd { display: inline-block; padding: 5px 10px; font-family: inherit; font-size: 12px; font-weight: 600; color: #fafafa; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 7px; margin: 0 3px; min-width: 26px; text-align: center; }
.hotkey-action { color: #ccc; font-size: 13.5px; }
.hotkey-help-footer { padding: 16px 32px; border-top: 1px solid var(--glass-border); text-align: center; }
.hotkey-help-footer p { margin: 0; font-size: 13px; color: #ccc; display: flex; align-items: center; justify-content: center; gap: 8px; }
.hotkey-help-footer p .icon { color: var(--accent); }
.hotkey-help-footer kbd { display: inline-block; padding: 3px 7px; font-family: inherit; font-size: 12px; font-weight: 600; color: #fafafa; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 4px; margin: 0 2px; }
@media screen and (max-width: 900px) {
	.hotkey-help-content { width: calc(100% - 2 * var(--gutter)); height: 92%; }
	.hotkey-help-sections { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
	.hotkey-help-header { padding: 16px 18px; }
	.hotkey-help-header h1 { font-size: 20px; }
	.hotkey-help-table td { padding: 8px 10px; font-size: 12px; }
	.hotkey-keys kbd { padding: 4px 8px; font-size: 11px; }
}

/* the playlist panel: collapsed it slides out but for its tab; with the controls hidden it goes entirely */
#playlistPanel { display: none; position: fixed; top: 12px; right: var(--gutter); max-height: calc(100% - var(--bar-h) - 36px); width: 340px; max-width: calc(100vw - 2 * var(--gutter) - 32px); z-index: 9999999; color: var(--text); transform: translateX(calc(100% + 60px)); transition: transform 0.45s var(--ease), display 0.45s allow-discrete; }
.playlistOpen #playlistPanel { display: flex; transform: none; }
@starting-style {
	#body.playlistOpen #playlistPanel { transform: translateX(calc(100% + 60px)); }
}
.playlistOpen #playlistPanel.collapsed { transform: translateX(calc(100% + var(--gutter))); }
.playlistOpen #loading { right: 372px; }
.playlistField { width: 100%; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--glass-border); border-radius: 9px; background: rgba(0, 0, 0, 0.35); color: var(--text); font: inherit; font-size: 12.5px; user-select: text; }
#body:not(.showControls) #playlistPanel:not(:focus-within) { transform: translateX(calc(100% + 60px)); }
/* the collapse tab covers the panel's border where they meet, so the two read as one shape */
#playlistToggle { position: absolute; right: 100%; top: 50%; z-index: 1; width: 28px; height: 56px; margin: -28px -1px 0 0; padding: 0; border: 1px solid var(--glass-border); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--glass-strong); color: var(--dim); cursor: pointer; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: -10px 8px 18px -6px rgba(0, 0, 0, 0.35); transition: color var(--dur) var(--ease); }
#playlistToggle:hover { color: #fff; }
#playlistToggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
#playlistToggle .icon { transition: transform 0.45s var(--ease); }
.collapsed #playlistToggle .icon { transform: rotate(180deg); }
#playlistContent { display: flex; flex-direction: column; flex: 1; min-width: 0; border-radius: var(--radius); overflow: hidden; background: var(--glass-strong); }
#playlistPanel:not(.loaded) #playlistContent > :not(#playlistStatus) { display: none; }
#playlistHeader { display: flex; gap: 10px; padding: 12px; }
#playlistCoverContainer { position: relative; flex: none; width: 64px; height: 64px; }
#playlistCoverContainer img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
#playlistInfo { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
#playlistTitle { color: #fff; font-size: 15px; font-weight: 650; text-decoration: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#playlistTitle[href]:hover { text-decoration: underline; }
#playlistOwner { display: flex; align-items: center; gap: 5px; color: var(--dim); font-size: 12px; text-decoration: none; }
#playlistOwner img { width: 18px; height: 18px; border-radius: 50%; }
#playlistOwner[href]:hover { color: #fff; }
#playlistBadges { display: flex; gap: 4px; }
.playlistBadge { padding: 1px 7px; border: none; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 10px; white-space: nowrap; }
.playlistBadge:disabled { color: #fff; }
.playlistBadge.public { background: rgba(46, 125, 50, 0.7); }
#playlistHeaderButtons { display: flex; flex-direction: column; gap: 2px; flex: none; }
#playlistDescription { margin: 0 12px 8px; max-height: 6em; overflow-y: auto; color: var(--dim); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
#playlistDescription:empty { display: none; }
.playlistIconButton { flex: none; width: 26px; height: 26px; padding: 0; border: none; border-radius: 7px; background: none; color: var(--dim); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.playlistIconButton:hover:enabled { background: rgba(255, 255, 255, 0.1); color: #fff; }
.playlistIconButton:disabled { opacity: 0.3; cursor: default; }
#playlistNav { display: flex; align-items: center; gap: 4px; padding: 5px 12px; border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); font-size: 12px; }
#playlistPosition { min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; }
.countingDown #playlistPosition { display: none; }
#playlistCountdown { display: none; align-items: center; color: #ffd24d; }
.countingDown #playlistCountdown { display: flex; }
.playlistToggleLabel { display: flex; align-items: center; gap: 6px; margin-left: auto; cursor: pointer; }
.playlistToggleLabel .switch { transform: scale(0.85); }
#playlistMapOptions { display: none; align-items: center; gap: 6px; padding: 5px 12px; border-bottom: 1px solid var(--glass-border); }
.mapPlaylist #playlistMapOptions { display: flex; }
#playlistMapOptions .settingSelect { flex: 1 1 0; min-width: 0; max-width: none; }
#playlistStatus { margin: 0; padding: 8px 12px; color: var(--dim); font-size: 12px; }
#playlistStatus:empty { display: none; }
#playlistStatus.error { color: #ff8a8a; }
#playlistVote { display: flex; flex-direction: column; gap: 4px; margin: 6px 8px 0; padding: 8px 10px; border: 1px solid rgba(155, 109, 255, 0.4); border-radius: 10px; background: rgba(155, 109, 255, 0.08); font-size: 12px; }
#playlistVote:empty { display: none; }
.playlistVoteHead { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.playlistVoteHead .icon { color: #9b6dff; }
.playlistVoteMeta, .playlistVoteActions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.playlistVoteMeta, .playlistVoteNote { color: var(--dim); font-size: 11px; }
.playlistVoteTally { display: flex; align-items: center; gap: 6px; color: var(--dim); }
.playlistVoteTally b { color: #fff; }
.playlistVoteBar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.playlistVoteBar span { display: block; height: 100%; background: #9b6dff; }
.playlistMore { width: 100%; margin: 4px 0; padding: 6px; border: none; border-radius: 8px; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; }
#playlistItems { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 4px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
.playlistItem { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 6px; border-radius: 10px; cursor: pointer; transition: background var(--dur) var(--ease); }
.playlistItem:hover { background: rgba(255, 255, 255, 0.06); }
.playlistItem.current { background: rgba(142, 84, 233, 0.32); }
.playlistItem.unavailable { opacity: 0.65; cursor: default; }
.playlistItem.failed .playlistItemSong { color: #ff8a8a; }
.playlistItemPosition { flex: none; min-width: 20px; padding-top: 2px; color: var(--faint); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.playlistItemCover { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); object-fit: cover; color: var(--faint); }
.playlistItemInfo { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 11px; }
.playlistItemSong { color: #fff; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlistItemMap, .playlistItemPlayer { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.playlistItemDifficulty { flex: none; padding: 0 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 10px; }
.playlistItemDifficulty[data-entry] { cursor: pointer; }
.playlistItemDifficulty.empty { opacity: 0.4; cursor: default; }
.playlistItemDifficulty.current { box-shadow: 0 0 0 1px #fff; }
.playlistItemStars { flex: none; color: var(--dim); }
.playlistItemMapper, .playlistItemPlayerName { overflow: hidden; text-overflow: ellipsis; color: var(--dim); }
.playlistItemAvatar { flex: none; width: 14px; height: 14px; border-radius: 50%; }
.playlistItemEndType { flex: none; padding: 0 5px; border-radius: 4px; background: #6b4e16; font-size: 10px; }
.playlistItemStats { display: flex; gap: 6px; margin-left: auto; padding-left: 4px; }
.playlistItemPp { color: #a8b1ff; }
.playlistItemNote { color: var(--dim); font-style: italic; white-space: pre-wrap; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.current .playlistItemNote { display: block; }
#addToPlaylist .menuitem-icon .icon { color: #fff; }
#playlistCoverContainer input { display: none; }
#playlistCoverEdit { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; border-radius: 10px; background: rgba(0, 0, 0, 0.6); cursor: pointer; }
.editable #playlistCoverContainer:hover #playlistCoverEdit { display: flex; }
.playlistBadge:enabled { cursor: pointer; }
#playlistRole { background: #1f6fb2; }
#playlistEditInfo { display: none; }
.editable #playlistEditInfo { display: inline-flex; }
#playlistInfoForm { display: none; flex-direction: column; gap: 4px; padding: 0 12px 8px; }
.editingInfo #playlistInfoForm { display: flex; }
.editingInfo #playlistHeader .playlistBadge, .editingInfo #playlistHeaderButtons, .editingInfo #playlistDescription { display: none; }
.playlistFormButtons { display: flex; justify-content: flex-end; gap: 2px; }
#playlistStatus a { color: #fff; }
.playlistButton { padding: 3px 10px; border: none; border-radius: 7px; background: #9b6dff; color: #fff; cursor: pointer; }
.playlistButton:disabled { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.5); cursor: default; }
.playlistVoteLink { padding: 0; border: none; background: none; color: var(--dim); font-size: 11px; text-decoration: underline; cursor: pointer; }
.playlistVoteLink.danger { color: #ff8a8a; }
.playlistVotePick { flex: none; display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-top: 2px; padding: 0; border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 4px; background: transparent; color: #fff; font-size: 9px; cursor: pointer; }
.playlistVotePick.single { border-radius: 50%; }
.playlistVotePick.on { border-color: #9b6dff; background: #9b6dff; }
.playlistVotePick.ghost { opacity: 0.3; }
.playlistVotePick:disabled { cursor: default; }
.playlistVotePick .icon { width: 10px; height: 10px; }
.playlistItem.dragging { opacity: 0.4; }
.playlistItem.dropBefore { box-shadow: inset 0 2px #eb008c; }
.playlistItem.dropAfter { box-shadow: inset 0 -2px #eb008c; }
.playlistItemPosition .icon { display: none; cursor: grab; }
.playlistItem:hover .playlistItemPosition.draggable .playlistItemNumber { display: none; }
.playlistItem:hover .playlistItemPosition.draggable .icon { display: inline; }
.playlistNoteForm { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.playlistItemActions { position: absolute; top: 4px; right: 4px; display: flex; border-radius: 7px; background: rgba(0, 0, 0, 0.8); opacity: 0; }
.playlistItem:hover .playlistItemActions { opacity: 1; }
@media (hover: none) { .playlistItemActions { opacity: 1; } }
#playlistPicker { display: none; position: fixed; inset: 0; z-index: 999999990; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.4); color: var(--text); }
#playlistPicker.open { display: flex; }
#playlistPickerDialog { display: flex; flex-direction: column; gap: 8px; width: 360px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); box-sizing: border-box; padding: 12px; border-radius: var(--radius); background: rgba(0, 0, 0, 0.9); font-size: 12px; }
#playlistPickerHead { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
#playlistPickerNoteHint, .playlistPickerEmpty { color: var(--faint); font-size: 11px; }
#playlistPickerNoteHint:empty, #playlistPickerStatus:empty { display: none; }
#playlistPickerStatus { margin: 0; color: #ff8a8a; }
#playlistPickerList { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; }
.playlistPickerEmpty { margin: 4px 0; }
.playlistPickerRow { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px; border: none; border-radius: 8px; background: none; color: #fff; text-align: left; cursor: pointer; }
.playlistPickerRow:hover:enabled { background: rgba(255, 255, 255, 0.06); }
.playlistPickerRow:disabled { opacity: 0.5; cursor: default; }
.playlistPickerRow img { flex: none; width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }
.playlistPickerRow .icon { flex: none; width: 16px; height: 16px; color: rgba(255, 255, 255, 0.5); }
.playlistPickerRow.in .icon { color: rgb(142, 84, 233); }
.playlistPickerText { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.playlistPickerText b, .playlistPickerText small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlistPickerText small { color: var(--dim); }
#playlistPickerCreate { display: none; gap: 6px; }
#playlistPickerCreate.open { display: flex; }

@media (max-width: 760px) {
	#infoChips .chip { max-width: 200px; }
	#infoChips #playerChip .chipSub { display: none; }
}
@media (max-width: 640px) {
	#speedControl, #volumeControl { display: none; }
	.phoneOnly { display: flex !important; }
	.tab-container { flex-direction: column; }
	.tab-buttons { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 2px 10px 8px; gap: 4px; scrollbar-width: none; }
	.tab-buttons::-webkit-scrollbar { display: none; }
	.tab-button { flex: none; padding: 7px 10px; }
	.tab-content { padding: 0 8px 16px; }
	#settingsContainer { left: var(--gutter); right: var(--gutter); width: auto; height: min(560px, calc(100vh - var(--bar-h) - 32px)); }
	#playlistPanel { width: calc(100vw - 2 * var(--gutter) - 32px); }
	.playlistOpen #loading { right: var(--gutter); top: 72px; }
}
@media (max-width: 520px) {
	:root { --bar-row: 50px; --bar-row-lift: 6px; }
	.barButton { width: 34px; height: 34px; font-size: 18px; }
	.playButton { width: 38px; height: 38px; }
	#barRight .povswitch { display: none; }
	#songTime { font-size: 12px; margin: 0 2px !important; }
	#infoChips #playerChip .chipText { display: none; }
	#infoChips #playerChip { padding-right: 4px; }
	#infoChips .chip { max-width: 130px; padding-right: 6px; }
	#infoChips #songChip .chipSub { display: none; }
	/* the overlay's collapse and close buttons take the fullscreen button's place */
	html.overlay #barRight .controlsFullscreen { display: none; }
	#infoChips .card { position: fixed; left: var(--gutter); right: var(--gutter); width: auto; bottom: var(--popup-bottom); }
	.stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
	/* the map view's bar has no room for the duration */
	body.previewMode #songTime .timeSep, body.previewMode #songDuration, body.mapViewReplay #songTime .timeSep, body.mapViewReplay #songDuration { display: none; }
	#infoChips .chip { max-width: 100px; }
	/* the map view's phone bar also holds the beat and the effects toggle: tighter gaps */
	body.previewMode #barRow, body.mapViewReplay #barRow { gap: 4px; }
	body.previewMode #barLeft, body.mapViewReplay #barLeft { gap: 2px; }
	body.previewMode #barMid, body.mapViewReplay #barMid, body.previewMode #infoChips, body.mapViewReplay #infoChips { gap: 3px; }
	body.previewMode .previewChip { padding-left: 3px; padding-right: 3px; }
	body.previewMode .seekPrecision, body.mapViewReplay .seekPrecision { padding: 0 3px; }
	body.previewMode #songTime, body.mapViewReplay #songTime { margin: 0 2px 0 0 !important; }
}

/* the overlay mode: a transparent page; collapsed = the mini view + the bar */
html.overlay, html.overlay body { background: transparent !important; }
html.overlay #stage { background: #000; }
/* hidden until the start mode is set: no whole-page flash before it collapses */
html.overlay:not(.overlayReady) #stage, html.overlay:not(.overlayReady) #loading { visibility: hidden; }
html.overlay.closedOverlay body { visibility: hidden; }
html.overlay #controls.challengeLoaded, html.overlay.collapsed #controls { display: block; }
html.overlay.collapsed #controls { transform: none !important; opacity: 1 !important; }
html.overlay.collapsed #stage {
	inset: auto;
	left: 0;
	top: 0;
	width: var(--mini-w, 400px);
	height: var(--mini-h, 225px);
	transform: translate(var(--mini-x, 0px), var(--mini-y, 0px));
	border-radius: 14px;
	box-shadow: var(--shadow);
	border: 1px solid var(--glass-border);
	background: #000;
}
html.overlay.collapsed.dragging #stage { transition: none; cursor: grabbing; }
html.overlay.collapsed.resizing #stage { transition: none; }
html.overlay #stage { transition: border-radius 240ms var(--ease); }
#miniChrome { display: none; }
html.overlay.collapsed #miniChrome { display: flex; position: absolute; left: 0; right: 0; top: 0; height: 36px; align-items: center; justify-content: space-between; padding: 0 16px 0 0; background: rgba(0, 0, 0, 0.45); opacity: 0; transition: opacity var(--dur) var(--ease); z-index: 2; }
html.overlay.collapsed #stage:hover #miniChrome, html.overlay.collapsed.dragging #miniChrome, html.overlay.collapsed.resizing #miniChrome, html.overlay.collapsed #stage.touched #miniChrome { opacity: 1; }
/* the grip glyph shows in the corner facing the page's centre (data-grip) */
#miniResize { display: none; }
html.overlay.collapsed #miniResize { display: block; position: absolute; inset: 0; z-index: 3; pointer-events: none; }
#miniResize > div { position: absolute; pointer-events: auto; touch-action: none; --edge: 6px; --corner: 16px; }
#miniResize > [data-dir=n], #miniResize > [data-dir=s] { left: var(--corner); right: var(--corner); height: var(--edge); cursor: ns-resize; }
#miniResize > [data-dir=e], #miniResize > [data-dir=w] { top: var(--corner); bottom: var(--corner); width: var(--edge); cursor: ew-resize; }
#miniResize > [data-dir=n], #miniResize > [data-dir=ne], #miniResize > [data-dir=nw] { top: 0; }
#miniResize > [data-dir=s], #miniResize > [data-dir=se], #miniResize > [data-dir=sw] { bottom: 0; }
#miniResize > [data-dir=e], #miniResize > [data-dir=ne], #miniResize > [data-dir=se] { right: 0; }
#miniResize > [data-dir=w], #miniResize > [data-dir=nw], #miniResize > [data-dir=sw] { left: 0; }
#miniResize > [data-dir=ne], #miniResize > [data-dir=nw], #miniResize > [data-dir=se], #miniResize > [data-dir=sw] { width: var(--corner); height: var(--corner); }
#miniResize > [data-dir=nw], #miniResize > [data-dir=se] { cursor: nwse-resize; }
#miniResize > [data-dir=ne], #miniResize > [data-dir=sw] { cursor: nesw-resize; }
#miniResize > div::after { content: ''; position: absolute; width: 10px; height: 10px; opacity: 0; transition: opacity var(--dur) var(--ease); }
#miniResize[data-grip=se] > [data-dir=se]::after { right: 5px; bottom: 5px; background: linear-gradient(135deg, transparent 48%, rgba(255, 255, 255, 0.8) 48% 60%, transparent 60% 72%, rgba(255, 255, 255, 0.8) 72% 84%, transparent 84%); }
#miniResize[data-grip=sw] > [data-dir=sw]::after { left: 5px; bottom: 5px; background: linear-gradient(225deg, transparent 48%, rgba(255, 255, 255, 0.8) 48% 60%, transparent 60% 72%, rgba(255, 255, 255, 0.8) 72% 84%, transparent 84%); }
#miniResize[data-grip=ne] > [data-dir=ne]::after { right: 5px; top: 5px; background: linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.8) 48% 60%, transparent 60% 72%, rgba(255, 255, 255, 0.8) 72% 84%, transparent 84%); }
#miniResize[data-grip=nw] > [data-dir=nw]::after { left: 5px; top: 5px; background: linear-gradient(315deg, transparent 48%, rgba(255, 255, 255, 0.8) 48% 60%, transparent 60% 72%, rgba(255, 255, 255, 0.8) 72% 84%, transparent 84%); }
html.overlay.collapsed #stage:hover #miniResize > div::after, html.overlay.collapsed.resizing #miniResize > div::after, html.overlay.collapsed #stage.touched #miniResize > div::after { opacity: 1; }
@media (pointer: coarse) {
	#miniResize > div { --edge: 14px; --corner: 28px; }
}
#miniDrag { flex: 1; height: 100%; cursor: grab; touch-action: none; display: flex; align-items: center; justify-content: center; }
#miniDrag .grip { width: 36px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.6); }
.miniButton { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: rgba(0, 0, 0, 0.35); color: #fff; font-size: 15px; cursor: pointer; }
.miniButton:hover { background: rgba(0, 0, 0, 0.6); }
html.overlay.collapsed #playlistPanel, html.overlay.collapsed #loading, html.overlay.collapsed #randomReplay { display: none !important; }
/* at once: a transition would keep it drawn outside the regions */
html.overlay.collapsed #playlistPanel { transition: none; }
html.overlay.collapsed #hudLayer { display: none; }
/* the live view's card over the mini view; the chat and the Up next card show expanded only */
html.overlay.collapsed .liveCard { left: calc(var(--mini-x, 0px) + var(--mini-w, 400px) / 2); top: calc(var(--mini-y, 0px) + var(--mini-h, 225px) / 2); width: min(420px, calc(var(--mini-w, 400px) - 24px)); padding: 12px; gap: 6px; }
html.overlay.collapsed .liveAvatar { width: 48px; height: 48px; }
html.overlay.collapsed .liveChat, html.overlay.collapsed .liveMod, html.overlay.collapsed .lcMenu, html.overlay.collapsed .lcButton, html.overlay.collapsed .liveUpNext { display: none !important; }
/* a cross-site iframe's backdrop filter sees only its own content: more opaque unless the host draws the glass */
html.overlay.collapsed:not(.hostGlass) #controls::before { background: rgba(12, 12, 18, 0.94); }
html.overlay.collapsed:not(.hostGlass) .popover, html.overlay.collapsed:not(.hostGlass) .card > .cardInner, html.overlay.collapsed:not(.hostGlass) #settingsContainer, html.overlay.collapsed:not(.hostGlass) .previewPicker { background: rgba(18, 18, 26, 0.96); }
html.overlay.collapsed:not(.hostGlass) #timelineGraph::before { background: rgba(12, 12, 18, 0.94); }
/* with the host's glass the regions' own blur is off; the patches blur the mini view (above it, under the bar and the
   panels) */
html.overlay.collapsed.hostGlass .hostGlassed, html.overlay.collapsed.hostGlass .hostGlassed::before { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
#glassPatches { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 99999997; }
html.overlay.collapsed.hostGlass #glassPatches { display: block; }
#glassPatches > div { position: absolute; }

/* motion-soft: short opacity fades (--soft) in place of slides, scales and raises; an element whose hidden state was
   only a transform gets an opacity-0 one (visibility hidden once faded: it takes no pointer); the small moves happen at
   once, their colour changes still fade. motion-none: every state at once, the delays too. */
html.motion-none *, html.motion-none *::before, html.motion-none *::after { transition-duration: 0ms !important; transition-delay: 0ms !important; animation-duration: 0ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; }

html.motion-soft #controls { transform: none; visibility: hidden; transition: opacity var(--soft) ease, visibility 0s linear var(--soft); }
html.motion-soft .showControls #controls, html.motion-soft.overlay.collapsed #controls { visibility: visible; transition: opacity var(--soft) ease, visibility 0s; }
html.motion-soft #settingsContainer, html.motion-soft #settingsContainer.settingsActive,
html.motion-soft .popover, html.motion-soft .popover.open, html.motion-soft .popoverHost.open > .popover,
html.motion-soft #ctxMenu, html.motion-soft #ctxMenu.open { transform: none; transition: opacity var(--soft) ease, display var(--soft) allow-discrete; }
html.motion-soft .card, html.motion-soft .chip:hover > .card, html.motion-soft .chip.open > .card, html.motion-soft .chip:focus-within > .card { transition: display var(--soft) allow-discrete; }
html.motion-soft .card > .cardInner, html.motion-soft .chip:hover > .card > .cardInner, html.motion-soft .chip.open > .card > .cardInner, html.motion-soft .chip:focus-within > .card > .cardInner { transform: none; transition: opacity var(--soft) ease; }
html.motion-soft #timelineHover, html.motion-soft #timelineHover.timelineHoverActive { transform: translate(-50%, 0); transition: opacity var(--soft) ease, display var(--soft) allow-discrete; }
@starting-style {
	html.motion-soft #settingsContainer.settingsActive, html.motion-soft .popover.open, html.motion-soft .popoverHost.open > .popover, html.motion-soft #ctxMenu.open,
	html.motion-soft .chip:hover > .card > .cardInner, html.motion-soft .chip.open > .card > .cardInner, html.motion-soft .chip:focus-within > .card > .cardInner { transform: none; }
	html.motion-soft #timelineHover.timelineHoverActive { transform: translate(-50%, 0); }
}
html.motion-soft .hotkey-notification { transition: opacity var(--soft) ease; }
html.motion-soft .hotkey-notification.hidden { transform: translateX(-50%); transition: opacity var(--soft) ease, visibility 0s linear var(--soft); }
html.motion-soft #timelineGraph { transform: none; transition: opacity var(--soft) ease, visibility 0s linear var(--soft); }
html.motion-soft #timeline:hover #timelineGraph, html.motion-soft #timeline.active #timelineGraph { transition: opacity var(--soft) ease, visibility 0s; }
/* collapsing the playlist panel moves it at once and it fades in at its new place (another animation name per state
   restarts the fade; `from` only: it ends at the state's own opacity) */
html.motion-soft #playlistPanel { transform: none; opacity: 0; visibility: hidden; transition: opacity var(--soft) ease, visibility 0s linear var(--soft), display var(--soft) allow-discrete; }
html.motion-soft .playlistOpen #playlistPanel { opacity: 1; visibility: visible; transition: opacity var(--soft) ease, visibility 0s, display var(--soft) allow-discrete; animation: softPanelOpen var(--soft) ease; }
html.motion-soft .playlistOpen #playlistPanel.collapsed { transform: translateX(calc(100% + var(--gutter))); animation-name: softPanelCollapsed; }
html.motion-soft #body.playlistOpen:not(.showControls) #playlistPanel:not(:focus-within) { opacity: 0; visibility: hidden; transition: opacity var(--soft) ease, visibility 0s linear var(--soft), display var(--soft) allow-discrete; }
html.motion-soft #body.playlistOpen:not(.showControls) #playlistPanel:not(:focus-within):not(.collapsed) { transform: none; }
html.motion-soft #body.playlistOpen:not(.showControls) #playlistPanel.collapsed:not(:focus-within) { transform: translateX(calc(100% + var(--gutter))); }
@starting-style {
	html.motion-soft #body.playlistOpen #playlistPanel { opacity: 0; }
}
@keyframes softPanelOpen { from { opacity: 0; } }
@keyframes softPanelCollapsed { from { opacity: 0; } }
html.motion-soft .hotkey-help-overlay, html.motion-soft .hotkey-help-overlay.hidden { transition: opacity var(--soft) ease, visibility 0s linear var(--soft); }
html.motion-soft .hotkey-help-overlay.visible { transition: opacity var(--soft) ease, visibility 0s; }
html.motion-soft .hotkey-help-content, html.motion-soft .tab-pane.active, html.motion-soft #randomReplay { animation: softFade var(--soft) ease; }
@keyframes softFade { from { opacity: 0; } }
html.motion-soft .glassButton, html.motion-soft .barButton, html.motion-soft .settingButton, html.motion-soft .playButton .bar, html.motion-soft .slider::before, html.motion-soft #timelineKnob, html.motion-soft #timelineTrack, html.motion-soft #playlistToggle .icon { transition-property: background-color, color, opacity; }
html.motion-soft input[type=range].settingRange::-webkit-slider-thumb { transition: none; }

#startPage { position: fixed; inset: 0; z-index: 50; display: none; overflow-y: auto; overscroll-behavior: contain; background: #0c0b14; user-select: text; -webkit-user-select: text; }
body.startShown #startPage, html.startEarly #startPage { display: flex; flex-direction: column; align-items: center; }
body.startShown #controls, html.startEarly #controls, body.startShown #hud, html.startEarly #hud { visibility: hidden; }
.startBg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.startBg img { position: absolute; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px); object-fit: cover; filter: blur(6px) brightness(0.55) saturate(1.1); opacity: 0; transition: opacity 900ms var(--ease); }
.startBg img.shown { opacity: 1; }
.startBg::after { content: ''; position: absolute; inset: 0; background: rgba(5, 5, 10, 0.5); }
.startCard { position: relative; box-sizing: border-box; width: min(760px, calc(100% - 2 * var(--gutter))); margin: max(24px, 8vh) var(--gutter) calc(24px + var(--safe-bottom)); padding: 18px 18px 14px; border-radius: var(--radius); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: var(--panel-border); box-shadow: var(--shadow); color-scheme: dark; }
.startHead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.startHead h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; font-weight: 750; letter-spacing: 0.005em; color: var(--text); }
.startHead h1::before { content: ''; flex: none; width: 6px; height: 1.1em; border-radius: 3px; background: var(--accent); }
.startTabs { margin: 0; }
.startTabs button:hover:not([aria-selected=true]) { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.startTabs button[aria-selected=true] { background: var(--accent); color: var(--on-accent); }
.startTabs button:focus-visible, .startForm button:focus-visible, .startRandom:focus-visible, .startItem:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.startForm { display: flex; gap: 8px; margin-top: 14px; }
.startForm input[type=text] { flex: 1 1 auto; min-width: 0; box-sizing: border-box; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(0, 0, 0, 0.35); font-size: 15px; outline: none; color-scheme: dark; }
.startForm input[type=text]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 49, 125, 0.25); }
.startOpen { flex: none; height: 42px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 650; cursor: pointer; transition: background var(--dur) var(--ease), transform 120ms var(--ease); }
.startOpen:hover { background: var(--accent-hover); }
.startOpen:active { background: var(--accent-press); transform: scale(0.98); }
.startIconButton { flex: none; width: 42px; height: 42px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; background: rgba(255, 255, 255, 0.06); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.startIconButton:hover, .startRandom:hover { background: rgba(255, 255, 255, 0.12); }
.startHint { min-height: 18px; margin: 8px 2px 0; color: var(--dim); font-size: 12px; }
.startHint.error { color: #ff8a9e; }
.startList { margin-top: 14px; }
.startListHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.startListHead h2 { margin: 0; font-size: 13px; font-weight: 650; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.startRandom { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; background: rgba(255, 255, 255, 0.06); font-weight: 600; cursor: pointer; }
.startItems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.startItem { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 10px 6px 6px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); text-decoration: none; color: var(--text); transition: background var(--dur) var(--ease); }
.startItem:hover { background: rgba(255, 255, 255, 0.12); }
.startCover { flex: none; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: rgba(255, 255, 255, 0.06); }
.startText { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; gap: 1px; }
.startSong { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.startSub, .startPlayer { display: flex; align-items: center; gap: 5px; color: var(--dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.startPlayer { color: var(--text); font-size: 12px; }
.startName { overflow: hidden; text-overflow: ellipsis; }
.startAcc { color: var(--dim); font-variant-numeric: tabular-nums; }
.startAvatar { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; flex: none; }
.startMode { color: var(--faint); }
.startStat { flex: none; display: flex; align-items: center; gap: 4px; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.startEmpty { grid-column: 1 / -1; margin: 6px 2px; color: var(--faint); }
.startItems .diffBadge[data-diff=Easy] { background: MediumSeaGreen; }
.startItems .diffBadge[data-diff=Normal] { background: #59b0f4; }
.startItems .diffBadge[data-diff=Hard] { background: tomato; }
.startItems .diffBadge[data-diff=Expert] { background: #bf2a42; }
.startItems .diffBadge[data-diff=ExpertPlus] { background: #8f48db; }
.startSource { margin: 0 0 0 auto; }
.startSource[hidden], .startLocal[hidden], .startItems[hidden], .startRandom[hidden], .localGrant[hidden], .localNote[hidden] { display: none; }
.startSource button { padding: 5px 11px; font-size: 12px; }
.startSource button:hover:not([aria-pressed=true]) { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.startSource button[aria-pressed=true] { background: var(--accent); color: var(--on-accent); }
.startSource button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.localBar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.localFilter { flex: 1 1 200px; min-width: 0; box-sizing: border-box; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(0, 0, 0, 0.35); font-size: 14px; outline: none; color-scheme: dark; }
.localFilter:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 49, 125, 0.25); }
.localWipSwitch { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; background: rgba(255, 255, 255, 0.06); font-weight: 650; cursor: pointer; }
.localInfo { display: flex; gap: 10px; align-items: baseline; margin: 8px 2px 0; color: var(--dim); font-size: 12px; }
.localInfo:empty { display: none; }
.localItems { margin-top: 8px; }
.localItem .startSong small { color: var(--dim); font-weight: 500; }
.localDiffs .diffBadge { padding: 0 4px; }
.localAgo { margin-left: auto; color: var(--faint); font-size: 11px; }
.localMore { grid-column: 1 / -1; justify-self: center; }
.localItems .diffBadge[data-diff=Easy] { background: MediumSeaGreen; }
.localItems .diffBadge[data-diff=Normal] { background: #59b0f4; }
.localItems .diffBadge[data-diff=Hard] { background: tomato; }
.localItems .diffBadge[data-diff=Expert] { background: #bf2a42; }
.localItems .diffBadge[data-diff=ExpertPlus] { background: #8f48db; }
@media (max-width: 640px) {
	.startItems { grid-template-columns: minmax(0, 1fr); }
	.startCard { margin-top: 16px; padding: 14px 12px 10px; }
	.startHead h1 { font-size: 17px; }
	.startOpen { padding: 0 14px; }
}

#loadBg { position: absolute; inset: 0; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 600ms var(--ease), visibility 0s 600ms; background: #000; }
#loadBg.on { opacity: 1; visibility: visible; transition: opacity 250ms var(--ease); }
#loadBg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: brightness(0.7); transition: opacity 900ms var(--ease); }
#loadBg img.shown { opacity: 1; }
html.overlay #loadBg { display: none; }

body.previewMode #playerChip { display: none; }
/* the preview's player camera stays reachable through the Camera tab and Shift+F */
body.previewMode #barRight .povswitch { display: none; }
.previewChip { gap: 8px; }
.previewChip[hidden], .previewNotes[hidden], .previewPicker[hidden] { display: none; }
.previewBadge { flex: none; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--on-accent); font-size: 17px; }
.previewDifficulty { padding: 0; border: 0; background: none; color: var(--dim); font: inherit; font-size: 11px; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.previewDifficulty:hover, .previewDifficulty[aria-expanded=true] { color: var(--text); }
.segmented.previewNotes { margin: 0; flex: none; }
.segmented.previewNotes button:hover:not([aria-pressed=true]) { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.segmented.previewNotes button[aria-pressed=true] { background: var(--accent); color: var(--on-accent); }
.segmented.previewNotes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* over the bar and its timeline, on the settings panel's layer */
.previewPicker { position: fixed; z-index: 100000000; bottom: var(--popup-bottom); box-sizing: border-box; max-height: min(420px, calc(100vh - var(--bar-h) - 32px)); overflow-y: auto; padding: 10px 12px 12px; border-radius: var(--radius-s); background: var(--panel-bg); -webkit-backdrop-filter: var(--panel-blur); backdrop-filter: var(--panel-blur); border: var(--panel-border); box-shadow: var(--panel-shadow); color-scheme: dark; }
.previewPickerTitle { font-weight: 650; margin-bottom: 6px; }
.previewSet + .previewSet { margin-top: 8px; }
.previewSetName { display: flex; align-items: center; gap: 5px; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.previewSetName > .modeIcon, .previewSetName > .icon { width: 14px; height: 14px; }
/* a characteristic's silhouette as a mask in the text's colour, as the website draws it */
.modeIcon { display: inline-block; flex: none; width: 1em; height: 1em; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.previewBadge > .modeIcon { width: 22px; height: 22px; }
/* the buttons are two block lines (no flex inside a button), each cut with an ellipsis */
.previewDiffs { display: grid; gap: 5px; align-items: stretch; }
.previewDiff { display: block; min-width: 0; box-sizing: border-box; margin: 0; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--diff) 70%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--diff) 18%, transparent); color: var(--text); font-weight: 600; font-size: 12px; line-height: 1.35; text-align: left; cursor: pointer; -webkit-appearance: none; appearance: none; }
.previewDiffName, .previewDiff small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.previewDiff small { color: var(--dim); font-weight: 400; font-size: 10px; }
.previewDiff:hover { background: color-mix(in srgb, var(--diff) 32%, transparent); }
.previewDiff.on { background: var(--diff); }
.previewDiff:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
@media (max-width: 520px) {
	.previewChip .chipText { display: none; }
}

.seekPrecision { position: relative; flex: none; display: flex; align-items: center; gap: 6px; height: 44px; box-sizing: border-box; padding: 0 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.seekPrecision[hidden] { display: none; }
.precisionIcon { color: var(--faint); font-size: 14px; line-height: 1; }
.precisionBox { display: inline-flex; align-items: center; height: 30px; box-sizing: border-box; padding: 0 3px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px; background: rgba(0, 0, 0, 0.32); font-variant-numeric: tabular-nums; transition: border-color var(--dur) var(--ease); }
.precisionBox:hover, .precisionBox:focus-within { border-color: rgba(232, 49, 125, 0.7); }
.precisionBox[data-box="1"]::before { content: 'Ctrl'; margin: 0 4px 0 2px; color: var(--faint); font-size: 10px; font-weight: 600; }
.precisionValue { width: 2.4ch; height: 22px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--text); text-align: center; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; outline: none; cursor: ns-resize; color-scheme: dark; }
.precisionValue:hover { background: rgba(255, 255, 255, 0.08); }
.precisionValue:focus { background: var(--accent); color: var(--on-accent); cursor: text; }
.precisionSlash { color: var(--faint); font-size: 12px; }
.precisionOpen { display: none; }
/* a touch screen: a tap opens the editor */
.seekPrecision.coarse .precisionOpen { display: block; position: absolute; inset: 0; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.seekPrecision.coarse .precisionValue { pointer-events: none; cursor: pointer; }
.seekPrecision.open { background: rgba(255, 255, 255, 0.12); }
.seekPrecision > .precisionPopover { left: 0; right: auto; width: 300px; max-width: calc(100vw - 2 * var(--gutter)); cursor: default; }
.precisionRow + .precisionRow { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--glass-border); }
.precisionRowHead { display: flex; justify-content: space-between; margin: 0 2px 6px; color: var(--dim); font-size: 12px; }
.precisionRowHead b { color: var(--text); font-variant-numeric: tabular-nums; }
.precisionStepper { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.precisionStepper b { min-width: 2.5ch; text-align: center; font-size: 15px; font-variant-numeric: tabular-nums; }
.precisionStepper .settingButton, .precisionSteps .settingButton { justify-content: center; min-width: 40px; min-height: 34px; padding: 4px 8px; }
.precisionOver { display: block; margin: 2px 0; color: var(--faint); font-size: 10.5px; text-align: center; }
.precisionSteps { display: flex; gap: 6px; margin-top: 8px; }
.precisionSteps .settingButton { flex: 1; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
	.seekPrecision > .precisionPopover { position: fixed; left: var(--gutter); right: var(--gutter); width: auto; bottom: var(--popup-bottom); }
	.seekPrecision { gap: 3px; padding: 0 5px; }
	.precisionIcon { display: none; }
	.precisionBox[data-box="1"]::before { content: none; }
	.precisionValue { font-size: 12px; }
	/* the bar is full: the preview badge keeps its size */
	body.previewMode .previewChip { flex: none; padding-right: 6px; }
}
/* a phone's bar shows the first box only (the editor has both) */
@media (max-width: 460px) {
	.seekPrecision .precisionBox[data-box="1"] { display: none; }
}

.mapLeaderboard { position: relative; flex: none; }
.mapLeaderboard[hidden], .backToPreview[hidden] { display: none; }
.mapLeaderboard.open > .lbButton { color: #fff; background: rgba(232, 49, 125, 0.35); }
.mapLeaderboard > .lbPopover { left: 0; right: auto; width: 420px; max-width: calc(100vw - 2 * var(--gutter)); cursor: default; }
.lbList { display: flex; flex-direction: column; gap: 2px; max-height: min(420px, calc(100vh - var(--bar-h) - 140px)); overflow-y: auto; }
.lbRow { display: grid; grid-template-columns: 30px 26px minmax(0, 1fr) auto auto; grid-template-areas: 'rank avatar name acc pp' 'rank avatar mods mods mods'; align-items: center; column-gap: 8px; padding: 5px 8px; border-radius: 10px; color: var(--text); text-decoration: none; font-variant-numeric: tabular-nums; transition: background var(--dur) var(--ease); }
.lbRow:hover, .lbRow:focus-visible { background: rgba(255, 255, 255, 0.09); outline: none; }
body.mapViewReplay .mapViewPreviewOnly, body:not(.mapViewReplay) .mapViewReplayOnly { display: none; }
/* a phone's bar in the map view's replay: the song is the preview's */
@media (max-width: 460px) {
	body.mapViewReplay #infoChips #songChip { display: none; }
}
.lbRow.current { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); cursor: default; }
/* a switch under way: its row pulses, the timeline's track carries a moving stripe */
.lbRow.pending { animation: lbPending 1.1s ease-in-out infinite alternate; }
@keyframes lbPending { from { background: rgba(255, 255, 255, 0.05); } to { background: var(--accent-soft); } }
html.switching #timelineTrack::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 30%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); animation: trackSwitching 1.1s linear infinite; pointer-events: none; }
@keyframes trackSwitching { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
html.motion-none .lbRow.pending { animation: none; background: var(--accent-soft); }
html.motion-none.switching #timelineTrack::after { animation: none; left: 0; width: 100%; background: rgba(255, 255, 255, 0.2); }
.lbRow.lbPreview { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; margin-bottom: 4px; }
.lbRow.lbPreview > .icon { flex: none; width: 26px; height: 26px; padding: 5px; box-sizing: border-box; border-radius: 7px; background: var(--accent); color: var(--on-accent); }
.lbRow.lbPreview .lbMods { margin-left: auto; }
.lbRank { grid-area: rank; color: var(--dim); font-weight: 650; text-align: right; }
.lbAvatar { grid-area: avatar; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: rgba(255, 255, 255, 0.06); }
.lbName { grid-area: name; display: flex; align-items: center; gap: 5px; min-width: 0; font-weight: 600; }
.lbName > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbAcc { grid-area: acc; font-weight: 650; }
.lbFc { color: #8ff0a4; font-size: 10px; }
.lbPp { grid-area: pp; color: #a8b1ff; font-size: 12px; min-width: 64px; text-align: right; }
.lbMods { grid-area: mods; color: var(--faint); font-size: 10.5px; }
.lbMods:empty { display: none; }
.lbNav { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.lbNav .settingButton { min-width: 34px; justify-content: center; }
.lbSite { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--dim); text-decoration: none; }
.lbSite:hover { color: var(--text); }
.lbEmpty { margin: 6px 4px; color: var(--dim); }
.backToPreview { border: 0; color: var(--text); font: inherit; cursor: pointer; font-size: 18px; }
.backToPreview .chipText { font-size: 13px; text-align: left; }
@media (max-width: 520px) {
	.mapLeaderboard > .lbPopover { position: fixed; left: var(--gutter); right: var(--gutter); width: auto; bottom: var(--popup-bottom); }
	.backToPreview .chipText { display: none; }
	.lbPp { min-width: 0; }
}

/* the bookmarks sit over the raised graph while it shows, their ticks running down through it to the track */
.bookmarks { --reach: 9px; position: absolute; left: calc(var(--bar-pad-l) + 2px); right: calc(var(--bar-pad-r) + 2px); bottom: calc(100% - 2px); height: 42px; pointer-events: none; z-index: 2; transition: bottom 220ms var(--ease); }
.bookmarks[hidden] { display: none; }
#timeline:hover + .bookmarks, #timeline.active + .bookmarks { --reach: 91px; bottom: calc(100% + 80px); }
.bookmark { position: absolute; bottom: 0; width: 0; height: 100%; padding: 0; border: 0; background: none; color: #fff; font: 600 11px/16px system-ui, -apple-system, 'Segoe UI', sans-serif; }
.bookmark.dark { color: #121218; }
.bookmarkTick { position: absolute; z-index: 0; left: -1px; bottom: calc(-1 * var(--reach)); width: 2px; height: calc(6px + var(--reach)); border-radius: 1px; background: var(--bm); opacity: 0.9; pointer-events: none; transition: height 220ms var(--ease), bottom 220ms var(--ease); }
.bookmark[data-row="1"] .bookmarkTick { height: calc(24px + var(--reach)); }
.bookmarkName { position: absolute; z-index: 1; bottom: 6px; height: 16px; box-sizing: border-box; padding: 0 6px; border-radius: 4px; background: var(--bm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; pointer-events: auto; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); }
.bookmark[data-row="1"] .bookmarkName { bottom: 24px; }
.bookmark[data-row="-1"] .bookmarkName { display: none; }
.bookmarkName:hover { filter: brightness(1.15); }
.bookmarkName:empty { display: none; }
body.mapBookmarks #timelineHover { bottom: calc(100% + 128px); }
#timelineHover .bookmarkHover { display: inline-block; padding-left: 6px; border-left: 3px solid var(--bm); }

:root { --live: #ff3b4e; }
.barButton.liveButton { gap: 6px; max-width: 360px; letter-spacing: 0.02em; }
.liveButton .liveDot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; box-shadow: 0 0 0 0 rgba(255, 59, 78, 0.6); animation: livePulse 1.6s var(--ease) infinite; }
.liveButton[data-state='behind'] .liveDot { background: var(--faint); animation: none; }
.liveButton[data-state='behind'] { color: var(--dim); }
.liveButton[data-state='behind']:hover { color: var(--text); }
.liveButton[data-state='wait'] .liveDot { background: #ffcf66; animation: none; }
.liveText { white-space: nowrap; }
.liveSub { color: var(--dim); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liveViewers { color: var(--dim); font-weight: 500; padding-left: 6px; border-left: 1px solid var(--glass-border); }
.liveViewers::before { content: '\25CF'; font-size: 8px; vertical-align: 2px; margin-right: 4px; color: var(--faint); }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 78, 0.55); } 70% { box-shadow: 0 0 0 6px rgba(255, 59, 78, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 78, 0); } }
@media (prefers-reduced-motion: reduce) { .liveButton .liveDot { animation: none; } }
@media (max-width: 640px) { .liveSub { display: none; } .barButton.liveButton { max-width: 180px; } }
/* the live menu has no song */
html.liveMenu #timeline, html.liveMenu #songTime, html.liveMenu #speedControl { visibility: hidden; }
html.liveMenu #infoChips { display: none; }
.liveCard { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 99999998; width: min(420px, calc(100% - 2 * var(--gutter))); box-sizing: border-box; padding: 24px; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--text); }
.liveCard[hidden] { display: none; }
.liveAvatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--glass-hi); }
.liveCardTitle { font-size: 18px; font-weight: 700; }
.liveCardText { color: var(--dim); font-size: 14px; }
.liveCardRow { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.liveCardRow .glassButton { text-decoration: none; font-size: 14px; }
html.stream .liveCard { display: none !important; }
.liveUpNext { position: fixed; left: calc(var(--gutter) + env(safe-area-inset-left, 0px)); top: calc(var(--corner-bottom, 56px) + 8px); z-index: 99999989; width: min(360px, calc(100% - 2 * var(--gutter))); box-sizing: border-box; display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius); color: var(--text); }
.liveUpNext[hidden] { display: none; }
.liveUpCover { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--glass-hi); flex: none; }
.liveUpBody { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.liveUpHead { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.liveUpLabel { font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--live); }
.liveUpWhen { color: var(--dim); font-variant-numeric: tabular-nums; }
.liveUpTitle { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liveUpMeta { display: flex; gap: 6px; align-items: center; min-width: 0; font-size: 12px; color: var(--dim); }
.liveUpDiff { flex: none; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 999px; color: #ffd28a; box-shadow: inset 0 0 0 1px rgba(255, 210, 138, 0.5); }
.liveUpBy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liveUpReq { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liveUpAvatar { width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px; margin-right: 5px; object-fit: cover; }
html.stream .liveUpNext { display: none !important; }
@media (max-width: 520px) { .liveUpCover { width: 56px; height: 56px; } }

/* the live chat: docked right on wide screens, a sheet above the bar on phones */
:root { --lc-mod: #3ec27a; --lc-vip: #c58bff; --lc-caster: #ffb547; --lc-mention: rgba(255, 181, 71, 0.14); }
.liveChat { position: fixed; right: var(--gutter); top: 12px; bottom: var(--popup-bottom); width: 348px; z-index: 99999990; border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; color: var(--text); font-size: 14px; }
.liveChat[hidden], .liveMod[hidden], .lcMenu[hidden], .liveChat [hidden] { display: none !important; }
.lcHead { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--glass-border); }
.lcAvatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--glass-hi); flex: none; }
.lcWho { min-width: 0; } .lcName { font-weight: 700; } .lcSub { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcSpacer { flex: 1; }
.lcIcon { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--dim); cursor: pointer; font-size: 15px; }
.lcIcon:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); } .lcIcon.on { color: #fff; background: rgba(232, 49, 125, 0.35); }
.lcModes { display: flex; gap: 6px; padding: 8px 12px 0; flex-wrap: wrap; } .lcModes:empty { display: none; }
.lcMode { font-size: 11px; color: var(--dim); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--glass-border); }
.lcPinned { margin: 8px 12px 0; padding: 8px 10px; border-radius: var(--radius-s); background: rgba(255, 255, 255, 0.06); font-size: 13px; box-shadow: inset 0 0 0 1px var(--lc-caster); }
.lcBy { display: block; font-size: 11px; color: var(--dim); margin-bottom: 2px; } .lcPinnedUser { font-weight: 700; }
.lcPoll { margin: 8px 12px 0; padding: 10px; border-radius: var(--radius-s); background: rgba(142, 84, 233, 0.16); border: 1px solid rgba(142, 84, 233, 0.35); }
.lcQ { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; } .lcQSub { font-weight: 500; color: var(--dim); font-size: 12px; white-space: nowrap; }
.lcOpt { position: relative; width: 100%; margin-top: 6px; height: 30px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, 0.07); overflow: hidden; display: flex; align-items: center; padding: 0 10px; font-size: 13px; color: var(--text); cursor: pointer; text-align: left; }
.lcOpt:disabled { cursor: default; } .lcOpt:not(:disabled):hover { background: rgba(255, 255, 255, 0.12); }
.lcFill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(142, 84, 233, 0.45); transition: width 400ms var(--ease); }
.lcOptText, .lcPct { position: relative; } .lcPct { margin-left: auto; color: var(--dim); font-variant-numeric: tabular-nums; }
.lcOpt.mine { outline: 2px solid rgba(255, 255, 255, 0.7); } .lcOpt.win .lcFill { background: rgba(62, 194, 122, 0.5); }
.lcPollFoot { margin-top: 6px; font-size: 11px; color: var(--dim); }
.lcList { flex: 1; overflow-y: auto; padding: 6px 4px 6px 12px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.lcList, .lcQueueList, .lcAbout, .lcDrop, .lcPicker, .liveMod { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
.lcList > :first-child { margin-top: auto; }
.lcEmpty { color: var(--faint); font-size: 13px; text-align: center; padding: 12px; }
.lcMsg { position: relative; padding: 4px 8px; border-radius: 8px; font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.lcMsg:hover { background: rgba(255, 255, 255, 0.06); }
.lcMsg.me { background: rgba(255, 255, 255, 0.04); } .lcMsg.mention { background: var(--lc-mention); box-shadow: inset 0 0 0 1px var(--lc-caster); }
.lcUser { border: 0; padding: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; color: #8fc2ff; }
.lcUser.mod { color: var(--lc-mod); } .lcUser.vip { color: var(--lc-vip); } .lcUser.caster { color: var(--lc-caster); }
.lcRole { display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; padding: 1px 4px; border-radius: 4px; margin-right: 4px; vertical-align: 1px; color: #111; }
.lcRole.mod { background: var(--lc-mod); } .lcRole.vip { background: var(--lc-vip); } .lcRole.caster { background: var(--lc-caster); } .lcRole.sup { background: #ff7aa8; }
.lcAt { color: var(--lc-caster); font-weight: 600; } .lcAtMe { background: rgba(255, 181, 71, 0.2); border-radius: 4px; padding: 0 2px; }
.lcReply { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .lcReply::before { content: '\21B3  '; }
.lcTime { float: right; font-size: 10.5px; color: var(--faint); margin-left: 6px; font-variant-numeric: tabular-nums; }
.lcActions { position: absolute; right: 6px; top: -14px; display: none; gap: 2px; padding: 2px; border-radius: 8px; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); z-index: 2; }
.lcMsg:hover .lcActions, .lcMsg:focus-within .lcActions { display: flex; }
.lcAct { border: 0; background: none; color: var(--text); font-size: 11px; padding: 3px 7px; border-radius: 6px; cursor: pointer; } .lcAct:hover { background: rgba(255, 255, 255, 0.1); } .lcAct.warn { color: #ff8b8b; }
.lcNew { align-self: center; margin: 4px auto; font-size: 12px; padding: 4px 12px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); cursor: pointer; }
.lcComposer { border-top: 1px solid var(--glass-border); padding: 8px 10px 10px; }
.lcReplyTo { font-size: 12px; color: var(--dim); display: flex; justify-content: space-between; gap: 8px; padding: 0 2px 6px; } .lcReplyTo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcErr { font-size: 12px; color: #ffb36b; padding: 0 2px 6px; }
.lcInputRow { display: flex; gap: 6px; align-items: center; }
.lcInput { flex: 1; min-width: 0; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--glass-border); padding: 0 10px; color: var(--text); font: inherit; font-size: 14px; }
.lcInput:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.lcSend { height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 700; cursor: pointer; } .lcSend:disabled, .lcInput:disabled { opacity: 0.5; cursor: default; }
.lcCount { font-size: 11px; color: var(--faint); text-align: right; } .lcCount:empty { display: none; }
.lcLogin { text-align: center; font-size: 13px; color: var(--dim); padding: 4px; } .lcLogin a { color: var(--text); font-weight: 700; }
.lcLink { border: 0; background: none; color: var(--dim); font-size: 12px; cursor: pointer; padding: 0 4px; text-decoration: underline; } .lcLink:hover { color: var(--text); }
.lcButton { font-size: 18px; } .lcBadge { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; color: var(--on-accent); }
.liveMod { position: fixed; right: calc(var(--gutter) + 360px); top: 12px; width: 300px; max-height: calc(100% - var(--bar-h) - 24px); overflow-y: auto; z-index: 99999991; border-radius: var(--radius); padding: 12px; color: var(--text); font-size: 13px; }
.lcSec { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; margin: 12px 0 6px; } .lcSec:first-child { margin-top: 0; }
.lcRow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; } .lcRow input[type='range'] { flex: 1; } .lcRow output { min-width: 36px; text-align: right; color: var(--dim); }
.lcBtn { font-size: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--glass-border); color: var(--text); cursor: pointer; } .lcBtn.warn { color: #ff8b8b; } .lcBtn:disabled { opacity: 0.5; }
.lcPerson { display: flex; align-items: center; gap: 8px; padding: 4px 0; } .lcPersonName { font-weight: 600; } .lcPersonWhat { color: var(--dim); font-size: 12px; margin-left: auto; }
.lcLog { font-size: 12px; color: var(--dim); padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); } .lcNone { color: var(--faint); font-size: 12px; }
.lcPollForm { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.lcMenu { position: fixed; z-index: 99999995; width: 200px; padding: 4px; border-radius: 10px; display: flex; flex-direction: column; }
.lcMenuHead { color: var(--faint); font-size: 11px; padding: 6px 8px 2px; } .lcMenuItem { border: 0; background: none; color: var(--text); text-align: left; padding: 7px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; } .lcMenuItem:hover { background: rgba(255, 255, 255, 0.08); } .lcMenuItem.warn { color: #ff8b8b; }
@media (max-width: 640px) {
	.liveChat { left: 0; right: 0; width: auto; top: auto; bottom: var(--bar-h); height: 52%; border-radius: var(--radius) var(--radius) 0 0; }
	.liveMod { left: 8px; right: 8px; width: auto; top: auto; bottom: var(--popup-bottom); max-height: 60%; }
	.lcInput { font-size: 16px; }
}
html.stream .liveChat, html.stream .liveMod, html.stream .lcButton { display: none !important; }
.lcQ { width: 100%; border: 0; padding: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.lcPoll.collapsed .lcPollFoot { margin-top: 2px; }
.lcBadge[hidden] { display: none; }
/* with the bar hidden the panel takes its place */
#body:not(.showControls) .liveChat { bottom: 12px; }
@media (max-width: 640px) { #body:not(.showControls) .liveChat { bottom: 0; } }
/* a tick per chat message of the recording that plays */
.lcMarks { position: absolute; left: 0; right: 0; bottom: 100%; height: 6px; pointer-events: none; }
.lcMark { position: absolute; bottom: 1px; width: 2px; height: 5px; margin-left: -1px; border-radius: 1px; background: rgba(255, 181, 71, 0.75); }
html.liveMenu .lcMarks { display: none; }

:root { --lc-reply: #5aa9ff; --lc-reply-bg: rgba(90, 169, 255, 0.13); --lc-right: #3ec27a; --lc-wrong: #ff8b8b; }
.lcView { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lcTabs { display: flex; gap: 4px; padding: 6px 12px 0; }
.lcTab { flex: none; border: 0; background: none; color: var(--dim); font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 8px; cursor: pointer; }
.lcTab:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.lcTab.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.lcMsg.replyMe { background: var(--lc-reply-bg); box-shadow: inset 0 0 0 1px var(--lc-reply); }
.lcReplyTag { color: var(--lc-reply); font-weight: 700; margin-right: 6px; }
.lcMsg.replyMe .lcReply { color: rgba(255, 255, 255, 0.78); } .lcMsg.replyMe .lcReply::before { content: none; }
.lcMentionTag { color: var(--lc-caster); font-weight: 700; } .lcMentionTag::before { content: none; }
.lcEmote { height: 1.9em; width: auto; max-width: 5em; vertical-align: -0.6em; margin: -0.2em 1px; object-fit: contain; }
.lcCmd { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.92em; padding: 0 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); color: #ffd28a; }
.lcBotAvatar { width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 4px; }
.lcRole.bot { background: #b8a6ff; } .lcUser.bot { color: #c9b8ff; cursor: default; }
.lcMsg.bot .lcText { color: rgba(255, 255, 255, 0.86); }
.lcComposer { position: relative; }
.lcEmoteBtn { flex: none; font-size: 18px; }
.lcDrop, .lcPicker { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 4px); z-index: 3; border-radius: 12px; padding: 4px; max-height: 260px; overflow-y: auto; background: rgba(16, 16, 24, 0.95); }
.lcDropItem { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; color: var(--text); text-align: left; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.lcDropItem.at, .lcDropItem:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.lcDropItem.away { opacity: 0.72; }
.lcDropSub { color: var(--faint); font-size: 12px; white-space: nowrap; }
.lcDropDesc { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.lcDropKind { font-size: 10px; color: var(--faint); border: 1px solid var(--glass-border); border-radius: 999px; padding: 0 6px; }
.lcDropName { font-weight: 700; } .lcDropAvatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--glass-hi); flex: none; }
.lcPickerGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; }
.lcPickerItem { border: 0; background: none; padding: 4px; border-radius: 8px; cursor: pointer; height: 40px; display: flex; align-items: center; justify-content: center; }
.lcPickerItem:hover { background: rgba(255, 255, 255, 0.1); }
.lcPickerImg { max-width: 32px; max-height: 32px; object-fit: contain; }
.lcPicker .lcSec { margin: 6px 4px 4px; }
.lcPoll.quiz { background: rgba(62, 160, 255, 0.12); border-color: rgba(90, 169, 255, 0.4); }
.lcQuizTag { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; padding: 1px 5px; border-radius: 4px; background: var(--lc-reply); color: #0b1220; vertical-align: 1px; }
.lcPoll.quiz .lcFill { background: rgba(90, 169, 255, 0.4); }
.lcOpt.mine { outline: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75); }
.lcOpt.right { box-shadow: inset 0 0 0 1px var(--lc-right); } .lcOpt.right .lcFill { background: rgba(62, 194, 122, 0.45); } .lcOpt.right .lcOptText { color: #bff2d4; font-weight: 700; }
.lcOpt.wrong { box-shadow: inset 0 0 0 1px var(--lc-wrong); }
.lcWinners { margin-top: 6px; font-size: 12px; color: var(--dim); } .lcWinLabel { color: var(--faint); }
.lcQuizResult { margin-top: 6px; font-size: 12.5px; font-weight: 700; } .lcQuizResult.right { color: var(--lc-right); } .lcQuizResult.wrong { color: var(--lc-wrong); }
.lcPollActs { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 4px; }
.lcBoard { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--glass-border); }
.lcBoardRow { display: flex; align-items: center; gap: 8px; padding: 3px 4px; font-size: 12.5px; border-radius: 6px; } .lcBoardRow.me { box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.lcRank { width: 20px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.lcSeg { display: flex; gap: 4px; } .lcSegBtn { flex: 1; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.05); color: var(--dim); border-radius: 8px; padding: 5px 8px; cursor: pointer; font-size: 12px; }
.lcSegBtn.active { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }
.lcOptRow { display: flex; align-items: center; gap: 6px; } .lcOptRow input[type='radio'] { accent-color: var(--lc-right); }
.lcOptRow input[type='radio'][hidden] { display: none; }
.lcQueueView { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lcQueueList { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px; overscroll-behavior: contain; }
.lcQueueHead { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.lcQueueState { font-weight: 800; font-size: 11px; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 999px; }
.lcQueueState.open { color: var(--lc-right); box-shadow: inset 0 0 0 1px var(--lc-right); } .lcQueueState.closed { color: var(--lc-wrong); box-shadow: inset 0 0 0 1px var(--lc-wrong); }
.lcQueueSum { color: var(--dim); } .lcQueueRules { font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.lcSecBtn { border: 0; background: none; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 0 6px; cursor: pointer; }
.lcReq { position: relative; display: flex; gap: 10px; padding: 6px; border-radius: 10px; margin-bottom: 4px; }
.lcReq:hover { background: rgba(255, 255, 255, 0.05); }
.lcReq.playing { background: rgba(62, 194, 122, 0.1); box-shadow: inset 0 0 0 1px rgba(62, 194, 122, 0.6); }
.lcReq.next { box-shadow: inset 0 0 0 1px var(--lc-reply); }
.lcReq.past { opacity: 0.66; }
.lcReqCover { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--glass-hi); flex: none; }
.lcReqBody { min-width: 0; flex: 1; }
.lcReqTitle { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.lcReqPos { color: var(--faint); font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.lcReqSong { text-decoration: none; } .lcReqSong:hover { text-decoration: underline; } .lcReqSub { color: var(--dim); font-weight: 500; }
.lcReqMeta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px; font-size: 11.5px; }
.lcChip { font-size: 10.5px; padding: 0 6px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--glass-border); color: var(--dim); }
.lcChip.diff { color: #ffd28a; box-shadow: inset 0 0 0 1px rgba(255, 210, 138, 0.5); } .lcChip.next { color: var(--lc-reply); box-shadow: inset 0 0 0 1px var(--lc-reply); }
.lcReqBy { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcReqAvatar { width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 4px; object-fit: cover; }
.lcReqNote { font-size: 12px; color: var(--dim); font-style: italic; margin-top: 2px; }
.lcReqMore { position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; }
.lcQueueBox { border-top: 1px solid var(--glass-border); padding: 8px 10px 10px; }
.lcDiff { flex: none; width: 92px; padding: 0 6px; }
.lcOk { font-size: 12px; color: var(--lc-right); padding: 0 2px 6px; }
.lcAbout { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.lcAboutText { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.45; user-select: text; }
.lcAboutText a, .lcUrl { color: #8fc2ff; }
.lcAboutLinks { display: flex; flex-wrap: wrap; gap: 6px; }
.lcAboutLink { text-decoration: none; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--glass-border); background: rgba(255, 255, 255, 0.06); }
.lcAboutLink:hover { box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.lcArea { height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; line-height: 1.4; } .lcAboutArea { min-height: 120px; }
.lcAboutEdit { display: flex; flex-direction: column; gap: 6px; }
.lcNum { width: 64px; height: 28px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--glass-border); color: var(--text); padding: 0 6px; }
.lcUnit { color: var(--faint); font-size: 11px; } .lcSmall { flex: none; width: auto; height: 28px; }
.lcEmoteAdmin { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.lcEmoteCell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--glass-border); font-size: 11px; }
.lcEmoteCode { color: var(--dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcFile { font-size: 12px; color: var(--dim); }
.lcLink.warn { color: #ff8b8b; }
@media (max-width: 640px) { .lcDrop, .lcPicker { max-height: 40vh; } }

/* ReeSabers (reesabers-ui.js) */
.rsRoot { display: flex; flex-direction: column; }
.rsRoot .segmented { align-self: flex-start; }
.rsSegmented button:disabled { cursor: default; opacity: 0.55; }
.rsViews { margin-top: 8px; }
.subTabs { margin: 4px 10px 8px; }
.subTabs button:hover:not([aria-selected=true]) { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.subTabs button[aria-selected=true] { background: var(--accent); color: var(--on-accent); }
.subTabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rsCategory { margin-top: 6px; padding-top: 4px; border-top: 1px solid var(--glass-border); }
.rsCatHead { display: flex; align-items: center; gap: 8px; padding: 2px 10px; color: var(--text); font-size: 12.5px; font-weight: 600; }
.rsUndrawn .rsCatName { color: var(--dim); }
.rsBadge { flex: none; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--faint); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.rsListHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 0 18px; color: var(--dim); font-size: 12px; }
.rsListHead .linkButton { display: inline-flex; align-items: center; gap: 4px; border: 0; padding: 3px 7px; border-radius: 7px; font-size: 12px; cursor: pointer; }
.rsListHead .linkButton:hover:enabled { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.rsListHead .linkButton:disabled { opacity: 0.4; cursor: default; }
.hint.rsEmpty { margin: 0 10px 4px 18px; }
.rsGroup { display: flex; align-items: center; gap: 8px; margin: 2px 6px 2px 14px; padding: 4px 4px 4px 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.rsGroup.open { background: rgba(255, 255, 255, 0.08); }
.rsCover { flex: none; width: 36px; height: 36px; border-radius: 7px; object-fit: cover; background: rgba(255, 255, 255, 0.06); }
.rsNoCover { display: inline-flex; align-items: center; justify-content: center; color: var(--faint); font-size: 15px; }
.rsGroupText { flex: 1 1 auto; min-width: 0; }
.rsGroupName, .rsCardName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 12.5px; font-weight: 600; }
.rsGroupSub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-size: 11px; }
.rsIconButton { flex: none; width: 28px; height: 28px; font-size: 13px; color: var(--dim); }
.rsIconButton:hover:enabled { color: var(--text); }
.rsIconButton:disabled { opacity: 0.35; cursor: default; }
.rsSettings { margin: 0 6px 6px 14px; padding: 2px 0 4px; border-left: 2px solid rgba(232, 49, 125, 0.45); }
.rsSubhead { margin: 10px 10px 2px; color: var(--faint); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.rsValue { flex: none; display: inline-flex; align-items: center; gap: 3px; }
.rsNumber { width: 58px; height: 26px; box-sizing: border-box; padding: 0 6px; border-radius: 7px; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.06); color: var(--text); font: inherit; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; outline: none; color-scheme: dark; }
.rsNumber:focus { border-color: var(--accent); }
.rsUnit { color: var(--faint); font-size: 11px; }
.rsBar { display: flex; align-items: center; gap: 6px; padding: 4px 10px; }
.rsSearch { flex: 1 1 auto; min-width: 0; box-sizing: border-box; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(0, 0, 0, 0.3); color: var(--text); font: inherit; font-size: 12.5px; outline: none; color-scheme: dark; }
.rsSearch:focus { border-color: var(--accent); }
.rsBar .settingSelect { flex: none; }
.rsDesc svg { transform: rotate(180deg); }
.rsChips { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 10px; }
.rsChip { border: 0; border-radius: 999px; padding: 3px 10px; background: rgba(255, 255, 255, 0.07); color: var(--dim); font-size: 11.5px; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.rsChip:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.rsChip.active { background: var(--accent); color: var(--on-accent); }
.rsChip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rsGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 6px 10px; }
.rsGrid.rsLoading { opacity: 0.5; pointer-events: none; }
.rsCard { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: 12px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--glass-border); }
.rsCardCover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: rgba(255, 255, 255, 0.06); }
.rsCardCover.rsNoCover { display: flex; font-size: 22px; }
.rsCardBody { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 6px 8px 8px; }
.rsFile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-top: 4px; border-top: 1px solid var(--glass-border); }
.rsFileName { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font-size: 11.5px; }
.rsFileButtons { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: auto; }
.rsAdd { padding: 3px 8px; font-size: 11.5px; }
.rsPager { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 4px 10px; }
.rsProfile { margin-top: 8px; padding-top: 4px; border-top: 1px solid var(--glass-border); }
@media (max-width: 520px) { .rsGrid { grid-template-columns: minmax(0, 1fr); } }
