/* =============================================================================
 * Koharu Shoka — the plugin's own stylesheet.
 *
 * Ported from the reference theme's `shoka-effects.css`, `shoka-containers.css`,
 * `shoka-tabs.css`, `shoka-links.css` and `embed.css`. The player is new: the
 * reference's is 900 lines of list, lyrics and theme switching around an APlayer
 * clone, and only the controls were asked for.
 *
 * ## Where the colours come from
 *
 * Every shadcn token is read with a fallback — `hsl(var(--primary, 351 77% 62%))`
 * — so the plugin looks right on the Koharu theme, which defines them, and still
 * looks deliberate on a theme that does not. The prefix `--shoka-` is the
 * plugin's own and is defined below.
 *
 * ## Scoping
 *
 * The reference applies `.red` and friends globally, which is fine in a theme
 * whose every class it owns and not fine in WordPress, where `.blue` and
 * `.primary` are common names for something else entirely. The collision-prone
 * one-word classes are therefore scoped to `.entry-content` (WordPress's usual
 * wrapper) or to a `shoka-syntax` class on `<body>`, which the plugin adds to
 * pages whose content actually uses the syntax. The plugin's own names —
 * `shoka-*`, `note-block`, `collapse-block`, `tab-*`, `friend-link-*` — are
 * already unambiguous and are left alone.
 * ============================================================================= */

/* -----------------------------------------------------------------------------
   Variables
   -------------------------------------------------------------------------- */

:root {
	--shoka-default: 0 0% 40%;
	--shoka-info: 210 100% 50%;
	--shoka-success: 142 76% 36%;
	--shoka-warning: 45 100% 40%;
	--shoka-danger: 0 84% 60%;

	/*
	 * Named text colours carry an `ink-` infix on purpose. The theme has its own
	 * `--shoka-blue`, an HSL triple used in a dozen `hsl()` calls of its own;
	 * defining a plain `--shoka-blue` here would shadow it with a hex value and
	 * break every one of them.
	 */
	--shoka-ink-red: #e74c3c;
	--shoka-ink-pink: #e91e63;
	--shoka-ink-orange: #f39c12;
	--shoka-ink-yellow: #d4a017;
	--shoka-ink-green: #27ae60;
	--shoka-ink-aqua: #1abc9c;
	--shoka-ink-blue: #2e86c1;
	--shoka-ink-purple: #8e44ad;
	--shoka-ink-grey: #7f8c8d;

	--shoka-radius: 8px;
	--shoka-gap: 1.5em;
}

.dark,
html[data-theme="dark"] {
	--shoka-default: 0 0% 60%;
	--shoka-info: 210 100% 65%;
	--shoka-success: 142 76% 50%;
	--shoka-warning: 45 100% 55%;
	--shoka-danger: 0 84% 70%;

	--shoka-ink-red: #f87171;
	--shoka-ink-pink: #f472b6;
	--shoka-ink-orange: #fbbf24;
	--shoka-ink-yellow: #facc15;
	--shoka-ink-green: #4ade80;
	--shoka-ink-aqua: #2dd4bf;
	--shoka-ink-blue: #60a5fa;
	--shoka-ink-purple: #c084fc;
	--shoka-ink-grey: #9ca3af;
}

/* Core's own utility, repeated because a plugin cannot assume the theme has it. */
.shoka-player .screen-reader-text,
.shoka-mermaid .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* -----------------------------------------------------------------------------
   Inline effects
   -------------------------------------------------------------------------- */

ins {
	--line-color: hsl(var(--primary, 351 77% 62%));
	text-decoration: none;
	border-bottom: 0.125rem solid var(--line-color);
}

ins.wavy {
	border-bottom: none;
	text-decoration: underline wavy var(--line-color);
	text-underline-offset: 4px;
}

ins.dot {
	border-bottom: 0.2rem dotted var(--line-color);
}

ins.primary {
	--line-color: hsl(var(--primary, 351 77% 62%));
}

ins.info {
	--line-color: hsl(var(--shoka-info));
}

ins.success {
	--line-color: hsl(var(--shoka-success));
}

ins.warning {
	--line-color: hsl(var(--shoka-warning));
}

ins.danger {
	--line-color: hsl(var(--shoka-danger));
}

del.primary {
	text-decoration-color: hsl(var(--primary, 351 77% 62%));
}

del.info {
	text-decoration-color: hsl(var(--shoka-info));
}

del.success {
	text-decoration-color: hsl(var(--shoka-success));
}

del.warning {
	text-decoration-color: hsl(var(--shoka-warning));
}

del.danger {
	text-decoration-color: hsl(var(--shoka-danger));
}

mark {
	padding: 0.1em 0.2em;
	border-radius: 0.2em;
	background: linear-gradient(120deg, hsl(50 100% 70% / 0.3) 0%, hsl(50 100% 70% / 0.6) 100%);
	color: inherit;
}

.dark mark,
html[data-theme="dark"] mark {
	background: linear-gradient(120deg, hsl(50 100% 50% / 0.2) 0%, hsl(50 100% 50% / 0.4) 100%);
}

/* --- Spoiler ---------------------------------------------------------------- */

/*
 * The click-to-reveal variant is the reference's panel: greyed out and
 * unselectable until opened. It is a `<button>` here rather than a web
 * component, so the styles cover the element's own reset as well.
 */
button.spoiler {
	display: inline;
	margin: 0;
	padding: 0 0.3em;
	border: 0;
	border-radius: 3px;
	background-color: hsl(0 0% 10%);
	color: transparent;
	font: inherit;
	cursor: pointer;
	user-select: none;
}

html[data-theme="dark"] button.spoiler,
.dark button.spoiler {
	background-color: hsl(0 0% 80%);
}

button.spoiler.is-revealed {
	background-color: hsl(var(--muted, 0 0% 96%));
	color: inherit;
	cursor: default;
	user-select: text;
}

button.spoiler:focus-visible {
	outline: 2px solid hsl(var(--primary, 351 77% 62%));
	outline-offset: 2px;
}

/* The hover-blur variant. */
.spoiler.blur {
	background-color: transparent;
	color: inherit;
	filter: blur(5px);
	cursor: pointer;
	user-select: none;
	transition: filter 0.3s;
}

.spoiler.blur:hover,
.spoiler.blur:focus,
.spoiler.blur.revealed {
	filter: none;
}

/* --- Ruby and emphasis dots ------------------------------------------------- */

ruby {
	ruby-align: center;
}

ruby rt {
	font-size: 0.6em;
	color: hsl(var(--muted-foreground, 0 0% 45%));
}

.shoka-emphasis-dot {
	text-emphasis: filled circle;
	-webkit-text-emphasis: filled circle;
	text-emphasis-position: under right;
	-webkit-text-emphasis-position: under right;
}

/* --- Labels and colours ----------------------------------------------------- */

:is(.entry-content, .shoka-syntax) .label {
	display: inline-block;
	padding: 0.15em 0.5em;
	border-radius: 0.3em;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.4;
	vertical-align: baseline;
}

:is(.entry-content, .shoka-syntax) .label.default {
	background: hsl(var(--shoka-default) / 0.15);
	color: hsl(var(--shoka-default));
}

:is(.entry-content, .shoka-syntax) .label.primary {
	background: hsl(var(--primary, 351 77% 62%) / 0.15);
	color: hsl(var(--primary, 351 77% 62%));
}

:is(.entry-content, .shoka-syntax) .label.info {
	background: hsl(var(--shoka-info) / 0.15);
	color: hsl(var(--shoka-info));
}

:is(.entry-content, .shoka-syntax) .label.success {
	background: hsl(var(--shoka-success) / 0.15);
	color: hsl(var(--shoka-success));
}

:is(.entry-content, .shoka-syntax) .label.warning {
	background: hsl(var(--shoka-warning) / 0.15);
	color: hsl(var(--shoka-warning));
}

:is(.entry-content, .shoka-syntax) .label.danger {
	background: hsl(var(--shoka-danger) / 0.15);
	color: hsl(var(--shoka-danger));
}

:is(.entry-content, .shoka-syntax) .red {
	color: var(--shoka-ink-red);
}

:is(.entry-content, .shoka-syntax) .pink {
	color: var(--shoka-ink-pink);
}

:is(.entry-content, .shoka-syntax) .orange {
	color: var(--shoka-ink-orange);
}

:is(.entry-content, .shoka-syntax) .yellow {
	color: var(--shoka-ink-yellow);
}

:is(.entry-content, .shoka-syntax) .green {
	color: var(--shoka-ink-green);
}

:is(.entry-content, .shoka-syntax) .aqua {
	color: var(--shoka-ink-aqua);
}

:is(.entry-content, .shoka-syntax) .blue {
	color: var(--shoka-ink-blue);
}

:is(.entry-content, .shoka-syntax) .purple {
	color: var(--shoka-ink-purple);
}

:is(.entry-content, .shoka-syntax) .grey {
	color: var(--shoka-ink-grey);
}

:is(.entry-content, .shoka-syntax) .rainbow {
	background: linear-gradient(
		90deg,
		var(--shoka-ink-red),
		var(--shoka-ink-orange),
		var(--shoka-ink-yellow),
		var(--shoka-ink-green),
		var(--shoka-ink-blue),
		var(--shoka-ink-purple),
		var(--shoka-ink-pink)
	);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-size: 200% 100%;
	animation: shoka-rainbow-shift 3s linear infinite;
}

@keyframes shoka-rainbow-shift {
	0% {
		background-position: 0% 50%;
	}

	100% {
		background-position: 200% 50%;
	}
}

:is(.entry-content, .shoka-syntax) .kbd,
:is(.entry-content, .shoka-syntax) kbd {
	display: inline-block;
	padding: 0.15em 0.4em;
	border: 1px solid hsl(0 0% 80%);
	border-radius: 4px;
	background: hsl(0 0% 97%);
	box-shadow:
		0 1px 0 hsl(0 0% 70%),
		inset 0 0 0 1px hsl(0 0% 100% / 0.5);
	color: hsl(0 0% 30%);
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.85em;
	line-height: 1.2;
	vertical-align: baseline;
}

.dark :is(.entry-content, .shoka-syntax) .kbd,
html[data-theme="dark"] :is(.entry-content, .shoka-syntax) .kbd,
.dark :is(.entry-content, .shoka-syntax) kbd,
html[data-theme="dark"] :is(.entry-content, .shoka-syntax) kbd {
	border-color: hsl(0 0% 35%);
	background: hsl(0 0% 20%);
	box-shadow:
		0 1px 0 hsl(0 0% 10%),
		inset 0 0 0 1px hsl(0 0% 100% / 0.05);
	color: hsl(0 0% 85%);
}

sub,
sup {
	position: relative;
	font-size: 0.75em;
	line-height: 0;
	vertical-align: baseline;
}

sup {
	top: -0.5em;
}

sub {
	bottom: -0.25em;
}

/* -----------------------------------------------------------------------------
   Note blocks
   -------------------------------------------------------------------------- */

.note-block {
	position: relative;
	margin: var(--shoka-gap) 0;
	padding: 1em 1em 1em 2.5em;
	border-left: 4px solid hsl(var(--shoka-default));
	border-radius: 0 var(--shoka-radius) var(--shoka-radius) 0;
	background: hsl(var(--shoka-default) / 0.06);
}

/*
 * The icon is a shape, not a character: `mask-image` supplies the outline and
 * `color` supplies the fill, the way the source's `fill="currentColor"` does.
 * The six names are the source's own (`NoteBlockIcon.tsx`), and the box matches
 * where its React mount lands: 1.1em at the mount's 1.5em font-size, so 1.65em.
 */
.note-block::before {
	/*
	 * An empty string rather than nothing. Without a `content` declaration the
	 * box is only generated because browsers are lenient about it — the spec says
	 * a `::before` with no content is not generated at all, and the rules below
	 * would then have nothing to paint on. `""` makes the box explicit.
	 */
	content: "";
	position: absolute;
	left: 0.35em;
	top: 0.7em;
	width: 1.65em;
	height: 1.65em;
	background-color: currentColor;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}

/* ri:arrow-right-circle-fill */
.note-block.note-default::before {
	color: hsl(var(--shoka-default));
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2c5.52 0 10 4.48 10 10s-4.48 10-10 10S2 17.52 2 12S6.48 2 12 2m0 9H8v2h4v3l4-4l-4-4z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2c5.52 0 10 4.48 10 10s-4.48 10-10 10S2 17.52 2 12S6.48 2 12 2m0 9H8v2h4v3l4-4l-4-4z'/%3E%3C/svg%3E");
}

/* ri:add-circle-fill */
.note-block.note-primary::before {
	color: hsl(var(--primary, 351 77% 62%));
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-1-11H7v2h4v4h2v-4h4v-2h-4V7h-2z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-1-11H7v2h4v4h2v-4h4v-2h-4V7h-2z'/%3E%3C/svg%3E");
}

/* ri:information-fill */
.note-block.note-info::before {
	color: hsl(var(--shoka-info));
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-1-11v6h2v-6zm0-4v2h2V7z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-1-11v6h2v-6zm0-4v2h2V7z'/%3E%3C/svg%3E");
}

/* ri:checkbox-circle-fill */
.note-block.note-success::before {
	color: hsl(var(--shoka-success));
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10m5.457-12.543L11 15.914l-4.207-4.207l1.414-1.414L11 13.086l5.043-5.043z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10m5.457-12.543L11 15.914l-4.207-4.207l1.414-1.414L11 13.086l5.043-5.043z'/%3E%3C/svg%3E");
}

/* ri:error-warning-fill */
.note-block.note-warning::before {
	color: hsl(var(--shoka-warning));
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-1-7v2h2v-2zm0-8v6h2V7z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-1-7v2h2v-2zm0-8v6h2V7z'/%3E%3C/svg%3E");
}

/* ri:indeterminate-circle-fill */
.note-block.note-danger::before {
	color: hsl(var(--shoka-danger));
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10M7 11v2h10v-2z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10M7 11v2h10v-2z'/%3E%3C/svg%3E");
}

.note-block.note-primary {
	border-left-color: hsl(var(--primary, 351 77% 62%));
	background: hsl(var(--primary, 351 77% 62%) / 0.06);
}

.note-block.note-info {
	border-left-color: hsl(var(--shoka-info));
	background: hsl(var(--shoka-info) / 0.06);
}

.note-block.note-success {
	border-left-color: hsl(var(--shoka-success));
	background: hsl(var(--shoka-success) / 0.06);
}

.note-block.note-warning {
	border-left-color: hsl(var(--shoka-warning));
	background: hsl(var(--shoka-warning) / 0.06);
}

.note-block.note-danger {
	border-left-color: hsl(var(--shoka-danger));
	background: hsl(var(--shoka-danger) / 0.06);
}

.note-block.no-icon {
	padding-left: 1em;
}

.note-block.no-icon::before {
	display: none;
}

.note-block > :first-child {
	margin-top: 0;
}

.note-block > :last-child {
	margin-bottom: 0;
}

/* -----------------------------------------------------------------------------
   Collapse blocks
   -------------------------------------------------------------------------- */

.collapse-block {
	margin: var(--shoka-gap) 0;
	border: 1px solid hsl(var(--shoka-default) / 0.3);
	border-radius: var(--shoka-radius);
	overflow: hidden;
}

.collapse-block > summary {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.8em 1em;
	border-bottom: 1px solid transparent;
	background: hsl(var(--shoka-default) / 0.06);
	font-weight: 600;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.collapse-block > summary::before {
	content: "▶";
	font-size: 0.7em;
	transition: transform 0.2s;
}

.collapse-block > summary::-webkit-details-marker {
	display: none;
}

.collapse-block[open] > summary {
	border-bottom-color: hsl(var(--shoka-default) / 0.2);
}

.collapse-block[open] > summary::before {
	transform: rotate(90deg);
}

.collapse-block > summary:focus-visible {
	outline: 2px solid hsl(var(--primary, 351 77% 62%));
	outline-offset: -2px;
}

.collapse-block > .collapse-content {
	padding: 1em;
}

.collapse-block > .collapse-content > :first-child {
	margin-top: 0;
}

.collapse-block > .collapse-content > :last-child {
	margin-bottom: 0;
}

.collapse-block.collapse-primary {
	border-color: hsl(var(--primary, 351 77% 62%) / 0.3);
}

.collapse-block.collapse-primary > summary {
	background: hsl(var(--primary, 351 77% 62%) / 0.06);
}

.collapse-block.collapse-info {
	border-color: hsl(var(--shoka-info) / 0.3);
}

.collapse-block.collapse-info > summary {
	background: hsl(var(--shoka-info) / 0.06);
}

.collapse-block.collapse-success {
	border-color: hsl(var(--shoka-success) / 0.3);
}

.collapse-block.collapse-success > summary {
	background: hsl(var(--shoka-success) / 0.06);
}

.collapse-block.collapse-warning {
	border-color: hsl(var(--shoka-warning) / 0.3);
}

.collapse-block.collapse-warning > summary {
	background: hsl(var(--shoka-warning) / 0.06);
}

.collapse-block.collapse-danger {
	border-color: hsl(var(--shoka-danger) / 0.3);
}

.collapse-block.collapse-danger > summary {
	background: hsl(var(--shoka-danger) / 0.06);
}

/* -----------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */

.tab-group {
	margin: var(--shoka-gap) 0;
	border: 1px solid hsl(var(--border, 0 0% 88%));
	border-radius: var(--shoka-radius);
	overflow: hidden;
}

.tab-headers {
	display: flex;
	flex-wrap: wrap;
	border-bottom: 1px solid hsl(var(--border, 0 0% 88%));
	background: hsl(var(--muted, 0 0% 96%) / 0.5);
}

.tab-header {
	position: relative;
	padding: 10px 20px;
	border: none;
	background: transparent;
	color: hsl(var(--muted-foreground, 0 0% 45%));
	font-family: inherit;
	font-size: 0.875em;
	font-weight: 500;
	cursor: pointer;
	user-select: none;
	transition:
		color 0.2s,
		background-color 0.2s;
}

.tab-header:hover {
	background: hsl(var(--muted, 0 0% 96%) / 0.6);
	color: hsl(var(--foreground, 0 0% 20%));
}

.tab-header[aria-selected="true"] {
	background: hsl(var(--background, 0 0% 100%));
	color: hsl(var(--primary, 351 77% 62%));
	font-weight: 600;
}

.tab-header[aria-selected="true"]::after {
	content: "";
	position: absolute;
	right: 8px;
	bottom: 0;
	left: 8px;
	height: 3px;
	border-radius: 3px 3px 0 0;
	background: hsl(var(--primary, 351 77% 62%));
}

.tab-header:focus-visible {
	outline: 2px solid hsl(var(--primary, 351 77% 62%));
	outline-offset: -2px;
}

.tab-panel {
	display: none;
	padding: 1em;
}

.tab-panel.is-active {
	display: block;
}

.tab-panel > :first-child {
	margin-top: 0;
}

.tab-panel > :last-child {
	margin-bottom: 0;
}

/* -----------------------------------------------------------------------------
   Link cards
   -------------------------------------------------------------------------- */

.shoka-card {
	display: flex;
	gap: 1em;
	align-items: stretch;
	margin: var(--shoka-gap) 0;
	border: 1px solid hsl(var(--border, 0 0% 88%));
	border-radius: var(--shoka-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition:
		border-color 0.2s,
		box-shadow 0.2s;
}

.shoka-card:hover {
	border-color: hsl(var(--primary, 351 77% 62%) / 0.5);
	box-shadow: 0 4px 16px hsl(0 0% 0% / 0.08);
	text-decoration: none;
}

.shoka-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.3em;
	min-width: 0;
	padding: 1em;
}

.shoka-card__site {
	color: hsl(var(--muted-foreground, 0 0% 45%));
	font-size: 0.75em;
	text-transform: lowercase;
}

.shoka-card__title {
	display: -webkit-box;
	overflow: hidden;
	font-weight: 600;
	line-height: 1.4;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.shoka-card__desc {
	display: -webkit-box;
	overflow: hidden;
	color: hsl(var(--muted-foreground, 0 0% 45%));
	font-size: 0.85em;
	line-height: 1.5;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.shoka-card__thumb {
	flex: 0 0 38%;
	max-width: 38%;
	background: hsl(var(--muted, 0 0% 96%));
}

.shoka-card__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (max-width: 600px) {
	.shoka-card__thumb {
		display: none;
	}
}

/* -----------------------------------------------------------------------------
   Friend links
   -------------------------------------------------------------------------- */

.friend-links-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1em;
	margin: var(--shoka-gap) 0;
}

.friend-link-card {
	display: flex;
	gap: 0.8em;
	align-items: center;
	padding: 0.8em;
	border: 1px solid hsl(var(--border, 0 0% 85%));
	border-radius: 10px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition:
		transform 0.2s,
		box-shadow 0.2s,
		border-color 0.2s;
}

.friend-link-card:hover {
	transform: translateY(-2px);
	border-color: hsl(var(--primary, 351 77% 62%) / 0.5);
	box-shadow: 0 4px 12px hsl(0 0% 0% / 0.12);
	text-decoration: none;
}

.friend-link-card .avatar {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
}

.friend-link-card .info {
	flex: 1;
	min-width: 0;
}

.friend-link-card .name {
	overflow: hidden;
	font-size: 0.95em;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.friend-link-card .owner {
	color: hsl(var(--muted-foreground, 0 0% 50%));
	font-size: 0.75em;
}

.friend-link-card .desc {
	display: -webkit-box;
	margin-top: 0.2em;
	overflow: hidden;
	color: hsl(var(--muted-foreground, 0 0% 50%));
	font-size: 0.8em;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* -----------------------------------------------------------------------------
   Audio player
   -------------------------------------------------------------------------- */

.shoka-player {
	--shoka-disc-size: 4.5rem;

	margin: var(--shoka-gap) 0;
	border: 1px solid hsl(var(--border, 0 0% 88%));
	border-radius: 1.5rem;
	overflow: hidden;
	background: hsl(var(--card, 0 12% 99%));
	box-shadow: 0 4px 20px -2px rgb(0 0 0 / 0.08), 0 10px 40px -10px rgb(0 0 0 / 0.12);
}

/* The record and the track it is playing, above the controls — the source's own
   order (`AudioPlayer.tsx:147-164`: preview, controls, playlist). */
.shoka-player__preview {
	display: flex;
	gap: 1em;
	align-items: center;
	padding: 1em 1.25em 0.75em;
}

.shoka-player__disc {
	position: relative;
	flex: 0 0 auto;
	width: var(--shoka-disc-size);
	height: var(--shoka-disc-size);
	border-radius: 50%;
	background: #111;
	box-shadow: 0 6px 18px -6px rgb(0 0 0 / 0.5), inset 0 0 0 1px rgb(255 255 255 / 0.06);
}

/* Grooves: concentric rings from a repeating radial gradient, the trick the
   source uses at `shoka-audio-player.css:120-128`. */
.shoka-player__disc::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: repeating-radial-gradient(#111 0, #111 2px, #222 3px, #111 4px);
}

/* The spindle. */
.shoka-player__disc::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: linear-gradient(to bottom right, #ddd, #999);
	box-shadow: 0 0 0 1px #666;
	transform: translate(-50%, -50%);
}

/* The label: the track's cover when it has one — the script swaps the gradient
   for the poster — and the brand gradient when it does not.

   `inset: 17.5%` makes the box 65% of the disc on both axes, i.e. square, and
   `background-size: cover` with `background-position: center` fills it from the
   middle of whatever was uploaded: a 16:9 photo is cropped evenly left and
   right, a tall one top and bottom, and neither is stretched. The square is
   then cut to a circle, so what a reader sees is always the centre of the
   picture. (The source's `.audio-player-cover` does the same thing with a
   `65%` box and `object-fit: cover`.) Setting the cover is `poster="…"` on
   `[shoka-audio]` / `[shoka-track]` — one picture per track. */
.shoka-player__disc-art {
	position: absolute;
	inset: 17.5%;
	border-radius: 50%;
	background: linear-gradient(135deg, hsl(var(--primary, 351 77% 62%) / 0.55), hsl(var(--muted, 240 4.8% 95.9%)));
	background-position: center;
	background-size: cover;
	box-shadow: inset 0 0 0 3px #111;
}

.shoka-player.is-playing .shoka-player__disc {
	animation: shoka-disc-spin 8s linear infinite;
}

@keyframes shoka-disc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Scrolling lyrics. The element is only unhidden when the track was given `lrc`,
   so a player without lyrics is exactly the height it was before. */
.shoka-player__lrc {
	height: 8rem;
	margin: 0 1.25em 0.75em;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
	mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
}

/* `position: relative` is load-bearing: the script measures each row's
   `offsetTop` to work out how far to scroll the run, and without a positioned
   ancestor those offsets come back relative to the page instead of the run. */
.shoka-player__lrc-inner {
	position: relative;
	transition: transform 400ms cubic-bezier(0.25, 1, 0.5, 1);
}

.shoka-player__lrc-inner p {
	height: 2rem;
	margin: 0;
	overflow: hidden;
	font-size: 0.9em;
	line-height: 2rem;
	color: hsl(var(--muted-foreground, 0 0% 45%));
	white-space: nowrap;
	text-overflow: ellipsis;
	opacity: 0.6;
	transform: scale(0.96);
	transform-origin: left center;
	transition: opacity 300ms ease, transform 300ms ease, color 300ms ease;
}

.shoka-player__lrc-inner p.is-current {
	color: hsl(var(--primary, 351 77% 62%));
	font-weight: 700;
	opacity: 1;
	transform: scale(1.02) translateX(4px);
}

.shoka-player__panel {
	display: flex;
	gap: 0.5em;
	align-items: center;
	padding: 0 1.25em 0.75em;
}

.shoka-player__toggle {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 2.875rem;
	height: 2.875rem;
	border: none;
	border-radius: 50%;
	background: var(--gradient-shoka-button, linear-gradient(to right, #ed6ea0 0, #ec8c69 100%));
	color: #fff;
	box-shadow: 0 4px 14px hsl(var(--primary, 351 77% 62%) / 0.35);
	cursor: pointer;
	transition: transform var(--duration-ui, 300ms) var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1)), box-shadow var(--duration-ui, 300ms) var(--ease-out, cubic-bezier(0, 0, 0.2, 1));
}

.shoka-player__toggle:hover {
	transform: scale(1.08);
}

.shoka-player__toggle:active {
	transform: scale(0.94);
}

.shoka-player__icon {
	width: 1.15rem;
	height: 1.15rem;
}

.shoka-player__icon.is-pause {
	display: none;
}

.shoka-player.is-playing .shoka-player__icon.is-play {
	display: none;
}

.shoka-player.is-playing .shoka-player__icon.is-pause {
	display: block;
}

.shoka-player__now {
	flex: 1;
	min-width: 0;
	line-height: 1.3;
}

.shoka-player__now-title {
	display: block;
	overflow: hidden;
	font-size: 1.05em;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.shoka-player__now-artist,
.shoka-player__time {
	color: hsl(var(--muted-foreground, 0 0% 45%));
	font-size: 0.75em;
}

.shoka-player__now-artist {
	display: block;
	margin-top: 0.25em;
}

.shoka-player__time {
	flex: 0 0 auto;
	margin-left: auto;
	font-variant-numeric: tabular-nums;
}

.shoka-player__nav {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: hsl(var(--muted, 240 4.8% 95.9%) / 0.6);
	color: hsl(var(--muted-foreground, 0 0% 45%));
	cursor: pointer;
	transition: transform var(--duration-normal, 250ms) var(--ease-out, cubic-bezier(0, 0, 0.2, 1)), background-color var(--duration-normal, 250ms) var(--ease-out, cubic-bezier(0, 0, 0.2, 1)), color var(--duration-normal, 250ms) var(--ease-out, cubic-bezier(0, 0, 0.2, 1));
}

.shoka-player__nav:hover {
	background: hsl(var(--muted, 240 4.8% 95.9%));
	color: hsl(var(--foreground, 0 0% 20%));
	transform: scale(1.1);
}

.shoka-player.is-multi .shoka-player__nav {
	display: flex;
}

.shoka-player__nav-icon {
	width: 0.9rem;
	height: 0.9rem;
}

.shoka-player__vol {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	width: 5rem;
}

.shoka-player__scrub {
	padding: 0 1.25em 0.9em;
}

/* A range input is drawn differently in every engine; these three rules are the
   smallest set that makes the thumb the theme's colour everywhere. */
.shoka-player input[type="range"] {
	width: 100%;
	height: 1.25rem;
	margin: 0;
	background: transparent;
	appearance: none;
	cursor: pointer;
}

.shoka-player input[type="range"]::-webkit-slider-runnable-track {
	height: 0.375rem;
	border-radius: 999px;
	background: hsl(var(--border, 0 0% 88%));
}

.shoka-player input[type="range"]::-webkit-slider-thumb {
	width: 0.875rem;
	height: 0.875rem;
	margin-top: -0.25rem;
	border: none;
	border-radius: 50%;
	background: hsl(var(--primary, 351 77% 62%));
	box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);
	appearance: none;
}

.shoka-player input[type="range"]::-moz-range-track {
	height: 0.375rem;
	border-radius: 999px;
	background: hsl(var(--border, 0 0% 88%));
}

.shoka-player input[type="range"]::-moz-range-thumb {
	width: 0.875rem;
	height: 0.875rem;
	border: none;
	border-radius: 50%;
	background: hsl(var(--primary, 351 77% 62%));
	box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);
}

.shoka-player input[type="range"]:focus-visible {
	outline: 2px solid hsl(var(--primary, 351 77% 62%));
	outline-offset: 2px;
}

.shoka-player__list {
	display: none;
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px dashed hsl(var(--border, 0 0% 88%));
}

.shoka-player.is-multi .shoka-player__list {
	display: block;
}

.shoka-player__item + .shoka-player__item {
	border-top: 1px solid hsl(var(--border, 0 0% 88%) / 0.6);
}

.shoka-player__pick {
	display: flex;
	gap: 0.75em;
	align-items: baseline;
	width: 100%;
	padding: 0.6em 1.25em;
	border: none;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: background-color var(--duration-normal, 250ms) var(--ease-out, cubic-bezier(0, 0, 0.2, 1)), padding-left var(--duration-normal, 250ms) var(--ease-out, cubic-bezier(0, 0, 0.2, 1));
}

.shoka-player__pick:hover {
	background: hsl(var(--muted, 240 4.8% 95.9%) / 0.5);
	padding-left: 1.75em;
}

.shoka-player__item.is-active .shoka-player__pick {
	background: hsl(var(--primary, 351 77% 62%) / 0.08);
	color: hsl(var(--primary, 351 77% 62%));
}

.shoka-player__index {
	flex: 0 0 1.5em;
	color: hsl(var(--muted-foreground, 0 0% 45%));
	font-size: 0.75em;
	font-variant-numeric: tabular-nums;
}

.shoka-player__title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	font-size: 0.875em;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.shoka-player__artist {
	flex: 0 0 auto;
	color: hsl(var(--muted-foreground, 0 0% 45%));
	font-size: 0.75em;
}

.shoka-player__toggle:focus-visible,
.shoka-player__nav:focus-visible,
.shoka-player__pick:focus-visible {
	outline: 2px solid hsl(var(--primary, 351 77% 62%));
	outline-offset: -2px;
}

@media (max-width: 600px) {
	.shoka-player {
		--shoka-disc-size: 3.25rem;
	}

	.shoka-player__lrc {
		height: 6rem;
	}

	.shoka-player__artist {
		display: none;
	}

	.shoka-player__vol {
		display: none;
	}
}

/* The disc is decorative motion, so it stops with the rest of them. The theme's
   own list cannot name a plugin's classes, so the rule lives here — and it has to
   carry the same `.shoka-player.is-playing` the animating rule does, or the
   three-class declaration out-ranks the two-class cancellation and the disc keeps
   turning. `prefers-reduced-motion` gets the same treatment below. */
html.motion-off .shoka-player.is-playing .shoka-player__disc {
	animation: none;
}

/* -----------------------------------------------------------------------------
   Embeds
   -------------------------------------------------------------------------- */

.shoka-embed {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: var(--shoka-gap) 0;
}

.shoka-embed--tweet {
	min-height: 12rem;
}

.shoka-embed--codepen {
	min-height: 12rem;
}

.shoka-embed a {
	padding: 0.5em 1em;
	border: 1px solid hsl(var(--border, 0 0% 88%));
	border-radius: var(--shoka-radius);
}

/* -----------------------------------------------------------------------------
   Mermaid
   -------------------------------------------------------------------------- */

.shoka-mermaid {
	margin: var(--shoka-gap) 0;
	padding: 1em;
	border: 1px solid hsl(var(--border, 0 0% 88%));
	border-radius: var(--shoka-radius);
	overflow-x: auto;
	text-align: center;
}

.shoka-mermaid svg {
	max-width: 100%;
	height: auto;
}

/*
 * The source is hidden while the diagram is being drawn, and shown again if the
 * drawing never happens — a blocked script, an offline reader, a CDN that is
 * down. `.is-loading` is set as soon as the script takes charge, so the text
 * does not flash up during a slow download.
 */
.shoka-mermaid .shoka-mermaid__fallback {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 0.8em;
	text-align: left;
	white-space: pre-wrap;
	display: none;
}

.shoka-mermaid.is-failed .shoka-mermaid__fallback {
	display: block;
}

.shoka-mermaid.is-loading::after {
	content: "…";
	color: hsl(var(--muted-foreground, 0 0% 45%));
}

/* -----------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	:is(.entry-content, .shoka-syntax) .rainbow {
		animation: none;
	}

	.shoka-player.is-playing .shoka-player__disc {
		animation: none;
	}

	.shoka-player__lrc-inner,
	.shoka-player__lrc-inner p {
		transition: none;
	}

	.friend-link-card:hover {
		transform: none;
	}

	.collapse-block > summary::before,
	.friend-link-card,
	.shoka-card,
	.tab-header,
	.spoiler.blur {
		transition: none;
	}
}
