/*
   "How was this game?" under the winner's stats, and an endless game's bar.
   Loaded in order with the others (see index.html): a later rule wins. */

/* Under the winner's stats: how was the game, one tap; then a note if they like. */
.rate-game {
	margin: calc(1.5 * var(--m)) calc(1 * var(--m)) 0;
	font-family: var(--font-condensed);
	font-size: calc(3.4 * var(--m));
	color: var(--text-soft);
}

.rate-ask {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: calc(1 * var(--m)) calc(2 * var(--m));
}

.rate-choices {
	display: flex;
	gap: calc(1.2 * var(--m));
}

.rate-btn {
	width: calc(9 * var(--m));
	height: calc(8 * var(--m));
	padding: 0;
	font-size: calc(4.6 * var(--m));
	line-height: 1;
	background: var(--button-disabled);
	border: var(--border-muted);
	border-radius: var(--radius);
	cursor: pointer;
	filter: grayscale(0.4);
	transition: filter var(--fast), border-color var(--fast);
}

.rate-btn[aria-pressed="true"] {
	background: var(--button);
	border: var(--border);
	filter: none;
}

.rate-status {
	min-height: 1.2em;
	margin: calc(0.8 * var(--m)) 0 0;
}

.rate-status:empty {
	display: none;
}

.rate-more {
	display: flex;
	flex-direction: column;
	gap: calc(1 * var(--m));
	margin-top: calc(1 * var(--m));
	text-align: left;
}

.rate-note {
	resize: none;
}

.rate-send-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: calc(1.5 * var(--m));
}

.rate-small {
	font-size: calc(2.8 * var(--m));
	color: var(--text-muted);
}

.rate-send {
	flex: none;
	width: auto;
	padding-inline: calc(4 * var(--m));
}

/* An endless game's "How's it going?", once, a few legs in: along the bottom,
   between the board's buttons and Done (placeRateBar sets where and how wide),
   never over the players or the keypad. */
.rate-bar {
	position: absolute;
	z-index: 50;
	display: flex;
	align-items: center;
	gap: calc(1.2 * var(--m));
	width: max-content;
	box-sizing: border-box;
	padding: calc(1 * var(--m)) calc(1 * var(--m)) calc(1 * var(--m)) calc(2.5 * var(--m));
	font-family: var(--font-condensed);
	font-size: calc(3.2 * var(--m));
	line-height: 1.2;
	color: var(--text);
	background: var(--panel);
	border: var(--border);
	border-radius: var(--radius);
	box-shadow: 0 1vmin 3vmin rgba(0, 0, 0, 0.6);
	transform: translateX(-50%);
	animation: rate-bar-in var(--medium) var(--ease-back);
}

.rate-bar.leaving {
	animation: rate-bar-out var(--medium) var(--ease-out) forwards;
}

.rate-bar-text {
	min-width: 0;
}

.rate-bar-text:empty {
	display: none;
}

.rate-bar .rate-choices {
	flex: none;
}

.rate-bar .rate-choices[hidden] {
	display: none;
}

.rate-bar .rate-btn {
	width: calc(8 * var(--m));
	height: calc(7 * var(--m));
	font-size: calc(4 * var(--m));
}

.rate-bar-note {
	flex: none;
	width: auto;
	height: calc(7 * var(--m));
	padding-inline: calc(2.5 * var(--m));
	font-size: calc(3.2 * var(--m));
}

.rate-bar-close {
	flex: none;
	display: grid;
	place-items: center;
	width: calc(6 * var(--m));
	height: calc(6 * var(--m));
	padding: 0;
	color: var(--text-muted);
	background: none;
	border: none;
	cursor: pointer;
}

.rate-bar-close .icon {
	width: 60%;
	height: 60%;
}

@keyframes rate-bar-in {
	from { opacity: 0; translate: 0 2vmin; }
}

@keyframes rate-bar-out {
	to { opacity: 0; translate: 0 1.5vmin; }
}

/* The winner popup: the winner's name in green, and under it, the game and the legs won. */
.winner-text .winner-name {
	color: var(--checkout);
}

.winner-line {
	margin: 0 calc(1 * var(--m)) calc(1 * var(--m));
	font-family: var(--font-condensed);
	font-size: calc(3 * var(--m));
	color: var(--text);
}

/* Its choices side by side, as wide and as tall as each other, however their words wrap. */
.winner-next tr {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
}

.winner-next td > .settings-btn-action {
	height: 100%;
}

/* Unrated, the ask stands alone, a size bigger; rated, its answer, then the choices come up. */
.rate-game .rate-ask {
	flex-direction: column;
	padding: calc(1 * var(--m)) 0 calc(2 * var(--m));
}

.rate-game .rate-btn {
	width: calc(13 * var(--m));
	height: calc(11 * var(--m));
	font-size: calc(6.5 * var(--m));
}

.rate-status .start-link {
	margin-left: calc(0.5 * var(--m));
}

.winner-next {
	animation: winner-next-in var(--medium) var(--ease-out);
}

@keyframes winner-next-in {
	from { opacity: 0; transform: translateY(calc(1.5 * var(--m))); }
}
