@charset "UTF-8";

/* ============================================================
   Animal Crossing Music — tk.weslie.AnimalCrossingMusic
   Design tokens
   ============================================================ */

:root {
	color-scheme: dark;

	/* Ground */
	--bg: oklch(0.17 0.030 258);
	--bg-deep: oklch(0.13 0.026 258);

	/* Surfaces — Rauchglas. Nur die Hülle blurrt den Hintergrund; innen liegen
	   flache Tints, damit Blur-Ebenen sich nicht stapeln.
	   Die Alphawerte sind gegen die gemessene Helligkeit der vier Wallpaper
	   gerechnet. summer.png ist das hellste: in seinen oberen 10 % liegt die
	   Luminanz bei Y=0.78. Bei 0.62 hält dort auch --ink-3 noch 4.58:1 —
	   darunter kippt die schwächste Textstufe unter die 4.5:1-Grenze. */
	--shell: oklch(0.15 0.028 258 / 0.62);
	--surface: oklch(0.30 0.032 258 / 0.22);
	--surface-hi: oklch(0.42 0.036 258 / 0.34);
	--surface-solid: oklch(0.16 0.028 258);

	/* Hairlines dürfen auf transparentem Grund kräftiger sein. */
	--line: oklch(1 0 0 / 0.12);
	--line-strong: oklch(1 0 0 / 0.22);

	/* Ink — über Glas trägt Helligkeit keine Hierarchie mehr, das machen
	   Größe und Gewicht. Alle drei Stufen bleiben nah an Weiß. */
	--ink: oklch(0.96 0.012 250);
	--ink-2: oklch(0.93 0.020 252);
	--ink-3: oklch(0.88 0.028 252);
	/* Ausgeschaltete Bedienelemente: reines Grafikelement, braucht nur 3:1. */
	--control-off: oklch(0.70 0.030 252);

	/* Accent */
	--accent: oklch(0.81 0.113 235);
	--accent-hi: oklch(0.87 0.100 235);
	--accent-on: oklch(0.20 0.055 250);
	--accent-soft: oklch(0.81 0.113 235 / 0.16);
	--accent-ring: oklch(0.81 0.113 235 / 0.55);

	--good: oklch(0.86 0.120 166);
	--warn: oklch(0.84 0.135 78);
	--bad: oklch(0.72 0.170 22);

	/* Radii — cards cap at 16px on purpose */
	--r-xs: 6px;
	--r-sm: 9px;
	--r-md: 12px;
	--r-lg: 16px;
	--r-pill: 999px;

	/* Spacing */
	--s1: 4px;
	--s2: 8px;
	--s3: 12px;
	--s4: 16px;
	--s5: 22px;
	--s6: 30px;
	--s7: 42px;

	/* Type — fixed rem scale, ratio ≈ 1.18 */
	--t-xs: 0.75rem;
	--t-sm: 0.8125rem;
	--t-base: 0.9375rem;
	--t-md: 1.0625rem;
	--t-lg: 1.25rem;
	--t-xl: 1.5rem;
	--t-clock: 2rem;

	--font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu,
		Cantarell, "Noto Sans", Helvetica, Arial, sans-serif;
	--font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;

	/* Motion */
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--fast: 140ms;
	--base: 200ms;
	--slow: 260ms;

	/* Elevation — kept shallow; never paired with a 1px accent border */
	--lift: 0 1px 2px oklch(0 0 0 / 0.45);
	--lift-shell: 0 24px 60px oklch(0 0 0 / 0.5);

	/* z-index scale */
	--z-scene: 0;
	--z-app: 10;
	--z-sticky: 20;
	--z-popover: 30;
	--z-toast: 40;
}

/* ============================================================
   Reset
   ============================================================ */

*,
*::before,
*::after {
	box-sizing: border-box;
}

* {
	margin: 0;
}

/* Mehrere Komponenten setzen display selbst — sonst gewinnt das über [hidden]. */
[hidden] {
	display: none !important;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	min-height: 100dvh;
	font-family: var(--font);
	font-size: var(--t-base);
	line-height: 1.5;
	color: var(--ink);
	background: var(--bg-deep);
	padding: clamp(12px, 3vw, 34px);
	display: grid;
	place-items: start center;
}

img,
svg {
	display: block;
	max-width: 100%;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

a {
	color: var(--accent-hi);
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

a:hover {
	color: var(--ink);
}

code {
	font-family: var(--font-mono);
	font-size: 0.92em;
	background: var(--surface);
	padding: 0.1em 0.4em;
	border-radius: var(--r-xs);
}

.num {
	font-variant-numeric: tabular-nums;
}

.dot {
	opacity: 0.45;
	padding-inline: 2px;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

:where(button, a, input, select, [tabindex]):focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: var(--r-xs);
}

.skip-link {
	position: fixed;
	inset-block-start: var(--s3);
	inset-inline-start: var(--s3);
	z-index: var(--z-toast);
	padding: 10px 14px;
	border-radius: var(--r-sm);
	background: var(--accent);
	color: var(--accent-on);
	font-weight: 650;
	transform: translateY(-200%);
	transition: transform var(--fast) var(--ease);
}

.skip-link:focus-visible {
	transform: none;
}

/* ============================================================
   Seasonal scene
   ============================================================ */

.scene {
	position: fixed;
	inset: 0;
	z-index: var(--z-scene);
	background: var(--bg-deep);
	overflow: hidden;
}

/*
 * Kein Scrim, keine Verdunkelung, kein Blur: das Wallpaper wird unverändert
 * und scharf gezeigt. Weich wird es ausschließlich dort, wo die UI darüber
 * liegt — das erledigt der backdrop-filter der Hülle (.app).
 */
.scene__layer {
	position: absolute;
	inset: 0;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	opacity: 0;
	transition: opacity 700ms var(--ease);
	will-change: opacity;
}

.scene__layer.is-active {
	opacity: 1;
}

/* ============================================================
   Shell
   ============================================================ */

.app {
	position: relative;
	z-index: var(--z-app);
	width: min(1080px, 100%);
	background: var(--shell);
	/* Der einzige Blur der Seite: mattiert nur den Ausschnitt hinter der UI,
	   während das Wallpaper daneben scharf bleibt. Bei 18px verschwimmen die
	   Details, Farben und grobe Formen bleiben aber erkennbar. */
	backdrop-filter: blur(18px) saturate(130%);
	-webkit-backdrop-filter: blur(18px) saturate(130%);
	border-radius: var(--r-lg);
	box-shadow: var(--lift-shell);
	overflow: hidden;
	isolation: isolate;
}

/* ── Topbar ─────────────────────────────────────────────── */

.topbar {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s4) var(--s5);
	align-items: center;
	justify-content: space-between;
	padding: var(--s5) clamp(var(--s4), 3vw, var(--s6));
	border-bottom: 1px solid var(--line);
}

.brand {
	display: flex;
	align-items: center;
	gap: var(--s3);
	min-width: 0;
}

.brand__mark {
	width: 44px;
	height: 44px;
	border-radius: var(--r-sm);
	flex-shrink: 0;
}

.brand__title {
	font-size: var(--t-lg);
	font-weight: 660;
	letter-spacing: -0.015em;
	line-height: 1.2;
}

.brand__sub {
	font-size: var(--t-sm);
	color: var(--ink-3);
}

.clockbox {
	text-align: right;
	margin-inline-start: auto;
}

.clockbox__time {
	font-size: var(--t-clock);
	font-weight: 640;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
	line-height: 1.05;
}

.clockbox__meta {
	font-size: var(--t-sm);
	color: var(--ink-3);
	margin-top: 2px;
}

@media (max-width: 560px) {
	.clockbox {
		text-align: left;
		margin-inline-start: 0;
	}
}

/* ── Player ─────────────────────────────────────────────── */

.player {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: var(--s4) var(--s5);
	align-items: center;
	padding: clamp(var(--s4), 3vw, var(--s6));
	background: var(--surface);
	border-bottom: 1px solid var(--line);
}

.player__art {
	position: relative;
	width: 112px;
	height: 112px;
	flex-shrink: 0;
}

.player__art img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--r-md);
	background: var(--surface-solid);
	box-shadow: var(--lift);
}

/* Playing indicator: a slow breathing ring, only while audio runs. */
.player__pulse {
	position: absolute;
	inset: -5px;
	border-radius: calc(var(--r-md) + 5px);
	border: 2px solid var(--accent);
	opacity: 0;
	transition: opacity var(--base) var(--ease);
	pointer-events: none;
}

body.is-playing .player__pulse {
	opacity: 0.85;
	animation: breathe 3.2s var(--ease) infinite;
}

@keyframes breathe {

	0%,
	100% {
		transform: scale(1);
		opacity: 0.75;
	}

	50% {
		transform: scale(1.035);
		opacity: 0.3;
	}
}

.player__info {
	min-width: 0;
}

.player__status {
	font-size: var(--t-sm);
	color: var(--accent-hi);
	font-weight: 600;
}

.player__status[data-state="paused"] {
	color: var(--ink-3);
}

.player__status[data-state="error"] {
	color: var(--bad);
}

.player__title {
	font-size: var(--t-xl);
	font-weight: 640;
	letter-spacing: -0.018em;
	line-height: 1.15;
	margin-block: 2px 4px;
	overflow-wrap: anywhere;
}

.player__sub {
	font-size: var(--t-base);
	color: var(--ink-2);
	overflow-wrap: anywhere;
}

.player__actions {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	gap: var(--s2);
}

.player__volume {
	grid-column: 1 / -1;
	max-width: 460px;
}

@media (min-width: 860px) {
	.player {
		grid-template-columns: auto minmax(0, 1fr) auto;
	}

	.player__actions {
		grid-column: auto;
		grid-row: 1;
		flex-direction: column;
		align-items: stretch;
		min-width: 200px;
	}

	.player__volume {
		grid-column: 1 / -1;
	}
}

@media (max-width: 460px) {
	.player {
		grid-template-columns: minmax(0, 1fr);
	}

	.player__art {
		width: 84px;
		height: 84px;
	}
}

/* ── Tabs ───────────────────────────────────────────────── */

.tabs {
	display: flex;
	gap: 2px;
	padding: var(--s3) clamp(var(--s3), 3vw, var(--s6)) 0;
	/* Scrollen bleibt für schmale Viewports möglich, die Leiste selbst wird
	   ausgeblendet — auf dem Desktop passen alle sechs Tabs ohnehin nebeneinander. */
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	/* Kein position:sticky — .app ist wegen der runden Ecken overflow:hidden,
	   darin würde sticky nicht am Viewport haften. */
	border-bottom: 1px solid var(--line);
}

.tabs::-webkit-scrollbar {
	display: none;
}

.tab {
	appearance: none;
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	padding: 10px 14px;
	font-size: var(--t-base);
	/* Über Glas liegen alle Textstufen nah beieinander — der aktive Tab hebt
	   sich über Gewicht und Unterstrich ab, nicht über die Helligkeit. */
	font-weight: 480;
	color: var(--ink-3);
	white-space: nowrap;
	cursor: pointer;
	border-radius: var(--r-sm) var(--r-sm) 0 0;
	transition: color var(--fast) var(--ease), background var(--fast) var(--ease),
		border-color var(--fast) var(--ease);
}

.tab:hover {
	color: var(--ink);
	background: var(--surface);
}

.tab[aria-selected="true"] {
	color: var(--ink);
	font-weight: 660;
	border-bottom-color: var(--accent);
}

/* ── Panels ─────────────────────────────────────────────── */

.panels {
	padding: var(--s5) clamp(var(--s4), 3vw, var(--s6)) var(--s6);
}

.panel {
	display: grid;
	gap: var(--s6);
}

.panel:focus {
	outline: none;
}

.group {
	display: grid;
	gap: var(--s3);
	padding-bottom: var(--s5);
	border-bottom: 1px solid var(--line);
}

.group:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.group__title {
	font-size: var(--t-md);
	font-weight: 620;
	letter-spacing: -0.01em;
}

.group__hint {
	font-size: var(--t-sm);
	color: var(--ink-3);
	max-width: 68ch;
	margin-top: -6px;
	text-wrap: pretty;
}

.prose {
	color: var(--ink-2);
	max-width: 70ch;
	text-wrap: pretty;
}

.list {
	padding-left: 1.15em;
	display: grid;
	gap: var(--s2);
}

.grid-2 {
	display: grid;
	gap: var(--s3);
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.inline {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s2);
	align-items: center;
}

/* ── Radio options ──────────────────────────────────────── */

.options {
	display: grid;
	border-block: 1px solid var(--line);
}

.option {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: var(--s3);
	padding: 11px 10px;
	cursor: pointer;
	border-radius: var(--r-sm);
	transition: background var(--fast) var(--ease);
}

.option+.option {
	border-top: 1px solid var(--line);
}

.option:hover {
	background: var(--surface);
}

.option input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.option__mark {
	width: 18px;
	height: 18px;
	margin-top: 2px;
	border-radius: 50%;
	border: 1.5px solid var(--line-strong);
	flex-shrink: 0;
	display: grid;
	place-items: center;
	transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.option__mark::after {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent-on);
	transform: scale(0);
	transition: transform var(--base) var(--ease);
}

.option input:checked+.option__mark {
	background: var(--accent);
	border-color: var(--accent);
}

.option input:checked+.option__mark::after {
	transform: scale(1);
}

.option input:focus-visible+.option__mark {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.option__body {
	display: grid;
	gap: 1px;
	min-width: 0;
}

.option__name {
	font-weight: 520;
}

.option__note {
	font-size: var(--t-sm);
	color: var(--ink-3);
}

/* ── Switch ─────────────────────────────────────────────── */

.switch {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--s3);
	padding: 7px 0;
	cursor: pointer;
}

.switch input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.switch__track {
	width: 40px;
	height: 23px;
	border-radius: var(--r-pill);
	background: var(--surface-hi);
	border: 1px solid var(--line-strong);
	flex-shrink: 0;
	padding: 2px;
	transition: background var(--base) var(--ease), border-color var(--base) var(--ease);
}

.switch__knob {
	display: block;
	width: 17px;
	height: 17px;
	border-radius: 50%;
	background: var(--control-off);
	transition: transform var(--base) var(--ease), background var(--base) var(--ease);
}

.switch input:checked+.switch__track {
	background: var(--accent);
	border-color: var(--accent);
}

.switch input:checked+.switch__track .switch__knob {
	transform: translateX(17px);
	background: var(--accent-on);
}

.switch input:focus-visible+.switch__track {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.switch input:disabled~* {
	opacity: 0.45;
}

.switch__label {
	font-size: var(--t-base);
}

/* ── Buttons ────────────────────────────────────────────── */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 16px;
	border-radius: var(--r-sm);
	border: 1px solid var(--line-strong);
	background: var(--surface-hi);
	color: var(--ink);
	font-size: var(--t-base);
	font-weight: 560;
	cursor: pointer;
	white-space: nowrap;
	transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
		transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}

.btn:hover:not(:disabled) {
	background: oklch(0.50 0.038 258 / 0.44);
	border-color: oklch(1 0 0 / 0.34);
}

.btn:active:not(:disabled) {
	transform: translateY(1px);
}

.btn:disabled {
	opacity: 0.42;
	cursor: not-allowed;
}

.btn--primary {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-on);
	font-weight: 650;
}

.btn--primary:hover:not(:disabled) {
	background: var(--accent-hi);
	border-color: var(--accent-hi);
}

.btn--ghost {
	background: transparent;
	border-color: var(--line-strong);
	color: var(--ink-2);
}

.btn--ghost:hover:not(:disabled) {
	background: var(--surface);
	color: var(--ink);
}

.btn--sm {
	padding: 6px 11px;
	font-size: var(--t-sm);
}

.btn__glyph {
	font-size: 0.95em;
	line-height: 1;
}

.btn.is-busy {
	pointer-events: none;
	opacity: 0.7;
}

.iconbtn {
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	border-radius: var(--r-sm);
	border: 1px solid var(--line-strong);
	background: var(--surface);
	color: var(--ink-2);
	cursor: pointer;
	transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
		transform var(--fast) var(--ease);
}

.iconbtn:hover {
	background: var(--surface-hi);
	color: var(--ink);
}

.iconbtn:active {
	transform: scale(0.94);
}

/* ── Fields ─────────────────────────────────────────────── */

.field {
	display: grid;
	gap: 6px;
}

.field__label {
	font-size: var(--t-sm);
	color: var(--ink-2);
	display: flex;
	justify-content: space-between;
	gap: var(--s3);
}

.input,
.select {
	width: 100%;
	padding: 10px 12px;
	border-radius: var(--r-sm);
	border: 1px solid var(--line-strong);
	/* Eingabefelder bleiben bewusst dichter — sie sollen als Mulde lesbar sein. */
	background: oklch(0.16 0.028 258 / 0.50);
	color: var(--ink);
	transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.input::placeholder {
	color: var(--ink-3);
}

.input:hover,
.select:hover {
	border-color: oklch(1 0 0 / 0.26);
}

.input:focus-visible,
.select:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
	border-color: transparent;
}

.input[aria-invalid="true"] {
	border-color: var(--bad);
}

.select {
	appearance: none;
	padding-right: 34px;
	background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
		linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
	background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	cursor: pointer;
	width: auto;
	min-width: 140px;
}

/* ── Range ──────────────────────────────────────────────── */

.range {
	--fill: 50%;
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	height: 22px;
	background: transparent;
	cursor: pointer;
}

.range::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: var(--r-pill);
	background: linear-gradient(to right,
			var(--accent) 0 var(--fill),
			oklch(1 0 0 / 0.18) var(--fill) 100%);
}

.range::-moz-range-track {
	height: 6px;
	border-radius: var(--r-pill);
	background: linear-gradient(to right,
			var(--accent) 0 var(--fill),
			oklch(1 0 0 / 0.18) var(--fill) 100%);
}

.range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	margin-top: -5px;
	border-radius: 50%;
	background: var(--ink);
	border: 0;
	transition: transform var(--fast) var(--ease);
}

.range::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--ink);
	border: 0;
	transition: transform var(--fast) var(--ease);
}

.range:hover::-webkit-slider-thumb {
	transform: scale(1.15);
}

.range:hover::-moz-range-thumb {
	transform: scale(1.15);
}

.range:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 4px;
	border-radius: var(--r-pill);
}

/* ── Notices / facts / toast ────────────────────────────── */

.notice {
	font-size: var(--t-sm);
	color: var(--ink-2);
	min-height: 1.4em;
}

.notice[data-tone="ok"] {
	color: var(--good);
}

.notice[data-tone="bad"] {
	color: var(--bad);
}

.notice[data-tone="warn"] {
	color: var(--warn);
}

.facts {
	display: grid;
	gap: 0;
	border-block: 1px solid var(--line);
}

.fact {
	display: flex;
	justify-content: space-between;
	gap: var(--s4);
	padding: 10px 2px;
}

.fact+.fact {
	border-top: 1px solid var(--line);
}

.fact dt {
	color: var(--ink-3);
	font-size: var(--t-sm);
}

.fact dd {
	font-weight: 520;
	text-align: right;
}

.saved {
	font-size: var(--t-sm);
	color: var(--good);
	opacity: 0;
	transition: opacity var(--base) var(--ease);
}

.saved.is-on {
	opacity: 1;
}

.toast {
	position: fixed;
	inset-inline: 0;
	inset-block-end: 20px;
	z-index: var(--z-toast);
	margin-inline: auto;
	width: max-content;
	max-width: min(520px, calc(100% - 32px));
	padding: 11px 16px;
	border-radius: var(--r-sm);
	background: var(--surface-solid);
	border: 1px solid var(--line-strong);
	box-shadow: var(--lift);
	font-size: var(--t-sm);
	animation: toast-in var(--slow) var(--ease);
}

.toast[data-tone="bad"] {
	border-color: var(--bad);
}

@keyframes toast-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
}

/* ── K.K. song list ─────────────────────────────────────── */

.songs {
	display: grid;
	gap: var(--s2);
	transition: opacity var(--base) var(--ease);
}

.songs.is-off {
	opacity: 0.45;
	pointer-events: none;
}

.songs__bar {
	display: flex;
	gap: var(--s2);
	align-items: center;
}

.songs__bar .input {
	flex: 1 1 200px;
	min-width: 0;
}

.songs__count {
	font-size: var(--t-xs);
	color: var(--ink-3);
}

.songs__list {
	max-height: 320px;
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	padding: var(--s1);
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1px;
}

.song {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 9px;
	border-radius: var(--r-xs);
	cursor: pointer;
	font-size: var(--t-sm);
	transition: background var(--fast) var(--ease);
}

.song:hover {
	background: var(--surface);
}

.song input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.song__box {
	width: 16px;
	height: 16px;
	border-radius: 4px;
	border: 1.5px solid var(--line-strong);
	flex-shrink: 0;
	display: grid;
	place-items: center;
	transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.song__box::after {
	content: "";
	width: 8px;
	height: 4px;
	border-left: 2px solid var(--accent-on);
	border-bottom: 2px solid var(--accent-on);
	transform: rotate(-45deg) scale(0);
	margin-top: -2px;
	transition: transform var(--base) var(--ease);
}

.song input:checked+.song__box {
	background: var(--accent);
	border-color: var(--accent);
}

.song input:checked+.song__box::after {
	transform: rotate(-45deg) scale(1);
}

.song input:focus-visible+.song__box {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.song__game {
	color: var(--ink-3);
	font-size: var(--t-xs);
	margin-inline-start: auto;
	flex-shrink: 0;
}

.songs__empty {
	padding: var(--s4);
	color: var(--ink-3);
	font-size: var(--t-sm);
	grid-column: 1 / -1;
	text-align: center;
}

/* ── Town tune editor (piano roll) ──────────────────────── */

.roll__scroll {
	overflow-x: auto;
	overscroll-behavior-x: contain;
	padding-bottom: var(--s2);
}

/*
 * Das Raster braucht 558px (44px Label + 16x30px + 17x2px Lücke). Der
 * Panel-Innenraum unterschreitet das erst unterhalb von rund 635px Viewport.
 * Darüber darf gar kein Scrollcontainer entstehen: overflow-x:auto zwingt
 * overflow-y ebenfalls auf auto, und die scale()-Effekte von :hover und der
 * Abspiel-Animation ragen minimal über die Box hinaus — das allein hat auf
 * dem Desktop schon beide Leisten erzeugt.
 */
@media (min-width: 680px) {
	.roll__scroll {
		overflow: visible;
	}
}

.roll {
	display: grid;
	grid-template-columns: 44px repeat(16, minmax(30px, 1fr));
	gap: 2px;
	min-width: 560px;
}

.roll__label {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding-right: 7px;
	font-size: var(--t-xs);
	font-family: var(--font-mono);
	color: var(--ink-3);
	height: 21px;
}

.cell {
	height: 21px;
	border: 0;
	padding: 0;
	border-radius: 4px;
	background: oklch(1 0 0 / 0.055);
	cursor: pointer;
	transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.cell:hover {
	background: oklch(1 0 0 / 0.16);
}

.cell[aria-pressed="true"] {
	background: var(--cell, var(--accent));
}

.cell[aria-pressed="true"]:hover {
	transform: scale(1.06);
}

/* zZz und – sind Steuerzeichen, keine Töne: leiser gezeichnet. */
.cell--meta {
	background: oklch(1 0 0 / 0.028);
}

.cell--meta:hover {
	background: oklch(1 0 0 / 0.12);
}

.cell--meta[aria-pressed="true"],
.cell--meta[aria-pressed="true"]:hover {
	background: var(--cell);
}

.cell.is-flash {
	animation: flash 260ms var(--ease);
}

@keyframes flash {
	0% {
		box-shadow: 0 0 0 0 oklch(1 0 0 / 0.9);
		transform: scale(1.18);
	}

	100% {
		box-shadow: 0 0 0 7px oklch(1 0 0 / 0);
		transform: scale(1);
	}
}

.roll__steps {
	display: grid;
	grid-template-columns: 44px repeat(16, minmax(30px, 1fr));
	gap: 2px;
	min-width: 560px;
	list-style: none;
	padding: 4px 0 0;
	margin: 0;
}

.roll__steps li {
	font-size: var(--t-xs);
	color: var(--ink-3);
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.roll__steps li:first-child {
	grid-column: 1;
}

.tune__readout {
	font-size: var(--t-sm);
	display: flex;
	flex-wrap: wrap;
	gap: var(--s2);
	align-items: baseline;
}

.tune__readout-label {
	color: var(--ink-3);
}

.tune__readout code {
	background: transparent;
	padding: 0;
	color: var(--ink-2);
	letter-spacing: 0.02em;
}

/* ── Footer ─────────────────────────────────────────────── */

.footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s3);
	padding: var(--s3) clamp(var(--s4), 3vw, var(--s6));
	border-top: 1px solid var(--line);
	background: oklch(0.34 0.032 258 / 0.14);
}

.footer__note {
	font-size: var(--t-xs);
	color: var(--ink-3);
	min-width: 0;
	overflow-wrap: anywhere;
}

/* ── Reduced motion ─────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.scene__layer {
		transform: none;
		transition: opacity 0.01ms;
	}

	body.is-playing .player__pulse {
		animation: none;
		opacity: 0.85;
	}
}
