/*
   History and a kept game's board, the privacy notice, small fixes for phones
   and full screen, the bull-off, Lifetime stats, and How you play.
   Loaded in order with the others (see index.html): a later rule wins. */

/* Game history's rows (the page is in pages.css) */
.kept-list,
.kept-group {
	display: flex;
	flex-direction: column;
	gap: calc(1 * var(--m));
}

.kept-list {
	gap: calc(2.5 * var(--m));
}

/* How they're shown: by day or by game on the left, which dates on the right, one row the list's width;
   your own dates under them, the row's width too. */
.kept-controls[hidden],
.kept-dates[hidden],
.kept-none[hidden] {
	display: none;
}

.kept-controls {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: calc(1.5 * var(--m));
	margin-bottom: calc(2.5 * var(--m));
}

.kept-controls .segmented {
	box-sizing: border-box;
	height: calc(5.5 * var(--m));
	margin: 0;
}

.kept-controls .segmented button {
	padding-block: 0; /* iOS would push the text down */
}

.kept-range-pick {
	position: relative;
	display: flex;
}

.kept-range,
.kept-dates input {
	box-sizing: border-box;
	height: calc(5.5 * var(--m));
	border: var(--border);
	border-radius: var(--radius);
	background: var(--button-disabled);
	color: var(--text);
	color-scheme: dark;
	font-family: var(--font-condensed);
	font-size: calc(2.6 * var(--m));
}

.kept-range {
	appearance: none;
	-webkit-appearance: none;
	padding: 0 calc(5.5 * var(--m)) 0 calc(2.2 * var(--m));
	cursor: pointer;
}

.kept-range-pick .icon {
	position: absolute;
	right: calc(1.5 * var(--m));
	top: 50%;
	width: calc(3 * var(--m));
	height: calc(3 * var(--m));
	margin-top: calc(-1.5 * var(--m));
	fill: none;
	stroke: var(--text-soft);
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	pointer-events: none;
}

.kept-dates {
	display: flex;
	flex-basis: 100%;
	align-items: center;
	gap: calc(1.5 * var(--m));
}

.kept-dates input {
	flex: 1;
	min-width: 0;
	padding: 0 calc(1.5 * var(--m));
	text-align: center;
}

.kept-dash {
	color: var(--text-muted);
}

.kept-none {
	text-align: center;
}

.kept-group-title {
	display: flex;
	align-items: baseline;
	gap: calc(1.5 * var(--m));
	margin: 0 0 calc(0.5 * var(--m));
	font-size: calc(3.2 * var(--m));
	font-weight: 600;
	color: var(--text-soft);
}

.kept-group-count {
	font-size: calc(2.6 * var(--m));
	font-weight: normal;
	color: var(--text-muted);
}

.kept-row {
	flex: none;
	text-align: left;
}

.kept-row-title,
.kept-row-detail {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.kept-row-title {
	font-size: calc(3.2 * var(--m));
}

.kept-row-detail {
	font-size: calc(2.6 * var(--m));
	font-weight: normal;
	color: var(--text-soft);
}

/* A kept game's board: only the beds hit show, coloured by how often. */
.heat[hidden] {
	display: none;
}

.heat {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: calc(1 * var(--m));
}

.heat .confirm-detail {
	margin-top: 0;
}

.heat-who,
.heat-filter {
	max-width: 100%;
	margin-bottom: calc(1.5 * var(--m));
	overflow-x: auto;
}

.heat-board {
	flex: none;
	width: calc(44 * var(--m));
	height: calc(44 * var(--m));
}

.heat-board .seg:not(.legend) {
	fill: var(--button-disabled);
	stroke-width: 1; /* clear lines between the beds, more than the board's seams */
}

.heat-board .seg.hot {
	fill: var(--heat-1);
}

.heat-board .seg[data-heat="2"] { fill: var(--heat-2); }
.heat-board .seg[data-heat="3"] { fill: var(--heat-3); }
.heat-board .seg[data-heat="4"] { fill: var(--heat-4); }
.heat-board .seg[data-heat="5"] { fill: var(--heat-5); }
.heat-board .seg[data-heat="6"] { fill: var(--heat-6); }

/* Under the board: its colours, fewer darts to more. */
.heat-scale {
	display: flex;
	align-items: center;
	gap: calc(1 * var(--m));
	margin: calc(1 * var(--m)) 0 0;
	font-family: var(--font-condensed);
	font-size: calc(2.2 * var(--m));
	color: var(--text-muted);
}

.heat-scale i {
	width: calc(18 * var(--m));
	height: calc(1.2 * var(--m));
	border-radius: calc(0.6 * var(--m));
	background: linear-gradient(90deg, var(--heat-1) 0 16.6%, var(--heat-2) 16.6% 33.3%, var(--heat-3) 33.3% 50%, var(--heat-4) 50% 66.6%, var(--heat-5) 66.6% 83.3%, var(--heat-6) 83.3%);
}

/* Clean edges: in two colours, the board's shading where rings meet looks like a blur. */
.heat-board .shading {
	display: none;
}

/* Settings > Privacy */
.privacy-section {
	width: 60%;
}

.privacy-text {
	margin: calc(1 * var(--m));
	font-family: var(--font-condensed);
	font-size: calc(2.8 * var(--m));
	line-height: 1.3;
	color: var(--text-soft);
}

.privacy-text p {
	margin: 0 0 calc(1.5 * var(--m));
}

.privacy-text b {
	color: var(--text);
	font-weight: 500;
}

.privacy-text a {
	color: var(--text);
}

.privacy-switch {
	color: var(--text);
}

@media (orientation: portrait) {
	.privacy-section {
		width: 90%;
	}

	.privacy-text {
		font-size: 3.6vmin;
	}
}

/* On a phone, iOS zooms the page in on a text field with smaller text than this. */
@media (max-width: 600px), (max-height: 500px) {
	.settings-section .player-field input,
	.solo-name,
	.rate-note {
		font-size: 16px;
	}
}

/* Full screen is a shortcut for F11: for computers (touch screen laptops too:
   any pointer that hovers keeps it, and .touching doesn't matter), not for phones and tablets. */
@media (any-hover: none) {
	.menu-full-screen {
		display: none;
	}
}

.account-wait {
	text-align: center;
}

/* No gap of its own: it's there unseen while the check runs, and only sometimes shows. */
.account-check {
	display: flex;
	justify-content: center;
	margin-top: calc(-1.5 * var(--m));
}

/* A bull-off: its darts are on the board, but nothing is scored until it's over. */
.bull-off .done-btn,
.bull-off .check-score {
	opacity: 0.4;
	pointer-events: none;
}

/* Lifetime stats: one player's games over time */
.trend[hidden],
.trend-part[hidden] {
	display: none;
}

.trend {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: calc(1 * var(--m));
}

.trend-who {
	max-width: 100%;
	margin-bottom: calc(1.5 * var(--m));
	overflow-x: auto;
}

.trend-part {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: calc(1.5 * var(--m));
}

.trend-part .confirm-detail {
	margin: 0;
}

.trend-chart {
	width: calc(60 * var(--m));
	height: calc(22 * var(--m));
}

.trend-grid {
	stroke: var(--history-muted);
	stroke-width: 1;
	stroke-dasharray: 3 4;
}

.trend-axis {
	fill: var(--text-muted);
	font-family: var(--font-condensed);
	font-size: 12px;
}

.trend-dot {
	fill: var(--text-muted);
}

.trend-line {
	fill: none;
	stroke: var(--active-top);
	stroke-width: 2.5;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.trend-note {
	margin: 0;
	font-family: var(--font-condensed);
	font-size: calc(2.8 * var(--m));
	color: var(--text-soft);
}

/* How you play: as a profile is named, and in Profile */
.level-pick {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: calc(1 * var(--m));
}

.level-pick .confirm-detail {
	margin: 0;
	text-align: center;
}

.stats-all[hidden] {
	display: none;
}

/* Focus a tap away for Competitive: it opens and closes (the menu resizing with it), the gap over it too. */
.level-suggest {
	display: grid;
	grid-template-rows: 0fr;
	margin: calc(-1 * var(--m)) 0 0;
	opacity: 0;
	transition: grid-template-rows var(--slow) ease, margin var(--slow) ease, opacity var(--slow) ease;
}

.level-suggest > span {
	min-height: 0;
	overflow: hidden;
	text-align: center;
}

.level-suggest.shown {
	grid-template-rows: 1fr;
	margin-top: 0;
	opacity: 1;
}

/* On a phone, upright or sideways, what's tapped in the menus is at least about
   40px (Apple and Google ask for 44 to 48): the players' rows and their buttons,
   and the menu's buttons. */
@media (orientation: portrait) and (max-aspect-ratio: 3/5), (orientation: landscape) and (max-height: 540px) {
	.player-field {
		height: calc(8.5 * var(--m));
	}

	.field-btn {
		width: calc(8.5 * var(--m));
	}

	.grip {
		padding: 0 calc(1.6 * var(--m));
	}

	.players-add,
	.app-menu .settings-btn-action {
		min-height: calc(8.5 * var(--m));
	}
}
