@import url("data:text/css,");

:root {
	color-scheme: dark;
	--ink: #f5f2e9;
	--ink-muted: #a9aea8;
	--night: #090d11;
	--night-soft: #0f1519;
	--panel: rgba(19, 27, 31, 0.88);
	--panel-solid: #131b1f;
	--line: rgba(245, 242, 233, 0.12);
	--line-strong: rgba(245, 242, 233, 0.22);
	--lime: #5ba8ff;
	--lime-dark: #3176bd;
	--orange: #ff9f43;
	--blue: #8fddff;
	--radius-lg: 28px;
	--radius-md: 18px;
	--shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
	font-family:
		Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
		"Segoe UI", sans-serif;
	font-synthesis: none;
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	min-width: 320px;
	min-height: 100vh;
	margin: 0;
	overflow-x: hidden;
	color: var(--ink);
	background:
		linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
		var(--night);
	background-size: 48px 48px;
}

button,
textarea,
input {
	font: inherit;
}

button,
label[for],
summary {
	-webkit-tap-highlight-color: transparent;
}

button:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.upload-button:focus-within,
a:focus-visible {
	outline: 3px solid rgba(98, 217, 255, 0.75);
	outline-offset: 3px;
}

button:disabled {
	cursor: not-allowed;
	opacity: 0.58;
}

[hidden] {
	display: none !important;
}

.page-glow {
	position: fixed;
	z-index: -1;
	width: 520px;
	height: 520px;
	border-radius: 50%;
	filter: blur(130px);
	opacity: 0.1;
	pointer-events: none;
}

.page-glow-one {
	top: -240px;
	right: -120px;
	background: var(--lime);
}

.page-glow-two {
	top: 45%;
	left: -320px;
	background: var(--blue);
}

.site-header,
.page-shell,
footer {
	width: min(1180px, calc(100% - 40px));
	margin-inline: auto;
}

.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-block: 24px;
	border-bottom: 1px solid var(--line);
}

.brand {
	display: inline-flex;
	gap: 11px;
	align-items: center;
	color: var(--ink);
	font-size: 0.88rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
}

.brand-mark {
	display: grid;
	width: 34px;
	height: 34px;
	place-items: center;
	color: var(--night);
	background: var(--lime);
	border-radius: 50%;
	box-shadow: inset 0 0 0 3px rgba(9, 13, 17, 0.24);
}

.page-shell {
	padding-block: 68px 36px;
}

.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 40px;
	align-items: end;
	margin-bottom: 56px;
}

.eyebrow,
.section-kicker {
	margin: 0 0 10px;
	color: var(--lime);
	font-size: 0.7rem;
	font-weight: 850;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.hero h1 {
	max-width: 820px;
	margin: 0;
	font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
	font-size: clamp(3.5rem, 8.5vw, 7.2rem);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 0.86;
	text-transform: uppercase;
}

.hero h1 em {
	color: transparent;
	font-style: normal;
	-webkit-text-stroke: 1.5px var(--ink);
}

.hero-copy {
	max-width: 690px;
	margin: 28px 0 0;
	color: var(--ink-muted);
	font-size: clamp(1rem, 2vw, 1.13rem);
	line-height: 1.7;
}

.hero-stat {
	width: 190px;
	padding: 24px 0 4px 28px;
	border-left: 1px solid var(--line-strong);
}

.hero-stat-value {
	display: block;
	color: var(--lime);
	font-family: Georgia, serif;
	font-size: 3.3rem;
	font-weight: 700;
	line-height: 0.9;
}

.hero-stat-label,
.hero-progress {
	display: block;
	color: var(--ink-muted);
	font-size: 0.76rem;
	font-weight: 650;
}

.hero-stat-label {
	margin-top: 8px;
	text-transform: uppercase;
}

.hero-stat-rule {
	width: 100%;
	height: 1px;
	margin-block: 18px;
	background: var(--line);
}

.lottery-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.85fr) minmax(290px, 0.75fr);
	gap: 20px;
	align-items: start;
}

.arena-card,
.panel,
.results-panel {
	background: var(--panel);
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
	backdrop-filter: blur(16px);
}

.arena-card {
	position: relative;
	min-height: 670px;
	overflow: hidden;
	border-radius: var(--radius-lg);
}

.arena-card::after {
	position: absolute;
	right: -100px;
	bottom: -140px;
	width: 340px;
	height: 340px;
	background: radial-gradient(
		circle,
		rgba(91, 168, 255, 0.11),
		transparent 68%
	);
	content: "";
	pointer-events: none;
}

.arena-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 28px 30px;
	border-bottom: 1px solid var(--line);
}

.arena-header h2,
.panel-heading h2,
.results-heading h2 {
	margin: 0;
	font-size: 1.15rem;
	letter-spacing: -0.02em;
}

.round-counter,
.count-badge {
	display: inline-grid;
	height: 34px;
	min-width: 54px;
	place-items: center;
	color: var(--ink-muted);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--line);
	border-radius: 999px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.72rem;
	font-weight: 700;
}

.empty-state {
	display: grid;
	min-height: 500px;
	place-content: center;
	justify-items: center;
	color: var(--ink-muted);
}

.loader {
	width: 42px;
	height: 42px;
	border: 3px solid var(--line-strong);
	border-top-color: var(--lime);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

.lottery-stage {
	position: relative;
	z-index: 1;
	padding: 30px;
}

.stage-prompt {
	margin: 0 0 24px;
	color: var(--ink-muted);
	font-size: 0.84rem;
	text-align: center;
}

.matchup {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 118px minmax(0, 1fr);
	gap: 16px;
	align-items: stretch;
}

.choice-card {
	position: relative;
	display: flex;
	min-height: 235px;
	flex-direction: column;
	justify-content: space-between;
	overflow: hidden;
	padding: 22px;
	background:
		linear-gradient(145deg, rgba(91, 168, 255, 0.1), transparent 44%),
		rgba(255, 255, 255, 0.035);
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-md);
	transition: 400ms ease;
}

.choice-card-tails {
	background:
		linear-gradient(145deg, rgba(255, 159, 67, 0.1), transparent 44%),
		rgba(255, 255, 255, 0.035);
}

.choice-card::before {
	position: absolute;
	top: 50%;
	left: 50%;
	color: rgba(255, 255, 255, 0.025);
	font-family: Georgia, serif;
	font-size: 12rem;
	font-weight: 800;
	line-height: 1;
	content: "H";
	transform: translate(-50%, -50%);
}

.choice-card-tails::before {
	content: "T";
}

.choice-meta {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.choice-side,
.choice-status {
	color: var(--ink-muted);
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.choice-letter {
	display: grid;
	width: 30px;
	height: 30px;
	place-items: center;
	color: var(--lime);
	border: 1px solid currentcolor;
	border-radius: 50%;
	font-family: Georgia, serif;
	font-size: 0.78rem;
}

.choice-card-tails .choice-letter {
	color: var(--orange);
}

.player-name {
	position: relative;
	z-index: 1;
	margin: 30px 0;
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(1.45rem, 3vw, 2rem);
	font-weight: 650;
	line-height: 1.06;
}

.choice-status {
	position: relative;
	z-index: 1;
	margin: 0;
}

.choice-card.is-winner {
	background: rgba(91, 168, 255, 0.14);
	border-color: var(--lime);
	box-shadow:
		0 0 0 1px var(--lime),
		0 20px 50px rgba(0, 0, 0, 0.3);
	transform: translateY(-6px);
}

.choice-card-tails.is-winner {
	background: rgba(255, 159, 67, 0.14);
	border-color: var(--orange);
	box-shadow:
		0 0 0 1px var(--orange),
		0 20px 50px rgba(0, 0, 0, 0.3);
}

.choice-card.is-winner .choice-status {
	color: var(--lime);
}

.choice-card-tails.is-winner .choice-status {
	color: var(--orange);
}

.choice-card.is-winner .choice-status::after {
	content: " — selected";
}

.choice-card.is-out {
	opacity: 0.42;
	filter: grayscale(0.75);
	transform: scale(0.97);
}

.coin-zone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	perspective: 900px;
}

.coin {
	position: relative;
	width: 82px;
	height: 82px;
	transform-style: preserve-3d;
}

.coin-face {
	position: absolute;
	display: grid;
	width: 100%;
	height: 100%;
	place-items: center;
	color: #081d32;
	background:
		radial-gradient(circle at 34% 28%, #d7ebff 0 5%, transparent 6%),
		linear-gradient(145deg, #9dceff, var(--lime-dark));
	border: 5px double rgba(8, 29, 50, 0.55);
	border-radius: 50%;
	box-shadow:
		inset 0 0 0 4px rgba(255, 255, 255, 0.22),
		0 12px 30px rgba(0, 0, 0, 0.36);
	backface-visibility: hidden;
	font-family: Georgia, serif;
	font-size: 2rem;
	font-weight: 900;
}

.coin-tails {
	color: #3b2105;
	background:
		radial-gradient(circle at 34% 28%, #ffe0bd 0 5%, transparent 6%),
		linear-gradient(145deg, #ffc47d, var(--orange));
	transform: rotateY(180deg);
}

.coin.is-flipping {
	animation: coin-flip 1.55s cubic-bezier(0.16, 0.75, 0.2, 1) forwards;
}

.coin.landed-heads {
	transform: rotateY(0deg);
}

.coin.landed-tails {
	transform: rotateY(180deg);
}

.coin-shadow {
	width: 64px;
	height: 10px;
	margin-top: 16px;
	background: rgba(0, 0, 0, 0.45);
	border-radius: 50%;
	filter: blur(5px);
}

.coin:where(.is-flipping) + .coin-shadow {
	animation: shadow-pulse 1.55s ease-in-out;
}

.versus {
	margin-top: 18px;
	color: var(--ink-muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.62rem;
	font-weight: 800;
	letter-spacing: 0.12em;
}

.arena-actions {
	display: flex;
	justify-content: center;
	margin-top: 28px;
	gap: 12px;
}

.button,
.upload-button {
	display: inline-flex;
	min-height: 43px;
	gap: 9px;
	align-items: center;
	justify-content: center;
	padding: 0 17px;
	color: var(--ink);
	background: transparent;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	cursor: pointer;
	font-size: 0.78rem;
	font-weight: 800;
	transition: 180ms ease;
}

.button:hover:not(:disabled),
.upload-button:hover {
	border-color: rgba(245, 242, 233, 0.45);
	transform: translateY(-2px);
}

.button svg,
.upload-button svg,
.privacy-note svg {
	width: 17px;
	fill: none;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.button-primary {
	color: #101408;
	background: var(--lime);
	border-color: var(--lime);
	box-shadow: 0 10px 28px rgba(91, 168, 255, 0.16);
}

.button-primary:hover:not(:disabled) {
	background: #83bdff;
	border-color: #83bdff;
	box-shadow: 0 14px 34px rgba(91, 168, 255, 0.22);
}

.button-large {
	min-width: 220px;
	min-height: 52px;
}

.button-primary.is-loading svg {
	animation: arrow-pulse 650ms ease-in-out infinite alternate;
}

.button-quiet {
	border-color: transparent;
	color: var(--ink-muted);
}

.button-secondary,
.upload-button {
	background: rgba(255, 255, 255, 0.035);
}

.button-full,
.upload-button {
	width: 100%;
}

.sidebar {
	display: grid;
	gap: 20px;
}

.panel {
	padding: 22px;
	border-radius: var(--radius-md);
}

.panel-heading,
.results-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 20px;
}

.panel-heading-compact {
	margin-bottom: 16px;
}

.count-badge {
	min-width: 36px;
}

.owner-queue {
	max-height: 340px;
	margin: 0;
	padding: 0 4px 0 0;
	overflow-y: auto;
	list-style: none;
	scrollbar-color: var(--line-strong) transparent;
	scrollbar-width: thin;
}

.queue-item {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 11px 6px;
	color: var(--ink-muted);
	border-bottom: 1px solid var(--line);
	transition: 180ms ease;
}

.queue-item:last-child {
	border-bottom: 0;
}

.queue-item.is-current {
	color: var(--ink);
}

.queue-item.is-current .queue-marker {
	color: var(--night);
	background: var(--lime);
	border-color: var(--lime);
}

.queue-item.is-done .queue-marker {
	color: var(--lime);
	border-color: rgba(91, 168, 255, 0.4);
}

.queue-marker {
	display: grid;
	width: 32px;
	height: 32px;
	flex: 0 0 auto;
	place-items: center;
	border: 1px solid var(--line);
	border-radius: 50%;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.64rem;
	font-weight: 800;
}

.queue-details {
	min-width: 0;
}

.queue-details strong,
.queue-details small {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.queue-details strong {
	color: inherit;
	font-size: 0.82rem;
}

.queue-details small {
	margin-top: 3px;
	color: var(--ink-muted);
	font-size: 0.66rem;
}

.data-status {
	padding: 5px 9px;
	color: var(--lime);
	background: rgba(91, 168, 255, 0.1);
	border-radius: 999px;
	font-size: 0.62rem;
	font-weight: 800;
	text-transform: uppercase;
}

.data-status.is-error {
	color: #ffbc70;
	background: rgba(255, 159, 67, 0.12);
}

.json-details {
	margin-top: 10px;
}

.json-details summary {
	padding: 9px 2px;
	color: var(--ink-muted);
	cursor: pointer;
	font-size: 0.72rem;
	font-weight: 750;
	text-align: center;
}

.json-details form {
	display: grid;
	gap: 10px;
	margin-top: 8px;
}

textarea {
	width: 100%;
	resize: vertical;
	padding: 13px;
	color: var(--ink);
	background: rgba(0, 0, 0, 0.26);
	border: 1px solid var(--line-strong);
	border-radius: 12px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.7rem;
	line-height: 1.5;
}

.data-message {
	margin: 14px 0 0;
	color: var(--ink-muted);
	font-size: 0.7rem;
	line-height: 1.5;
}

.privacy-note {
	display: flex;
	gap: 7px;
	align-items: center;
	margin: 14px 0 0;
	padding-top: 14px;
	color: #7f8784;
	border-top: 1px solid var(--line);
	font-size: 0.64rem;
}

.privacy-note svg {
	width: 14px;
}

.results-panel {
	margin-top: 20px;
	padding: 28px 30px;
	border-radius: var(--radius-lg);
}

.results-heading {
	align-items: center;
	margin-bottom: 22px;
}

.result-actions {
	display: flex;
	gap: 8px;
}

.results-empty {
	display: flex;
	min-height: 116px;
	gap: 12px;
	align-items: center;
	justify-content: center;
	color: var(--ink-muted);
	border: 1px dashed var(--line-strong);
	border-radius: 14px;
	font-size: 0.82rem;
}

.results-empty span {
	color: var(--lime);
	font-size: 1.4rem;
}

.results-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1px;
	overflow: hidden;
	background: var(--line);
	border: 1px solid var(--line);
	border-radius: 14px;
}

.results-list:empty {
	display: none;
}

.result-row {
	display: grid;
	grid-template-columns: 38px minmax(90px, 0.7fr) minmax(130px, 1fr) auto;
	gap: 12px;
	align-items: center;
	min-height: 82px;
	padding: 15px;
	background: var(--panel-solid);
	animation: result-in 350ms ease both;
}

.result-number {
	color: #68716e;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.65rem;
}

.result-owner small,
.result-owner strong,
.result-selection small,
.result-selection strong {
	display: block;
}

.result-owner small,
.result-selection small {
	margin-bottom: 4px;
	color: var(--ink-muted);
	font-size: 0.6rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.result-owner strong,
.result-selection strong {
	overflow: hidden;
	font-size: 0.78rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.result-selection strong {
	color: var(--lime);
}

.result-side {
	padding: 5px 8px;
	border: 1px solid currentcolor;
	border-radius: 999px;
	font-size: 0.56rem;
	font-weight: 850;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.result-side-heads {
	color: var(--lime);
}

.result-side-tails {
	color: var(--orange);
}

.completion-overlay {
	width: min(940px, calc(100% - 32px));
	max-width: none;
	max-height: min(90vh, 860px);
	max-height: min(90dvh, 860px);
	margin: auto;
	padding: 0;
	overflow: hidden;
	color: var(--ink);
	background: #10171b;
	border: 1px solid rgba(91, 168, 255, 0.45);
	border-radius: var(--radius-lg);
	box-shadow:
		0 0 0 1px rgba(91, 168, 255, 0.12),
		0 36px 120px rgba(0, 0, 0, 0.72);
}

.completion-overlay::backdrop {
	background: rgba(2, 6, 9, 0.82);
	backdrop-filter: blur(10px);
}

.completion-overlay[open] {
	animation: completion-in 280ms cubic-bezier(0.16, 0.8, 0.25, 1) both;
}

.completion-card {
	display: grid;
	max-height: min(90vh, 860px);
	max-height: min(90dvh, 860px);
	grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.completion-header {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	justify-content: space-between;
	padding: 28px 30px 22px;
	background:
		radial-gradient(circle at 14% 0, rgba(91, 168, 255, 0.18), transparent 40%),
		var(--panel-solid);
	border-bottom: 1px solid var(--line);
}

.completion-heading {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}

.completion-heading .section-kicker {
	margin-bottom: 6px;
}

.completion-heading h2 {
	margin: 0;
	font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
	font-size: clamp(2.15rem, 5vw, 3.5rem);
	letter-spacing: -0.02em;
	line-height: 0.95;
	text-transform: uppercase;
}

.completion-mark {
	display: grid;
	width: 48px;
	height: 48px;
	flex: 0 0 auto;
	place-items: center;
	color: var(--night);
	background: var(--lime);
	border-radius: 50%;
	box-shadow: 0 0 0 8px rgba(91, 168, 255, 0.1);
	font-size: 1.3rem;
	font-weight: 900;
}

.completion-summary {
	margin: 11px 0 0;
	color: var(--ink-muted);
	font-size: 0.82rem;
}

.completion-close {
	width: 43px;
	height: 43px;
	flex: 0 0 auto;
	padding: 0;
	border-radius: 50%;
}

.completion-close svg {
	width: 18px;
}

.completion-results-frame {
	position: relative;
	min-height: 126px;
	padding: 22px 30px;
	overflow: hidden;
}

.completion-results-list {
	max-height: min(50vh, 500px);
	overflow-y: auto;
	scrollbar-color: var(--line-strong) transparent;
	scrollbar-width: thin;
	transition:
		filter 240ms ease,
		opacity 240ms ease,
		transform 240ms ease;
}

.completion-results-list.is-spoiler-filtered {
	overflow: hidden;
	filter: blur(13px);
	opacity: 0.34;
	pointer-events: none;
	transform: scale(0.985);
	user-select: none;
}

.spoiler-cover {
	position: absolute;
	z-index: 2;
	inset: 22px 30px;
	display: grid;
	place-content: center;
	justify-items: center;
	padding: 24px;
	background: rgba(16, 23, 27, 0.56);
	border: 1px solid rgba(91, 168, 255, 0.2);
	border-radius: 14px;
	text-align: center;
}

.spoiler-icon {
	display: grid;
	width: 42px;
	height: 42px;
	margin-bottom: 10px;
	place-items: center;
	color: var(--lime);
	background: rgba(91, 168, 255, 0.1);
	border: 1px solid rgba(91, 168, 255, 0.35);
	border-radius: 50%;
	font-size: 1.2rem;
}

.spoiler-cover strong,
.spoiler-cover span:last-child {
	display: block;
}

.spoiler-cover strong {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.1rem;
}

.spoiler-cover span:last-child {
	margin-top: 5px;
	color: var(--ink-muted);
	font-size: 0.72rem;
}

.completion-overlay.is-spoiler-mode {
	border-color: rgba(255, 159, 67, 0.55);
}

.completion-overlay.is-spoiler-mode .completion-results-frame {
	min-height: 180px;
	max-height: 220px;
	overflow: hidden;
}

.completion-overlay.is-spoiler-mode .completion-results-list {
	max-height: 176px;
}

.completion-overlay.is-spoiler-mode .completion-mark {
	background: var(--orange);
	box-shadow: 0 0 0 8px rgba(255, 159, 67, 0.1);
}

.completion-overlay.is-spoiler-mode .completion-footer .button-quiet {
	background: rgba(255, 255, 255, 0.035);
	border-color: var(--line-strong);
}

.completion-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 30px 22px;
}

.completion-footer {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	padding: 18px 30px;
	background: rgba(255, 255, 255, 0.025);
	border-top: 1px solid var(--line);
}

.completion-footer .button-primary {
	min-width: 180px;
}

footer {
	display: flex;
	justify-content: space-between;
	padding-block: 24px 36px;
	color: #606965;
	border-top: 1px solid var(--line);
	font-size: 0.68rem;
	font-weight: 750;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

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

.celebration i {
	position: absolute;
	top: -18px;
	left: var(--x);
	width: 8px;
	height: 15px;
	background: var(--color);
	animation: confetti-fall 1.6s var(--delay) cubic-bezier(0.15, 0.7, 0.5, 1)
		forwards;
}

.toast {
	position: fixed;
	z-index: 30;
	right: 24px;
	bottom: 24px;
	max-width: min(380px, calc(100% - 48px));
	padding: 14px 18px;
	color: var(--night);
	background: var(--lime);
	border-radius: 12px;
	box-shadow: var(--shadow);
	font-size: 0.78rem;
	font-weight: 800;
	opacity: 0;
	pointer-events: none;
	transform: translateY(14px);
	transition: 220ms ease;
}

.toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.toast.is-error {
	color: white;
	background: var(--orange);
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

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

@keyframes coin-flip {
	0% {
		transform: translateY(0) rotateY(0deg) rotateZ(0deg);
	}
	48% {
		transform: translateY(-105px) rotateY(calc(var(--end-rotation) * 0.52))
			rotateZ(5deg);
	}
	100% {
		transform: translateY(0) rotateY(var(--end-rotation)) rotateZ(0deg);
	}
}

@keyframes shadow-pulse {
	50% {
		opacity: 0.18;
		transform: scale(0.55);
	}
}

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

@keyframes completion-in {
	from {
		opacity: 0;
		transform: translateY(18px) scale(0.98);
	}
}

@keyframes arrow-pulse {
	to {
		transform: translateX(4px);
	}
}

@keyframes confetti-fall {
	to {
		transform: translate(var(--drift), 105vh) rotate(680deg);
	}
}

@media (max-width: 980px) {
	.lottery-grid {
		grid-template-columns: 1fr;
	}

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

	.owner-queue {
		max-height: 280px;
	}
}

@media (max-width: 720px) {
	.site-header,
	.page-shell,
	footer {
		width: min(100% - 24px, 1180px);
	}

	.page-shell {
		padding-top: 46px;
	}

	.hero {
		grid-template-columns: 1fr;
		gap: 28px;
		margin-bottom: 38px;
	}

	.hero-stat {
		display: grid;
		width: 100%;
		grid-template-columns: auto 1fr;
		column-gap: 12px;
		align-items: center;
		padding: 18px;
		border: 1px solid var(--line);
		border-radius: 14px;
	}

	.hero-stat-value {
		grid-row: span 2;
		font-size: 2.6rem;
	}

	.hero-stat-label {
		margin: 0;
	}

	.hero-stat-rule {
		display: none;
	}

	/* Keep both choices in view, then place the coin immediately above the action. */
	.matchup {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.choice-card {
		min-height: 142px;
		padding: 14px;
		grid-row: 1;
	}

	.choice-card-tails {
		grid-column: 2;
	}

	.choice-card::before {
		font-size: 7rem;
	}

	.player-name {
		margin: 14px 0;
		font-size: clamp(1.05rem, 5.5vw, 1.45rem);
	}

	.coin-zone {
		min-height: 96px;
		grid-column: 1 / -1;
		grid-row: 2;
	}

	.coin {
		width: 64px;
		height: 64px;
	}

	.coin-shadow {
		margin-top: 6px;
	}

	.versus {
		margin-top: 6px;
	}

	.arena-actions {
		margin-top: 16px;
	}

	.sidebar {
		grid-template-columns: 1fr;
	}

	.results-list {
		grid-template-columns: 1fr;
	}

	.results-heading {
		align-items: flex-start;
		flex-direction: column;
	}

	.arena-card {
		min-height: 0;
	}
}

@media (max-width: 500px) {
	.arena-header,
	.lottery-stage,
	.results-panel {
		padding: 20px;
	}

	.arena-actions {
		align-items: stretch;
		flex-direction: column;
	}

	.button-large {
		width: 100%;
	}

	.result-actions {
		width: 100%;
		flex-direction: column;
	}

	.result-actions .button {
		width: 100%;
	}

	.completion-overlay {
		width: calc(100% - 20px);
		border-radius: 20px;
	}

	.completion-header {
		padding: 22px 20px 18px;
	}

	.completion-mark {
		display: none;
	}

	.completion-results-frame {
		padding: 16px 20px;
	}

	.spoiler-cover {
		inset: 16px 20px;
	}

	.completion-actions {
		padding: 0 20px 18px;
	}

	.completion-actions .button {
		width: 100%;
	}

	.completion-footer {
		align-items: stretch;
		flex-direction: column;
		padding: 16px 20px 20px;
	}

	.completion-footer .button {
		width: 100%;
	}

	.result-row {
		grid-template-columns: 30px minmax(0, 0.65fr) minmax(0, 1fr);
	}

	.result-side {
		display: none;
	}

	footer {
		gap: 10px;
		flex-direction: column;
	}
}

@media (max-height: 700px) {
	.completion-overlay {
		overflow-y: auto;
	}

	.completion-card {
		display: block;
		max-height: none;
	}

	.completion-results-frame {
		overflow: visible;
	}

	.completion-results-list {
		max-height: none;
		overflow: visible;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
