/* ==========================================================================
   Canary Design System — Components
   Buttons, icon buttons, section titles, dividers, ornaments, cards, forms,
   modals, navigation primitives (links, tabs, pagination, slider controls),
   tags, tables.

   Conventions
   - BEM-ish: .block, .block__element, .block--modifier, state: .is-*
   - Ornaments are CSS gradients / masks or inline SVG. No raster images.
   - All values come from tokens.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Icons (inline SVG sprite <use href="#i-name">)
   -------------------------------------------------------------------------- */
.icon {
	width: 1em;
	height: 1em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icon--fill {
	fill: currentColor;
	stroke: none;
}

.icon--sm {
	width: 14px;
	height: 14px;
}

.icon--md {
	width: 18px;
	height: 18px;
}

.icon--lg {
	width: 24px;
	height: 24px;
}

.icon--xl {
	width: 36px;
	height: 36px;
	stroke-width: 1.25;
}

/* Ornamental glyph: gold by default */
.glyph {
	color: var(--gold-primary);
}

/* --------------------------------------------------------------------------
   Corner brackets — shared ornament technique (8 gradient layers, 4 corners)
   Used by buttons (outer ornament), cards and modals.
   -------------------------------------------------------------------------- */
.corners {
	position: relative;
}

.corners::after,
.fbtn__ornament,
.fcard__corners {
	--corner-color: var(--border-ornament);
	--corner-len: 14px;
	content: "";
	position: absolute;
	inset: var(--corner-inset, 0);
	pointer-events: none;
	background-image:
		linear-gradient(var(--corner-color), var(--corner-color)),
		linear-gradient(var(--corner-color), var(--corner-color)),
		linear-gradient(var(--corner-color), var(--corner-color)),
		linear-gradient(var(--corner-color), var(--corner-color)),
		linear-gradient(var(--corner-color), var(--corner-color)),
		linear-gradient(var(--corner-color), var(--corner-color)),
		linear-gradient(var(--corner-color), var(--corner-color)),
		linear-gradient(var(--corner-color), var(--corner-color));
	background-position:
		left top, left top,
		right top, right top,
		left bottom, left bottom,
		right bottom, right bottom;
	background-size:
		var(--corner-len) 1px, 1px var(--corner-len),
		var(--corner-len) 1px, 1px var(--corner-len),
		var(--corner-len) 1px, 1px var(--corner-len),
		var(--corner-len) 1px, 1px var(--corner-len);
	background-repeat: no-repeat;
}

/* --------------------------------------------------------------------------
   FantasyButton  (.fbtn)
   Anatomy:
     <a class="fbtn fbtn--outlined">
       <span class="fbtn__ornament" aria-hidden="true"></span>  outer brackets (hover)
       <svg class="icon fbtn__icon">…</svg>                       optional
       <span class="fbtn__label">Label</span>
     </a>
   ::before  → frame / fill (interrupted lines or chamfered fill)
   ::after   → four corner diamonds (mask)
   -------------------------------------------------------------------------- */
.fbtn {
	/* per-variant knobs */
	--fbtn-fg: var(--gold-primary);
	--fbtn-fg-hover: var(--gold-bright);
	--fbtn-line: var(--border-ornament);
	--fbtn-line-hover: var(--border-ornament-bright);
	--fbtn-fill: transparent;
	--fbtn-fill-hover: rgb(var(--gold-rgb) / 0.06);
	--fbtn-gap: 12px;
	--fbtn-gap-hover: 5px;
	--fbtn-diamond: var(--gold-primary);
	--fbtn-cut: 0px;

	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--spacing-sm);
	min-height: var(--button-height);
	min-width: var(--button-min-width);
	padding: 0 calc(var(--spacing-lg) + var(--spacing-sm));
	font-family: var(--font-ui);
	font-size: var(--text-button);
	font-weight: var(--weight-ui);
	letter-spacing: var(--tracking-button);
	text-transform: uppercase;
	line-height: 1;
	color: var(--fbtn-fg);
	text-decoration: none;
	white-space: nowrap;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	isolation: isolate;
	transition:
		color var(--duration-fast) var(--ease-cine),
		transform var(--duration-fast) var(--ease-cine);
}

.fbtn__label {
	position: relative;
	z-index: 2;
	transform: translateZ(0);
}

.fbtn__icon {
	position: relative;
	z-index: 2;
	width: 16px;
	height: 16px;
	transition: transform var(--duration-base) var(--ease-cine);
}

.fbtn:hover .fbtn__icon--arrow {
	transform: translateX(3px);
}

/* Frame (outlined construction) */
.fbtn::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-color: var(--fbtn-fill);
	background-image:
		linear-gradient(var(--fbtn-line), var(--fbtn-line)),
		linear-gradient(var(--fbtn-line), var(--fbtn-line)),
		linear-gradient(var(--fbtn-line), var(--fbtn-line)),
		linear-gradient(var(--fbtn-line), var(--fbtn-line)),
		var(--texture-hairline);
	background-position: center top, center bottom, left center, right center, 0 0;
	background-size:
		calc(100% - var(--fbtn-gap) * 2) 1px,
		calc(100% - var(--fbtn-gap) * 2) 1px,
		1px calc(100% - var(--fbtn-gap) * 2),
		1px calc(100% - var(--fbtn-gap) * 2),
		auto;
	background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
	transition:
		background-size var(--duration-base) var(--ease-cine),
		background-color var(--duration-base) var(--ease-cine),
		filter var(--duration-base) var(--ease-cine);
}

/* Corner diamonds */
.fbtn::after {
	content: "";
	position: absolute;
	inset: -3px;
	z-index: 1;
	pointer-events: none;
	background-color: var(--fbtn-diamond);
	-webkit-mask-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0 10 5 5 10 0 5Z'/%3E%3C/svg%3E"),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0 10 5 5 10 0 5Z'/%3E%3C/svg%3E"),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0 10 5 5 10 0 5Z'/%3E%3C/svg%3E"),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0 10 5 5 10 0 5Z'/%3E%3C/svg%3E");
	mask-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0 10 5 5 10 0 5Z'/%3E%3C/svg%3E"),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0 10 5 5 10 0 5Z'/%3E%3C/svg%3E"),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0 10 5 5 10 0 5Z'/%3E%3C/svg%3E"),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0 10 5 5 10 0 5Z'/%3E%3C/svg%3E");
	-webkit-mask-position: left top, right top, left bottom, right bottom;
	mask-position: left top, right top, left bottom, right bottom;
	-webkit-mask-size: 7px 7px;
	mask-size: 7px 7px;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	opacity: 0.85;
	transition:
		opacity var(--duration-base) var(--ease-cine),
		background-color var(--duration-base) var(--ease-cine);
}

/* Outer ornament — corner brackets that appear on hover, slightly outside */
.fbtn__ornament {
	--corner-color: var(--fbtn-line-hover);
	--corner-len: 10px;
	--corner-inset: -7px;
	z-index: 0;
	opacity: 0;
	transform: scale(0.97);
	transition:
		opacity var(--duration-base) var(--ease-cine),
		transform var(--duration-base) var(--ease-cine);
}

.fbtn:hover,
.fbtn:focus-visible,
.fbtn.is-hover {
	color: var(--fbtn-fg-hover);
	transform: translateY(-1px) scale(1.005);
}

.fbtn:hover::before,
.fbtn:focus-visible::before,
.fbtn.is-hover::before {
	--fbtn-line: var(--fbtn-line-hover);
	background-color: var(--fbtn-fill-hover);
	background-size:
		calc(100% - var(--fbtn-gap-hover) * 2) 1px,
		calc(100% - var(--fbtn-gap-hover) * 2) 1px,
		1px calc(100% - var(--fbtn-gap-hover) * 2),
		1px calc(100% - var(--fbtn-gap-hover) * 2),
		auto;
}

.fbtn:hover::after,
.fbtn:focus-visible::after,
.fbtn.is-hover::after {
	opacity: 1;
}

.fbtn:hover .fbtn__ornament,
.fbtn:focus-visible .fbtn__ornament,
.fbtn.is-hover .fbtn__ornament {
	opacity: 1;
	transform: none;
}

.fbtn:active {
	transform: translateY(0) scale(0.995);
	transition-duration: 80ms;
}

/* — Variant: outlined (default construction)
   A whisper of ink behind the label keeps it legible over bright artwork
   while still reading as "almost transparent" on dark surfaces. */
.fbtn--outlined {
	--fbtn-fill: rgba(9, 9, 9, 0.34);
	--fbtn-fill-hover: rgba(14, 13, 10, 0.62);
}

/* — Variant: primary — molten gold, ink text, chamfered, hairline inner frame.
   A luminous brass gradient with a glossy crest and a warm halo; on hover the
   halo swells and a light sweep crosses the face once (background-position). */
.fbtn--primary {
	--fbtn-fg: var(--gold-cta-ink);
	--fbtn-fg-hover: var(--gold-cta-ink);
	--fbtn-fill: var(--gold-cta);
	--fbtn-fill-hover: var(--gold-cta);
	--fbtn-line: rgba(70, 44, 8, 0.3);
	--fbtn-line-hover: rgba(70, 44, 8, 0.42);
	--fbtn-diamond: rgba(70, 44, 8, 0.55);
	--fbtn-gap: 9px;
	--fbtn-gap-hover: 9px;
	--fbtn-cut: var(--cut-sm);
	--fbtn-sweep-x: -60%;
	font-weight: 700;
	text-shadow: 0 1px 0 rgba(255, 244, 214, 0.45);
	box-shadow:
		0 10px 28px -10px rgb(var(--gold-cta-rgb) / 0.55),
		0 0 0 0 rgb(var(--gold-cta-rgb) / 0);
	transition:
		color var(--duration-fast) var(--ease-cine),
		transform var(--duration-fast) var(--ease-cine),
		box-shadow var(--duration-base) var(--ease-cine);
}

.fbtn--primary:hover,
.fbtn--primary:focus-visible,
.fbtn--primary.is-hover {
	--fbtn-sweep-x: 160%;
	box-shadow:
		0 14px 36px -10px rgb(var(--gold-cta-rgb) / 0.7),
		0 0 26px 2px rgb(var(--gold-cta-rgb) / 0.28);
}

.fbtn--primary::before {
	background-image:
		linear-gradient(var(--fbtn-line), var(--fbtn-line)),
		linear-gradient(var(--fbtn-line), var(--fbtn-line)),
		linear-gradient(var(--fbtn-line), var(--fbtn-line)),
		linear-gradient(var(--fbtn-line), var(--fbtn-line)),
		/* light sweep (moves on hover) */
		linear-gradient(105deg, rgba(255, 252, 240, 0) 38%, rgba(255, 252, 240, 0.55) 50%, rgba(255, 252, 240, 0) 62%),
		/* glossy crest */
		linear-gradient(180deg, rgba(255, 250, 230, 0.34) 0%, rgba(255, 250, 230, 0.1) 40%, rgba(255, 250, 230, 0) 52%, rgba(60, 36, 4, 0.08) 100%),
		/* molten body */
		linear-gradient(180deg, var(--gold-cta-top) 0%, var(--gold-cta) 58%, var(--gold-cta-deep) 100%);
	clip-path: polygon(
		var(--fbtn-cut) 0,
		calc(100% - var(--fbtn-cut)) 0,
		100% var(--fbtn-cut),
		100% calc(100% - var(--fbtn-cut)),
		calc(100% - var(--fbtn-cut)) 100%,
		var(--fbtn-cut) 100%,
		0 calc(100% - var(--fbtn-cut)),
		0 var(--fbtn-cut)
	);
	/* inner double line sits 4px inside the fill */
	background-position:
		center 4px,
		center calc(100% - 4px),
		4px center,
		calc(100% - 4px) center,
		var(--fbtn-sweep-x) 0,
		0 0,
		0 0;
	background-size:
		calc(100% - var(--fbtn-gap) * 2 - 8px) 1px,
		calc(100% - var(--fbtn-gap) * 2 - 8px) 1px,
		1px calc(100% - var(--fbtn-gap) * 2 - 8px),
		1px calc(100% - var(--fbtn-gap) * 2 - 8px),
		45% 100%,
		auto,
		auto;
	background-repeat: no-repeat;
	transition:
		background-position 0s,
		filter var(--duration-base) var(--ease-cine);
}

.fbtn--primary:hover::before,
.fbtn--primary:focus-visible::before,
.fbtn--primary.is-hover::before {
	background-size:
		calc(100% - var(--fbtn-gap) * 2 - 8px) 1px,
		calc(100% - var(--fbtn-gap) * 2 - 8px) 1px,
		1px calc(100% - var(--fbtn-gap) * 2 - 8px),
		1px calc(100% - var(--fbtn-gap) * 2 - 8px),
		45% 100%,
		auto,
		auto;
	filter: brightness(1.06) saturate(1.06);
	/* the sweep only animates on the way in; it snaps back when the pointer leaves */
	transition:
		background-position 700ms var(--ease-cine),
		filter var(--duration-base) var(--ease-cine);
}

.fbtn--primary::after {
	inset: 6px;
	-webkit-mask-size: 4px 4px;
	mask-size: 4px 4px;
	opacity: 0.4;
}

.fbtn--primary:hover::after,
.fbtn--primary.is-hover::after {
	opacity: 0.75;
}

.fbtn--primary .fbtn__ornament {
	--corner-color: rgb(var(--gold-cta-rgb) / 0.8);
}

.fbtn--primary:active {
	box-shadow: 0 6px 18px -8px rgb(var(--gold-cta-rgb) / 0.5);
}

/* — Variant: secondary — dark elevated fill with muted brass lines */
.fbtn--secondary {
	--fbtn-fg: var(--text-primary);
	--fbtn-fg-hover: var(--gold-bright);
	--fbtn-fill: var(--surface-elevated);
	--fbtn-fill-hover: #1c1a13;
	--fbtn-line: rgb(var(--gold-rgb) / 0.32);
	--fbtn-line-hover: var(--border-ornament-bright);
	--fbtn-diamond: var(--gold-muted);
}

/* — Variant: ghost — text only, ornament reveals on hover */
.fbtn--ghost {
	--fbtn-fg: var(--text-secondary);
	--fbtn-fg-hover: var(--gold-bright);
	--fbtn-fill-hover: transparent;
	min-width: 0;
	padding-inline: var(--spacing-md);
}

.fbtn--ghost::before {
	background-image: none;
}

.fbtn--ghost::after {
	/* two diamonds flanking the label, appearing on hover */
	inset: 0;
	-webkit-mask-position: left center, right center, left center, right center;
	mask-position: left center, right center, left center, right center;
	-webkit-mask-size: 6px 6px;
	mask-size: 6px 6px;
	opacity: 0;
	transform: scaleX(1.15);
	transition:
		opacity var(--duration-base) var(--ease-cine),
		transform var(--duration-base) var(--ease-cine);
}

.fbtn--ghost:hover::after,
.fbtn--ghost.is-hover::after {
	opacity: 1;
	transform: none;
}

.fbtn--ghost .fbtn__ornament {
	display: none;
}

/* — Variant: danger — outlined construction in blood red */
.fbtn--danger {
	--fbtn-fg: #e4b8b8;
	--fbtn-fg-hover: #fff;
	--fbtn-line: var(--border-danger);
	--fbtn-line-hover: var(--blood-bright);
	--fbtn-fill-hover: rgb(var(--blood-rgb) / 0.14);
	--fbtn-diamond: var(--blood-bright);
}

/* — Variant: icon-only square (used in toolbars) */
.fbtn--square {
	min-width: var(--button-height);
	width: var(--button-height);
	padding: 0;
}

/* — Sizes */
.fbtn--sm {
	min-height: var(--button-height-sm);
	min-width: 0;
	padding-inline: var(--spacing-lg);
	font-size: 0.75rem;
	--fbtn-gap: 9px;
	--fbtn-gap-hover: 4px;
}

.fbtn--sm .fbtn__ornament {
	--corner-inset: -6px;
	--corner-len: 8px;
}

.fbtn--block {
	display: flex;
	width: 100%;
}

/* — States */
.fbtn:disabled,
.fbtn.is-disabled,
.fbtn[aria-disabled="true"] {
	opacity: 0.38;
	pointer-events: none;
	cursor: not-allowed;
	filter: saturate(0.4);
}

.fbtn--loading .fbtn__label {
	opacity: 0.5;
}

/* Button group */
.fbtn-group {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-md) var(--spacing-lg);
	align-items: center;
}

/* --------------------------------------------------------------------------
   FantasyIconButton  (.ficon-btn)
   -------------------------------------------------------------------------- */
.ficon-btn {
	--ficon-size: var(--icon-button-size);
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--ficon-size);
	height: var(--ficon-size);
	border-radius: var(--radius-round);
	border: 1px solid rgb(var(--gold-rgb) / 0.3);
	background: var(--surface-glass);
	color: var(--text-primary);
	-webkit-tap-highlight-color: transparent;
	transition:
		border-color var(--duration-base) var(--ease-cine),
		color var(--duration-base) var(--ease-cine),
		background-color var(--duration-base) var(--ease-cine),
		transform var(--duration-fast) var(--ease-cine);
}

.ficon-btn .icon {
	width: 40%;
	height: 40%;
	transition: transform var(--duration-base) var(--ease-cine);
}

/* inner ring — the "micro internal animation" */
.ficon-btn::before {
	content: "";
	position: absolute;
	inset: 4px;
	border-radius: inherit;
	border: 1px solid rgb(var(--gold-rgb) / 0.35);
	opacity: 0;
	transform: scale(0.82);
	transition:
		opacity var(--duration-base) var(--ease-cine),
		transform var(--duration-base) var(--ease-cine);
}

/* outer halo */
.ficon-btn::after {
	content: "";
	position: absolute;
	inset: -1px;
	border-radius: inherit;
	box-shadow: var(--glow-gold);
	opacity: 0;
	transition: opacity var(--duration-base) var(--ease-cine);
}

.ficon-btn:hover,
.ficon-btn:focus-visible,
.ficon-btn.is-hover {
	border-color: var(--gold-primary);
	color: var(--gold-bright);
	background: rgba(9, 9, 9, 0.85);
}

.ficon-btn:hover::before,
.ficon-btn:focus-visible::before,
.ficon-btn.is-hover::before {
	opacity: 1;
	transform: scale(1);
}

.ficon-btn:hover::after,
.ficon-btn.is-hover::after {
	opacity: 1;
}

.ficon-btn:hover .icon {
	transform: scale(1.06);
}

.ficon-btn:active {
	transform: scale(0.96);
}

.ficon-btn.is-active,
.ficon-btn[aria-pressed="true"] {
	background: var(--gold-primary);
	border-color: var(--gold-primary);
	color: var(--text-inverse);
}

.ficon-btn.is-active::before {
	border-color: rgba(9, 9, 9, 0.3);
	opacity: 1;
	transform: none;
}

.ficon-btn--sm {
	--ficon-size: var(--icon-button-size-sm);
}

.ficon-btn--ghost {
	border-color: transparent;
	background: transparent;
}

.ficon-btn--danger:hover {
	border-color: var(--blood-bright);
	color: #fff;
}

.ficon-btn--danger:hover::after {
	box-shadow: var(--glow-blood);
}

.ficon-btn:disabled {
	opacity: 0.35;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   SectionTitle  (.section-title)
   -------------------------------------------------------------------------- */
.section-title {
	--st-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--spacing-md);
	text-align: center;
	margin-bottom: var(--spacing-2xl);
}

.section-title--left {
	align-items: flex-start;
	text-align: left;
}

.section-title__eyebrow {
	order: 0;
}

/* Top rule — ───◇ EYEBROW ◇─── — mirrors the ornament below the heading */
.section-title__rule {
	order: 0;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: var(--spacing-md);
	width: min(100%, 620px);
	color: var(--gold-muted);
}

.section-title__rule .section-title__line {
	background: linear-gradient(90deg, transparent, var(--border-ornament) 55%, var(--border-ornament));
}

.section-title__rule .section-title__line:last-child {
	background: linear-gradient(90deg, var(--border-ornament), var(--border-ornament) 45%, transparent);
}

.section-title__rule .section-title__eyebrow {
	position: relative;
	padding: 0 var(--spacing-xs);
}

.section-title__rule .section-title__eyebrow::before,
.section-title__rule .section-title__eyebrow::after,
.section-title__dot {
	content: "";
	display: inline-block;
	width: 5px;
	height: 5px;
	background: currentColor;
	transform: rotate(45deg);
	opacity: 0.8;
}

.section-title__rule .section-title__eyebrow::before {
	margin-right: var(--spacing-xs);
}

.section-title__rule .section-title__eyebrow::after {
	margin-left: var(--spacing-xs);
}

.section-title__heading {
	order: 1;
	margin: 0;
}

.section-title__ornament {
	order: 2;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: var(--spacing-sm);
	width: min(100%, 520px);
	color: var(--gold-primary);
}

.section-title--left .section-title__ornament {
	width: min(100%, 360px);
	grid-template-columns: auto auto 1fr;
}

.section-title__line {
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--border-ornament) 35%, var(--border-ornament));
}

.section-title__line:last-child {
	background: linear-gradient(90deg, var(--border-ornament), var(--border-ornament) 65%, transparent);
}

.section-title--left .section-title__line:first-child {
	width: 28px;
	background: var(--border-ornament);
}

.section-title__glyph {
	width: 92px;
	height: 14px;
	color: var(--gold-primary);
	fill: none;
	stroke: currentColor;
	stroke-width: 1;
}

.section-title__glyph .fill {
	fill: currentColor;
	stroke: none;
}

.section-title__lede {
	order: 3;
	max-width: 56ch;
	margin: var(--spacing-sm) 0 0;
	color: var(--text-secondary);
}

/* ornament above heading */
.section-title--above .section-title__ornament {
	order: 0;
}

.section-title--above .section-title__eyebrow,
.section-title--above .section-title__rule {
	order: 1;
}

/* the glyph ornament already sits above; keep the rule to its eyebrow only */
.section-title--above .section-title__rule {
	width: auto;
	grid-template-columns: auto;
}

.section-title--above .section-title__rule .section-title__line,
.section-title--above .section-title__rule .section-title__dot {
	display: none;
}

.section-title--above .section-title__heading {
	order: 2;
}

/* hero scale */
.section-title--hero .section-title__heading {
	font-size: var(--text-h1);
}

.section-title--hero .section-title__ornament {
	width: min(100%, 680px);
}

.section-title--hero .section-title__glyph {
	width: 132px;
	height: 18px;
}

/* --------------------------------------------------------------------------
   OrnamentalDivider  (.divider)
   -------------------------------------------------------------------------- */
.divider {
	--divider-color: var(--border-ornament);
	position: relative;
	display: grid;
	grid-template-columns: 1fr;
	align-items: center;
	gap: var(--spacing-md);
	width: 100%;
	margin: var(--spacing-2xl) auto;
	color: var(--gold-primary);
}

.divider--subtle {
	height: 1px;
	margin-block: var(--spacing-xl);
	background: linear-gradient(90deg, transparent, var(--border-default) 20%, var(--border-default) 80%, transparent);
}

.divider--standard,
.divider--hero {
	grid-template-columns: 1fr auto 1fr;
}

.divider__line {
	position: relative;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--divider-color) 30%, var(--divider-color));
}

.divider__line:last-child {
	background: linear-gradient(90deg, var(--divider-color), var(--divider-color) 70%, transparent);
}

/* hero: second hairline offset beneath and a faint grunge break */
.divider--hero {
	margin-block: var(--section-gap-sm);
}

.divider--hero .divider__line::after {
	content: "";
	position: absolute;
	inset: 4px 0 auto 0;
	height: 1px;
	background: inherit;
	opacity: 0.35;
	-webkit-mask-image: repeating-linear-gradient(90deg, #000 0 40px, transparent 40px 54px);
	mask-image: repeating-linear-gradient(90deg, #000 0 40px, transparent 40px 54px);
}

.divider__glyph {
	color: inherit;
	fill: none;
	stroke: currentColor;
	stroke-width: 1;
	width: 56px;
	height: 12px;
}

.divider__glyph .fill {
	fill: currentColor;
	stroke: none;
}

.divider--hero .divider__glyph {
	width: 120px;
	height: 26px;
}

.divider--blood {
	--divider-color: var(--border-danger);
	color: var(--blood-bright);
}

/* --------------------------------------------------------------------------
   Tags / badges
   -------------------------------------------------------------------------- */
.ftag {
	display: inline-flex;
	align-items: center;
	gap: var(--spacing-xs);
	height: 24px;
	padding: 0 10px;
	border: 1px solid var(--border-strong);
	font-family: var(--font-ui);
	font-size: 0.6875rem;
	font-weight: var(--weight-ui);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--gold-primary);
	background: rgba(9, 9, 9, 0.6);
	clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}

.ftag--danger {
	border-color: var(--border-danger);
	color: #f0c9c9;
	background: rgb(var(--blood-rgb) / 0.22);
}

.ftag--success {
	border-color: rgba(127, 156, 106, 0.5);
	color: #cfe0c4;
	background: rgba(127, 156, 106, 0.16);
}

.ftag--solid {
	background: var(--gold-primary);
	color: var(--text-inverse);
	border-color: var(--gold-primary);
}

.ftag--muted {
	color: var(--text-secondary);
	border-color: var(--border-default);
}

/* Status dot (online/offline) */
.status-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--success);
	box-shadow: 0 0 0 3px rgba(127, 156, 106, 0.18);
}

.status-dot--offline {
	background: var(--blood-bright);
	box-shadow: 0 0 0 3px rgb(var(--blood-rgb) / 0.2);
}

/* --------------------------------------------------------------------------
   Cards  (.fcard)
   Cards only where semantically justified: news, characters, bosses, features.
   -------------------------------------------------------------------------- */
.fcard {
	--fcard-gap: 16px;
	--fcard-gap-hover: 6px;
	--fcard-line: var(--border-default);
	--fcard-line-hover: var(--border-ornament);
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--surface-dark);
	color: var(--text-primary);
	isolation: isolate;
	transition: transform var(--duration-slow) var(--ease-cine);
}

/* interrupted frame */
.fcard::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	background-image:
		linear-gradient(var(--fcard-line), var(--fcard-line)),
		linear-gradient(var(--fcard-line), var(--fcard-line)),
		linear-gradient(var(--fcard-line), var(--fcard-line)),
		linear-gradient(var(--fcard-line), var(--fcard-line));
	background-position: center top, center bottom, left center, right center;
	background-size:
		calc(100% - var(--fcard-gap) * 2) 1px,
		calc(100% - var(--fcard-gap) * 2) 1px,
		1px calc(100% - var(--fcard-gap) * 2),
		1px calc(100% - var(--fcard-gap) * 2);
	background-repeat: no-repeat;
	transition: background-size var(--duration-slow) var(--ease-cine);
}

.fcard__corners {
	--corner-inset: -1px;
	--corner-len: 12px;
	--corner-color: var(--border-ornament-bright);
	z-index: 4;
	opacity: 0;
	transition: opacity var(--duration-slow) var(--ease-cine);
}

.fcard__link {
	display: flex;
	flex-direction: column;
	flex: 1;
	color: inherit;
	text-decoration: none;
}

.fcard__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: var(--bg-deep);
}

.fcard__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.001);
	transition: transform var(--duration-xslow) var(--ease-cine);
}

.fcard__media-shade {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(9, 9, 9, 0) 45%, var(--surface-dark) 100%),
		linear-gradient(180deg, rgba(9, 9, 9, 0.25), rgba(9, 9, 9, 0) 40%);
	opacity: 0.95;
	transition: opacity var(--duration-slow) var(--ease-cine);
}

.fcard__tag {
	position: absolute;
	top: var(--spacing-md);
	left: var(--spacing-md);
	z-index: 2;
}

.fcard__body {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-sm);
	padding: var(--spacing-lg);
	flex: 1;
}

.fcard__meta {
	color: var(--gold-muted);
}

.fcard__title {
	font-family: var(--font-display);
	font-size: var(--text-h3);
	font-weight: var(--weight-heading);
	letter-spacing: 0.04em;
	line-height: var(--leading-tight);
	color: var(--text-primary);
	transition:
		transform var(--duration-slow) var(--ease-cine),
		color var(--duration-slow) var(--ease-cine);
}

.fcard__text {
	color: var(--text-secondary);
	font-size: var(--text-small);
	line-height: 1.55;
}

.fcard__cta {
	display: inline-flex;
	align-items: center;
	gap: var(--spacing-sm);
	margin-top: auto;
	padding-top: var(--spacing-md);
	font-family: var(--font-ui);
	font-size: 0.75rem;
	font-weight: var(--weight-ui);
	letter-spacing: var(--tracking-button);
	text-transform: uppercase;
	color: var(--gold-primary);
}

.fcard__cta .icon {
	transition: transform var(--duration-base) var(--ease-cine);
}

/* hover choreography */
.fcard:hover,
.fcard:focus-within,
.fcard.is-hover {
	--fcard-line: var(--fcard-line-hover);
}

.fcard:hover::before,
.fcard:focus-within::before,
.fcard.is-hover::before {
	background-size:
		calc(100% - var(--fcard-gap-hover) * 2) 1px,
		calc(100% - var(--fcard-gap-hover) * 2) 1px,
		1px calc(100% - var(--fcard-gap-hover) * 2),
		1px calc(100% - var(--fcard-gap-hover) * 2);
}

.fcard:hover .fcard__corners,
.fcard:focus-within .fcard__corners,
.fcard.is-hover .fcard__corners {
	opacity: 1;
}

.fcard:hover .fcard__media img,
.fcard.is-hover .fcard__media img {
	transform: scale(1.035);
}

.fcard:hover .fcard__media-shade,
.fcard.is-hover .fcard__media-shade {
	opacity: 0.8;
}

.fcard:hover .fcard__title,
.fcard.is-hover .fcard__title {
	transform: translateY(-3px);
	color: var(--gold-bright);
}

.fcard:hover .fcard__cta .icon,
.fcard.is-hover .fcard__cta .icon {
	transform: translateX(4px);
}

/* — Character card: portrait media, name overlaid on the image */
.fcard--character .fcard__media {
	aspect-ratio: 3 / 4;
	background: radial-gradient(ellipse at 50% 35%, #1a1913 0%, var(--bg-deep) 75%);
}

.fcard--character .fcard__media img {
	object-fit: contain;
	padding: var(--spacing-lg) var(--spacing-lg) 0;
	filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.7));
}

.fcard--character .fcard__media-shade {
	background: linear-gradient(180deg, rgba(9, 9, 9, 0) 55%, var(--surface-dark) 100%);
}

.fcard--character .fcard__body {
	margin-top: -64px;
	position: relative;
	z-index: 2;
	text-align: center;
	align-items: center;
	padding-top: 0;
}

.fcard--character .fcard__title {
	font-size: var(--text-h3);
	text-transform: uppercase;
}

.fcard__stats {
	display: flex;
	gap: var(--spacing-lg);
	margin-top: var(--spacing-sm);
	font-family: var(--font-ui);
	font-size: var(--text-caption);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--text-muted);
}

.fcard__stats > * {
	min-width: 0;
}

/* Values stay on one line (guild/world names can be long) and elide instead of wrapping */
.fcard__stats strong {
	display: block;
	max-width: 100%;
	font-family: var(--font-display);
	font-size: 1.125rem;
	letter-spacing: 0.04em;
	color: var(--gold-primary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* — Feature card: no media, icon-led, quiet frame */
.fcard--feature {
	--fcard-line: var(--border-subtle);
	background: transparent;
}

.fcard--feature .fcard__body {
	padding: var(--spacing-xl) var(--spacing-lg);
	gap: var(--spacing-md);
}

.fcard--feature .fcard__icon {
	width: 44px;
	height: 44px;
	color: var(--gold-primary);
	stroke-width: 1.1;
}

.fcard--feature .fcard__title {
	font-size: var(--text-h4);
	text-transform: uppercase;
}

/* — Boss card: pixel-art creature is the game content; surroundings stay refined */
.fcard--boss .fcard__media {
	aspect-ratio: 1 / 1;
	display: grid;
	place-items: center;
	background:
		radial-gradient(circle at 50% 55%, rgb(var(--blood-rgb) / 0.18) 0%, rgba(9, 9, 9, 0) 42%),
		radial-gradient(circle at 50% 50%, #15130f 0%, var(--bg-deep) 70%);
}

.fcard--boss .fcard__media img {
	width: 52%;
	height: auto;
	object-fit: contain;
	image-rendering: pixelated;
	filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.8));
	transition: transform var(--duration-xslow) var(--ease-cine);
}

.fcard--boss:hover .fcard__media img,
.fcard--boss.is-hover .fcard__media img {
	transform: scale(1.06) translateY(-3px);
}

.fcard--boss .fcard__media-shade {
	background: linear-gradient(180deg, rgba(9, 9, 9, 0) 60%, var(--surface-dark) 100%);
}

.fcard--boss .fcard__title {
	text-transform: uppercase;
}

/* Card grid helper */
.fcard-grid {
	display: grid;
	gap: var(--spacing-lg);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.ffield {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-sm);
}

.ffield__label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

.ffield__label small {
	letter-spacing: 0.04em;
	text-transform: none;
	color: var(--text-muted);
	font-weight: 400;
}

.ffield__hint {
	color: var(--text-muted);
}

.ffield.is-invalid .ffield__hint,
.ffield__error {
	color: #e39a9c;
}

.finput,
.fselect select,
.ftextarea {
	width: 100%;
	min-height: var(--input-height);
	padding: 0 var(--spacing-md);
	background: rgba(0, 0, 0, 0.55);
	border: 1px solid rgb(var(--gold-rgb) / 0.25);
	border-radius: var(--radius-sm);
	color: var(--text-primary);
	font-family: var(--font-body);
	font-size: var(--text-body);
	letter-spacing: var(--tracking-body);
	-webkit-appearance: none;
	appearance: none;
	transition:
		border-color var(--duration-base) var(--ease-cine),
		box-shadow var(--duration-base) var(--ease-cine),
		background-color var(--duration-base) var(--ease-cine);
}

.finput::placeholder,
.ftextarea::placeholder {
	color: var(--text-muted);
}

.finput:hover,
.fselect select:hover,
.ftextarea:hover {
	border-color: rgb(var(--gold-rgb) / 0.4);
}

.finput:focus,
.fselect select:focus,
.ftextarea:focus {
	outline: none;
	border-color: var(--gold-primary);
	box-shadow: var(--glow-gold-soft);
	background: rgba(0, 0, 0, 0.7);
}

.finput:disabled,
.fselect select:disabled,
.ftextarea:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.ffield.is-invalid .finput,
.ffield.is-invalid .fselect select,
.ffield.is-invalid .ftextarea,
.finput.is-invalid {
	border-color: var(--border-danger);
	box-shadow: 0 0 0 3px rgb(var(--blood-rgb) / 0.12);
}

.ftextarea {
	min-height: 140px;
	padding: var(--spacing-md);
	line-height: var(--leading-body);
	resize: vertical;
}

/* Select with custom chevron */
.fselect {
	position: relative;
}

.fselect select {
	padding-right: calc(var(--spacing-md) * 2 + 16px);
	cursor: pointer;
}

.fselect select option {
	background: var(--bg-secondary);
	color: var(--text-primary);
}

.fselect::after {
	content: "";
	position: absolute;
	right: var(--spacing-md);
	top: 50%;
	width: 14px;
	height: 14px;
	transform: translateY(-50%);
	background: var(--gold-primary);
	pointer-events: none;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform var(--duration-base) var(--ease-cine);
}

.fselect:focus-within::after {
	transform: translateY(-50%) rotate(180deg);
}

/* Input with leading icon */
.finput-wrap {
	position: relative;
}

.finput-wrap .icon {
	position: absolute;
	left: var(--spacing-md);
	top: 50%;
	transform: translateY(-50%);
	color: var(--gold-muted);
	pointer-events: none;
}

.finput-wrap .finput {
	padding-left: calc(var(--spacing-md) * 2 + 16px);
}

/* Checkbox & radio */
.fcheck,
.fradio {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: var(--spacing-sm) var(--spacing-md);
	cursor: pointer;
	color: var(--text-secondary);
	font-size: var(--text-small);
	user-select: none;
}

.fcheck input,
.fradio input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.fcheck__box,
.fradio__dot {
	position: relative;
	flex: none;
	width: var(--control-size);
	height: var(--control-size);
	border: 1px solid rgb(var(--gold-rgb) / 0.35);
	background: rgba(0, 0, 0, 0.55);
	transition:
		border-color var(--duration-fast) var(--ease-cine),
		box-shadow var(--duration-fast) var(--ease-cine);
}

.fradio__dot {
	border-radius: 50%;
}

.fcheck__box::after {
	/* diamond mark */
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 10px;
	height: 10px;
	background: var(--gold-primary);
	clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
	transform: scale(0);
	transition: transform var(--duration-fast) var(--ease-out-soft);
}

.fradio__dot::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--gold-primary);
	transform: scale(0);
	transition: transform var(--duration-fast) var(--ease-out-soft);
}

.fcheck:hover .fcheck__box,
.fradio:hover .fradio__dot {
	border-color: var(--gold-primary);
}

.fcheck input:checked ~ .fcheck__box,
.fradio input:checked ~ .fradio__dot {
	border-color: var(--gold-primary);
}

.fcheck input:checked ~ .fcheck__box::after,
.fradio input:checked ~ .fradio__dot::after {
	transform: scale(1);
}

.fcheck input:focus-visible ~ .fcheck__box,
.fradio input:focus-visible ~ .fradio__dot {
	box-shadow: var(--glow-gold-soft);
	outline: 2px solid var(--gold-primary);
	outline-offset: 2px;
}

.fcheck input:checked ~ .fcheck__text,
.fradio input:checked ~ .fradio__text {
	color: var(--text-primary);
}

.fcheck input:disabled ~ *,
.fradio input:disabled ~ * {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Form layout */
.fform {
	display: grid;
	gap: var(--spacing-lg);
}

.fform__row {
	display: grid;
	gap: var(--spacing-lg);
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.fform__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-md);
	justify-content: flex-end;
	padding-top: var(--spacing-sm);
}

/* Message panels (success / error / info) */
.fnote {
	position: relative;
	display: flex;
	gap: var(--spacing-md);
	padding: var(--spacing-md) var(--spacing-lg);
	border: 1px solid var(--border-default);
	border-left: 2px solid var(--gold-primary);
	background: rgba(0, 0, 0, 0.35);
	color: var(--text-secondary);
	font-size: var(--text-small);
}

.fnote .icon {
	flex: none;
	margin-top: 2px;
	color: var(--gold-primary);
}

.fnote--error {
	border-left-color: var(--blood-bright);
}

.fnote--error .icon {
	color: var(--blood-bright);
}

.fnote--success {
	border-left-color: var(--success);
}

.fnote--success .icon {
	color: var(--success);
}

/* --------------------------------------------------------------------------
   Modal  (.fmodal) — <dialog>
   -------------------------------------------------------------------------- */
.fmodal {
	--fmodal-width: 560px;
	position: fixed;
	inset: 0;
	margin: auto;
	width: min(var(--fmodal-width), calc(100vw - var(--gutter) * 2));
	max-height: calc(100vh - var(--spacing-2xl));
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--text-primary);
	overflow: visible;
}

.fmodal::backdrop {
	background: rgba(0, 0, 0, 0.74);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	animation: fmodal-backdrop-in var(--duration-base) var(--ease-cine) both;
}

.fmodal--confirm {
	--fmodal-width: 440px;
}

.fmodal__panel {
	position: relative;
	background: var(--bg-secondary);
	border: 1px solid var(--border-default);
	box-shadow: var(--shadow-deep);
	max-height: calc(100vh - var(--spacing-2xl));
	overflow: auto;
}

.fmodal[open] .fmodal__panel {
	animation: fmodal-in var(--duration-base) var(--ease-cine) both;
}

.fmodal.is-closing .fmodal__panel {
	animation: fmodal-out var(--duration-fast) var(--ease-cine) both;
}

.fmodal.is-closing::backdrop {
	animation: fmodal-backdrop-out var(--duration-fast) var(--ease-cine) both;
}

/* corner ornaments — TL / BR only, never a frame around everything */
.fmodal__panel::before,
.fmodal__panel::after {
	content: "";
	position: absolute;
	width: 22px;
	height: 22px;
	pointer-events: none;
	border-color: var(--border-ornament-bright);
	border-style: solid;
}

.fmodal__panel::before {
	top: -1px;
	left: -1px;
	border-width: 1px 0 0 1px;
}

.fmodal__panel::after {
	bottom: -1px;
	right: -1px;
	border-width: 0 1px 1px 0;
}

.fmodal__close {
	position: absolute;
	top: var(--spacing-md);
	right: var(--spacing-md);
	z-index: 2;
}

.fmodal__header {
	padding: var(--spacing-xl) var(--spacing-xl) 0;
}

.fmodal__eyebrow {
	margin-bottom: var(--spacing-sm);
}

.fmodal__title {
	padding-right: var(--spacing-2xl);
	text-transform: uppercase;
}

.fmodal__header .divider {
	margin-block: var(--spacing-lg) 0;
	width: 100%;
}

.fmodal__body {
	padding: var(--spacing-lg) var(--spacing-xl);
	color: var(--text-secondary);
}

.fmodal__footer {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-md);
	justify-content: flex-end;
	padding: 0 var(--spacing-xl) var(--spacing-xl);
}

.fmodal--confirm .fmodal__body {
	text-align: center;
}

.fmodal--confirm .fmodal__footer {
	justify-content: center;
}

.fmodal__glyph {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin: 0 auto var(--spacing-md);
	border: 1px solid var(--border-strong);
	border-radius: 50%;
	color: var(--gold-primary);
}

.fmodal--confirm.fmodal--danger .fmodal__glyph {
	border-color: var(--border-danger);
	color: var(--blood-bright);
}

@keyframes fmodal-in {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes fmodal-out {
	from {
		opacity: 1;
		transform: none;
	}
	to {
		opacity: 0;
		transform: translateY(6px) scale(0.985);
	}
}

@keyframes fmodal-backdrop-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes fmodal-backdrop-out {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}

@media (max-width: 767.98px) {
	.fmodal__header,
	.fmodal__body,
	.fmodal__footer {
		padding-inline: var(--spacing-lg);
	}
}

/* --------------------------------------------------------------------------
   Navigation link with ornamental indicator  (.fnav-link)
   -------------------------------------------------------------------------- */
.fnav-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	padding: 10px 2px;
	font-family: var(--font-ui);
	font-size: var(--text-nav);
	font-weight: var(--weight-ui);
	letter-spacing: var(--tracking-nav);
	text-transform: uppercase;
	color: var(--text-secondary);
	text-decoration: none;
	transition: color var(--duration-fast) var(--ease-cine);
}

/* indicator line */
.fnav-link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 2px;
	height: 1px;
	background: var(--gold-primary);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform var(--duration-base) var(--ease-cine);
}

/* indicator diamond */
.fnav-link::before {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -1px;
	width: 5px;
	height: 5px;
	background: var(--gold-primary);
	clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
	transform: translate(-50%, 4px);
	opacity: 0;
	transition:
		opacity var(--duration-base) var(--ease-cine),
		transform var(--duration-base) var(--ease-cine);
}

.fnav-link:hover,
.fnav-link:focus-visible {
	color: var(--gold-primary);
}

.fnav-link:hover::after,
.fnav-link:focus-visible::after {
	transform: scaleX(1);
}

.fnav-link.is-active,
.fnav-link[aria-current="page"] {
	color: var(--gold-primary);
}

.fnav-link.is-active::after,
.fnav-link[aria-current="page"]::after {
	transform: scaleX(1);
}

.fnav-link.is-active::before,
.fnav-link[aria-current="page"]::before {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   Tabs  (.ftabs) — sliding indicator driven by JS (--x, --w)
   -------------------------------------------------------------------------- */
.ftabs {
	position: relative;
	display: flex;
	gap: var(--spacing-xl);
	border-bottom: 1px solid var(--border-subtle);
	overflow-x: auto;
	scrollbar-width: none;
}

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

.ftabs__tab {
	position: relative;
	flex: none;
	padding: var(--spacing-md) 0;
	font-family: var(--font-ui);
	font-size: var(--text-nav);
	font-weight: var(--weight-ui);
	letter-spacing: var(--tracking-nav);
	text-transform: uppercase;
	color: var(--text-muted);
	transition: color var(--duration-fast) var(--ease-cine);
}

.ftabs__tab:hover {
	color: var(--text-primary);
}

.ftabs__tab[aria-selected="true"] {
	color: var(--gold-primary);
}

.ftabs__indicator {
	/* bottom: 0 keeps it inside the scroll container's clip; it sits flush on the border */
	position: absolute;
	left: 0;
	bottom: 0;
	width: var(--w, 0px);
	height: 1px;
	background: var(--gold-primary);
	transform: translateX(var(--x, 0px));
	transition:
		transform var(--duration-base) var(--ease-cine),
		width var(--duration-base) var(--ease-cine);
}

.ftabs__indicator::after {
	content: "";
	position: absolute;
	left: 50%;
	top: -2px;
	width: 5px;
	height: 5px;
	background: var(--gold-primary);
	clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
	transform: translateX(-50%);
}

.ftabs__panel {
	padding-top: var(--spacing-lg);
}

.ftabs__panel[hidden] {
	display: none;
}

/* --------------------------------------------------------------------------
   Pagination  (.fpagination)
   -------------------------------------------------------------------------- */
.fpagination {
	display: flex;
	align-items: center;
	gap: var(--spacing-sm);
	flex-wrap: wrap;
}

.fpagination__list {
	display: flex;
	align-items: center;
	gap: var(--spacing-sm);
	list-style: none;
	margin: 0;
	padding: 0;
}

.fpagination__item {
	display: inline-grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	padding: 0 var(--spacing-sm);
	border: 1px solid var(--border-subtle);
	font-family: var(--font-display);
	font-size: var(--text-small);
	font-weight: 600;
	letter-spacing: 0.06em;
	color: var(--text-secondary);
	text-decoration: none;
	transition:
		border-color var(--duration-fast) var(--ease-cine),
		color var(--duration-fast) var(--ease-cine),
		background-color var(--duration-fast) var(--ease-cine);
}

.fpagination__item:hover {
	border-color: var(--border-strong);
	color: var(--gold-bright);
}

.fpagination__item.is-current,
.fpagination__item[aria-current="page"] {
	background: var(--gold-primary);
	border-color: var(--gold-primary);
	color: var(--text-inverse);
	clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}

.fpagination__ellipsis {
	color: var(--text-muted);
	padding: 0 var(--spacing-xs);
	letter-spacing: 0.2em;
}

/* --------------------------------------------------------------------------
   Slider controls  (.fslider-controls)
   -------------------------------------------------------------------------- */
.fslider-controls {
	display: flex;
	align-items: center;
	gap: var(--spacing-lg);
}

.fslider-controls__count {
	font-family: var(--font-display);
	font-size: var(--text-small);
	letter-spacing: 0.16em;
	color: var(--text-secondary);
	font-variant-numeric: tabular-nums;
}

.fslider-controls__count b {
	color: var(--gold-primary);
	font-weight: 600;
}

.fslider-controls__progress {
	position: relative;
	flex: 1;
	min-width: 80px;
	max-width: 240px;
	height: 1px;
	background: var(--border-subtle);
}

.fslider-controls__progress::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--gold-primary);
	transform: scaleX(var(--progress, 0.2));
	transform-origin: left;
	transition: transform var(--duration-slow) var(--ease-cine);
}

/* Dots (rendered as small diamonds) */
.fdots {
	display: flex;
	gap: var(--spacing-md);
	list-style: none;
	margin: 0;
	padding: 0;
}

.fdots__dot {
	width: 8px;
	height: 8px;
	border: 1px solid var(--gold-muted);
	transform: rotate(45deg);
	background: transparent;
	transition:
		background-color var(--duration-base) var(--ease-cine),
		border-color var(--duration-base) var(--ease-cine);
}

.fdots__dot:hover,
.fdots__dot.is-active {
	border-color: var(--gold-primary);
}

.fdots__dot.is-active {
	background: var(--gold-primary);
}

/* --------------------------------------------------------------------------
   Diamond list (feature / vocation navigation)
   -------------------------------------------------------------------------- */
.dlist {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-xs);
	list-style: none;
	margin: 0;
	padding: 0;
}

.dlist__item {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--spacing-md);
	width: 100%;
	padding: var(--spacing-md) var(--spacing-sm);
	font-family: var(--font-display);
	font-size: var(--text-h4);
	font-weight: var(--weight-heading);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: left;
	color: var(--text-muted);
	opacity: 0.75;
	transition:
		color var(--duration-base) var(--ease-cine),
		opacity var(--duration-base) var(--ease-cine),
		transform var(--duration-base) var(--ease-cine);
}

.dlist__diamond {
	flex: none;
	width: 9px;
	height: 9px;
	border: 1px solid var(--gold-muted);
	transform: rotate(45deg);
	transition:
		background-color var(--duration-base) var(--ease-cine),
		border-color var(--duration-base) var(--ease-cine),
		box-shadow var(--duration-base) var(--ease-cine);
}

.dlist__item:hover {
	color: var(--text-primary);
	opacity: 1;
}

.dlist__item:hover .dlist__diamond {
	border-color: var(--gold-primary);
}

.dlist__item.is-active,
.dlist__item[aria-selected="true"] {
	color: var(--gold-primary);
	opacity: 1;
	transform: translateX(6px);
}

.dlist__item.is-active .dlist__diamond,
.dlist__item[aria-selected="true"] .dlist__diamond {
	background: var(--gold-primary);
	border-color: var(--gold-primary);
	box-shadow: 0 0 0 4px rgb(var(--gold-rgb) / 0.14);
}

/* Rich items — a small role line under the name (vocations) */
.dlist--rich .dlist__item {
	align-items: flex-start;
}

.dlist--rich .dlist__diamond {
	margin-top: 0.5em;
}

.dlist__text {
	display: grid;
	gap: 3px;
	min-width: 0;
}

.dlist__name {
	line-height: 1.1;
}

.dlist__sub {
	font-family: var(--font-ui);
	font-size: 0.6875rem;
	font-weight: var(--weight-ui);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--text-muted);
	opacity: 0.7;
	transition:
		color var(--duration-base) var(--ease-cine),
		opacity var(--duration-base) var(--ease-cine);
}

.dlist__item.is-active .dlist__sub,
.dlist__item[aria-selected="true"] .dlist__sub {
	color: var(--text-secondary);
	opacity: 1;
}

/* Autoplay progress — a hairline fills under the active item while a
   [data-autoplay] switcher rotates; theme.js sets --switch-autoplay and toggles
   .is-paused while the section is hovered or focused. */
[data-autoplay] .dlist__item.is-active::after {
	content: "";
	position: absolute;
	left: var(--spacing-sm);
	right: var(--spacing-sm);
	bottom: 0;
	height: 1px;
	background: linear-gradient(90deg, rgb(var(--gold-rgb) / 0.85), rgb(var(--gold-rgb) / 0));
	transform: scaleX(0);
	transform-origin: left center;
	animation: switch-progress var(--switch-autoplay, 8s) linear forwards;
}

[data-autoplay].is-paused .dlist__item.is-active::after {
	animation-play-state: paused;
}

@keyframes switch-progress {
	to {
		transform: scaleX(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	[data-autoplay] .dlist__item.is-active::after {
		display: none;
	}
}

/* --------------------------------------------------------------------------
   Data table  (.ftable) — highscores, kill statistics, houses…
   -------------------------------------------------------------------------- */
.ftable-wrap {
	overflow-x: auto;
	border: 1px solid var(--border-subtle);
}

.ftable {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--text-small);
}

.ftable th {
	padding: 14px var(--spacing-md);
	text-align: left;
	font-family: var(--font-ui);
	font-size: var(--text-caption);
	font-weight: var(--weight-ui);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--gold-muted);
	background: rgba(0, 0, 0, 0.5);
	border-bottom: 1px solid var(--border-default);
	white-space: nowrap;
}

.ftable td {
	padding: 12px var(--spacing-md);
	color: var(--text-secondary);
	border-bottom: 1px solid var(--border-subtle);
	vertical-align: middle;
}

/* Narrow screens: keep cells on one line and let the wrapper scroll sideways */
@media (max-width: 767.98px) {
	.ftable th,
	.ftable td {
		white-space: nowrap;
	}
}

.ftable tr:last-child td {
	border-bottom: 0;
}

.ftable tbody tr {
	transition: background-color var(--duration-fast) var(--ease-cine);
}

.ftable tbody tr:hover td {
	background: rgb(var(--gold-rgb) / 0.04);
}

.ftable .is-rank {
	font-family: var(--font-display);
	font-weight: 600;
	letter-spacing: 0.06em;
	color: var(--gold-primary);
	width: 56px;
}

.ftable .is-name {
	color: var(--text-primary);
	font-weight: 600;
}

.ftable .is-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* Attribute meter (vocations) — 5 diamonds */
.meter {
	display: flex;
	align-items: center;
	gap: var(--spacing-md);
	font-family: var(--font-ui);
	font-size: var(--text-caption);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--text-secondary);
}

.meter__label {
	width: 96px;
	flex: none;
}

.meter__track {
	display: flex;
	gap: 6px;
}

.meter__seg {
	width: 7px;
	height: 7px;
	border: 1px solid var(--gold-muted);
	transform: rotate(45deg);
	opacity: 0.6;
	transition:
		background-color var(--duration-slow) var(--ease-cine),
		opacity var(--duration-slow) var(--ease-cine);
}

.meter__seg.is-on {
	background: var(--gold-primary);
	border-color: var(--gold-primary);
	opacity: 1;
}

/* Brass plate — a chamfered nameplate ("⚔ CONTA", "II · PALADIN") that hangs
   on the edge of a frame. The host positions it; --voc-rgb tints the brass. */
.plate {
	--plate-cut: 7px;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--spacing-sm);
	height: 30px;
	padding-inline: var(--spacing-md);
	clip-path: polygon(
		var(--plate-cut) 0, calc(100% - var(--plate-cut)) 0, 100% var(--plate-cut),
		100% calc(100% - var(--plate-cut)), calc(100% - var(--plate-cut)) 100%, var(--plate-cut) 100%,
		0 calc(100% - var(--plate-cut)), 0 var(--plate-cut));
	background: linear-gradient(180deg, rgb(var(--voc-rgb, var(--gold-rgb)) / 0.9), rgb(var(--voc-rgb, var(--gold-rgb)) / 0.4));
	color: var(--gold-primary);
	font-family: var(--font-display);
	font-size: 0.75rem;
	font-weight: var(--weight-heading);
	letter-spacing: 0.22em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
	filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6));
}

.plate::before {
	content: "";
	position: absolute;
	inset: 1px;
	z-index: -1;
	clip-path: polygon(
		calc(var(--plate-cut) - 1px) 0, calc(100% - var(--plate-cut) + 1px) 0, 100% calc(var(--plate-cut) - 1px),
		100% calc(100% - var(--plate-cut) + 1px), calc(100% - var(--plate-cut) + 1px) 100%, calc(var(--plate-cut) - 1px) 100%,
		0 calc(100% - var(--plate-cut) + 1px), 0 calc(var(--plate-cut) - 1px));
	background: linear-gradient(180deg, #241d11, #110d07);
}

.plate .icon {
	color: var(--gold-muted);
}

.plate--premium {
	color: #f4e4b0;
	--voc-rgb: var(--gold-rgb);
	filter: drop-shadow(0 0 14px rgb(var(--gold-rgb) / 0.35));
}

.plate--premium .icon {
	color: var(--gold-primary);
}

.plate--ok {
	--voc-rgb: 127 156 106;
	color: #cfe0c4;
}

.plate--ok .icon {
	color: var(--success);
}

.plate--muted {
	--voc-rgb: 110 100 82;
	color: var(--text-secondary);
}

.plate--danger {
	--voc-rgb: var(--blood-rgb);
	color: #f0c9c9;
}

.plate--danger .icon {
	color: var(--blood-bright);
}

/* Game bar — XP / HP / mana: label, a sunken track with a lit fill (--p) and the
   value on the right. The fill is the classic 2D gradient with a highlight line. */
.gbar {
	--gbar-rgb: var(--gold-rgb);
	display: grid;
	grid-template-columns: 78px minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--spacing-sm);
	font-size: var(--text-small);
}

.gbar__label {
	color: var(--text-muted);
	font-family: var(--font-display);
	font-size: 0.7rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	white-space: nowrap;
}

.gbar__track {
	position: relative;
	display: block;
	height: 12px;
	background: linear-gradient(180deg, #050403, #0d0b08);
	border: 1px solid rgba(0, 0, 0, 0.9);
	box-shadow:
		inset 1px 1px 0 rgba(0, 0, 0, 0.9),
		0 0 0 1px rgb(var(--gold-rgb) / 0.16);
}

.gbar__fill {
	position: absolute;
	inset: 1px;
	width: calc(var(--p, 0%) - 2px);
	min-width: 0;
	background: linear-gradient(180deg, rgb(var(--gbar-rgb) / 1) 0%, rgb(var(--gbar-rgb) / 0.7) 55%, rgb(var(--gbar-rgb) / 0.45) 100%);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.35),
		0 0 10px rgb(var(--gbar-rgb) / 0.45);
	transition: width 900ms var(--ease-cine) 200ms;
}

/* the fill grows in when its sheet becomes active */
[data-switch-panel]:not(.is-active) .gbar__fill {
	width: 0;
	transition: none;
}

.gbar__value {
	color: var(--text-secondary);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.gbar--xp {
	--gbar-rgb: var(--gold-rgb);
}

.gbar--hp {
	--gbar-rgb: 196 58 52;
}

.gbar--mana {
	--gbar-rgb: 74 110 214;
}

/* Skills window — the in-game skills list: name, thin progress hairline, value */
.skillwin {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.skillwin__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas: "label value" "bar bar";
	align-items: baseline;
	gap: 0 var(--spacing-sm);
	font-size: var(--text-small);
}

.skillwin__label {
	grid-area: label;
	color: var(--text-secondary);
}

.skillwin__value {
	grid-area: value;
	color: var(--text-primary);
	font-family: var(--font-display);
	font-weight: var(--weight-heading);
	font-variant-numeric: tabular-nums;
}

.skillwin__bar {
	grid-area: bar;
	position: relative;
	display: block;
	height: 3px;
	margin-top: 3px;
	background: rgba(0, 0, 0, 0.7);
	box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 236, 200, 0.04);
}

.skillwin__bar::after {
	content: "";
	position: absolute;
	inset: 0;
	width: var(--p, 0%);
	background: linear-gradient(90deg, rgb(var(--voc-rgb, var(--gold-rgb)) / 0.55), rgb(var(--voc-rgb, var(--gold-rgb)) / 1));
	box-shadow: 0 0 6px rgb(var(--voc-rgb, var(--gold-rgb)) / 0.5);
	transition: width 800ms var(--ease-cine);
	transition-delay: calc(var(--k, 0) * 60ms + 250ms);
}

[data-switch-panel]:not(.is-active) .skillwin__bar::after {
	width: 0;
	transition: none;
}

@media (prefers-reduced-motion: reduce) {
	.gbar__fill,
	.skillwin__bar::after {
		transition: none;
	}
}

/* Input with a glyph on the left (login) */
.finput-glyph {
	position: relative;
}

.finput-glyph .finput {
	padding-left: 44px;
}

.finput-glyph__icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--gold-muted);
	pointer-events: none;
	transition: color var(--duration-fast) var(--ease-cine);
}

.finput-glyph:focus-within .finput-glyph__icon {
	color: var(--gold-primary);
}

/* Skill row (ui.skill) — the classic 2D skills window: label left, a stepped
   bar of bevelled blocks and the value flush right. The host tints the filled
   blocks with --voc-rgb (defaults to the brand gold). */
.skill {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto 34px;
	align-items: center;
	gap: var(--spacing-sm);
	font-family: var(--font-ui);
	font-size: var(--text-caption);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--text-secondary);
}

.skill__label {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.skill__track {
	display: flex;
	gap: 2px;
	padding: 2px;
	background: #000;
	box-shadow:
		inset 0 1px 0 rgba(0, 0, 0, 0.9),
		0 0 0 1px rgba(255, 236, 200, 0.08);
}

.skill__seg {
	width: 16px;
	height: 8px;
	background: linear-gradient(180deg, #1b1712, #0f0d0a);
	box-shadow: inset 0 1px 0 rgba(255, 236, 200, 0.05);
	transition:
		background-color var(--duration-slow) var(--ease-cine),
		box-shadow var(--duration-slow) var(--ease-cine),
		opacity var(--duration-slow) var(--ease-cine);
}

.skill__seg.is-on {
	background: linear-gradient(180deg, rgb(var(--voc-rgb, var(--gold-rgb)) / 1), rgb(var(--voc-rgb, var(--gold-rgb)) / 0.62));
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.35),
		inset 0 -1px 0 rgba(0, 0, 0, 0.45),
		0 0 8px rgb(var(--voc-rgb, var(--gold-rgb)) / 0.35);
}

/* inside a crossfading panel the filled blocks light up as it becomes active
   (theme.js staggers their transition-delay) */
.cparty__detail:not(.is-active) .skill__seg.is-on {
	opacity: 0.2;
}

.skill__value {
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: var(--text-muted);
}

.skill__value b {
	font-weight: 600;
	color: var(--text-primary);
}
