/*
 * Release Cards — Trading-card portrait layout (1.22.506).
 *
 * Two surfaces:
 *   .release-stage   — /wp{NN}/{username}/ individual card page.
 *   .release-gallery — /wp{NN}/ grid of small trading cards.
 *
 * Card component (.trading-card) renders at two sizes:
 *   default     — large, used on the individual page (~320×460).
 *   .--sm       — gallery size (~190×270).
 *
 * Rarity tiers drive the gradient border + a subtle inner glow:
 *   --mythic    gold/magenta/cyan rotation, animated.
 *   --legendary warm gold.
 *   --epic      purple.
 *   --rare      blue.
 *   --common    slate.
 *
 * The :hover lift + subtle gradient rotation on apex tiers is gated
 * by prefers-reduced-motion so the page stays calm for folks who
 * opt out.
 */

/* ---------- Page shell ---------- */
.release-stage,
.release-gallery {
	max-width: 1180px;
	margin: 0 auto;
	padding: 48px 24px 80px;
	font-family: var(--font-body, system-ui, sans-serif);
}
.release-stage__inner,
.release-gallery__inner {
	max-width: 1080px;
	margin: 0 auto;
}

.release-stage__banner {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-radius: 12px;
	margin: 0 0 24px;
	font-size: 14px;
	line-height: 1.4;
	font-weight: 500;
}
.release-stage__banner .dashicons {
	flex: none;
	font-size: 20px;
	width: 20px;
	height: 20px;
}
.release-stage__banner--success {
	background: #ecfdf5;
	border: 1px solid #6ee7b7;
	color: #065f46;
}
.release-stage__banner--success .dashicons {
	color: #10b981;
}
.release-stage__banner--error {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	color: #991b1b;
}
.release-stage__banner--error .dashicons {
	color: #dc2626;
}

/* ============================================================
 * 1.22.509 — In-site card page uses the same trading-pack visual
 * as /share/. .release-stage__pack scopes the rarity CSS variables
 * so the gitpacks-style markup picks up the right colors here.
 * ============================================================ */
.release-stage__pack {
	display: flex;
	justify-content: center;
	margin: 0 auto 28px;
}
.release-stage__pack .trading-pack {
	/* Animation already runs in release-share.css. Nothing to override. */
}

/* ==================================================================
 * 1.22.511 — Two-column edit layout for owners. Card preview on the
 * LEFT (sticky as the owner scrolls the editor), customization form
 * on the RIGHT. Collapses to a single column under 980px.
 * ================================================================ */
.release-stage__edit-layout {
	display: grid;
	grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
	gap: 40px;
	align-items: start;
	max-width: 980px;
	margin: 0 auto 28px;
}
.release-stage__edit-layout .release-stage__pack {
	position: sticky;
	top: 24px;
	margin: 0;
}
.release-stage__edit-layout .release-customization {
	max-width: none;
	margin: 0;
}
@media (max-width: 980px) {
	.release-stage__edit-layout {
		grid-template-columns: 1fr;
		gap: 24px;
	}
	.release-stage__edit-layout .release-stage__pack {
		position: static;
		margin: 0 auto;
	}
}

/* ==================================================================
 * 1.22.510 — Customization form. Replaces the single-field tagline
 * editor. Multi-field card: title, featured contribution, tagline,
 * social link, accent swatch picker, single Save button.
 * ================================================================ */
.release-customization {
	max-width: 540px;
	margin: 32px auto 0;
	padding: 28px 30px 24px;
	background: #ffffff;
	border: 1px solid var(--border-default, #e2e8f0);
	border-radius: 16px;
	box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}
.release-customization__header {
	margin-bottom: 22px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--border-default, #e2e8f0);
}
.release-customization__header h2 {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 800;
	color: var(--color-text, #0f172a);
}
.release-customization__header p {
	margin: 0;
	font-size: 13px;
	color: var(--color-muted, #64748b);
	line-height: 1.5;
}
.release-customization__field {
	margin-bottom: 18px;
}
.release-customization__field > label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: var(--color-text, #0f172a);
	margin-bottom: 4px;
}
.release-customization__hint {
	margin: 0 0 8px;
	font-size: 12px;
	color: var(--color-muted, #64748b);
	line-height: 1.45;
}
.release-customization__field input[type="text"],
.release-customization__field input[type="url"],
.release-customization__field textarea {
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.5;
	font-family: inherit;
	border: 1px solid var(--border-default, #e2e8f0);
	border-radius: 10px;
	background: #f8fafc;
	color: var(--color-text, #0f172a);
}
.release-customization__field input[type="text"]:focus,
.release-customization__field input[type="url"]:focus,
.release-customization__field textarea:focus {
	outline: 2px solid color-mix(in srgb, var(--color-brand, #2145e6) 35%, transparent);
	outline-offset: 1px;
	background: #ffffff;
}
.release-customization__field textarea {
	min-height: 60px;
	resize: vertical;
}

/* Accent swatch radio group */
.release-customization__accents {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.release-customization__accent {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 8px 10px 6px;
	border: 1px solid var(--border-default, #e2e8f0);
	border-radius: 10px;
	cursor: pointer;
	background: #ffffff;
	transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.release-customization__accent input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.release-customization__accent-swatch {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1) inset;
}
.release-customization__accent-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--color-muted, #64748b);
}
.release-customization__accent:hover {
	border-color: var(--color-brand, #2145e6);
}
.release-customization__accent.is-selected {
	border-color: var(--color-brand, #2145e6);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand, #2145e6) 15%, transparent);
	transform: translateY(-1px);
}
.release-customization__accent.is-selected .release-customization__accent-label {
	color: var(--color-text, #0f172a);
}

.release-customization__actions {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 4px;
	padding-top: 18px;
	border-top: 1px solid var(--border-default, #e2e8f0);
}
.release-customization__save {
	background: var(--color-brand, #2145e6);
	color: #ffffff;
	border: none;
	padding: 11px 22px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}
.release-customization__save:hover {
	background: #1a37b8;
	transform: translateY(-1px);
}
.release-customization__save:disabled {
	opacity: 0.6;
	cursor: progress;
}

.release-customization__status {
	font-size: 12px;
	color: var(--color-muted, #64748b);
}
.release-customization__status[data-kind="pending"] {
	color: var(--color-brand, #2145e6);
}
.release-customization__status[data-kind="success"] {
	color: #065f46;
}
.release-customization__status[data-kind="error"] {
	color: #991b1b;
}

/* 1.22.520 — Two-column owner edit layout. Card preview pinned on
 * the LEFT, celebration message + theme picker + share controls on
 * the RIGHT. Collapses to a single stacked column under 900px. */
.release-stage__edit-layout {
	display: grid;
	grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
	gap: 32px;
	align-items: start;
	max-width: 980px;
	margin: 0 auto 24px;
}
.release-stage__edit-card {
	position: sticky;
	top: 24px;
}
.release-stage__edit-card .wpf-card {
	margin: 0;
}
.release-stage__edit-side {
	display: flex;
	flex-direction: column;
	gap: 24px;
}
.release-stage__actions--side {
	margin: 0;
}
@media (max-width: 900px) {
	.release-stage__edit-layout {
		grid-template-columns: 1fr;
	}
	.release-stage__edit-card {
		position: static;
	}
	.release-stage__edit-card .wpf-card {
		margin: 0 auto;
	}
}

/* 1.22.520 — Celebration / theme editor (right column).
 * Compact, multi-section card. */
.release-celebration-edit {
	margin: 0;
	padding: 22px 24px;
	background: #ffffff;
	border: 1px solid var(--border-default, #e2e8f0);
	border-radius: 14px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}
.release-celebration-edit__header {
	margin-bottom: 16px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--border-default, #e2e8f0);
}
.release-celebration-edit__header h2 {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 700;
	color: var(--color-text, #0f172a);
}
.release-celebration-edit__header p {
	margin: 0;
	font-size: 12px;
	color: var(--color-muted, #64748b);
	line-height: 1.5;
}
.release-celebration-edit__header a {
	color: var(--color-brand, #2145e6);
	font-weight: 600;
	text-decoration: none;
}
.release-celebration-edit__header a:hover { text-decoration: underline; }
.release-celebration-edit__label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: var(--color-text, #0f172a);
	margin-bottom: 6px;
}
.release-celebration-edit__input {
	width: 100%;
	min-height: 70px;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.5;
	font-family: inherit;
	border: 1px solid var(--border-default, #e2e8f0);
	border-radius: 10px;
	background: #f8fafc;
	color: var(--color-text, #0f172a);
	resize: vertical;
}
.release-celebration-edit__input:focus {
	outline: 2px solid color-mix(in srgb, var(--color-brand, #2145e6) 35%, transparent);
	outline-offset: 1px;
	background: #ffffff;
}
.release-celebration-edit__hint {
	margin: 0 0 8px;
	font-size: 11px;
	color: var(--color-muted, #64748b);
	line-height: 1.5;
}
.release-celebration-edit__label--theme {
	margin-top: 18px;
}

/* 1.22.549 — Dark / light mode picker. Two side-by-side chips
 * with a small color preview. Lives below the theme swatches in
 * the customization form. */
.release-celebration-edit__mode {
	display: flex;
	gap: 10px;
	margin-bottom: 12px;
}
.release-celebration-edit__mode-option {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	cursor: pointer;
	border-radius: 999px;
	border: 1px solid var(--border-default, #e2e8f0);
	background: #ffffff;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.release-celebration-edit__mode-option:hover {
	background: #f8fafc;
}
.release-celebration-edit__mode-option.is-selected {
	border-color: var(--color-brand, #2145e6);
	background: color-mix(in srgb, var(--color-brand, #2145e6) 8%, #ffffff);
}
.release-celebration-edit__mode-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.release-celebration-edit__mode-chip {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.1);
}
.release-celebration-edit__mode-chip--dark {
	background: #1A1F2E;
}
.release-celebration-edit__mode-chip--light {
	background: #ffffff;
	box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
}
.release-celebration-edit__mode-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--color-text, #0f172a);
}

/* Theme swatch picker — Auto + 11 presets in a wrap grid. */
.release-celebration-edit__themes {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 6px;
}
.release-celebration-edit__theme {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 6px 8px 4px;
	cursor: pointer;
	border-radius: 8px;
	border: 1px solid transparent;
	background: transparent;
	transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.release-celebration-edit__theme:hover {
	border-color: var(--border-default, #e2e8f0);
	background: #f8fafc;
}
.release-celebration-edit__theme.is-selected {
	border-color: var(--color-brand, #2145e6);
	background: color-mix(in srgb, var(--color-brand, #2145e6) 7%, #ffffff);
	transform: translateY(-1px);
}
.release-celebration-edit__theme input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.release-celebration-edit__theme-swatch {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.1);
}
.release-celebration-edit__theme-swatch--auto {
	background: linear-gradient(135deg, #174ECF 0%, #93B4F4 100%);
}
.release-celebration-edit__theme-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: var(--color-muted, #64748b);
	text-transform: uppercase;
}
.release-celebration-edit__theme.is-selected .release-celebration-edit__theme-label {
	color: var(--color-text, #0f172a);
}

.release-celebration-edit__count-row {
	margin-top: 6px;
	text-align: right;
}

.release-celebration-edit__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid var(--border-default, #e2e8f0);
	justify-content: flex-end;
}
.release-celebration-edit__count {
	flex: 1;
	font-size: 11px;
	color: var(--color-muted, #64748b);
}
.release-celebration-edit__count.is-near-limit { color: #b45309; }
.release-celebration-edit__save {
	background: var(--color-brand, #2145e6);
	color: #ffffff;
	border: none;
	padding: 9px 18px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease;
}
.release-celebration-edit__save:hover { background: #1a37b8; }
.release-celebration-edit__save:disabled { opacity: 0.6; cursor: progress; }
.release-celebration-edit__status {
	margin: 10px 0 0;
	font-size: 12px;
}
.release-celebration-edit__status[data-kind="pending"] { color: var(--color-brand, #2145e6); }
.release-celebration-edit__status[data-kind="error"]   { color: #991b1b; }

/* Legacy tagline editor styles — keep them around in case an older
 * /wp{NN}/{user}/ template variant is still in the wild somewhere. */
.release-tagline-editor {
	max-width: 460px;
	margin: 28px auto 0;
	padding: 20px 22px;
	background: #ffffff;
	border: 1px solid var(--border-default, #e2e8f0);
	border-radius: 14px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}
.release-tagline-editor__label {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: var(--color-text, #0f172a);
	margin-bottom: 8px;
}
.release-tagline-editor__hint {
	display: block;
	font-weight: 400;
	font-size: 12px;
	color: var(--color-muted, #64748b);
	margin-top: 2px;
}
.release-tagline-editor__input {
	width: 100%;
	min-height: 64px;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.5;
	font-family: inherit;
	border: 1px solid var(--border-default, #e2e8f0);
	border-radius: 10px;
	background: #f8fafc;
	color: var(--color-text, #0f172a);
	resize: vertical;
}
.release-tagline-editor__input:focus {
	outline: 2px solid color-mix(in srgb, var(--color-brand, #2145e6) 35%, transparent);
	outline-offset: 1px;
	background: #ffffff;
}
.release-tagline-editor__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 10px;
}
.release-tagline-editor__count {
	flex: 1;
	font-size: 11px;
	color: var(--color-muted, #64748b);
}
.release-tagline-editor__count.is-near-limit {
	color: #b45309;
}
.release-tagline-editor__save {
	background: var(--color-brand, #2145e6);
	color: #ffffff;
	border: none;
	padding: 8px 18px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease;
}
.release-tagline-editor__save:hover {
	background: #1a37b8;
}
.release-tagline-editor__save:disabled {
	opacity: 0.6;
	cursor: progress;
}
.release-tagline-editor__status {
	margin: 10px 0 0;
	font-size: 12px;
}
.release-tagline-editor__status[data-kind="success"] {
	color: #065f46;
}
.release-tagline-editor__status[data-kind="error"] {
	color: #991b1b;
}

.release-stage__back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	color: var(--color-muted, #64748b);
	text-decoration: none;
	margin-bottom: 32px;
}
.release-stage__back:hover {
	color: var(--color-brand, #2145e6);
}
.release-stage__back .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.release-stage > .release-stage__inner > .trading-card {
	margin: 0 auto;
}

/* 1.22.545 — Center the new .wpf-card partial when it renders as
 * a direct child of .release-stage__inner. That's the path used
 * for unclaimed cards and any non-owner viewer (the owner-edit
 * layout wraps it in .release-stage__edit-card which has its
 * own column sizing). Without this rule the 460px-wide card
 * left-aligns inside the 1080px container. */
.release-stage > .release-stage__inner > .wpf-card {
	margin: 0 auto;
}

/* ============================================================
 * Trading card component
 * ============================================================ */

.trading-card {
	--card-w: 340px;
	--card-h: 480px;
	--card-radius: 22px;
	--border-thickness: 4px;
	--inner-bg: #0b1220;
	--text-primary: #f8fafc;
	--text-secondary: rgba(248, 250, 252, 0.7);
	--text-muted: rgba(248, 250, 252, 0.45);

	position: relative;
	width: var(--card-w);
	height: var(--card-h);
	border-radius: var(--card-radius);
	overflow: hidden;
	color: var(--text-primary);
	text-decoration: none;
	isolation: isolate;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	box-shadow: 0 24px 50px rgba(15, 23, 42, 0.28);
}

a.trading-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 32px 60px rgba(15, 23, 42, 0.35);
}

/* Gradient border — a colored layer behind the body that shows
 * through as a ring of $border-thickness width. */
.trading-card__border {
	position: absolute;
	inset: 0;
	border-radius: var(--card-radius);
	background: linear-gradient(135deg, var(--rarity-1, #475569) 0%, var(--rarity-2, #94a3b8) 50%, var(--rarity-3, #cbd5e1) 100%);
	z-index: 0;
}

.trading-card__body {
	position: absolute;
	inset: var(--border-thickness);
	border-radius: calc(var(--card-radius) - var(--border-thickness));
	background: var(--inner-bg);
	background-image:
		radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.05), transparent 60%),
		linear-gradient(180deg, #111827 0%, #0b1220 70%, #050810 100%);
	padding: 18px 20px 16px;
	display: flex;
	flex-direction: column;
	z-index: 1;
}

/* Top row — release label + rarity stamp. */
.trading-card__top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	color: var(--text-muted);
}
.trading-card__release {
	background: rgba(255, 255, 255, 0.08);
	padding: 4px 9px;
	border-radius: 999px;
	color: var(--text-secondary);
}
.trading-card__rarity {
	color: var(--rarity-2, #cbd5e1);
	letter-spacing: 0.18em;
}

/* Avatar block. Padded so the photo doesn't kiss the border. */
.trading-card__avatar-wrap {
	display: flex;
	justify-content: center;
	margin: 22px 0 12px;
}
.trading-card__avatar {
	display: block;
	width: 200px;
	height: 200px;
	border-radius: 50%;
	object-fit: cover;
	background: #1e293b;
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08), 0 16px 32px rgba(0, 0, 0, 0.45);
}

.trading-card__identity {
	text-align: center;
	margin-top: 6px;
}
.trading-card__name {
	font-size: 22px;
	font-weight: 800;
	color: #ffffff;
	margin: 0;
	line-height: 1.15;
}
.trading-card__handle {
	font-size: 13px;
	color: var(--text-secondary);
	margin: 4px 0 0;
}

.trading-card__divider {
	height: 1px;
	margin: 14px 0 12px;
	background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
}

.trading-card__role {
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	color: var(--rarity-3, #cbd5e1);
	letter-spacing: 0.04em;
	flex-grow: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 8px;
}

.trading-card__bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 10px;
	letter-spacing: 0.16em;
	font-weight: 700;
	color: var(--text-muted);
	margin-top: auto;
}
.trading-card__brand {
	color: var(--text-secondary);
	letter-spacing: 0.22em;
}

/* Claimed mark — sits over the bottom-right of the avatar, verified-
 * badge style. Avoids overlapping the rarity stamp in the top row. */
.trading-card__claimed-mark {
	position: absolute;
	top: calc(50% - 60px);
	right: calc(50% - 110px);
	color: #ffffff;
	background: #22c55e;
	border: 3px solid var(--inner-bg, #0b1220);
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	z-index: 3;
}
.trading-card__claimed-mark .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* ---------- Rarity tier colors ---------- */
.trading-card--common .trading-card__border {
	--rarity-1: #475569;
	--rarity-2: #94a3b8;
	--rarity-3: #cbd5e1;
}
.trading-card--common {
	--rarity-1: #475569; --rarity-2: #94a3b8; --rarity-3: #cbd5e1;
}

.trading-card--rare .trading-card__border {
	--rarity-1: #2563eb;
	--rarity-2: #60a5fa;
	--rarity-3: #bfdbfe;
}
.trading-card--rare {
	--rarity-1: #2563eb; --rarity-2: #60a5fa; --rarity-3: #bfdbfe;
}

.trading-card--epic .trading-card__border {
	--rarity-1: #7c3aed;
	--rarity-2: #a78bfa;
	--rarity-3: #c4b5fd;
}
.trading-card--epic {
	--rarity-1: #7c3aed; --rarity-2: #a78bfa; --rarity-3: #c4b5fd;
}

.trading-card--legendary .trading-card__border {
	--rarity-1: #f59e0b;
	--rarity-2: #fbbf24;
	--rarity-3: #fde68a;
}
.trading-card--legendary {
	--rarity-1: #f59e0b; --rarity-2: #fbbf24; --rarity-3: #fde68a;
}

/* Mythic — rotating tri-color conic gradient.
 * Animation gated behind prefers-reduced-motion. */
.trading-card--mythic .trading-card__border {
	background: conic-gradient(
		from var(--mythic-angle, 0deg),
		#fde047 0%,
		#f472b6 33%,
		#22d3ee 66%,
		#fde047 100%
	);
}
.trading-card--mythic {
	--rarity-1: #fde047; --rarity-2: #f472b6; --rarity-3: #22d3ee;
}
@property --mythic-angle {
	syntax: '<angle>';
	initial-value: 0deg;
	inherits: false;
}
@media (prefers-reduced-motion: no-preference) {
	.trading-card--mythic .trading-card__border {
		animation: mythic-rotate 8s linear infinite;
	}
}
@keyframes mythic-rotate {
	to { --mythic-angle: 360deg; }
}

/* Apex tiers get a faint inner glow on hover so the card feels alive. */
.trading-card--mythic:hover .trading-card__body,
.trading-card--legendary:hover .trading-card__body {
	box-shadow: inset 0 0 60px rgba(253, 224, 71, 0.08);
}

/* Claimed cards get a tiny extra lift in identity color. */
.trading-card--claimed .trading-card__name {
	background: linear-gradient(90deg, #ffffff 0%, #93c5fd 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

/* ------------------------------------------------------------------
 * 1.22.507 — Celebration treatment for claimed cards (individual page
 * only, NOT the gallery — keeps the small-cell variant calm).
 *
 * Two layered effects:
 *   1. Rotating gradient border using the rarity color stops, so the
 *      card feels alive but stays on-tier (mythic still rotates its
 *      own gold-magenta-cyan; others rotate within their hue family).
 *   2. Pulsing halo behind the card via box-shadow keyframes — radiates
 *      out 3 layers, color-matched to rarity stop #2.
 *
 * Both are gated by prefers-reduced-motion. Skipped on .--sm so the
 * gallery grid doesn't shimmer like a slot machine.
 * ---------------------------------------------------------------- */
.release-stage .trading-card--claimed:not(.trading-card--sm) .trading-card__border {
	background: conic-gradient(
		from var(--claimed-angle, 0deg),
		var(--rarity-1) 0%,
		var(--rarity-2) 33%,
		var(--rarity-3) 66%,
		var(--rarity-1) 100%
	);
}
@property --claimed-angle {
	syntax: '<angle>';
	initial-value: 0deg;
	inherits: false;
}
@media (prefers-reduced-motion: no-preference) {
	.release-stage .trading-card--claimed:not(.trading-card--sm) .trading-card__border {
		animation: claimed-rotate 12s linear infinite;
	}
	.release-stage .trading-card--claimed:not(.trading-card--sm) {
		animation: claimed-halo 5s ease-in-out infinite;
	}
}
@keyframes claimed-rotate {
	to { --claimed-angle: 360deg; }
}
@keyframes claimed-halo {
	0%, 100% {
		box-shadow:
			0 24px 50px rgba(15, 23, 42, 0.28),
			0 0 0 0 rgba(33, 69, 230, 0);
	}
	50% {
		box-shadow:
			0 32px 60px rgba(15, 23, 42, 0.32),
			0 0 80px 4px var(--rarity-2);
	}
}

/* ------------------------------------------------------------------
 * Inline tagline (personal celebration message).
 *
 * Shows under the role label inside the card body. For owners it's
 * editable in place — click → textarea → save via AJAX. For everyone
 * else it's read-only (or hidden if empty).
 * ---------------------------------------------------------------- */
.trading-card__tagline {
	margin: 10px 14px 0;
	text-align: center;
	font-size: 13px;
	line-height: 1.4;
	color: rgba(248, 250, 252, 0.85);
	font-style: italic;
	min-height: 18px;
}
.trading-card__tagline-text {
	display: inline-block;
}

/* Owner: editable affordance + edit icon. */
.trading-card__tagline--editable .trading-card__tagline-display {
	position: relative;
	cursor: text;
	padding: 6px 10px;
	border-radius: 8px;
	border: 1px dashed transparent;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.trading-card__tagline--editable .trading-card__tagline-display:hover {
	border-color: rgba(255, 255, 255, 0.2);
	background: rgba(255, 255, 255, 0.04);
}
.trading-card__tagline--editable .trading-card__tagline-display[data-empty="1"] .trading-card__tagline-text {
	color: rgba(248, 250, 252, 0.4);
	font-style: normal;
}
.trading-card__tagline-edit-btn {
	background: none;
	border: none;
	color: rgba(248, 250, 252, 0.5);
	padding: 0;
	margin-left: 6px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	transition: color 0.15s ease;
}
.trading-card__tagline-edit-btn:hover {
	color: #ffffff;
}
.trading-card__tagline-edit-btn .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* Editor panel — sits over the role + tagline area when active. */
.trading-card__tagline-editor {
	padding: 6px 8px;
}
.trading-card__tagline-input {
	width: 100%;
	background: rgba(15, 23, 42, 0.7);
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13px;
	font-family: inherit;
	line-height: 1.4;
	resize: none;
}
.trading-card__tagline-input:focus {
	outline: none;
	border-color: rgba(255, 255, 255, 0.5);
}
.trading-card__tagline-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 6px;
	font-size: 11px;
}
.trading-card__tagline-count {
	flex: 1;
	text-align: left;
	color: rgba(248, 250, 252, 0.5);
}
.trading-card__tagline-count.is-near-limit {
	color: #fbbf24;
}
.trading-card__tagline-cancel,
.trading-card__tagline-save {
	font-size: 12px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	background: transparent;
	color: rgba(248, 250, 252, 0.85);
	cursor: pointer;
}
.trading-card__tagline-save {
	background: var(--rarity-2);
	color: #0b1220;
	border-color: var(--rarity-2);
	font-weight: 700;
}
.trading-card__tagline-save:disabled {
	opacity: 0.5;
	cursor: progress;
}
.trading-card__tagline-error {
	margin: 6px 0 0;
	font-size: 11px;
	color: #fca5a5;
}

/* ---------- Small variant (gallery cells) ---------- */
.trading-card--sm {
	--card-w: 100%;
	--card-h: 320px;
	--card-radius: 16px;
	--border-thickness: 3px;
}
.trading-card--sm .trading-card__body {
	padding: 14px 14px 12px;
}
.trading-card--sm .trading-card__avatar {
	width: 110px;
	height: 110px;
}
.trading-card--sm .trading-card__avatar-wrap {
	margin: 12px 0 8px;
}
.trading-card--sm .trading-card__name {
	font-size: 15px;
}
.trading-card--sm .trading-card__handle {
	font-size: 11px;
}
.trading-card--sm .trading-card__role {
	font-size: 11px;
	letter-spacing: 0.02em;
}
.trading-card--sm .trading-card__top {
	font-size: 9px;
}
.trading-card--sm .trading-card__bottom {
	display: none;
}
.trading-card--sm .trading-card__divider {
	margin: 10px 0 8px;
}
.trading-card--sm .trading-card__claimed-mark {
	width: 22px;
	height: 22px;
	top: calc(50% - 88px);
	right: calc(50% - 65px);
	border-width: 2px;
}
.trading-card--sm .trading-card__claimed-mark .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* ============================================================
 * Individual page actions + footer
 * ============================================================ */

.release-stage__actions {
	margin: 36px auto 0;
	max-width: 540px;
	text-align: center;
}

.release-stage__claim {
	padding: 24px 24px 20px;
	background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
	border: 1px solid var(--border-default, #e2e8f0);
	border-radius: 16px;
}
.release-stage__claim-text {
	margin: 0 0 14px;
	font-size: 15px;
	color: var(--color-text, #0f172a);
	font-weight: 600;
}
.release-stage__claim-btn {
	display: inline-block;
	background: var(--color-brand, #2145e6);
	color: #ffffff;
	padding: 14px 28px;
	border-radius: 12px;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
	transition: transform 0.15s ease, background 0.15s ease;
	box-shadow: 0 8px 24px rgba(33, 69, 230, 0.25);
}
.release-stage__claim-btn:hover {
	background: #1a37b8;
	transform: translateY(-1px);
}
.release-stage__claim-meta {
	margin: 14px 0 0;
	font-size: 12px;
	color: var(--color-muted, #64748b);
}
.release-stage__claim-existing {
	margin: 8px 0 0;
	font-size: 12px;
	color: var(--color-muted, #64748b);
}
.release-stage__claim-existing a {
	color: var(--color-brand, #2145e6);
	font-weight: 600;
	text-decoration: none;
}
.release-stage__claim-existing a:hover {
	text-decoration: underline;
}

.release-stage__claimed-note {
	margin-top: 18px;
	font-size: 13px;
	color: var(--color-muted, #64748b);
}

/* 1.22.510 — "Preview your share card" block + divider. Sits between
 * the tagline editor and the inline share buttons so folks understand
 * the share link lands on a dedicated full-screen card page (not the
 * current /wp{NN}/{user}/ in-site URL). Gives the owner a clear
 * "see what gets shared" path after they customize. */
.release-stage__share-preview {
	max-width: 460px;
	margin: 0 auto 18px;
	padding: 22px 24px;
	text-align: center;
	background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
	border: 1px solid color-mix(in srgb, var(--color-brand, #2145e6) 22%, transparent);
	border-radius: 14px;
}
.release-stage__share-preview-label {
	margin: 0 0 10px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--color-brand, #2145e6);
}
.release-stage__share-preview-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	background: var(--color-brand, #2145e6);
	color: #ffffff;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 10px 24px rgba(33, 69, 230, 0.25);
	transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.release-stage__share-preview-btn:hover {
	background: #1a37b8;
	transform: translateY(-2px);
	box-shadow: 0 14px 28px rgba(33, 69, 230, 0.32);
}
.release-stage__share-preview-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}
.release-stage__share-preview-hint {
	margin: 12px 0 0;
	font-size: 12px;
	color: var(--color-muted, #64748b);
	line-height: 1.5;
}

.release-stage__share-divider {
	max-width: 460px;
	margin: 4px auto 14px;
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--color-muted, #64748b);
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}
.release-stage__share-divider::before,
.release-stage__share-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--border-default, #e2e8f0);
}
.release-stage__share-divider span {
	flex: none;
}

.release-stage__footer {
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid var(--border-default, #e2e8f0);
	font-size: 13px;
	color: var(--color-muted, #64748b);
	line-height: 1.6;
	text-align: center;
}
.release-stage__footer p {
	margin: 0 0 8px;
}
.release-stage__footer a {
	color: var(--color-brand, #2145e6);
	text-decoration: underline;
}

/* ---------- Share buttons (claimed cards) ---------- */
.release-share {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	position: relative;
}
.release-share__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	border: 1px solid var(--border-default, #e2e8f0);
	background: #ffffff;
	color: var(--color-text, #0f172a);
	transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.release-share__btn:hover {
	background: #f1f5f9;
	border-color: var(--color-brand, #2145e6);
	transform: translateY(-1px);
}
.release-share__btn--x span:first-child {
	font-size: 16px;
	font-weight: 800;
	line-height: 1;
}
.release-share__btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}
.release-share__toast {
	position: absolute;
	top: calc(100% + 12px);
	left: 50%;
	transform: translateX(-50%);
	padding: 8px 14px;
	background: rgba(15, 23, 42, 0.92);
	color: #ffffff;
	border-radius: 8px;
	font-size: 12px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}
.release-share__toast--visible {
	opacity: 1;
}

/* ============================================================
 * Gallery
 * ============================================================ */

.release-gallery__header {
	text-align: center;
	margin-bottom: 36px;
}
.release-gallery__title {
	font-size: 36px;
	font-weight: 800;
	margin: 0 0 8px;
	color: var(--color-text, #0f172a);
}
.release-gallery__sub {
	margin: 0;
	font-size: 15px;
	color: var(--color-muted, #64748b);
}

.release-gallery__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 18px;
}

.release-gallery__pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 36px;
	flex-wrap: wrap;
}
.release-gallery__page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 12px;
	border-radius: 8px;
	border: 1px solid var(--border-default, #e2e8f0);
	background: #ffffff;
	color: var(--color-text, #0f172a);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
.release-gallery__page:hover {
	border-color: var(--color-brand, #2145e6);
	color: var(--color-brand, #2145e6);
}
.release-gallery__page--current {
	background: var(--color-brand, #2145e6);
	color: #ffffff;
	border-color: var(--color-brand, #2145e6);
}

.release-gallery__footer {
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid var(--border-default, #e2e8f0);
	font-size: 13px;
	color: var(--color-muted, #64748b);
	text-align: center;
}
.release-gallery__footer a {
	color: var(--color-brand, #2145e6);
	text-decoration: underline;
}

.release-gallery__empty {
	text-align: center;
	padding: 60px 20px;
	color: var(--color-muted, #64748b);
}

/* 1.22.544 — Search bar above the contributor grid. Filters the
 * inline JSON index client-side so even 1000+ folks are findable
 * instantly. The clear button + meta line + results container all
 * sit above the original grid and swap visibility based on input
 * state. */
.release-gallery__search {
	position: relative;
	max-width: 560px;
	margin: 0 auto 14px;
}
.release-gallery__search-icon {
	position: absolute;
	top: 50%;
	left: 14px;
	transform: translateY(-50%);
	color: var(--color-muted, #64748b);
	pointer-events: none;
}
.release-gallery__search-input {
	width: 100%;
	padding: 12px 44px 12px 42px;
	font-size: 15px;
	color: var(--color-text, #0f172a);
	background: var(--color-surface, #ffffff);
	border: 1px solid var(--border-default, #e2e8f0);
	border-radius: 999px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.release-gallery__search-input:focus {
	outline: none;
	border-color: var(--color-brand, #2145e6);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand, #2145e6) 18%, transparent);
}
.release-gallery__search-input::-webkit-search-cancel-button { display: none; }
.release-gallery__search-clear {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-size: 22px;
	line-height: 1;
	color: var(--color-muted, #64748b);
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}
.release-gallery__search-clear:hover {
	background: var(--color-surface-muted, #f1f5f9);
	color: var(--color-text, #0f172a);
}
.release-gallery__search-meta {
	max-width: 560px;
	margin: 0 auto 18px;
	font-size: 12px;
	color: var(--color-muted, #64748b);
	text-align: center;
	letter-spacing: 0.02em;
}
.release-gallery__results {
	display: grid;
	/* 1.22.576 — Cap at 4 columns. `repeat(auto-fill, minmax(170px,
	 * 1fr))` was producing 5 cards on wider viewports; lock the
	 * grid to 4 explicit columns so the results sit at a slightly
	 * larger card size matching the rest of the gallery. Below
	 * 720px the responsive override drops columns naturally. */
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 32px;
}
@media (max-width: 960px) {
	.release-gallery__results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
	.release-gallery__results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
	.release-gallery__results { grid-template-columns: 1fr; }
}
.release-gallery__no-match {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px 20px;
	color: var(--color-muted, #64748b);
	font-size: 14px;
}

/* 1.22.542 — Pre-release window. Active release URL renders this
 * block instead of 404 when wp.org hasn't published the credits
 * roster yet. Friendly "launching soon" CTA back to the previous
 * release archive. */
.release-gallery__pre-release {
	max-width: 560px;
	margin: 40px auto 80px;
	padding: 32px 28px;
	text-align: center;
	background: var(--color-surface, #ffffff);
	border: 1px solid var(--border-default, #e2e8f0);
	border-radius: 12px;
}
.release-gallery__pre-release-msg {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--color-text, #0f172a);
}
.release-gallery__pre-release-actions {
	margin: 0;
}
.release-gallery__pre-release-cta {
	display: inline-flex;
	align-items: center;
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 600;
	color: #ffffff;
	background: var(--color-brand, #2145e6);
	border-radius: 999px;
	text-decoration: none;
	transition: filter 0.15s ease, transform 0.15s ease;
}
.release-gallery__pre-release-cta:hover {
	filter: brightness(1.08);
	transform: translateY(-1px);
	color: #ffffff;
	text-decoration: none;
}

.release-error {
	max-width: 600px;
	margin: 80px auto;
	text-align: center;
	color: var(--color-muted, #64748b);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
	.release-stage,
	.release-gallery {
		padding: 32px 14px 60px;
	}
	.trading-card {
		--card-w: 100%;
		max-width: 320px;
		margin-left: auto;
		margin-right: auto;
	}
	.release-gallery__title {
		font-size: 26px;
	}
	.release-gallery__grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: 12px;
	}
	.trading-card--sm {
		--card-h: 280px;
	}
	.trading-card--sm .trading-card__avatar {
		width: 90px;
		height: 90px;
	}
}
