/* Colour palettes and the design tokens derived from them.
   A palette is selected by setting data-color-scheme on <body>. */

:root {
	--font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--font-display: 'Afacad', var(--font-body);

	--cardin-green-50: #effef5;
	--cardin-green-100: #dafee9;
	--cardin-green-200: #b6fcd5;
	--cardin-green-300: #7ef7b4;
	--cardin-green-400: #3fe98c;
	--cardin-green-500: #16d16b;
	--cardin-green-600: #0bae55;
	--cardin-green-700: #0d8846;
	--cardin-green-800: #106b3b;
	--cardin-green-900: #0f5832;
	--cardin-green-950: #02341b;

	--red-50: #fef3f2;
	--red-100: #ffe3e1;
	--red-200: #ffcbc8;
	--red-300: #ffa7a2;
	--red-400: #fd6a62;
	--red-500: #f5473e;
	--red-600: #e3291f;
	--red-700: #bf1f16;
	--red-800: #9e1d16;
	--red-900: #831e19;
	--red-950: #470b08;

	--java-50: #effefc;
	--java-100: #cafdf8;
	--java-200: #95faf1;
	--java-300: #58f0e9;
	--java-400: #26dbd8;
	--java-500: #0dbcbc;
	--java-600: #07979a;
	--java-700: #0b767a;
	--java-800: #0e5d61;
	--java-900: #114d50;
	--java-950: #022d31;

	--orange-50: #fff9ed;
	--orange-100: #fff1d5;
	--orange-200: #fee0aa;
	--orange-300: #fdc162;
	--orange-400: #fba53c;
	--orange-500: #f98a16;
	--orange-600: #ea6f0c;
	--orange-700: #c2540c;
	--orange-800: #9a4212;
	--orange-900: #7c3812;
	--orange-950: #431a07;

	--pink-50: #fdf2f7;
	--pink-100: #fce7f1;
	--pink-200: #fbcfe4;
	--pink-300: #f9a8cd;
	--pink-400: #f68dbb;
	--pink-500: #ec488b;
	--pink-600: #db2768;
	--pink-700: #be184f;
	--pink-800: #9d1742;
	--pink-900: #83183a;
	--pink-950: #50071e;

	--red: #e63950;
}

/* Green is also the default, so unscoped :root gets the same values.
   That keeps the app rendering correctly even before JS applies a scheme. */
:root,
body[data-color-scheme='green'] {
	--secondary-white: var(--cardin-green-50);
	--main-50: var(--cardin-green-50);
	--main-100: var(--cardin-green-100);
	--main-200: var(--cardin-green-200);
	--main-300: var(--cardin-green-300);
	--main-400: var(--cardin-green-400);
	--main-500: var(--cardin-green-500);
	--main-600: var(--cardin-green-600);
	--main-700: var(--cardin-green-700);
	--main-800: var(--cardin-green-800);
	--main-900: var(--cardin-green-900);
	--main-950: var(--cardin-green-950);
}

body[data-color-scheme='blue'] {
	--secondary-white: var(--java-50);
	--main-50: var(--java-50);
	--main-100: var(--java-100);
	--main-200: var(--java-200);
	--main-300: var(--java-300);
	--main-400: var(--java-400);
	--main-500: var(--java-500);
	--main-600: var(--java-600);
	--main-700: var(--java-700);
	--main-800: var(--java-800);
	--main-900: var(--java-900);
	--main-950: var(--java-950);
}

body[data-color-scheme='red'] {
	--secondary-white: var(--red-50);
	--main-50: var(--red-50);
	--main-100: var(--red-100);
	--main-200: var(--red-200);
	--main-300: var(--red-300);
	--main-400: var(--red-400);
	--main-500: var(--red-500);
	--main-600: var(--red-600);
	--main-700: var(--red-700);
	--main-800: var(--red-800);
	--main-900: var(--red-900);
	--main-950: var(--red-950);
}

body[data-color-scheme='orange'] {
	--secondary-white: var(--orange-50);
	--main-50: var(--orange-50);
	--main-100: var(--orange-100);
	--main-200: var(--orange-200);
	--main-300: var(--orange-300);
	--main-400: var(--orange-400);
	--main-500: var(--orange-500);
	--main-600: var(--orange-600);
	--main-700: var(--orange-700);
	--main-800: var(--orange-800);
	--main-900: var(--orange-900);
	--main-950: var(--orange-950);
}

body[data-color-scheme='pink'] {
	--secondary-white: var(--pink-50);
	--main-50: var(--pink-50);
	--main-100: var(--pink-100);
	--main-200: var(--pink-200);
	--main-300: var(--pink-300);
	--main-400: var(--pink-400);
	--main-500: var(--pink-500);
	--main-600: var(--pink-600);
	--main-700: var(--pink-700);
	--main-800: var(--pink-800);
	--main-900: var(--pink-900);
	--main-950: var(--pink-950);
}

/* Font mapping:
   Proxima Nova -> Figtree
   Edmondsans -> Afacad
*/

@font-face {
  font-family: 'Figtree';
  src: url(fonts/c529ff25ad876d9a7ddf.woff2) format('woff2');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/9994c318fed41ad7cf61.woff2) format('woff2');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/40ebe977f6e040ac4518.woff2) format('woff2');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/48f87883a119361c3452.woff2) format('woff2');
  font-weight: 300;
  font-style: italic;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/df37a8785d1e1dc79bf4.woff2) format('woff2');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/102dbfab65c1f2dda699.woff2) format('woff2');
  font-weight: 500;
  font-style: italic;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/8d5177fc3f64a3e0dcb4.woff2) format('woff2');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/fac67847b988ccc2da11.woff2) format('woff2');
  font-weight: 600;
  font-style: italic;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/8ba3e97e450704439a17.woff2) format('woff2');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/78f3183516e3afdde77a.woff2) format('woff2');
  font-weight: 700;
  font-style: italic;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/9d0723f30a83aa4d9677.woff2) format('woff2');
  font-weight: 800;
  font-style: normal;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/133b251c9b31207c8e1c.woff2) format('woff2');
  font-weight: 800;
  font-style: italic;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/cdd8a414ee94aebdbcbd.woff2) format('woff2');
  font-weight: 900;
  font-style: normal;
}

@font-face {
  font-family: 'Figtree';
  src: url(fonts/39aa41d719c2a3595411.woff2) format('woff2');
  font-weight: 900;
  font-style: italic;
}

@font-face {
  font-family: 'Afacad';
  src: url(fonts/ce4d680f06370e31ec49.woff2) format('woff2');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Afacad';
  src: url(fonts/c2eadc3b2bddea7fd930.woff2) format('woff2');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'Afacad';
  src: url(fonts/a338d79dfbbf81d25cb0.woff2) format('woff2');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Afacad';
  src: url(fonts/da10187030f76058d72b.woff2) format('woff2');
  font-weight: 500;
  font-style: italic;
}

@font-face {
  font-family: 'Afacad';
  src: url(fonts/8a89ebe2e17b86dd0923.woff2) format('woff2');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Afacad';
  src: url(fonts/f86d7622ca4766ea1f50.woff2) format('woff2');
  font-weight: 600;
  font-style: italic;
}

@font-face {
  font-family: 'Afacad';
  src: url(fonts/e19f3e5da36228b5c841.woff2) format('woff2');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Afacad';
  src: url(fonts/4251c71d1c3924f14bb8.woff2) format('woff2');
  font-weight: 700;
  font-style: italic;
}

/* Reset, global typography and the shared keyframes. */

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

html {
	height: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--font-body);
	font-weight: 400;
	background-color: var(--main-600);
	color: var(--main-50);
	-webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
p {
	margin: 0;
	font-weight: 400;
}

h1 {
	font-size: 2rem;
}

h2 {
	font-size: 1rem;
}

p {
	line-height: 1.5;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

input,
button,
select,
textarea {
	font-size: inherit;
	font-family: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

button:focus:not(:focus-visible) {
	outline: none;
}

ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

svg {
	display: block;
}

[hidden] {
	display: none !important;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: auto;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

@media (min-width: 720px) {
	h1 {
		font-size: 2.4rem;
	}
}

/* --- shared animations --- */

.fadeIn {
	animation: fadeIn 0.5s forwards;
}

.fadeOut {
	animation: fadeOut 0.5s forwards;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes fadeOut {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}

@keyframes scroll {
	from {
		transform: translateY(-100%);
	}
	to {
		transform: translateY(0);
	}
}

.is-winner {
	animation-name: tada;
	animation-duration: 1s;
	animation-iteration-count: 5;
}

@keyframes tada {
	0% {
		transform: scaleX(1);
	}
	10%,
	20% {
		transform: scale3d(0.9, 0.9, 0.9) rotate(-3deg);
	}
	30%,
	50%,
	70%,
	90% {
		transform: scale3d(1.1, 1.1, 1.1) rotate(3deg);
	}
	40%,
	60%,
	80% {
		transform: scale3d(1.1, 1.1, 1.1) rotate(-3deg);
	}
	to {
		transform: scaleX(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.is-winner {
		animation: none;
	}
}

/* App shell: the screen stack and the floating toolbar. */

.app {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	-webkit-touch-callout: none;
	user-select: none;
}

.app main {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 100vw;
	height: 100vh;
	margin: 0 auto;
	overflow: hidden;
}

/* One .screen per route; the router unhides exactly one. */
.screen {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 0;
}

/* --- toolbar --- */

.toolbar {
	position: absolute;
	inset: auto 0 0 0;
	z-index: 100;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	height: 84px;
	padding: 12px;
	text-align: center;
}

.toolbar__credit {
	color: var(--main-200);
	font-size: 0.95rem;
	text-align: left;
}

.toolbar__credit a {
	text-decoration: underline;
}

.toolbar__actions {
	display: flex;
	gap: 0.5rem;
	margin-left: auto;
	padding: 0.5rem 0.75rem;
	background: var(--main-800);
	border: 4px solid var(--main-100);
	border-radius: 0.75rem;
	box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.25);
}

.toolbar__button {
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	color: var(--main-50);
	background: none;
	border: 0;
	border-radius: 0.375rem;
}

.toolbar__button svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.toolbar__button:hover {
	color: var(--main-200);
}

.toolbar__button:focus-visible {
	outline: 2px solid var(--main-50);
	outline-offset: 2px;
}

.toolbar__separator {
	width: 0;
	height: 3rem;
	margin: 0 1rem;
	border-left: 3px solid var(--main-50);
	border-radius: 1rem;
}

@media (max-width: 720px) {
	.toolbar__credit {
		display: none;
	}
}

/* Fixed, so it never contributes to the page's scrollable area, and clipped,
   so particles leaving the viewport cannot either. Decorative, so it must not
   swallow clicks aimed at the game underneath (pointer-events inherits). */
.confetti-layer {
	position: fixed;
	inset: 0;
	z-index: 1200;
	overflow: hidden;
	pointer-events: none;
}

/* The library also sets position: relative here; stating it ourselves keeps
   the offsets working if that ever changes. Percentages resolve against the
   layer, so this is 50%/30% of the viewport. */
.confetti-host {
	position: relative;
	top: 30%;
	left: 50%;
}

/* Per-game settings popover (native HTML popover). */

.settings-popover {
	padding: 1.5rem 2rem;
	color: #111827;
	background: #fff;
	border: 2px solid #111827;
	border-radius: 0.5rem;
}

.settings-popover::backdrop {
	background-color: rgba(0, 0, 0, 0.5);
}

.settings-popover h3 {
	margin-bottom: 0.5rem;
	font-size: 1.25rem;
	font-weight: 600;
}

.settings-popover__fields {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	gap: 0.5rem 1rem;
	margin: 1rem 0;
}

.settings-popover__fields label {
	font-size: 0.875rem;
	font-weight: 500;
}

.settings-popover__fields select,
.settings-popover__fields input[type='text'],
.settings-popover__fields input[type='number'] {
	width: 100%;
	min-width: 6rem;
	padding: 0.25rem 0.5rem;
	border: 1px solid var(--main-800);
	border-radius: 4px;
	background: #fff;
}

.settings-popover__fields select {
	appearance: auto;
}

.settings-popover__fields input[type='checkbox'] {
	width: 1.1rem;
	height: 1.1rem;
	justify-self: start;
	accent-color: var(--main-700);
}

/* A field made of a pair of inputs (the slots range). */
.settings-popover__group {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.settings-popover__group input {
	flex: 1 1 auto;
	min-width: 0;
}

.settings-popover__actions {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 1rem;
}

.button-secondary,
.button-primary {
	padding: 0.625rem 1.25rem;
	font-size: 0.875rem;
	font-weight: 500;
	border-radius: 0.5rem;
}

.button-secondary {
	color: #111827;
	background: #fff;
	border: 1px solid #e5e7eb;
}

.button-secondary:hover {
	background: #f3f4f6;
}

.button-primary {
	color: var(--main-50);
	background: var(--main-700);
	border: 1px solid var(--main-700);
}

.button-primary:hover {
	background: var(--main-800);
}

/* Browsers without the popover API treat [popover] as an unknown attribute and
   would render all three popovers inline, so hide them by default and re-show
   through whichever mechanism the browser actually understands. The two rules
   below are kept separate on purpose: a browser that cannot parse
   :popover-open drops that rule only, leaving the .is-open fallback intact. */
.settings-popover {
	display: none;
}

.settings-popover:popover-open {
	display: block;
}

.settings-popover.is-open {
	display: block;
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 1000;
	transform: translate(-50%, -50%);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Home screen: title and the four game tiles. */

/* Always 1024px (or the window, if narrower). Without an explicit width the
   column shrinks to its content inside the flex layout, so a short tagline
   made the whole page narrower in some languages. */
.home {
	width: 100%;
	max-width: 1024px;
	margin: auto;
	padding: 0 1rem;
	flex: 0.6;
}

.home__title {
	width: 100%;
	font-size: 3.75rem;
	line-height: 1;
	font-weight: 700;
	text-transform: uppercase;
	text-align: left;
}

/* Sized to the window so the longest tagline (Norwegian) stays on one line
   from about 540px up; on phones it wraps, balanced, at a readable 1rem. */
.home__tagline {
	margin-top: 0.5rem;
	font-size: clamp(1rem, 2.8vw, 1.75rem);
	text-wrap: balance;
	line-height: 1.2;
	font-weight: 200;
	text-transform: uppercase;
	text-align: left;
	color: var(--main-800);
}

.home__games {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem;
	width: 100%;
	margin-top: 1.5rem;
}

.game-box {
	overflow: hidden;
	border: 1px solid var(--main-100);
	border-radius: 12px;
	box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.25);
}

.game-box:hover {
	text-decoration: none;
}

.game-box:focus-visible {
	outline: 3px solid var(--main-50);
	outline-offset: 3px;
}

.game-box svg {
	width: 100%;
	height: 100%;
	border-radius: 4px;
}

@media (max-width: 860px) {
	.home__games {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.home__title {
		font-size: 2.5rem;
	}
}

/* Books / numeral draw. */

.books {
	margin: auto;
	color: #fff;
	font-size: 1em;
	text-align: left;
}

.books__setup {
	display: flex;
	flex-direction: column;
	justify-content: center;
	flex-grow: 1;
	overflow: hidden;
}

.books__error {
	margin-bottom: 1rem;
	padding: 1rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #991b1b;
	background: #fef2f2;
	border-radius: 0.5rem;
}

.books__mode {
	margin-top: 1rem;
	font-size: 1.875rem;
	font-weight: 200;
	text-transform: uppercase;
	color: #666;
}

.books__mode a {
	color: var(--secondary-white);
	text-decoration: underline;
	cursor: pointer;
}

/* The currently selected mode is not a link. */
.books[data-game-type='books'] .books__mode a[data-type='books'],
.books[data-game-type='numeral'] .books__mode a[data-type='numeral'] {
	color: inherit;
	text-decoration: none;
	pointer-events: none;
	cursor: default;
}

.books[data-game-type='books'] [data-when='numeral'],
.books[data-game-type='numeral'] [data-when='books'] {
	display: none;
}

.books__options {
	margin-top: 0.5rem;
	font-size: 2.25rem;
}

.books__field {
	display: inline-flex;
	margin-right: 1rem;
}

.books__field label {
	height: 100px;
	padding: 0 25px;
	line-height: 100px;
	font-size: 1em;
	text-transform: uppercase;
	color: #ccc;
	background: #fff;
}

.books__field label:first-child {
	border-radius: 0.375rem 0 0 0.375rem;
}

.books__field label:last-child {
	border-radius: 0 0.375rem 0.375rem 0;
	border-left: 1px solid #e5e5e5;
}

.books__field input {
	width: 200px;
	height: 100px;
	padding: 0;
	line-height: 100px;
	font-size: 1em;
	font-weight: bold;
	text-align: center;
	color: var(--main-600);
	background: #fff;
	border: none;
	border-left: 1px solid #e5e5e5;
	appearance: none;
}

.books__field input:last-child {
	border-radius: 0 0.375rem 0.375rem 0;
}

.books__field input:focus {
	outline: 2px solid var(--main-900);
	outline-offset: -2px;
}

.draw-button {
	width: fit-content;
	margin-top: 1.5rem;
	padding: 1rem 2rem;
	font-weight: bold;
	font-size: 2rem;
	text-align: center;
	color: #fff;
	background: var(--main-900);
	border: none;
	border-radius: 8px;
}

/* Phones: one field per row, full width, so "WITH 100 TICKETS" fits. */
@media (max-width: 720px) {
	.books {
		width: 100%;
		padding: 0 1rem;
	}

	.books__mode {
		font-size: 1.25rem;
	}

	.books__options {
		font-size: 1.5rem;
	}

	.books__field {
		display: flex;
		margin: 0 0 0.75rem;
	}

	.books__field label,
	.books__field input {
		height: 64px;
		line-height: 64px;
	}

	.books__field label {
		padding: 0 1rem;
	}

	.books__field input {
		flex: 1;
		width: auto;
		min-width: 0;
	}

	.draw-button {
		font-size: 1.5rem;
	}
}

/* --- the drawn number --- */

.books__draw {
	display: grid;
	place-items: center;
	height: 100%;
	cursor: pointer;
}

.books__number {
	font-size: 30vw;
	font-weight: bold;
	text-shadow: 7px 7px 0 rgba(0, 0, 0, 0.3);
	text-wrap: nowrap;
	user-select: none;
}

.app[data-scale='1x'] .books__number {
	font-size: 20vw;
}
.app[data-scale='2x'] .books__number {
	font-size: 30vw;
}
.app[data-scale='3x'] .books__number {
	font-size: 40vw;
}

.books__number .book-nr::before,
.books__number .ticket-nr::before {
	content: attr(title);
	position: absolute;
	font-size: 0.1em;
	line-height: 3em;
	text-shadow: none;
	color: rgba(0, 0, 0, 0.3);
}

.books__exit {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 150;
	width: 3rem;
	height: 3rem;
	padding: 0;
	color: var(--main-700);
	background: none;
	border: 0;
}

.books__exit svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

/* --- every number drawn --- */

.books__finished {
	display: grid;
	place-items: center;
	height: 100%;
	font-size: 2rem;
	text-align: center;
}

.books__finished a {
	text-decoration: underline;
	cursor: pointer;
}

/* --- log drawer --- */

.books__log {
	position: absolute;
	inset: 0 0 0 auto;
	width: 20%;
	min-width: 300px;
	font-size: 2em;
	transform: translateX(100%);
	transition: transform 0.25s ease;
}

.books__log[data-open='true'] {
	transform: translateX(0);
}

.books__log-trigger {
	position: absolute;
	top: 50%;
	left: 0;
	width: 120px;
	height: 50px;
	font: inherit;
	font-weight: bold;
	line-height: 50px;
	text-align: center;
	text-transform: uppercase;
	color: inherit;
	background: rgba(0, 0, 0, 0.3);
	border: 0;
	transform: rotate(270deg) translate(0, -86px);
	cursor: pointer;
	user-select: none;
}

.books__log-entries {
	position: absolute;
	inset: 0;
	padding: 0.5rem;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.3);
	overflow-wrap: anywhere;
}

.books__log-entries span {
	color: rgba(0, 0, 0, 0.3);
}

.books__hint {
	position: absolute;
	bottom: 0;
	left: 0;
	z-index: 5;
	padding: 20px;
	font-size: 1.25rem;
	color: rgba(0, 0, 0, 0.3);
	text-align: left;
}

/* Shared reel mechanics for the slots and name-list games.
   A .slot-container is a viewport of --li-count rows, holding two stacked
   <ul>s so the strip can scroll continuously. */

.faded-container {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.faded-container::before,
.faded-container::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	z-index: 10;
	height: 30%;
}

.faded-container::after {
	top: 0;
	background-image: linear-gradient(to top, rgba(255, 255, 255, 0), var(--main-600) 90%);
}

.faded-container::before {
	bottom: 0;
	background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--main-600) 90%);
}

.slot-container {
	--line-height: 1.5;
	--li-height: calc(var(--font-size) * var(--line-height));

	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: calc(var(--li-height) * var(--li-count));
	color: var(--secondary-white);
	user-select: none;
}

/* The two horizontal rules marking the winning row. */
.slot-container::before,
.slot-container::after {
	content: '';
	position: absolute;
	z-index: -1;
	width: 100%;
	border: calc(var(--font-size) / 20) solid var(--main-700);
}

.slot-container::after {
	top: calc(50% - (var(--li-height) / 2 + 1rem));
}

.slot-container::before {
	bottom: calc(50% - (var(--li-height) / 2 + 1rem));
}

.slot-container:first-of-type::before,
.slot-container:first-of-type::after {
	border-top-left-radius: 999px;
	border-bottom-left-radius: 999px;
}

.slot-container:last-of-type::before,
.slot-container:last-of-type::after {
	border-top-right-radius: 999px;
	border-bottom-right-radius: 999px;
}

.slot-container[data-pre-animation='true'] ul {
	animation: scroll 20s linear infinite;
}

.slot-container ul {
	display: flex;
	flex-direction: column;
	place-content: center start;
}

.slot-container li {
	font-size: var(--font-size);
	line-height: var(--line-height);
	text-align: center;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}

/* Slots: one reel per digit. */

.slots {
	--font-size: 5rem;

	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 1280px;
	max-height: 100vh;
	margin: 0 auto;
	overflow: hidden;
}

.slots .slot-container {
	max-width: 200px;
	overflow: hidden;
}

.slots .slot-container[data-pre-animation='true'] ul {
	animation: scroll 1s linear infinite;
}

.app[data-scale='1x'] .slots {
	--font-size: 5rem;
}
.app[data-scale='2x'] .slots {
	--font-size: 7rem;
}
.app[data-scale='3x'] .slots {
	--font-size: 10rem;
}

.app[data-scale='1x'] .slots .slot-container {
	max-width: 200px;
}
.app[data-scale='2x'] .slots .slot-container {
	max-width: 250px;
}
.app[data-scale='3x'] .slots .slot-container {
	max-width: 300px;
}

/* The whole screen is the draw button. */
[data-route='/slots'] {
	cursor: pointer;
}

/* Name list: one tall reel of names loaded from CSV or typed in. */

.list {
	--font-size: 4rem;

	display: flex;
	flex-direction: column;
	justify-content: center;
	flex-grow: 1;
	width: 100%;
	max-width: 1536px;
	max-height: 100vh;
	margin: 0 auto;
	padding: 0 1rem;
	overflow: hidden;
}

.app[data-scale='1x'] .list {
	--font-size: 4rem;
}
.app[data-scale='2x'] .list {
	--font-size: 5.5rem;
}
.app[data-scale='3x'] .list {
	--font-size: 7rem;
}

.list__reel {
	display: flex;
	cursor: pointer;
	flex-direction: column;
	justify-content: center;
	width: fit-content;
	margin: auto;
	overflow: hidden;
}

.list li {
	min-width: 400px;
	padding: 0 3rem;
}

/* --- data entry --- */

.list__setup h1 {
	text-align: left;
}

.list__setup p {
	margin: 0.5rem 0;
}

.dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 10rem;
	padding: 1.25rem 1.5rem;
	text-align: center;
	color: var(--main-800);
	background: var(--main-50);
	border: 2px dashed var(--main-800);
	border-radius: 0.5rem;
	cursor: pointer;
}

.dropzone:hover,
.dropzone[data-dragover='true'] {
	background: var(--main-100);
}

.dropzone svg {
	width: 2rem;
	height: 2rem;
	margin-bottom: 1rem;
	stroke: currentColor;
	fill: none;
}

.dropzone__hint {
	margin-bottom: 0.5rem;
	font-size: 0.875rem;
}

.dropzone__hint strong {
	font-weight: 600;
}

.dropzone__format {
	font-size: 0.75rem;
}

.list__separator {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin: 2rem 0;
	color: var(--main-100);
}

.list__separator::before,
.list__separator::after {
	content: '';
	width: 8rem;
	height: 1px;
	background: var(--main-100);
}

.list__manual {
	display: flex;
	gap: 0.25rem;
}

.list__manual input {
	display: block;
	width: 100%;
	padding: 0.625rem;
	font-size: 0.875rem;
	color: var(--main-900);
	background: var(--main-50);
	border: 1px solid var(--main-800);
	border-radius: 0.5rem;
}

.list__manual input:focus {
	outline: 2px solid var(--main-500);
	outline-offset: -1px;
}

.list__manual button {
	flex-shrink: 0;
}

/* Wheel of fortune. Sector geometry is pure CSS, driven by --_items / --_idx. */

.wheel-screen {
	max-width: 1280px;
	margin: auto;
}

.wheel-screen__headline {
	margin-bottom: 2.5rem;
	font-size: 3rem;
	font-weight: 700;
	text-transform: uppercase;
	text-align: center;
}

.wheel {
	position: relative;
	display: grid;
	width: 40vmin;
	margin: auto;
	aspect-ratio: 1 / 1;
	container-type: inline-size;
	direction: ltr;
}

.app[data-scale='1x'] .wheel {
	width: 40vmin;
}
.app[data-scale='2x'] .wheel {
	width: 60vmin;
}
.app[data-scale='3x'] .wheel {
	width: 80vmin;
}

.wheel > * {
	position: absolute;
}

.wheel__border {
	inset: 0;
	border: 10px solid var(--main-900);
	border-radius: 9999px;
}

.wheel__pin {
	position: absolute;
	top: 0;
	left: 50%;
	height: 5rem;
	transform: translate(-50%, -50%);
}

.wheel__spin {
	width: 20cqi;
	aspect-ratio: 1 / 1;
	place-self: center;
	font-size: 5cqi;
	color: var(--red);
	background: hsla(0, 0%, 100%, 0.8);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.wheel__sectors {
	inset: 0;
	display: grid;
	place-content: center start;
	clip-path: inset(0 0 0 0 round 50%);
}

.wheel__sectors li {
	grid-area: 1 / -1;
	display: grid;
	align-content: center;
	width: 50cqi;
	aspect-ratio: 1 / calc(2 * tan(180deg / var(--_items)));
	padding-left: 1ch;
	font-size: 5cqi;
	clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
	rotate: calc(360deg / var(--_items) * (var(--_idx) - 1));
	transform-origin: center right;
	user-select: none;
}

.wheel__sectors li:nth-child(even) {
	background: var(--main-700);
	color: var(--secondary-white);
}

.wheel__sectors li:nth-child(odd) {
	background: var(--secondary-white);
	color: var(--main-700);
}

.wheel__sectors li.is-highlighted {
	background: var(--red);
	color: #fff;
}



