:root {
	/* Brand colors from the Seminaarinmäen Senators logo. The site uses one dark theme. */
	color-scheme: dark;
	--color-background: #0b1724;
	--color-surface: #102135;
	--color-text: #ffffff;
	--color-muted: #a9b8c9;
	--color-border: #24405e;
	--color-accent: #f4580c;
	--color-accent-text: #0b1724;
	--color-error: #ff8a80;
	--color-success: #7fd99c;
	--color-team-white: #f4f6f9;
	--color-team-white-text: #102135;
	--color-team-black: #05090f;
	--color-team-black-text: #ffffff;
	--radius: 14px;
	--space: 16px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-display: "Oswald", "Arial Narrow", system-ui, sans-serif;
}

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

body {
	min-height: 100vh;
	margin: 0;
	color: var(--color-text);
	font-family: var(--font);
	line-height: 1.5;
	background:
		radial-gradient(circle at 50% -20%, rgb(244 88 12 / 0.18), transparent 55%),
		var(--color-background);
	background-attachment: fixed;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 0.5em;
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

h2 {
	font-size: clamp(1.4rem, 4vw, 1.9rem);
}

code {
	color: var(--color-accent);
}

[hidden] {
	display: none !important;
}

.container {
	width: 100%;
	max-width: 960px;
	margin: 0 auto;
	padding: 0 var(--space);
}

.skip-link {
	position: absolute;
	top: -100px;
	left: var(--space);
	z-index: 10;
	padding: 8px 12px;
	color: var(--color-accent-text);
	background: var(--color-accent);
}

.skip-link:focus {
	top: 8px;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

:focus-visible {
	outline: 3px solid var(--color-accent);
	outline-offset: 2px;
}

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

/* Header */

.site-header {
	margin-bottom: calc(var(--space) * 1.5);
	padding: 12px 0;
	border-bottom: 3px solid var(--color-accent);
	background: var(--color-surface);
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
}

.brand__logo {
	width: 56px;
	height: 56px;
	border-radius: 50%;
}

.brand__club {
	margin: 0;
	color: var(--color-accent);
	font-family: var(--font-display);
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.brand__title {
	margin: 0;
	font-size: 1.6rem;
}

.site-header__auth {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 0.875rem;
}

/* Cards and forms */

.card {
	margin-bottom: var(--space);
	padding: clamp(16px, 4vw, 28px);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	background: var(--color-surface);
}

.card__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.notice {
	border-color: var(--color-error);
}

.form {
	display: grid;
	gap: 12px;
	max-width: 360px;
}

.form--row {
	grid-template-columns: 1fr;
	max-width: none;
}

@media (min-width: 640px) {
	.form--row {
		grid-template-columns: 2fr 1fr 1fr auto;
		align-items: end;
	}
}

.field {
	display: grid;
	gap: 4px;
	font-weight: 600;
}

.field--inline {
	display: inline-grid;
}

input,
select,
button {
	font: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
	width: 100%;
	min-height: 44px;
	padding: 8px 10px;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	color: var(--color-text);
	background: var(--color-background);
}

.button {
	min-height: 44px;
	padding: 8px 20px;
	border: 2px solid var(--color-accent);
	border-radius: 8px;
	color: var(--color-accent-text);
	font-family: var(--font-display);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: var(--color-accent);
	cursor: pointer;
	transition: filter 0.15s;
}

.button:hover:not(:disabled) {
	filter: brightness(1.1);
}

.button:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.button--ghost {
	color: var(--color-accent);
	background: transparent;
}

.button--ghost:hover:not(:disabled) {
	background: rgb(244 88 12 / 0.12);
}

.button--small {
	min-height: 36px;
	padding: 4px 12px;
	font-size: 0.875rem;
}

.button--primary {
	min-width: 220px;
	font-size: 1.125rem;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: var(--space);
}

.message {
	min-height: 1.5em;
	margin: 8px 0 0;
}

.message[data-type="error"] {
	color: var(--color-error);
	font-weight: 600;
}

.message[data-type="success"] {
	color: var(--color-success);
	font-weight: 600;
}

.error-list {
	color: var(--color-error);
}

/* Teams */

.draw-date {
	margin-top: 0;
	color: var(--color-muted);
	font-weight: 600;
}

.teams {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space);
}

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

.team {
	padding: 20px;
	border: 2px solid var(--color-border);
	border-top: 6px solid var(--color-accent);
	border-radius: var(--radius);
}

.team h3 {
	font-size: 1.75rem;
}

.team h4 {
	margin: 16px 0 4px;
	font-size: 1.05rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.75;
}

.team ul {
	margin: 0;
	padding: 0;
	font-size: 1rem;
	font-weight: 500;
	list-style: none;
}

.team--white {
	border-color: var(--color-team-white);
	border-top-color: var(--color-accent);
	color: var(--color-team-white-text);
	background: var(--color-team-white);
}

.team--black {
	color: var(--color-team-black-text);
	background: var(--color-team-black);
}

/* Admin */

.tabs {
	display: flex;
	gap: 4px;
	margin-bottom: -1px;
}

.tabs__tab {
	padding: 10px 18px;
	font-family: var(--font-display);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	border: 1px solid var(--color-border);
	border-radius: var(--radius) var(--radius) 0 0;
	color: var(--color-muted);
	font-weight: 700;
	background: transparent;
	cursor: pointer;
}

.tabs__tab[aria-selected="true"] {
	border-top: 3px solid var(--color-accent);
	border-bottom-color: var(--color-surface);
	color: var(--color-text);
	background: var(--color-surface);
}

.tabs + .card {
	border-top-left-radius: 0;
}

.selection-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: var(--space);
}

.selection-bar .actions {
	margin-top: 0;
}

.selection-summary {
	margin: 0;
	font-weight: 600;
}

.checklist {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: 12px;
	margin-top: 12px;
}

.checklist__group {
	margin: 0;
	padding: 8px 12px 12px;
	border: 1px solid var(--color-border);
	border-radius: 10px;
}

.checklist__group legend {
	padding: 0 4px;
	font-weight: 700;
}

.checklist__item {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 40px;
	cursor: pointer;
}

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

.table-wrap {
	overflow-x: auto;
}

.players-table {
	width: 100%;
	min-width: 560px;
	border-collapse: collapse;
}

.players-table th,
.players-table td {
	padding: 6px;
	border-bottom: 1px solid var(--color-border);
	text-align: left;
}

.players-table td:nth-child(3) input {
	width: 80px;
}

.players-table__actions {
	white-space: nowrap;
}

.players-table__actions .button + .button {
	margin-left: 4px;
}

/* Evaluation */

.draw-evaluation {
	margin: var(--space) 0 0;
	font-weight: 600;
}

.evaluation {
	margin-top: calc(var(--space) * 1.5);
	padding-top: var(--space);
	border-top: 1px solid var(--color-border);
}

.evaluation fieldset {
	margin: 0 0 var(--space);
	padding: 0;
	border: 0;
}

.evaluation legend {
	margin-bottom: 8px;
	font-weight: 700;
}

/* The slider and the ticks share the same 5 columns. The thumb centers are on the column centers. */
.evaluation__scale {
	--thumb-size: 28px;
	margin-bottom: calc(var(--space) * 1.5);
}

.evaluation__question {
	display: block;
	font-weight: 700;
}

.evaluation__value {
	display: block;
	margin: 4px 0 12px;
	color: var(--color-accent);
	font-family: var(--font-display);
	font-size: 1.4rem;
	font-weight: 700;
	text-align: center;
	text-transform: uppercase;
}

.evaluation__slider {
	display: block;
	width: calc(80% + var(--thumb-size));
	height: var(--thumb-size);
	margin: 0 0 0 calc(10% - var(--thumb-size) / 2);
	background: transparent;
	cursor: pointer;
	appearance: none;
}

.evaluation__slider::-webkit-slider-runnable-track {
	height: 10px;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	background: linear-gradient(to right, var(--color-team-white), var(--color-accent) 50%, var(--color-team-black));
}

.evaluation__slider::-moz-range-track {
	height: 10px;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	background: linear-gradient(to right, var(--color-team-white), var(--color-accent) 50%, var(--color-team-black));
}

.evaluation__slider::-webkit-slider-thumb {
	width: var(--thumb-size);
	height: var(--thumb-size);
	margin-top: calc((10px - var(--thumb-size)) / 2 - 1px);
	border: 4px solid var(--color-surface);
	border-radius: 50%;
	background: var(--color-accent);
	box-shadow: 0 0 0 2px var(--color-accent);
	appearance: none;
}

.evaluation__slider::-moz-range-thumb {
	width: var(--thumb-size);
	height: var(--thumb-size);
	border: 4px solid var(--color-surface);
	border-radius: 50%;
	background: var(--color-accent);
	box-shadow: 0 0 0 2px var(--color-accent);
}

.evaluation__slider:focus-visible {
	outline-offset: 6px;
}

.evaluation__ticks {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	margin-top: 4px;
}

.evaluation__tick {
	position: relative;
	padding: 14px 2px 4px;
	border: 0;
	color: var(--color-muted);
	font-size: clamp(0.72rem, 2.6vw, 0.9rem);
	line-height: 1.25;
	text-align: center;
	background: transparent;
	cursor: pointer;
}

/* Tick mark above each label. */
.evaluation__tick::before {
	position: absolute;
	top: 0;
	left: 50%;
	width: 2px;
	height: 10px;
	background: var(--color-border);
	content: "";
	transform: translateX(-50%);
}

.evaluation__tick:hover,
.evaluation__tick[aria-pressed="true"] {
	color: var(--color-text);
}

.evaluation__tick[aria-pressed="true"] {
	font-weight: 700;
}

.evaluation__tick[aria-pressed="true"]::before {
	background: var(--color-accent);
}

.evaluation__score {
	display: flex;
	align-items: end;
	gap: 12px;
}

.evaluation__score input {
	width: 90px;
}

.evaluation__score > span {
	padding-bottom: 10px;
	font-weight: 700;
}

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

.adjustment--negative {
	color: var(--color-error);
}

/* Admin navigation */

.admin-nav {
	display: flex;
	gap: 4px;
	margin-left: auto;
}

.admin-nav__link {
	padding: 8px 12px;
	border-bottom: 3px solid transparent;
	color: var(--color-muted);
	font-family: var(--font-display);
	font-weight: 500;
	letter-spacing: 0.04em;
	text-decoration: none;
	text-transform: uppercase;
}

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

.admin-nav__link[aria-current="page"] {
	border-bottom-color: var(--color-accent);
	color: var(--color-text);
}

@media (max-width: 640px) {
	.admin-nav {
		order: 3;
		width: 100%;
		margin-left: 0;
	}
}

/* Guide and FAQ */

.guide a {
	color: var(--color-accent);
}

.guide h3 {
	margin-top: calc(var(--space) * 1.5);
	color: var(--color-accent);
	font-size: 1.15rem;
}

.guide li + li {
	margin-top: 6px;
}

.guide details {
	border-bottom: 1px solid var(--color-border);
}

.guide summary {
	padding: 12px 0;
	font-weight: 600;
	cursor: pointer;
}

.guide summary:hover {
	color: var(--color-accent);
}

.guide details[open] {
	padding-bottom: 12px;
}

.guide details > :not(summary) {
	margin-top: 0;
}

/* Footer */

.site-footer {
	margin-top: calc(var(--space) * 3);
	border-top: 3px solid var(--color-accent);
	color: var(--color-muted);
	font-size: 0.95rem;
	background: var(--color-surface);
}

.site-footer__inner {
	display: grid;
	grid-template-columns: 1fr;
	gap: calc(var(--space) * 1.5);
	padding-top: calc(var(--space) * 2);
	padding-bottom: calc(var(--space) * 1.5);
}

@media (min-width: 720px) {
	.site-footer__inner {
		grid-template-columns: 2fr 1fr 1fr;
	}
}

.site-footer h2 {
	margin-bottom: 12px;
	color: var(--color-text);
	font-size: 1.1rem;
}

.site-footer p {
	margin: 0 0 8px;
}

.site-footer a {
	color: var(--color-accent);
}

.site-footer a:hover {
	color: var(--color-text);
}

.site-footer__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.site-footer__brand img {
	border-radius: 50%;
}

.site-footer__brand h2 {
	margin: 0;
}

.site-footer__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__list li + li {
	margin-top: 8px;
}

.site-footer .site-footer__bottom {
	margin: 0;
	padding: var(--space) 0;
	border-top: 1px solid var(--color-border);
	font-size: 0.85rem;
}

/* Keeps the footer at the bottom of the window on short pages. */
body {
	display: flex;
	flex-direction: column;
}

main {
	flex: 1 0 auto;
}

/* Unsaved player changes */

.players-table tr.is-changed td:first-child {
	box-shadow: inset 4px 0 0 var(--color-accent);
}

.players-table tr.is-changed input,
.players-table tr.is-changed select {
	border-color: var(--color-accent);
}

/* The bar is above the table. It stays at the top of the window while the user scrolls the table. */
.save-bar {
	display: flex;
	position: sticky;
	top: 0;
	z-index: 5;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: var(--space) 0;
	padding: 12px var(--space);
	border: 1px solid var(--color-border);
	border-radius: 10px;
	color: var(--color-muted);
	background: var(--color-surface);
}

.save-bar.has-changes {
	border: 2px solid var(--color-accent);
	color: var(--color-text);
	box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
}

.save-bar .actions {
	margin-top: 0;
}

.save-bar__text {
	margin: 0;
	font-weight: 600;
}

/* Table on the info page */

.info-table {
	width: 100%;
	max-width: 420px;
	border-collapse: collapse;
}

.info-table th,
.info-table td {
	padding: 6px 10px;
	border-bottom: 1px solid var(--color-border);
	text-align: left;
}

.info-table th {
	color: var(--color-text);
}
