/* Dartsapp — dark only, colours from the club logo. Portrait-first, touch-sized. */

@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("/fonts/inter-latin-wght-260c81a4759baf163c025001c4f27872.woff2") format("woff2");
}

@font-face {
	font-family: "Barlow Condensed";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("/fonts/barlow-condensed-latin-700-e1180918b87380fc8304efcbb08d6de6.woff2") format("woff2");
}

@font-face {
	font-family: "Barlow Condensed";
	font-style: normal;
	font-weight: 800;
	font-display: swap;
	src: url("/fonts/barlow-condensed-latin-800-b1b7dd5dbceabdf92674e14a41546405.woff2") format("woff2");
}

:root {
	color-scheme: dark;

	--bg: #07090c;
	--surface: #10151b;
	--surface-2: #161d25;
	--surface-3: #1f2832;
	--border: rgba(255, 255, 255, 0.07);
	--border-strong: rgba(255, 255, 255, 0.13);
	--text: #eef3f8;
	--muted: #8b98a7;
	--faint: #5b6775;

	--primary: #29abe2;
	--primary-hover: #4fc0ef;
	--primary-soft: rgba(41, 171, 226, 0.14);
	--primary-text: #6fd0f6;
	--on-primary: #001520;
	--danger: #e3141b;
	--danger-hover: #ff4b51;
	--danger-soft: rgba(227, 20, 27, 0.14);
	--on-danger: #ffffff;
	--success: #2fd28a;
	--success-soft: rgba(47, 210, 138, 0.13);
	--warning: #f5b544;

	--grad-primary: linear-gradient(180deg, #41bdf0 0%, #1d93ca 100%);
	--grad-danger: linear-gradient(180deg, #f2363c 0%, #c80f15 100%);
	--grad-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 60%);

	--shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.9);
	--shadow-lift: 0 18px 40px -20px rgba(0, 0, 0, 0.95);
	--glow-primary: 0 8px 24px -10px rgba(41, 171, 226, 0.75);
	--ring: 0 0 0 3px rgba(41, 171, 226, 0.35);

	--radius-lg: 20px;
	--radius: 16px;
	--radius-sm: 12px;
	--radius-xs: 8px;
	--gutter: 16px;
	--tap: 48px;

	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--display: "Barlow Condensed", "Inter", system-ui, sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

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

html {
	-webkit-text-size-adjust: 100%;
	background: var(--bg);
}

body {
	margin: 0;
	min-height: 100dvh;
	background: transparent;
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.5;
	font-feature-settings: "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	-webkit-tap-highlight-color: transparent;
}

/* Soft logo-coloured glows behind everything; fixed so they don't scroll. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(900px 520px at -10% -12%, rgba(41, 171, 226, 0.17), transparent 62%),
		radial-gradient(720px 460px at 112% -6%, rgba(227, 20, 27, 0.11), transparent 60%),
		radial-gradient(900px 600px at 50% 120%, rgba(41, 171, 226, 0.06), transparent 70%);
}

a {
	color: var(--primary-text);
	text-decoration: none;
	transition: color 0.15s;
}

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

:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

h1, h2, h3 {
	margin: 0 0 12px;
	line-height: 1.1;
}

h1 {
	font-family: var(--display);
	font-weight: 800;
	font-size: clamp(1.9rem, 6vw, 2.4rem);
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

h2 {
	margin-top: 28px;
	font-family: var(--display);
	font-weight: 700;
	font-size: 1.35rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

h2::before {
	content: "";
	display: inline-block;
	width: 4px;
	height: 0.85em;
	margin-right: 10px;
	border-radius: 2px;
	background: var(--grad-primary);
	vertical-align: -0.06em;
}

h3 {
	font-size: 1rem;
	font-weight: 700;
}

p {
	margin: 0 0 12px;
}

b, strong {
	font-weight: 650;
}

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

.icon {
	width: 1.25em;
	height: 1.25em;
	flex-shrink: 0;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	vertical-align: -0.2em;
}

/* ---- Top bar ---- */

.topbar {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px var(--gutter);
	padding-top: max(6px, env(safe-area-inset-top));
	background: rgba(7, 9, 12, 0.72);
	-webkit-backdrop-filter: blur(16px) saturate(1.4);
	backdrop-filter: blur(16px) saturate(1.4);
}

/* Hairline in the logo colours */
.topbar::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: linear-gradient(90deg, rgba(41, 171, 226, 0.7), rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.08) 55%, rgba(227, 20, 27, 0.7));
}

.topbar__home {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: var(--tap);
	color: var(--text);
	font-family: var(--display);
	font-weight: 800;
	font-size: 1.45rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

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

.topbar__home img {
	width: 44px;
	height: 44px;
	margin: -4px 0;
	filter: drop-shadow(0 2px 10px rgba(41, 171, 226, 0.35));
}

.topbar__user {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	color: var(--muted);
	font-size: 0.92rem;
}

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

@media (max-width: 420px) {
	.topbar__name {
		display: none;
	}
}

.avatar {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--grad-primary);
	color: var(--on-primary);
	font-weight: 800;
	font-size: 0.9rem;
	text-transform: uppercase;
	box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px rgba(41, 171, 226, 0.45);
}

.topbar__user form {
	margin: 0;
}

.icon-btn {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: rgba(255, 255, 255, 0.03);
	color: var(--muted);
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.icon-btn:hover {
	background: var(--surface-3);
	border-color: var(--border-strong);
	color: var(--text);
}

/* ---- Page ---- */

.page {
	max-width: 780px;
	margin: 0 auto;
	padding: 20px var(--gutter);
	padding-bottom: calc(var(--gutter) * 4);
	animation: page-in 0.25s ease-out;
}

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

.page-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.page-head h1, .page-head h2 {
	margin: 0;
}

.back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	margin-bottom: 6px;
	padding-right: 10px;
	color: var(--muted);
	font-size: 0.9rem;
	font-weight: 500;
}

.back::before {
	content: "";
	width: 8px;
	height: 8px;
	margin: 0 2px 0 4px;
	border-left: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}

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

.card {
	position: relative;
	margin-bottom: 16px;
	padding: 18px;
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

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

/* ---- Home ---- */

.hero {
	position: relative;
	overflow: hidden;
	margin-bottom: 20px;
	padding: 22px 20px;
	border-radius: var(--radius-lg);
	border: 1px solid rgba(41, 171, 226, 0.22);
	background:
		radial-gradient(420px 220px at 0% 0%, rgba(41, 171, 226, 0.28), transparent 70%),
		radial-gradient(320px 200px at 100% 100%, rgba(227, 20, 27, 0.18), transparent 70%),
		var(--surface);
	box-shadow: var(--shadow-lift);
}

.hero h1 {
	position: relative;
	margin: 0;
	font-size: clamp(2rem, 7vw, 2.8rem);
}

.hero p {
	position: relative;
	margin: 4px 0 0;
	color: var(--muted);
}

.hero__logo {
	position: absolute;
	right: -28px;
	top: 50%;
	width: 170px;
	height: 170px;
	transform: translateY(-50%) rotate(-8deg);
	opacity: 0.16;
	pointer-events: none;
}

.tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 8px;
}

@media (min-width: 600px) {
	.tiles {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.tile {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 2px;
	min-height: 118px;
	padding: 14px 14px 13px;
	overflow: hidden;
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--text);
	font-weight: 650;
	font-size: 1.02rem;
	box-shadow: var(--shadow);
	transition: transform 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.tile:hover, .tile:focus-visible {
	color: var(--text);
	border-color: rgba(41, 171, 226, 0.45);
	background: var(--grad-surface), var(--surface-2);
	box-shadow: var(--shadow-lift);
	transform: translateY(-2px);
}

.tile:active {
	transform: scale(0.98);
}

.tile__icon {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin-bottom: auto;
	border-radius: var(--radius-sm);
	background: var(--primary-soft);
	color: var(--primary-text);
}

.tile__icon .icon {
	width: 22px;
	height: 22px;
}

.tile small {
	display: block;
	color: var(--muted);
	font-weight: 400;
	font-size: 0.84rem;
	line-height: 1.3;
}

.tile--primary {
	border-color: transparent;
	background:
		radial-gradient(160px 120px at 100% 0%, rgba(255, 255, 255, 0.22), transparent 70%),
		var(--grad-primary);
	color: var(--on-primary);
	box-shadow: var(--glow-primary);
}

.tile--primary:hover, .tile--primary:focus-visible {
	color: var(--on-primary);
	border-color: transparent;
	background:
		radial-gradient(160px 120px at 100% 0%, rgba(255, 255, 255, 0.3), transparent 70%),
		var(--grad-primary);
	box-shadow: 0 14px 30px -12px rgba(41, 171, 226, 0.85);
}

.tile--primary small {
	color: rgba(0, 21, 32, 0.72);
}

.tile--primary .tile__icon {
	background: rgba(0, 21, 32, 0.16);
	color: var(--on-primary);
}

.tile__badge {
	position: absolute;
	top: 12px;
	right: 12px;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--grad-danger);
	color: var(--on-danger);
	font-size: 0.72rem;
	font-weight: 700;
	box-shadow: 0 4px 14px -4px rgba(227, 20, 27, 0.8);
}

.section-label {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 28px 0 12px;
	color: var(--muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.section-label::after {
	content: "";
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* ---- Buttons ---- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: var(--tap);
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	background: var(--grad-primary);
	color: var(--on-primary);
	font: inherit;
	font-weight: 650;
	letter-spacing: 0.005em;
	cursor: pointer;
	white-space: nowrap;
	box-shadow: var(--glow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.28);
	transition: filter 0.15s, background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn:hover {
	color: var(--on-primary);
	filter: brightness(1.08);
}

.btn:active {
	transform: translateY(1px) scale(0.99);
}

.btn--secondary {
	background: var(--surface-3);
	border-color: var(--border-strong);
	color: var(--text);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn--secondary:hover {
	background: #283340;
	color: var(--text);
	filter: none;
}

.btn--danger {
	background: var(--danger-soft);
	border-color: rgba(227, 20, 27, 0.45);
	color: var(--danger-hover);
	box-shadow: none;
}

.btn--danger:hover {
	background: var(--grad-danger);
	border-color: transparent;
	color: var(--on-danger);
	filter: none;
	box-shadow: 0 8px 22px -10px rgba(227, 20, 27, 0.8);
}

.btn--ghost {
	background: transparent;
	color: var(--muted);
	padding: 0 12px;
	box-shadow: none;
}

.btn--ghost:hover {
	background: rgba(255, 255, 255, 0.06);
	color: var(--text);
	filter: none;
}

.btn--small {
	min-height: 36px;
	padding: 0 13px;
	border-radius: var(--radius-xs);
	font-size: 0.88rem;
}

.btn--block {
	width: 100%;
}

.btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	filter: none;
	transform: none;
}

.actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 20px;
}

.actions--grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin-top: 0;
}

/* ---- Forms ---- */

.field {
	margin-bottom: 18px;
}

.field label, .label {
	display: block;
	margin-bottom: 7px;
	color: var(--muted);
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}

input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="time"], input[type="datetime-local"], select, textarea {
	width: 100%;
	min-height: var(--tap);
	padding: 0 14px;
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	color: var(--text);
	font: inherit;
	font-size: 16px; /* prevents iOS zoom on focus */
	transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input::placeholder, textarea::placeholder {
	color: var(--faint);
}

input:hover, select:hover, textarea:hover {
	border-color: rgba(255, 255, 255, 0.2);
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
	outline: none;
	border-color: var(--primary);
	box-shadow: var(--ring);
	background: rgba(0, 0, 0, 0.5);
}

select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b98a7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
}

select option {
	background: var(--surface-2);
}

textarea {
	padding: 12px 14px;
	font-family: var(--mono);
	line-height: 1.45;
}

textarea.prose {
	font-family: var(--font);
}

.field--error input {
	border-color: var(--danger);
}

.field-error {
	margin-top: 6px;
	color: var(--danger-hover);
	font-size: 0.88rem;
}

.hint {
	margin-top: 6px;
	color: var(--muted);
	font-size: 0.84rem;
}

.check {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: var(--tap);
	cursor: pointer;
}

.check input {
	width: 22px;
	height: 22px;
	accent-color: var(--primary);
}

.inline-form {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.inline-form > :first-child {
	flex: 1;
	min-width: 0;
}

/* ---- Lists ---- */

.list {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
}

.list > li + li {
	border-top: 1px solid var(--border);
}

.list__row {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 60px;
	padding: 10px var(--gutter);
	color: var(--text);
	transition: background 0.15s;
}

a.list__row:hover {
	background: rgba(255, 255, 255, 0.035);
	color: var(--text);
}

/* Chevron on navigable rows */
a.list__row::after {
	content: "";
	flex-shrink: 0;
	width: 7px;
	height: 7px;
	margin-left: 2px;
	border-top: 2px solid var(--faint);
	border-right: 2px solid var(--faint);
	transform: rotate(45deg);
	transition: border-color 0.15s, transform 0.15s;
}

a.list__row:hover::after {
	border-color: var(--primary);
	transform: translateX(2px) rotate(45deg);
}

.list__main {
	flex: 1;
	min-width: 0;
}

.list__main small {
	display: block;
	margin-top: 1px;
	color: var(--muted);
	font-size: 0.84rem;
}

.list__actions {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
}

.list__empty {
	padding: 22px var(--gutter);
	color: var(--muted);
	text-align: center;
}

/* ---- Badges, alerts ---- */

.badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 9px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.07);
	color: var(--muted);
	font-size: 0.72rem;
	font-weight: 650;
	letter-spacing: 0.02em;
	vertical-align: middle;
	white-space: nowrap;
}

.badge--primary {
	background: var(--primary-soft);
	color: var(--primary-text);
	box-shadow: inset 0 0 0 1px rgba(41, 171, 226, 0.3);
}

.badge--danger {
	background: var(--danger-soft);
	color: var(--danger-hover);
	box-shadow: inset 0 0 0 1px rgba(227, 20, 27, 0.35);
}

.alert {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 13px 16px;
	margin-bottom: 16px;
	border-radius: var(--radius-sm);
	border: 1px solid rgba(41, 171, 226, 0.3);
	background: var(--primary-soft);
	font-size: 0.95rem;
}

.alert::before {
	content: "";
	flex-shrink: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--primary);
	box-shadow: 0 0 10px var(--primary);
}

.alert--success {
	border-color: rgba(47, 210, 138, 0.3);
	background: var(--success-soft);
}

.alert--success::before {
	background: var(--success);
	box-shadow: 0 0 10px var(--success);
}

.alert--error {
	border-color: rgba(227, 20, 27, 0.4);
	background: var(--danger-soft);
}

.alert--error::before {
	background: var(--danger);
	box-shadow: 0 0 10px var(--danger);
}

.secret {
	display: block;
	margin: 8px 0;
	padding: 14px;
	background: rgba(0, 0, 0, 0.4);
	border: 1px dashed var(--primary);
	border-radius: var(--radius-sm);
	font-family: var(--mono);
	font-size: 1.4rem;
	letter-spacing: 0.08em;
	text-align: center;
	user-select: all;
}

/* ---- Login ---- */

.login {
	max-width: 400px;
	margin: 4vh auto 0;
	text-align: center;
}

.login img {
	width: 200px;
	height: 200px;
	margin-bottom: 4px;
	filter: drop-shadow(0 10px 40px rgba(41, 171, 226, 0.35));
	animation: logo-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1.1);
}

@keyframes logo-in {
	from {
		opacity: 0;
		transform: scale(0.9) rotate(-6deg);
	}
}

.login h1 {
	margin-bottom: 4px;
	font-size: 2.6rem;
	letter-spacing: 0.06em;
}

.login__tagline {
	margin-bottom: 24px;
	color: var(--muted);
	font-size: 0.95rem;
}

.login form {
	padding: 22px;
	text-align: left;
}

.htmx-request {
	opacity: 0.6;
	transition: opacity 0.2s;
}

/* ---- Shared bits for games and stats ---- */

.grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 12px;
}

.grid-2 > .actions {
	grid-column: 1 / -1;
	margin-top: 0;
}

.score {
	font-family: var(--display);
	font-weight: 800;
	font-size: 1.45rem;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
}

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

.bust {
	color: var(--danger-hover);
	font-weight: 700;
}

.segmented {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
	padding: 4px;
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
}

.segmented label {
	flex: 1;
	min-width: 72px;
}

.segmented input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.segmented span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0 12px;
	border-radius: var(--radius-xs);
	color: var(--muted);
	font-weight: 650;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.segmented span:hover {
	color: var(--text);
}

.segmented input:checked + span {
	background: var(--grad-primary);
	color: var(--on-primary);
	box-shadow: 0 4px 14px -6px rgba(41, 171, 226, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.segmented input:focus-visible + span {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

/* ---- New game form ---- */

.sides {
	display: grid;
	gap: 16px;
}

@media (min-width: 600px) {
	.sides {
		grid-template-columns: 1fr 1fr;
	}
}

.slot {
	margin-bottom: 8px;
}

.slot .guest-name {
	display: none;
	margin-top: 6px;
}

.slot:has(option[value="new"]:checked) .guest-name {
	display: block;
}

.doubles-only {
	display: none;
}

.game-form:has(input[name="playersPerSide"][value="2"]:checked) .doubles-only {
	display: block;
}

/* ---- Game detail ---- */

.match-head {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
	padding: 22px 16px 16px;
	text-align: center;
	background:
		radial-gradient(300px 160px at 0% 0%, rgba(41, 171, 226, 0.16), transparent 70%),
		radial-gradient(300px 160px at 100% 0%, rgba(227, 20, 27, 0.1), transparent 70%),
		var(--surface);
}

.match-head__side a {
	display: block;
	color: var(--text);
	font-weight: 700;
	font-size: 1.1rem;
	line-height: 1.25;
}

.match-head__side.winner a {
	color: var(--primary-text);
}

.match-head__side.winner a {
	text-shadow: 0 0 18px rgba(41, 171, 226, 0.55);
}

.match-head__side--b {
	order: 3;
}

.match-head__score {
	order: 2;
	font-family: var(--display);
	font-size: clamp(3rem, 12vw, 4.2rem);
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	text-shadow: 0 4px 30px rgba(41, 171, 226, 0.35);
}

.match-head__meta {
	order: 4;
	grid-column: 1 / -1;
	margin: 6px 0 0;
	padding-top: 12px;
	border-top: 1px solid var(--border);
	font-size: 0.84rem;
}

.table-scroll {
	overflow-x: auto;
	margin-bottom: 8px;
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.stats-table, .visits-table {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.stats-table th, .stats-table td {
	padding: 12px 12px;
	border-bottom: 1px solid var(--border);
	text-align: right;
	white-space: nowrap;
}

.stats-table tbody tr:last-child > * {
	border-bottom: 0;
}

.stats-table tbody tr {
	transition: background 0.15s;
}

.stats-table tbody tr:hover {
	background: rgba(255, 255, 255, 0.03);
}

.stats-table th:first-child, .stats-table tbody th {
	text-align: left;
}

.stats-table thead th {
	background: rgba(255, 255, 255, 0.025);
	color: var(--muted);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.leg {
	margin-bottom: 8px;
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.leg summary {
	display: flex;
	gap: 8px;
	align-items: center;
	min-height: 54px;
	padding: 0 var(--gutter);
	cursor: pointer;
	font-weight: 650;
	list-style: none;
}

.leg summary::-webkit-details-marker {
	display: none;
}

.leg > summary::after, .filters > summary::after {
	content: "";
	margin-left: auto;
	width: 7px;
	height: 7px;
	border-right: 2px solid var(--muted);
	border-bottom: 2px solid var(--muted);
	transform: rotate(45deg);
	transition: transform 0.2s;
}

.leg[open] > summary::after, .filters[open] > summary::after {
	transform: rotate(-135deg);
}

.correction {
	padding: 8px var(--gutter) var(--gutter);
	border-top: 1px solid var(--border);
}

.correction summary {
	display: flex;
	align-items: center;
	min-height: 40px;
	color: var(--muted);
	cursor: pointer;
}

.visits-table td {
	padding: 7px var(--gutter);
	border-top: 1px solid var(--border);
}

.visits-table td:nth-child(n+3) {
	width: 4.5em;
	text-align: right;
}

.visits-table__darts {
	color: var(--muted);
}

.visits-table__b td:first-child {
	color: var(--primary-text);
}

/* ---- Player profile ---- */

.filters summary {
	display: flex;
	align-items: center;
	min-height: 32px;
	cursor: pointer;
	font-weight: 650;
	list-style: none;
}

.filters summary::-webkit-details-marker {
	display: none;
}

.filters form {
	margin-top: 14px;
}

.stat-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 8px;
}

.stat-grid--5 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 600px) {
	.stat-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.stat-grid--5 {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

.stat {
	display: flex;
	flex-direction: column;
	gap: 0;
	min-width: 0;
	padding: 13px 14px;
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.stat__label {
	color: var(--muted);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.stat__value {
	font-family: var(--display);
	font-size: 2rem;
	font-weight: 800;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
}

.stat--big {
	border-color: rgba(41, 171, 226, 0.35);
	background:
		radial-gradient(200px 120px at 100% 0%, rgba(41, 171, 226, 0.22), transparent 70%),
		var(--surface);
}

.stat--big .stat__value {
	font-size: 2.7rem;
	color: var(--primary-text);
	text-shadow: 0 2px 24px rgba(41, 171, 226, 0.45);
}

.stat__sub {
	color: var(--muted);
	font-size: 0.82rem;
}

.result {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.06);
	color: var(--muted);
	font-family: var(--display);
	font-weight: 800;
	font-size: 1rem;
}

.result--won {
	background: var(--success-soft);
	color: var(--success);
	box-shadow: inset 0 0 0 1px rgba(47, 210, 138, 0.35);
}

.result--lost {
	background: var(--danger-soft);
	color: var(--danger-hover);
	box-shadow: inset 0 0 0 1px rgba(227, 20, 27, 0.35);
}

.history .more {
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* ---- Spectator view (watch.ts) ---- */

.page:has(.watch-page), .page:has(.live-page) {
	max-width: 1400px;
}

.watch__meta {
	margin-bottom: 12px;
	text-align: center;
}

.watch__grid {
	display: grid;
	gap: 16px;
}

/* Landscape / big screens: board next to the numbers */
@media (min-width: 900px) {
	.watch__grid {
		grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr);
		align-items: start;
	}

	.watch__board {
		position: sticky;
		top: 80px;
	}
}

.watch__main {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

.watch .side__remaining {
	font-size: clamp(4rem, 13vw, 8.5rem);
}

.watch__board {
	max-width: 560px;
	width: 100%;
	margin: 0 auto;
}

.watch-visits__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.watch-visits__side h3 {
	margin: 0 0 6px;
	color: var(--muted);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.watch-visits {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}

.watch-visits li {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 10px;
	font-variant-numeric: tabular-nums;
}

.watch-visits li + li {
	border-top: 1px solid var(--border);
}

.watch-visits li:first-child {
	animation: slide-in 0.35s ease-out;
}

.watch-visits__darts {
	color: var(--muted);
}

.watch-visits b {
	font-family: var(--display);
	font-size: 1.15rem;
}

.watch-stats td {
	text-align: center;
}

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

/* ---- Dartboard (board.ts) ---- */

.board {
	display: block;
	width: 100%;
	height: auto;
	filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.6));
}

.board__frame {
	fill: #0b0e12;
	stroke: rgba(255, 255, 255, 0.06);
	stroke-width: 1.5;
}

.board__miss {
	fill: #050608;
}

.bed {
	stroke: #9aa3ad;
	stroke-width: 0.6;
	stroke-opacity: 0.55;
	transition: fill 0.2s;
}

.bed--dark {
	fill: #15191e;
}

.bed--light {
	fill: #2c333c;
}

.bed--red {
	fill: #b3141a;
}

.bed--blue {
	fill: #1a86b8;
}

.bed--hit {
	fill: #f4f8fb;
	stroke: var(--primary);
	stroke-width: 1.4;
	stroke-opacity: 1;
	filter: drop-shadow(0 0 6px rgba(41, 171, 226, 0.95)) drop-shadow(0 0 14px rgba(41, 171, 226, 0.6));
	animation: bed-hit 0.6s ease-out;
}

.bed--red.bed--hit {
	fill: #ff9a9e;
	stroke: #fff;
	filter: drop-shadow(0 0 6px rgba(227, 20, 27, 0.95)) drop-shadow(0 0 14px rgba(227, 20, 27, 0.6));
}

.bed--blue.bed--hit {
	fill: #8fdcff;
	stroke: #fff;
}

.board__number {
	fill: #c9d2db;
	font-family: var(--display);
	font-size: 17px;
	font-weight: 700;
	text-anchor: middle;
	dominant-baseline: central;
}

.marker circle {
	fill: #fff;
	stroke: var(--bg);
	stroke-width: 2.5;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

.marker text {
	fill: var(--bg);
	font-family: var(--display);
	font-size: 15px;
	font-weight: 800;
	text-anchor: middle;
	dominant-baseline: central;
}

.marker--miss circle {
	fill: var(--danger);
}

.marker--miss text {
	fill: #fff;
}

.marker__pop {
	animation: marker-pop 0.45s cubic-bezier(0.2, 1.6, 0.3, 1) both;
}

@keyframes bed-hit {
	0% {
		fill: #fff;
	}
}

@keyframes marker-pop {
	from {
		opacity: 0;
		transform: scale(2.4);
	}
}

/* ---- Live page (live.ts) ---- */

.live-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 14px;
}

.live-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px;
	overflow: hidden;
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	color: var(--text);
	transition: border-color 0.15s, transform 0.15s;
}

.live-tile:hover {
	color: var(--text);
	border-color: rgba(41, 171, 226, 0.5);
	transform: translateY(-2px);
}

.live-tile__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 4px;
	color: var(--muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.live-tile__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--danger);
	box-shadow: 0 0 8px var(--danger);
	animation: pulse 1.2s ease-in-out infinite;
}

.live-tile__side {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 10px;
	padding: 4px 8px;
	border-radius: var(--radius-xs);
}

.live-tile__side--active {
	background: var(--primary-soft);
	box-shadow: inset 3px 0 0 var(--primary);
}

.live-tile__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 650;
}

.live-tile__legs {
	color: var(--muted);
	font-family: var(--display);
	font-weight: 800;
	font-size: 1.1rem;
}

.live-tile__remaining {
	min-width: 3ch;
	font-family: var(--display);
	font-size: 2.2rem;
	font-weight: 800;
	line-height: 1;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.live-tile__visit {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-top: 6px;
	padding-top: 8px;
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 0.9rem;
}

.live-tile__visit b {
	color: var(--primary-text);
	font-family: var(--display);
	font-size: 1.2rem;
}

.live-tile--180 {
	border-color: rgba(227, 20, 27, 0.8);
	box-shadow: 0 0 0 1px rgba(227, 20, 27, 0.5), 0 14px 40px -14px rgba(227, 20, 27, 0.9);
}

.live-tile__flash {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	background: radial-gradient(circle, rgba(227, 20, 27, 0.55), rgba(5, 6, 8, 0.75) 70%);
	color: #fff;
	font-family: var(--display);
	font-size: 4.5rem;
	font-weight: 800;
	text-shadow: 0 0 30px rgba(227, 20, 27, 0.9);
	animation: fx-slam 0.6s cubic-bezier(0.2, 1.4, 0.3, 1) both;
	pointer-events: none;
}

/* ---- Tournament tree (big screen first, scrolls sideways on phones) ---- */

.page:has(.tree-page) {
	max-width: 1800px;
}

.tree-groups {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}

.tree-group {
	margin: 0;
	padding: 14px;
}

.tree-group h3 {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 8px;
	font-family: var(--display);
	font-size: 1.2rem;
	text-transform: uppercase;
}

.tree-group__table {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: rank;
}

.tree-group__table li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 5px 0;
	border-top: 1px solid var(--border);
	counter-increment: rank;
	font-size: clamp(0.9rem, 1vw, 1.05rem);
}

.tree-group__table li::before {
	content: counter(rank);
	width: 1.2em;
	color: var(--faint);
	font-weight: 700;
	text-align: center;
}

.tree-group__table li.qualifies {
	color: var(--primary-text);
	font-weight: 650;
}

.tree-group__table li.qualifies::before {
	color: var(--primary);
}

.tree-group__live {
	margin-top: 10px;
}

.tree-hint {
	text-align: center;
}

.tree-group__table li.withdrawn {
	text-decoration: line-through;
	opacity: 0.5;
}

.tree-group__name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tree-group__stat {
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

/* Rounds are columns of equal height; every slot of round r+1 spans two slots of round r, so the lines meet. */
.tree {
	--gap: 44px;
	display: flex;
	justify-content: safe center;
	gap: var(--gap);
	overflow-x: auto;
	padding: 4px 4px 12px;
	scroll-snap-type: x proximity;
}

.tree__round {
	display: flex;
	flex-direction: column;
	flex: 1 0 210px;
	min-width: 210px;
	max-width: 320px;
	scroll-snap-align: start;
}

.tree__round h3 {
	margin: 0 0 10px;
	color: var(--muted);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-align: center;
	text-transform: uppercase;
}

.tree__slots {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.tree__slot {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	padding: 8px 0;
}

/* Line out of each match to the right … */
.tree__round:not(:last-child) .tree__slot::after {
	content: "";
	position: absolute;
	top: 50%;
	right: calc(var(--gap) / -2);
	width: calc(var(--gap) / 2);
	border-top: 2px solid var(--border-strong);
}

/* … joined with its pair partner by a vertical line … */
.tree__round:not(:last-child) .tree__slot:nth-child(odd):not(:last-child)::before {
	content: "";
	position: absolute;
	top: 50%;
	right: calc(var(--gap) / -2);
	height: 100%;
	border-right: 2px solid var(--border-strong);
}

/* … and into the next round's match from the left. */
.tree__round + .tree__round .tree__slot .tree__match::before,
.tree__round + .tree__round .tree__winner::before {
	content: "";
	position: absolute;
	top: 50%;
	left: calc(var(--gap) / -2 - 1px);
	width: calc(var(--gap) / 2 + 1px);
	border-top: 2px solid var(--border-strong);
}

.tree__match {
	position: relative;
	width: 100%;
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
}

.tree__line {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 12px;
	font-size: clamp(0.92rem, 1.05vw, 1.15rem);
}

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

.tree__name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tree__legs {
	min-width: 1.4em;
	font-family: var(--display);
	font-size: 1.25em;
	font-weight: 800;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.tree__line.winner {
	color: var(--text);
	font-weight: 700;
}

.tree__line.winner .tree__legs {
	color: var(--primary-text);
}

.tree__line.loser {
	color: var(--faint);
}

.tree__match.is-bye {
	opacity: 0.55;
}

.tree__match.is-live {
	border-color: rgba(41, 171, 226, 0.7);
	box-shadow: 0 0 0 1px rgba(41, 171, 226, 0.35), 0 10px 30px -12px rgba(41, 171, 226, 0.7);
}

.tree__match.is-live .tree__legs {
	color: var(--primary-text);
}

.tree__live {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 12px 6px;
	border-top: 1px solid var(--border);
	color: var(--primary-text);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.tree__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--danger);
	box-shadow: 0 0 8px var(--danger);
	animation: pulse 1.2s ease-in-out infinite;
}

.tree__round--champion {
	flex: 0 0 200px;
	min-width: 200px;
}

.tree__winner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 100%;
	padding: 16px 12px;
	border-radius: var(--radius);
	border: 1px solid rgba(41, 171, 226, 0.55);
	background:
		radial-gradient(160px 100px at 50% 0%, rgba(41, 171, 226, 0.3), transparent 70%),
		var(--surface);
	box-shadow: 0 14px 40px -16px rgba(41, 171, 226, 0.8);
	color: var(--primary-text);
	font-family: var(--display);
	font-size: clamp(1.3rem, 1.6vw, 1.8rem);
	font-weight: 800;
	text-align: center;
	text-transform: uppercase;
}

.tree__winner .icon {
	width: 32px;
	height: 32px;
}

.tree-third {
	max-width: 260px;
	margin-top: 16px;
}

.tree-third h3 {
	margin: 0 0 8px;
	color: var(--muted);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* ---- Stats charts (charts.ts) ---- */

.chart-card {
	padding: 16px;
}

.chart-card h3 {
	margin: 0 0 10px;
	color: var(--muted);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.chart-pair {
	display: grid;
	gap: 12px;
}

@media (min-width: 700px) {
	.chart-pair {
		grid-template-columns: 1fr 1fr;
	}
}

.chart-pair > .card {
	margin: 0;
}

/* Horizontal bars: one series, value at the tip, the row is the hit target */
.bars {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.bars__row {
	display: grid;
	grid-template-columns: minmax(64px, auto) 1fr;
	align-items: center;
	gap: 12px;
	min-height: 32px;
	padding: 0 6px;
	border-radius: var(--radius-xs);
	outline: none;
}

.bars__row:hover, .bars__row:focus-visible {
	background: rgba(255, 255, 255, 0.04);
}

.bars__label {
	color: var(--muted);
	font-size: 0.85rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.bars__track {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.bars__bar {
	flex: 0 0 auto;
	height: 20px;
	max-width: calc(100% - 4.5em);
	border-radius: 0 4px 4px 0;
	background: #1d93ca;
	transition: filter 0.15s;
}

.bars__row:hover .bars__bar {
	filter: brightness(1.2);
}

.bars__bar--zero {
	width: 2px !important;
	background: var(--border-strong);
}

.bars__value {
	color: var(--text);
	font-size: 0.85rem;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Line charts: hairline solid grid, 2px lines, dots with a 2px surface ring */
.line-chart {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.line-chart__grid {
	stroke: rgba(255, 255, 255, 0.07);
	stroke-width: 1;
}

.line-chart__tick, .line-chart__axis {
	fill: var(--muted);
	font-family: var(--font);
	font-size: 11px;
	font-variant-numeric: tabular-nums;
}

.line-chart__tick {
	text-anchor: end;
	dominant-baseline: central;
}

.line-chart__line {
	fill: none;
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.line-chart__dot {
	stroke: var(--surface);
	stroke-width: 2;
}

.line-chart__cross {
	stroke: var(--border-strong);
	stroke-width: 1;
	opacity: 0;
}

.line-chart__cross--on {
	opacity: 1;
}

.line-chart__hit {
	fill: transparent;
}

.chart-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin-bottom: 8px;
	color: var(--muted);
	font-size: 0.8rem;
}

.chart-legend span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.chart-legend b {
	color: var(--text);
}

.chart-legend__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.chart-legend__line {
	width: 16px;
	height: 2px;
	border-radius: 1px;
}

.chart-tip {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 70;
	display: flex;
	flex-direction: column;
	gap: 2px;
	max-width: 260px;
	padding: 8px 10px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-xs);
	background: var(--surface-3);
	box-shadow: var(--shadow-lift);
	color: var(--muted);
	font-size: 0.8rem;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.1s;
}

.chart-tip strong {
	color: var(--text);
	font-size: 0.9rem;
}

.chart-tip--on {
	opacity: 1;
}

/* Heatmap on the dartboard */
.heatmap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.heatmap__mode {
	width: 100%;
	max-width: 360px;
}

.heatmap__board {
	width: 100%;
	max-width: 420px;
}

.board--heatmap .bed {
	stroke: #0b0e12;
	stroke-width: 0.8;
	stroke-opacity: 1;
	outline: none;
	transition: fill 0.25s;
}

.board--heatmap .bed:hover, .board--heatmap .bed:focus-visible {
	stroke: #fff;
	stroke-width: 1.6;
}

.heatmap__scale {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--muted);
	font-size: 0.75rem;
}

.heatmap__ramp {
	display: flex;
	gap: 2px;
}

.heatmap__ramp i {
	width: 22px;
	height: 10px;
	border-radius: 2px;
}

.heatmap__summary {
	margin: 0;
	font-size: 0.85rem;
	text-align: center;
}

.heatmap__table {
	width: 100%;
	max-width: 360px;
}

.heatmap__table summary {
	color: var(--muted);
	font-size: 0.85rem;
	cursor: pointer;
}

.heatmap-card__stats {
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	max-width: 420px;
	margin: 14px auto 0;
}

.leg__chart {
	padding: 4px var(--gutter) 12px;
}

/* Form: last games, oldest left */
.form-strip {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding-bottom: 4px;
}

.form-strip__game {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 0 0 52px;
	padding: 8px 0 6px;
	border-radius: var(--radius-sm);
	color: var(--text);
	box-shadow: inset 0 0 0 1px var(--border);
}

.form-strip__game:hover {
	color: var(--text);
	box-shadow: inset 0 0 0 1px var(--border-strong);
}

.form-strip__game b {
	font-family: var(--display);
	font-size: 1.4rem;
	line-height: 1;
}

.form-strip__game small {
	color: var(--muted);
	font-size: 0.72rem;
	font-variant-numeric: tabular-nums;
}

.form-strip__game.is-won {
	background: var(--success-soft);
}

.form-strip__game.is-won b {
	color: var(--success);
}

.form-strip__game.is-lost {
	background: var(--danger-soft);
}

.form-strip__game.is-lost b {
	color: var(--danger-hover);
}

/* ---- League match (Ligaspiel) ---- */

.league-head .h2h__name {
	font-size: clamp(1.2rem, 4.5vw, 1.7rem);
}

.league-game.is-live {
	background: linear-gradient(90deg, rgba(41, 171, 226, 0.12), transparent 70%);
	box-shadow: inset 3px 0 0 var(--primary);
}

.league-game.is-default .league-game__players {
	opacity: 0.6;
}

.league-game__name {
	flex: 0 0 74px;
	color: var(--muted);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.league-game__players {
	display: flex;
	flex-direction: column;
}

.league-game__players .winner {
	font-weight: 700;
}

.league-game__result {
	flex-shrink: 0;
	text-align: right;
}

.league-game__live {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	color: var(--primary-text);
}

.league-game__live b {
	font-family: var(--display);
	font-size: 1.45rem;
}

.league-game__live small {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
}

.league-pairs-box > summary {
	padding: 0 var(--gutter) 12px;
	color: var(--primary-text);
	font-size: 0.85rem;
	font-weight: 650;
	cursor: pointer;
}

.league-pairs {
	display: grid;
	gap: 10px;
	padding: 0 var(--gutter) 14px;
}

@media (min-width: 600px) {
	.league-pairs {
		grid-template-columns: 1fr 1fr auto;
		align-items: end;
	}
}

.league-pairs__side {
	display: grid;
	gap: 6px;
}

.league-lineup__title {
	margin: 0 0 8px;
	font-family: var(--display);
	font-size: 1.2rem;
	text-transform: uppercase;
}

.league-lineup {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

.league-lineup li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 0;
	border-top: 1px solid var(--border);
}

.league-lineup li.is-substitute {
	color: var(--muted);
}

.league-lineup__pos {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.06);
	font-family: var(--display);
	font-weight: 800;
}

.league-sub {
	flex-wrap: wrap;
}

.league-sub select {
	flex: 1 1 130px;
	min-width: 0;
}

.league-cancel {
	display: grid;
	gap: 8px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--border);
}

/* ---- Head-to-head ---- */

.h2h {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
	text-align: center;
	background:
		radial-gradient(300px 160px at 0% 0%, rgba(41, 171, 226, 0.18), transparent 70%),
		radial-gradient(300px 160px at 100% 100%, rgba(227, 20, 27, 0.14), transparent 70%),
		var(--surface);
}

.h2h__name {
	color: var(--text);
	font-family: var(--display);
	font-size: clamp(1.3rem, 5vw, 1.9rem);
	font-weight: 800;
	line-height: 1.1;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.h2h__record {
	display: flex;
	flex-direction: column;
	align-items: center;
	color: var(--muted);
	font-size: 0.82rem;
}

.h2h__score {
	color: var(--text);
	font-family: var(--display);
	font-size: clamp(2.6rem, 11vw, 3.6rem);
	font-weight: 800;
	line-height: 1;
	text-shadow: 0 4px 30px rgba(41, 171, 226, 0.4);
}

.compare-table td {
	width: 35%;
	text-align: center;
}

.compare-table thead th:not(:first-child) {
	text-align: center;
}

.compare-table td.better {
	color: var(--primary-text);
	font-weight: 800;
	background: linear-gradient(180deg, rgba(41, 171, 226, 0.12), rgba(41, 171, 226, 0.04));
}

/* ---- Scoring screen (board tablet, portrait first) ---- */

.scoring-body {
	height: 100dvh;
	overflow: hidden;
	overscroll-behavior: none;
}

.scoring {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: 100dvh;
	max-width: 900px;
	margin: 0 auto;
	padding: 8px;
	padding-top: max(8px, env(safe-area-inset-top));
	padding-bottom: max(8px, env(safe-area-inset-bottom));
	user-select: none;
	-webkit-user-select: none;
	touch-action: manipulation;
}

.scoring__bar {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	color: var(--muted);
	font-size: 0.9rem;
}

.scoring__format {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
}

.sync {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-left: auto;
	flex-shrink: 0;
	padding: 4px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.05);
	font-size: 0.78rem;
	font-weight: 600;
}

.sync::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--muted);
}

.sync--synced::before {
	background: var(--success);
	box-shadow: 0 0 8px var(--success);
}

.sync--pending::before {
	background: var(--warning);
	box-shadow: 0 0 8px var(--warning);
	animation: pulse 1s ease-in-out infinite;
}

.sync--offline, .sync--rejected {
	background: var(--danger-soft);
	color: var(--danger-hover);
}

.sync--offline::before, .sync--rejected::before {
	background: var(--danger);
	box-shadow: 0 0 8px var(--danger);
	animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
	50% {
		opacity: 0.35;
	}
}

.scoreboard {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.side {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 0;
	padding: 12px 8px 10px;
	overflow: hidden;
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	text-align: center;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.side--active {
	border-color: rgba(41, 171, 226, 0.7);
	background:
		radial-gradient(120% 80% at 50% 0%, rgba(41, 171, 226, 0.24), transparent 70%),
		var(--surface);
	box-shadow: 0 0 0 1px rgba(41, 171, 226, 0.4), 0 12px 40px -16px rgba(41, 171, 226, 0.7);
}

.side--active::before {
	content: "";
	position: absolute;
	top: 0;
	left: 18%;
	right: 18%;
	height: 3px;
	border-radius: 0 0 3px 3px;
	background: var(--grad-primary);
	box-shadow: 0 0 14px var(--primary);
}

.side__names {
	display: flex;
	flex-direction: column;
	max-width: 100%;
	font-weight: 700;
	font-size: 1.05rem;
}

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

.side__names .throwing {
	color: var(--primary-text);
}

.side__remaining {
	font-family: var(--display);
	font-size: clamp(4.4rem, 21vw, 10rem);
	font-weight: 800;
	line-height: 0.95;
	letter-spacing: -0.01em;
	font-variant-numeric: tabular-nums;
}

.side--active .side__remaining {
	text-shadow: 0 4px 40px rgba(41, 171, 226, 0.45);
}

.side__score {
	color: var(--muted);
}

.side__score b {
	color: var(--text);
	font-family: var(--display);
	font-size: 1.4rem;
	font-weight: 800;
}

.side__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2px 10px;
	color: var(--muted);
	font-size: 0.84rem;
}

.visit {
	padding: 8px 10px;
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.visit__darts {
	display: flex;
	align-items: center;
	gap: 8px;
}

.visit__dart {
	flex: 1;
	display: grid;
	place-items: center;
	min-height: 50px;
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	font-family: var(--display);
	font-size: 1.7rem;
	font-weight: 800;
	letter-spacing: 0.02em;
}

.visit__dart--empty {
	border-style: dashed;
	background: rgba(0, 0, 0, 0.15);
}

.visit__total {
	min-width: 84px;
	text-align: right;
	font-family: var(--display);
	font-size: 2.6rem;
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.visit__info {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	min-height: 1.6em;
	margin-top: 6px;
	color: var(--muted);
}

.visit__checkout {
	color: var(--primary-text);
	font-family: var(--display);
	font-weight: 800;
	font-size: 1.35rem;
	letter-spacing: 0.03em;
}

.keypad {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	grid-auto-rows: minmax(0, 1fr);
	gap: 6px;
}

.key {
	min-height: 44px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	background: linear-gradient(180deg, #1d252f, #151b22);
	color: var(--text);
	font-family: var(--display);
	font-size: clamp(1.6rem, 5.6vw, 2.5rem);
	font-weight: 700;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-touch-callout: none;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 0 rgba(0, 0, 0, 0.45);
	transition: background 0.08s, transform 0.08s, box-shadow 0.08s;
}

.key:active {
	background: linear-gradient(180deg, #2a3542, #222b36);
	transform: translateY(1px) scale(0.97);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.key--mod {
	background: linear-gradient(180deg, rgba(41, 171, 226, 0.2), rgba(41, 171, 226, 0.08));
	border-color: rgba(41, 171, 226, 0.4);
	color: var(--primary-text);
	font-size: clamp(1.15rem, 3.8vw, 1.6rem);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.key--mod small {
	display: block;
	font-family: var(--font);
	font-size: 0.55em;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	opacity: 0.75;
}

/* A tap waiting for a possible second tap (double) */
.key--pending {
	border-color: var(--primary);
	box-shadow: 0 0 0 2px var(--primary) inset;
}

.visit__dart--pending {
	border-color: var(--primary);
	color: var(--primary-text);
	animation: dart-pending 0.25s ease-out;
}

@keyframes dart-pending {
	from { opacity: 0.3; transform: scale(0.92); }
}

.key--on, .key--on:active {
	background: var(--grad-primary);
	border-color: transparent;
	color: var(--on-primary);
	box-shadow: 0 0 22px -4px rgba(41, 171, 226, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.key--miss {
	color: var(--muted);
}

.key--undo {
	background: linear-gradient(180deg, rgba(227, 20, 27, 0.2), rgba(227, 20, 27, 0.08));
	border-color: rgba(227, 20, 27, 0.45);
	color: var(--danger-hover);
}

.key:disabled {
	opacity: 0.25;
	transform: none;
}

.modal {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: grid;
	place-items: center;
	padding: var(--gutter);
	background: rgba(3, 5, 8, 0.7);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	animation: fade-in 0.15s ease-out;
}

.modal__box {
	width: min(480px, 100%);
	padding: 24px;
	background:
		radial-gradient(360px 180px at 50% 0%, rgba(41, 171, 226, 0.18), transparent 70%),
		var(--surface-2);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-lg);
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
	text-align: center;
	animation: pop-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1.1);
}

.modal__box h2 {
	margin-top: 0;
}

.modal__box h2::before {
	display: none;
}

.modal__buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 18px;
}

.modal__buttons .btn {
	min-height: 58px;
	font-size: 1.1rem;
}

.modal__score {
	margin: 0;
	font-family: var(--display);
	font-size: 4rem;
	font-weight: 800;
	line-height: 1;
	text-shadow: 0 4px 30px rgba(41, 171, 226, 0.45);
}

@keyframes fade-in {
	from {
		opacity: 0;
	}
}

@keyframes pop-in {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.97);
	}
}

/* ---- Scoring effects (180, leg won, game shot, next match) ---- */

.fx {
	position: fixed;
	inset: 0;
	z-index: 60;
	pointer-events: none;
	overflow: hidden;
}

.fx > * {
	position: absolute;
	inset: 0;
}

/* 180: rays, a slammed-in number and the thrower's name */
.fx__180 {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: radial-gradient(circle at 50% 45%, rgba(227, 20, 27, 0.35), rgba(3, 5, 8, 0.55) 60%);
	animation: fx-fade 2.2s ease-in-out both;
}

.fx__180 b {
	position: relative;
	font-family: var(--display);
	font-size: clamp(9rem, 42vw, 20rem);
	font-weight: 800;
	line-height: 0.9;
	letter-spacing: -0.02em;
	color: #fff;
	text-shadow: 0 0 40px rgba(227, 20, 27, 0.9), 0 0 90px rgba(41, 171, 226, 0.6), 0 8px 0 #9c0d12;
	animation: fx-slam 0.7s cubic-bezier(0.2, 1.4, 0.3, 1) both, fx-shake 0.35s 0.55s ease-in-out 2;
}

.fx__180 span {
	position: relative;
	margin-top: 10px;
	padding: 4px 16px;
	border-radius: 999px;
	background: var(--grad-danger);
	font-family: var(--display);
	font-size: clamp(1.4rem, 5vw, 2.2rem);
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	animation: fx-rise 0.5s 0.35s ease-out both;
}

.fx__rays {
	position: absolute;
	inset: 0;
	animation: fx-rays 2.2s linear both;
}

.fx__rays i {
	position: absolute;
	left: 50%;
	top: 45%;
	width: 14vmin;
	height: 140vmax;
	margin-left: -7vmin;
	transform-origin: 50% 0;
	transform: rotate(var(--angle));
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 60%);
	clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
}

/* Leg or set won: a banner sweeping across the scoreboard */
.fx__banner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	inset: 26% 0 auto;
	padding: 26px 16px;
	background: linear-gradient(90deg, transparent, rgba(41, 171, 226, 0.92) 18%, rgba(29, 147, 202, 0.95) 82%, transparent);
	color: var(--on-primary);
	text-align: center;
	box-shadow: 0 0 80px rgba(41, 171, 226, 0.6);
	animation: fx-sweep 2.6s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.fx__banner small {
	font-weight: 800;
	font-size: 0.85rem;
	letter-spacing: 0.25em;
	text-transform: uppercase;
}

.fx__banner b {
	font-family: var(--display);
	font-size: clamp(2.6rem, 10vw, 4.5rem);
	font-weight: 800;
	line-height: 1;
	text-transform: uppercase;
	color: #fff;
	text-shadow: 0 3px 0 rgba(0, 21, 32, 0.35);
}

.fx__banner span {
	font-family: var(--display);
	font-size: 2rem;
	font-weight: 800;
}

.fx__banner em {
	margin-top: 4px;
	padding: 2px 12px;
	border-radius: 999px;
	background: var(--grad-danger);
	color: #fff;
	font-style: normal;
	font-weight: 800;
	font-size: 0.9rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	animation: fx-pop 0.5s 0.5s cubic-bezier(0.2, 1.5, 0.3, 1) both;
}

/* Confetti in the club colours */
.fx__confetti i {
	position: absolute;
	top: -24px;
	left: var(--x);
	width: 9px;
	height: 15px;
	border-radius: 2px;
	background: var(--color);
	animation: fx-fall var(--duration) var(--delay) cubic-bezier(0.25, 0.4, 0.5, 1) both;
}

/* Next match intro: names fly in from both sides */
.fx__intro {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 24px;
	pointer-events: auto;
	background:
		radial-gradient(60% 40% at 0% 30%, rgba(41, 171, 226, 0.35), transparent 70%),
		radial-gradient(60% 40% at 100% 70%, rgba(227, 20, 27, 0.3), transparent 70%),
		#05070a;
	text-align: center;
	animation: fx-fade 3.2s ease-in-out both;
}

.fx__intro small {
	color: var(--primary-text);
	font-weight: 800;
	font-size: 0.9rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	animation: fx-rise 0.5s ease-out both;
}

.fx__intro b {
	max-width: 100%;
	font-family: var(--display);
	font-size: clamp(2.6rem, 11vw, 5rem);
	font-weight: 800;
	line-height: 1;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.fx__intro-a {
	animation: fx-from-left 0.6s 0.15s cubic-bezier(0.2, 1, 0.3, 1) both;
}

.fx__intro-b {
	animation: fx-from-right 0.6s 0.3s cubic-bezier(0.2, 1, 0.3, 1) both;
}

.fx__vs {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	margin: 6px 0;
	border-radius: 50%;
	background: var(--grad-danger);
	font-family: var(--display);
	font-size: 1.8rem;
	font-weight: 800;
	text-transform: uppercase;
	box-shadow: 0 0 40px rgba(227, 20, 27, 0.7);
	animation: fx-pop 0.5s 0.55s cubic-bezier(0.2, 1.6, 0.3, 1) both;
}

/* Game shot modal and the countdown to the next match */
.modal--win .modal__box {
	border-color: rgba(41, 171, 226, 0.5);
	box-shadow: 0 0 0 1px rgba(41, 171, 226, 0.3), 0 30px 90px -20px rgba(41, 171, 226, 0.6);
}

.modal__eyebrow {
	display: block;
	margin-bottom: 6px;
	color: var(--danger-hover);
	font-family: var(--font);
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.25em;
}

.modal--win .modal__score {
	animation: fx-pop 0.6s 0.1s cubic-bezier(0.2, 1.5, 0.3, 1) both;
}

.countdown {
	height: 6px;
	margin-top: 14px;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.08);
	overflow: hidden;
}

.countdown span {
	display: block;
	height: 100%;
	background: var(--grad-primary);
	box-shadow: 0 0 12px var(--primary);
	transform-origin: left;
	animation: countdown var(--duration) var(--elapsed) linear both;
}

@keyframes countdown {
	from {
		transform: scaleX(1);
	}

	to {
		transform: scaleX(0);
	}
}

/* Leaving for the next match */
.scoring--leaving, .board-advancing .page {
	transition: opacity 0.3s, transform 0.3s;
	opacity: 0;
	transform: scale(0.97);
}

@keyframes fx-fade {
	0% {
		opacity: 0;
	}

	10%, 80% {
		opacity: 1;
	}

	100% {
		opacity: 0;
	}
}

@keyframes fx-slam {
	from {
		opacity: 0;
		transform: scale(2.6) rotate(-8deg);
	}
}

@keyframes fx-shake {
	25% {
		transform: translateX(-6px) rotate(-1deg);
	}

	75% {
		transform: translateX(6px) rotate(1deg);
	}
}

@keyframes fx-rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
}

@keyframes fx-pop {
	from {
		opacity: 0;
		transform: scale(0.4);
	}
}

@keyframes fx-rays {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(40deg);
	}
}

@keyframes fx-sweep {
	0% {
		opacity: 0;
		transform: translateX(-100%) skewX(-12deg);
	}

	14% {
		opacity: 1;
		transform: translateX(0) skewX(0);
	}

	82% {
		opacity: 1;
		transform: translateX(0);
	}

	100% {
		opacity: 0;
		transform: translateX(100%) skewX(-12deg);
	}
}

@keyframes fx-fall {
	0% {
		opacity: 1;
		transform: translate(0, 0) rotate(0);
	}

	100% {
		opacity: 0.9;
		transform: translate(var(--drift), 110vh) rotate(var(--spin));
	}
}

@keyframes fx-from-left {
	from {
		opacity: 0;
		transform: translateX(-60vw) skewX(-10deg);
	}
}

@keyframes fx-from-right {
	from {
		opacity: 0;
		transform: translateX(60vw) skewX(-10deg);
	}
}

/* ---- Money ---- */

.balance {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 20px;
	overflow: hidden;
	border-color: rgba(41, 171, 226, 0.25);
	background:
		radial-gradient(320px 180px at 100% 0%, rgba(41, 171, 226, 0.2), transparent 70%),
		var(--surface);
}

.balance__value {
	font-family: var(--display);
	font-size: 3.2rem;
	font-weight: 800;
	line-height: 1.05;
	font-variant-numeric: tabular-nums;
}

.amount {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.positive {
	color: var(--success);
}

.negative {
	color: var(--danger-hover);
}

.struck {
	text-decoration: line-through;
	color: var(--muted);
}

.year-nav {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

.year-nav a {
	padding: 4px 10px;
	border-radius: 999px;
	color: var(--muted);
	font-weight: 600;
	font-size: 0.9rem;
}

.year-nav a:hover {
	color: var(--text);
}

.year-nav a.active {
	background: var(--primary-soft);
	color: var(--primary-text);
}

.void summary {
	margin-top: 4px;
	color: var(--muted);
	font-size: 0.84rem;
	cursor: pointer;
}

.void form {
	margin-top: 6px;
}

.penalty-type {
	flex-wrap: wrap;
}

.penalty-type__form {
	flex: 1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	min-width: 0;
}

.penalty-type__form .list__main {
	min-width: 200px;
}

/* Editable names get the whole row, controls go below */
.penalty-type__form .list__main:has(input) {
	flex-basis: 100%;
}

.penalty-type__controls {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

.penalty-type__amount {
	width: 96px;
	text-align: right;
}

.penalty-type--inactive .list__main {
	opacity: 0.5;
}

/* ---- Events ---- */

.event-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-right: 12px;
	flex-wrap: wrap;
}

.event-row__main {
	flex: 1;
	min-width: 220px;
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 68px;
	padding: 10px var(--gutter);
	color: var(--text);
}

.event-row__main:hover {
	color: var(--text);
}

.event-row--cancelled .event-row__main {
	opacity: 0.5;
}

.event-date {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 50px;
	height: 52px;
	border-radius: var(--radius-sm);
	background: rgba(255, 255, 255, 0.05);
	box-shadow: inset 0 0 0 1px var(--border);
	line-height: 1;
}

.event-date b {
	font-family: var(--display);
	font-size: 1.55rem;
	font-weight: 800;
}

.event-date small {
	margin-top: 2px;
	color: var(--primary-text);
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.rsvp {
	display: flex;
	gap: 6px;
	margin-left: auto;
	padding: 0 0 10px var(--gutter);
}

@media (min-width: 600px) {
	.rsvp {
		padding-bottom: 0;
	}
}

.event-info p {
	margin-bottom: 6px;
}

.event-description {
	white-space: pre-line;
}

.penalty-switch {
	margin-bottom: 18px;
}

.penalty-switch .hint {
	margin-top: 0;
}

.event-form:has(input[name="type"][value="OTHER"]:checked) .penalty-switch {
	display: none;
}

.event-form .repeat-until {
	display: none;
}

.event-form:has(input[name="repeat"]:checked) .repeat-until {
	display: block;
}

.calendar {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
	margin-bottom: 12px;
}

.calendar__head {
	padding: 4px 0;
	color: var(--muted);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-align: center;
	text-transform: uppercase;
}

.calendar__day {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	min-height: 66px;
	padding: 5px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
}

@media (min-width: 600px) {
	.calendar__day {
		min-height: 100px;
	}
}

.calendar__day.is-other {
	opacity: 0.35;
}

.calendar__day.is-today {
	border-color: rgba(41, 171, 226, 0.7);
	background:
		radial-gradient(100% 60% at 50% 0%, rgba(41, 171, 226, 0.18), transparent 80%),
		var(--surface);
	box-shadow: 0 0 0 1px rgba(41, 171, 226, 0.35), 0 8px 24px -12px rgba(41, 171, 226, 0.7);
}

.calendar__num {
	color: var(--muted);
	font-family: var(--display);
	font-size: 1rem;
	font-weight: 700;
}

.calendar__day.is-today .calendar__num {
	color: var(--primary-text);
}

.calendar__event {
	position: relative;
	display: block;
	padding: 2px 5px;
	border-radius: 5px;
	background: rgba(255, 255, 255, 0.08);
	color: var(--text);
	font-size: 0.7rem;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.calendar__event:hover {
	background: rgba(255, 255, 255, 0.14);
	color: var(--text);
}

.calendar__event.match {
	background: rgba(41, 171, 226, 0.26);
}

.calendar__event.cancelled {
	text-decoration: line-through;
	opacity: 0.55;
}

.calendar__event.open::after {
	content: "";
	position: absolute;
	top: 3px;
	right: 3px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--danger);
	box-shadow: 0 0 6px var(--danger);
}

.calendar__time {
	margin-right: 3px;
	font-weight: 700;
}

@media (max-width: 599px) {
	.calendar__title {
		display: none;
	}
}

/* ---- Live and board waiting ---- */

.watch__meta {
	text-align: center;
}

.side--winner {
	border-color: rgba(47, 210, 138, 0.7);
	box-shadow: 0 0 0 1px rgba(47, 210, 138, 0.35), 0 12px 40px -16px rgba(47, 210, 138, 0.6);
}

.waiting {
	padding: 44px var(--gutter);
	text-align: center;
}

.spinner {
	position: relative;
	width: 64px;
	height: 64px;
	margin: 0 auto 20px;
	border-radius: 50%;
	background: conic-gradient(from 0deg, transparent 0 25%, var(--primary));
	-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
	mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
	animation: spin 1s linear infinite;
}

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

/* ---- Tournaments ---- */

.check-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 0 12px;
}

.pairs-only, .tournament-form:has(input[name="playersPerSide"][value="2"]:checked) .singles-only {
	display: none;
}

.tournament-form:has(input[name="playersPerSide"][value="2"]:checked) .pairs-only {
	display: block;
}

.pair {
	display: grid;
	grid-template-columns: 28px 1fr 1fr;
	gap: 8px;
	align-items: start;
	margin-bottom: 8px;
}

.pair__label {
	padding-top: 12px;
	color: var(--muted);
	font-weight: 700;
}

.qualifies th, .qualifies td:first-child {
	color: var(--primary-text);
}

.qualifies td:first-child {
	box-shadow: inset 3px 0 0 var(--primary);
}

.champion {
	padding: 26px 18px;
	overflow: hidden;
	text-align: center;
	border-color: rgba(41, 171, 226, 0.5);
	background:
		radial-gradient(360px 200px at 50% 0%, rgba(41, 171, 226, 0.3), transparent 70%),
		var(--surface);
	box-shadow: 0 20px 50px -24px rgba(41, 171, 226, 0.8);
}

.champion__name {
	display: block;
	margin-top: 4px;
	font-family: var(--display);
	font-size: 2.6rem;
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--primary-text);
	text-shadow: 0 4px 30px rgba(41, 171, 226, 0.6);
}

.bracket {
	display: flex;
	gap: 14px;
	overflow-x: auto;
	padding-bottom: 8px;
	scroll-snap-type: x proximity;
}

.bracket__round {
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	gap: 10px;
	min-width: 200px;
	scroll-snap-align: start;
}

.bracket__round h3 {
	margin: 0;
	color: var(--muted);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-align: center;
	text-transform: uppercase;
}

.bracket__match {
	margin: 0;
	padding: 6px 0;
}

.bracket__line {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 5px 12px;
}

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

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

.bracket__line.winner {
	color: var(--primary-text);
	font-weight: 700;
}

.match-list .list__row {
	min-height: 52px;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
	}

	.fx__confetti, .fx__rays {
		display: none;
	}
}

/* ---- A Board's follow screen (follow.ts): a TV or laptop next to the Board ---- */

.follow-body--still, .follow-body--still * {
	cursor: none;
}

.follow {
	max-width: 1800px;
	margin: 0 auto;
	padding: max(16px, env(safe-area-inset-top)) clamp(12px, 2.5vw, 40px) 120px;
}

/* The whole board fits on a 16:9 screen next to the numbers */
.follow .watch__board {
	position: static;
	max-width: min(720px, 80vh);
}

@media (min-width: 1200px) {
	.follow .watch__grid {
		grid-template-columns: minmax(0, 1.3fr) minmax(360px, 1fr);
	}
}

.follow__corner {
	position: fixed;
	top: max(8px, env(safe-area-inset-top));
	right: 12px;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--muted);
	font-size: 0.85rem;
	opacity: 0.75;
}

.follow-body--still .follow__fullscreen {
	visibility: hidden;
}

.follow__banner {
	position: fixed;
	left: 50%;
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 4;
	width: max-content;
	max-width: calc(100% - 32px);
	padding: 12px 28px;
	transform: translateX(-50%);
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-lg);
	box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.9);
	text-align: center;
	animation: fade-in 0.3s ease-out;
}

.follow__banner p {
	margin: 0;
}

.follow__banner > p:first-child {
	color: var(--muted);
}

.follow__next {
	display: grid;
	gap: 2px;
	margin: 10px 0 0;
}

.follow__next small {
	color: var(--muted);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.follow__next b {
	font-family: var(--display);
	font-size: clamp(1.5rem, 3vw, 2.4rem);
	letter-spacing: 0.02em;
}

.follow-idle {
	min-height: calc(100dvh - 160px);
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 6px;
	text-align: center;
}

.follow-idle h1 {
	margin: 12px 0 0;
	font-family: var(--display);
	font-size: clamp(2.5rem, 7vw, 5.5rem);
	line-height: 1;
}

.follow-idle p {
	margin: 0;
	font-size: 1.2rem;
}

/* "Zweiter Bildschirm": the QR code on the Board tablet */
.follow-qr {
	display: grid;
	justify-items: center;
	gap: 8px;
	text-align: center;
}

.follow-qr p {
	margin: 0;
}

.follow-qr__code {
	width: min(240px, 60vw);
	padding: 10px;
	background: #fff;
	border-radius: var(--radius-sm);
}

.follow-qr__code svg {
	display: block;
	width: 100%;
	height: auto;
}

.follow-qr__url {
	font-family: var(--mono);
	font-size: 0.9rem;
	word-break: break-all;
}

.dialog {
	width: min(440px, calc(100vw - 32px));
	padding: 24px;
	color: var(--text);
	background: var(--grad-surface), var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-lg);
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
}

.dialog::backdrop {
	background: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(4px);
}

.dialog h2 {
	margin-top: 0;
	text-align: center;
}

.dialog form {
	margin-top: 16px;
}

.board-status--playing {
	color: var(--primary-text);
}

/* ---- Recurring payments and dues (treasury) ---- */

.field-row {
	display: grid;
	gap: 0 12px;
}

@media (min-width: 520px) {
	.field-row {
		grid-template-columns: 1fr 1fr;
	}
}

.schedule-every {
	align-items: center;
}

/* "alle [3] [Monat(e)]": the word and the number keep their size, the unit takes the rest */
.schedule-every > :first-child {
	flex: none;
}

.schedule-every input[type="number"] {
	width: 5.5em;
	flex: none;
}

.schedule-every select {
	flex: 1;
	min-width: 0;
}

.due-list__actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

/* Booking a due date with another amount or date */
.due-adjust {
	flex-wrap: wrap;
}

.due-adjust > input {
	flex: 1 1 7em;
	min-width: 7em;
}

.list__row.is-ended {
	opacity: 0.6;
}

.dues-plan {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin-top: 16px;
}

@media (max-width: 520px) {
	.due-list .list__row {
		flex-wrap: wrap;
	}

	.due-list__actions {
		width: 100%;
		justify-content: flex-start;
	}
}

/* Admin: the one-time QR code a Board's tablet scans to log in */
.board-login {
	text-align: center;
}

.board-login strong {
	display: block;
	margin-bottom: 10px;
}
