/*
   The Theme popup: a tile per theme, its preview drawn in that theme's own
   colours; and a new theme bursting in out of the bull.
   Loaded in order with the others (see index.html): a later rule wins. */

/* The menu's Theme: a tile per theme, its preview drawn in that theme's own colours. */
.theme-section {
	width: min(calc(70 * var(--m)), 92%);
}

.theme-list {
	display: flex;
	flex-direction: column;
	gap: calc(1 * var(--m));
}

.theme-tile {
	display: flex;
	align-items: center;
	gap: calc(2 * var(--m));
	height: auto;
	padding: calc(1 * var(--m)) calc(1.5 * var(--m));
	text-align: left;
}

/* The theme on: outlined green, like the picked game on New game. */
.theme-tile[aria-checked="true"] {
	border-color: var(--checkout);
}

.theme-preview {
	display: flex;
	flex: none;
	align-items: center;
	gap: calc(1 * var(--m));
	padding: calc(0.8 * var(--m));
	border-radius: calc(0.6 * var(--radius));
	background: var(--page);
}

.theme-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: calc(1.5 * var(--m));
	width: calc(14 * var(--m));
	height: calc(5 * var(--m));
	padding: 0 calc(1 * var(--m));
	box-sizing: border-box;
	border: var(--border);
	border-radius: calc(0.5 * var(--radius));
	background: linear-gradient(var(--active-top), var(--active-bottom));
	color: var(--text);
	font-family: var(--font-condensed);
	text-shadow: 0 0 1vmin black;
}

.theme-card-name {
	font-size: calc(2.4 * var(--m));
}

.theme-card-score {
	font-family: var(--font);
	font-size: calc(3 * var(--m));
	font-weight: 600;
}

/* A dartboard in a few strokes: segments, a ring and the bull. */
.theme-board {
	width: calc(5 * var(--m));
	height: calc(5 * var(--m));
	border-radius: 50%;
	background:
		radial-gradient(circle, var(--board-red) 0 12%, var(--board-green) 12% 24%, transparent 24% 62%, var(--board-red) 62% 72%, transparent 72%),
		repeating-conic-gradient(var(--board-black) 0 18deg, var(--board-white) 18deg 36deg);
	box-shadow: 0 0 0 calc(0.5 * var(--m)) var(--board-legend);
}

.theme-words {
	display: flex;
	flex-direction: column;
	gap: calc(0.3 * var(--m));
	min-width: 0;
}

.theme-name {
	display: flex;
	align-items: center;
	gap: calc(1 * var(--m));
	font-size: calc(2.8 * var(--m));
}

/* One line each, every tile the same height: cut short rather than wrap (with
   room round the words for their shadow, which the cut would otherwise edge). */
.theme-name,
.theme-note {
	margin: -1vmin;
	padding: 1vmin;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.theme-note {
	font-size: calc(2 * var(--m));
	color: var(--text-soft);
}

.theme-extra {
	flex: none;
	padding: 0 calc(0.8 * var(--m));
	border: 1px solid var(--text-muted);
	border-radius: calc(1 * var(--m));
	font-size: calc(1.6 * var(--m));
	color: var(--text-muted);
}

/* On a phone held sideways: wider, its words bigger. */
@media (orientation: landscape) and (max-height: 540px) {
	.theme-section {
		width: min(calc(84 * var(--m)), 92%);
	}

	.theme-name {
		font-size: calc(3.2 * var(--m));
	}

	.theme-note {
		font-size: calc(2.6 * var(--m));
	}
}

/* A new theme bursting out of the bull (burstTheme, a View Transition): the pictures of the old and new themes
   move only as it animates them, not by the browser's own fade. */
::view-transition-old(root),
::view-transition-new(root) {
	animation: none;
	mix-blend-mode: normal;
}

/* A new theme bursting out of the bull (burstTheme): the ring of light at its edge, over everything for the moment it lasts. */
.theme-burst {
	position: fixed;
	inset: 0;
	z-index: 1000;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.theme-burst circle {
	fill: none;
}

.theme-burst-glow {
	stroke: var(--checkout);
	stroke-opacity: 0.35;
}

.theme-burst-line {
	stroke: var(--text);
}
