/* The logo bracket's look: the game's dark palette (src/index.css), with system fonts. */
:root {
	color-scheme: dark;
	--page: #111;
	--surface: #2d2d2d;
	--surface-hover: #3a3a3a;
	--line: #3f3f3f;
	--white: #ededed;
	--muted: #a0a0a0;
	--primary: #00ceac;
	--danger: #ff6b6b;
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
	background: var(--page);
	color: var(--white);
	font: 16px/1.4 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
h1,
h2 {
	margin: 0;
	font-weight: 700;
}
h1 {
	font-size: 22px;
}
h2 {
	font-size: 18px;
}
button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}
button:disabled {
	cursor: default;
}
[hidden] {
	display: none !important;
}
.muted {
	color: var(--muted);
}
:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

.button {
	border: 0;
	border-radius: 12px;
	padding: 12px 20px;
	background: var(--primary);
	color: #111;
	font-weight: 700;
}
.link {
	border: 0;
	background: none;
	padding: 4px;
	color: var(--muted);
	text-decoration: underline;
}
.icon-button {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 10px;
	background: var(--surface);
}
.icon-button svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.icon-button:disabled {
	opacity: 0.35;
}

/* ---------- Voting page ---------- */
.play {
	min-height: 100dvh;
	display: grid;
	place-items: center;
	padding: 16px;
}
.card {
	width: 100%;
	max-width: 420px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 24px;
	border-radius: 16px;
	background: var(--surface);
	text-align: center;
}
.card input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--page);
	color: var(--white);
	font: inherit;
}
.card .button {
	width: 100%;
}
.champion {
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 12px;
	border: 2px solid var(--primary);
}
#save-status {
	margin: 0;
	min-height: 1.4em;
}

#match-view {
	width: 100%;
	max-width: 1200px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.match-header {
	display: grid;
	grid-template-columns: 36px 1fr 36px;
	align-items: center;
	text-align: center;
}
.match-header #progress {
	font-size: 14px;
	text-align: right;
}
.bar {
	height: 4px;
	border-radius: 2px;
	background: var(--surface);
	overflow: hidden;
}
#bar-fill {
	height: 100%;
	background: var(--primary);
	transition: width 0.2s ease-out;
}
.pair {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}
@media (min-width: 768px) {
	.pair {
		grid-template-columns: 1fr 1fr;
		gap: 20px;
	}
}
.option {
	padding: 0;
	border: 2px solid transparent;
	border-radius: 14px;
	background: var(--surface);
	overflow: hidden;
	transition: border-color 0.12s ease-out, transform 0.12s ease-out;
}
.option img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
}
@media (hover: hover) {
	.option:not(:disabled):hover {
		border-color: var(--surface-hover);
		transform: scale(1.01);
	}
}
.option.picked {
	border-color: var(--primary);
	transform: scale(1.02);
}

/* ---------- Dashboard ---------- */
.admin {
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px 16px 64px;
	display: flex;
	flex-direction: column;
	gap: 32px;
}
.admin-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}
.panel {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.table-wrap {
	overflow-x: auto;
	border-radius: 12px;
	background: var(--surface);
}
table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
th,
td {
	padding: 8px 12px;
	text-align: left;
	white-space: nowrap;
	border-bottom: 1px solid var(--line);
}
tr:last-child > td {
	border-bottom: 0;
}
th {
	color: var(--muted);
	font-weight: 600;
}
th button {
	border: 0;
	background: none;
	padding: 0;
	color: inherit;
	font-weight: inherit;
}
th button[aria-sort] {
	color: var(--white);
}
td.num,
th.num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.thumb {
	display: block;
	width: 128px;
	aspect-ratio: 16 / 9;
	border-radius: 6px;
}
.thumb.small {
	width: 64px;
}
.thumb-link {
	display: inline-block;
}
tr.replaced {
	opacity: 0.45;
}
.row-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}
.small-button {
	border: 1px solid var(--line);
	border-radius: 8px;
	background: none;
	padding: 4px 10px;
	font-size: 13px;
}
.small-button.danger {
	color: var(--danger);
}
.rounds {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 8px 0;
	white-space: normal;
}
.round-matches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 6px;
}
.duel {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px;
	border-radius: 8px;
	background: var(--page);
}
.duel img {
	opacity: 0.4;
	border: 2px solid transparent;
}
.duel img.won {
	opacity: 1;
	border-color: var(--primary);
}
.h2h {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding: 16px;
	border-radius: 12px;
	background: var(--surface);
}
.h2h-side {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}
.h2h select {
	padding: 6px 8px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--page);
	color: var(--white);
	font: inherit;
}
.h2h-score {
	font-size: 28px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	min-width: 96px;
	text-align: center;
}
.h2h-note {
	font-size: 13px;
	font-weight: 400;
}
.image-cell {
	display: flex;
	align-items: center;
	gap: 10px;
}
.empty {
	padding: 24px;
	text-align: center;
}
