/* The lounge sits inside the game, so it takes the challenge editor's furniture turned
   dark: its backdrop photo under a scrim, translucent panels framed in an outset bevel,
   white titles punched out with a black outline and Courier New legends. The tab row
   follows choosePerso's pill — plain text until it is current, then a filled pill. That
   only reads as a position while nothing you press is round and flat, which is why every
   button below stays square-ish with a bevel. */
:root {
	--lounge-ground: #0A0C15;
	--lounge-panel: rgba(22, 26, 44, 0.80);
	--lounge-panel-hi: rgba(30, 35, 58, 0.90);
	--lounge-panel-off: rgba(14, 16, 26, 0.72);
	--lounge-frame: #5A6088;
	--lounge-frame-off: #3A3E55;
	--lounge-ink: #DEE2F5;
	--lounge-dim: #99A0C2;
	--lounge-off: #5E6480;
	--lounge-legend: #EEF;
	--lounge-hot: #FEFF3F;
	--lounge-btn: #2B3150;
	--lounge-btn-hover: #39406A;
	--lounge-danger: #6A1A1A;
	--lounge-danger-ink: #FFD9CF;
	--lounge-danger-frame: #9C4444;
	--lounge-warn: #F0B44A;
	--lounge-bad: #FF8C78;
	--lounge-good: #7BE38B;
	--lounge-self: rgba(90, 90, 20, 0.42);
	--lounge-hair: rgba(255, 255, 255, 0.07);
	--lounge-stripe: rgba(255, 255, 255, 0.03);
	--lounge-mono: "Courier New", Courier, monospace;
	--lounge-outline: -2px 0 #000, 0 2px #000, 2px 0 #000, 0 -2px #000, -1px -1px #000, -1px 1px #000, 1px -1px #000, 1px 1px #000;
	--lounge-outline-thin: -1px -1px #000, -1px 1px #000, 1px -1px #000, 1px 1px #000;
}

html, body {
	margin: 0;
	padding: 0;
	min-height: 100%;
	font-family: Tahoma, Verdana, Geneva, sans-serif;
	font-size: 15px;
	color: var(--lounge-ink);
	background-color: var(--lounge-ground);
}

body {
	background-image: linear-gradient(rgba(8,10,22,0.9), rgba(8,10,22,0.4)), url('../images/challenges/fond_challenges.jpg');
	background-size: cover;
	background-position: center bottom;
	background-attachment: fixed;
	background-repeat: no-repeat;
}

@media screen and (max-width: 720px) {
	body {
		background-image: linear-gradient(rgba(8,10,22,0.9), rgba(8,10,22,0.4)), url('../images/challenges/fond_challenges.jpg');
	}
}

a {
	color: var(--lounge-hot);
}

/* Panels: the editor's fieldset, flipped dark and let through to the photo. */
.lounge-gate,
.lounge-playerstrip,
.lounge-waiting-status,
.lounge-tier,
.lounge-member-list,
.lounge-vote-btn,
.lounge-rules,
.lounge-draft-team,
.lounge-rules-gate,
.lounge-access-block,
.lounge-alerts-toggle,
.lounge-results-table,
.lounge-leaderboard-table,
.lounge-lb-card,
.lounge-matchlist,
.lounge-ratings-table,
.lounge-profile-grid,
.lounge-profile-chartbox {
	background: var(--lounge-panel);
	border: outset 2px var(--lounge-frame);
	border-radius: 5px;
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

/* Titles and section headings: white or pale-blue over a photo needs the outline. */
.lounge-header h1,
.lounge-gate h1,
.lounge-bar,
.lounge-waiting-header h2,
.lounge-results-header h2,
.lounge-launching h2,
.lounge-rules-body h2,
.lounge-access-block h2,
.lounge-lb-cardhead h3,
.lounge-ratings-title,
.lounge-profile-name,
[data-panel="howitworks"] h2 {
	font-weight: bold;
	text-shadow: var(--lounge-outline);
}

.lounge-gate {
	max-width: 480px;
	margin: 80px auto;
	text-align: center;
	padding: 20px 24px 24px;
}

.lounge-gate h1 {
	margin-top: 6px;
	font-size: 24px;
	color: #FFF;
}

#lounge {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	box-sizing: border-box;
}

.lounge-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 16px;
	border-bottom: solid 2px var(--lounge-frame);
}

.lounge-header h1 {
	margin: 0;
	font-size: 22px;
	color: #FFF;
}

.lounge-tabs {
	display: flex;
	gap: 3px;
	padding-bottom: 2px;
}

.lounge-tab {
	appearance: none;
	background: transparent;
	color: #FFF;
	border: none;
	padding: 3px 11px;
	border-radius: 11px;
	cursor: pointer;
	font-family: inherit;
	font-size: 13px;
	font-weight: bold;
	text-shadow: var(--lounge-outline-thin);
}

.lounge-tab:hover {
	background: rgba(58, 64, 104, 0.65);
}

.lounge-modlink {
	text-decoration: none;
	line-height: 1.55;
}

.lounge-tab.is-active {
	background: #3A4068;
	color: var(--lounge-hot);
	border: solid 1px var(--lounge-frame);
	padding: 2px 10px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.14);
	text-shadow: none;
}

.lounge-tabpanel {
	display: none;
	flex: 1;
	padding: 16px 20px 24px;
	box-sizing: border-box;
}

.lounge-tabpanel.is-active {
	display: block;
}

/* The editor's legends: Courier New, pale blue, outlined. */
.lounge-bar {
	margin: 0 0 12px;
	font-family: var(--lounge-mono);
	font-size: 19px;
	color: var(--lounge-legend);
}

.lounge-playerstrip {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	padding: 7px 11px;
	margin-bottom: 16px;
	font-size: 13px;
}

.lounge-stat {
	display: inline-flex;
	gap: 6px;
	align-items: center;
}

.lounge-stat-label {
	font-size: 11px;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--lounge-dim);
}

.lounge-stat-value {
	font-weight: bold;
}

.lounge-stat--warn .lounge-stat-value {
	color: var(--lounge-warn);
}

.lounge-stat--ban {
	color: var(--lounge-bad);
	font-weight: bold;
}

/* A rank is a chip rather than coloured ink: the ladder's own colours run from near-black
   to near-white, and the label flips black or white against whichever it is. Square, so
   it is never mistaken for the current tab. */
.lounge-rank {
	display: inline-block;
	box-sizing: border-box;
	min-width: 68px;
	text-align: center;
	padding: 0 7px;
	border-radius: 2px;
	border: solid 1px rgba(255,255,255,0.25);
	font-size: 11px;
	font-weight: bold;
	line-height: 1.6;
}

.lounge-loading {
	color: var(--lounge-dim);
	font-style: italic;
}

/* Text that floats on the photo rather than sitting in a panel gets lifted off it. */
.lounge-loading,
.lounge-waiting-count,
.lounge-waiting-note,
.lounge-vote-hint,
.lounge-vote-group-title,
.lounge-draft-hint,
.lounge-draft-turn,
.lounge-results-sub,
.lounge-empty,
.lounge-launching p {
	text-shadow: 0 1px 2px #000, 0 0 4px #000;
}

.lounge-tiers {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 10px;
}

.lounge-tier {
	padding: 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 6px;
}

.lounge-tier:hover {
	background: var(--lounge-panel-hi);
}

.lounge-tier.is-locked,
.lounge-tier.is-locked:hover {
	background: var(--lounge-panel-off);
	border-color: var(--lounge-frame-off);
	color: var(--lounge-off);
}

.lounge-tier-title {
	margin: 0;
	font-family: var(--lounge-mono);
	font-size: 16px;
	color: var(--lounge-legend);
	text-shadow: var(--lounge-outline-thin);
}

.lounge-tier.is-locked .lounge-tier-title {
	color: #6E7490;
	text-shadow: none;
}

.lounge-tier-range,
.lounge-tier-count {
	margin: 0;
	font-size: 12px;
	color: var(--lounge-dim);
}

.lounge-tier.is-locked .lounge-tier-range,
.lounge-tier.is-locked .lounge-tier-count {
	color: #565B78;
}

/* Buttons stay square-ish and bevelled — that is what keeps the pill tab readable as a
   position rather than a control. */
.lounge-tier-join,
.lounge-confirm-btn,
.lounge-rules-accept,
.lounge-results-back,
.lounge-drop,
.lounge-draft-pick,
.lounge-ratings-edit,
.lounge-ratings-actions button {
	appearance: none;
	background: var(--lounge-btn);
	color: var(--lounge-hot);
	border: outset 2px var(--lounge-frame);
	border-radius: 5px;
	font-family: inherit;
	font-size: 13px;
	font-weight: bold;
	padding: 4px 15px;
	cursor: pointer;
}
.lounge-tier-join:not(:disabled):active,
.lounge-confirm-btn:not(:disabled):active,
.lounge-rules-accept:not(:disabled):active,
.lounge-results-back:not(:disabled):active,
.lounge-drop:not(:disabled):active,
.lounge-draft-pick:not(:disabled):active,
.lounge-ratings-edit:active,
.lounge-ratings-actions button:not(:disabled):active {
	border: inset 2px var(--lounge-frame);
}

.lounge-tier-join:hover:not(:disabled),
.lounge-confirm-btn:hover:not(:disabled),
.lounge-rules-accept:hover:not(:disabled),
.lounge-results-back:hover,
.lounge-ratings-edit:hover,
.lounge-ratings-actions button:hover:not(:disabled) {
	background: var(--lounge-btn-hover);
}

.lounge-tier-join:disabled,
.lounge-confirm-btn:disabled,
.lounge-rules-accept:disabled {
	background: rgba(20, 22, 34, 0.7);
	color: var(--lounge-off);
	border-color: var(--lounge-frame-off);
	cursor: not-allowed;
}

.lounge-rules {
	max-width: 860px;
	padding: 2px 20px 14px;
}

/* Discord's own colours, but the bevelled square edge the rest of the buttons wear. */
.lounge-discord {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: #5865F2;
	color: #FFF;
	border: outset 2px #8A92F7;
	border-radius: 5px;
	font-size: 13px;
	font-weight: bold;
	padding: 5px 15px;
	text-decoration: none;
}

.lounge-discord:hover {
	background: #4752C4;
}
.lounge-discord:active {
	border: inset 2px #8A92F7;
}

[data-panel="howitworks"] ul,
.lounge-rules-body ul,
.lounge-access-block ul {
	padding-left: 20px;
	line-height: 1.7;
}

[data-panel="howitworks"] h2,
.lounge-rules-body h2,
.lounge-access-block h2 {
	margin-top: 0;
	font-family: var(--lounge-mono);
	font-size: 17px;
	color: var(--lounge-legend);
}

.lounge-waiting {
	max-width: 560px;
	margin: 0 auto;
}

.lounge-waiting-header h2 {
	margin: 0;
	font-family: var(--lounge-mono);
	font-size: 17px;
	color: var(--lounge-legend);
}

.lounge-waiting-count {
	margin: 4px 0 14px;
	color: var(--lounge-dim);
	font-size: 12px;
	font-style: italic;
}

/* One card carries where the queue stands and whether it will alert you about it. */
.lounge-waiting-status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 7px 14px;
	padding: 7px 11px;
	margin: 0 0 14px;
	font-size: 13px;
}

.lounge-waiting-text {
	margin: 0;
	flex: 1 1 220px;
}

.lounge-member-list {
	list-style: none;
	padding: 0;
	margin: 0 0 14px;
	overflow: hidden;
}

.lounge-member-list li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px 11px;
}

.lounge-member-list li + li {
	border-top: solid 1px var(--lounge-hair);
}

.lounge-member-list li:nth-child(2n) {
	background: var(--lounge-stripe);
}

.lounge-member.is-self {
	background: var(--lounge-self);
	color: var(--lounge-hot);
}

/* the seats the lineup is still short of, so the wait has a shape */
.lounge-slot {
	color: var(--lounge-off);
	font-style: italic;
}

.lounge-member-name {
	font-weight: bold;
}

.lounge-member-mmr {
	color: var(--lounge-dim);
	font-size: 12px;
}

.lounge-member.is-self .lounge-member-mmr {
	color: var(--lounge-hot);
}

.lounge-waiting-actions {
	display: flex;
	justify-content: flex-end;
}

.lounge-drop {
	background: var(--lounge-danger);
	color: var(--lounge-danger-ink);
	border-color: var(--lounge-danger-frame);
}

.lounge-drop:hover:not(:disabled) {
	background: #7E2020;
}

.lounge-drop:disabled {
	background: rgba(20, 22, 34, 0.7);
	color: var(--lounge-off);
	border-color: var(--lounge-frame-off);
	cursor: not-allowed;
}

/* Miss this one and you are out of the lineup, so it is the one thing on the screen that
   does not wear the panel's colours: a lit warning block that cannot be read past. */
.lounge-confirm {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 14px;
	padding: 8px 14px;
	margin: 0 0 12px;
	border: none;
	border-radius: 5px;
	background: #fc6;
	color: #c40;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.lounge-confirm-text {
	margin: 0;
	flex: 1 1 240px;
	font-size: 14px;
}

.lounge-confirm-btn {
	background: #f70;
	color: #FED;
	border: none;
	padding: 5px 16px;
}

.lounge-confirm-btn:hover:not(:disabled) {
	background: #d70;
}

.lounge-confirm-btn:disabled {
	background: #630;
	color: #FFEDC6;
	border: none;
	opacity: 0.55;
}

.lounge-alerts-toggle {
	appearance: none;
	color: var(--lounge-ink);
	border: none;
	padding-right: 0;
	font-family: inherit;
	font-size: 11px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.lounge-alerts-toggle:hover {
	background: var(--lounge-panel-hi);
}

.lounge-alerts-toggle.is-on {
	color: var(--lounge-hot);
}

.lounge-alerts-icon::before {
	content: "\1F515";
	font-size: 13px;
}

.lounge-alerts-toggle.is-on .lounge-alerts-icon::before {
	content: "\1F514";
}

/* the label names the setting, the state word and the switch both report it */
.lounge-alerts-state {
	color: var(--lounge-dim);
}

.lounge-alerts-toggle.is-on .lounge-alerts-state {
	color: var(--lounge-hot);
	font-weight: bold;
}

.lounge-alerts-switch {
	flex: none;
	width: 26px;
	height: 14px;
	border-radius: 7px;
	background: rgba(10, 12, 21, 0.8);
	border: solid 1px var(--lounge-frame-off);
	position: relative;
	transition: background 0.15s, border-color 0.15s;
}

.lounge-alerts-switch::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--lounge-off);
	transition: transform 0.15s, background 0.15s;
}

.lounge-alerts-toggle.is-on .lounge-alerts-switch {
	background: rgba(60, 62, 26, 0.72);
	border-color: var(--lounge-hot);
}

.lounge-alerts-toggle.is-on .lounge-alerts-switch::after {
	background: var(--lounge-hot);
	transform: translateX(12px);
}

.lounge-alerts-hint {
	flex-basis: 100%;
	margin: 0;
	color: var(--lounge-dim);
	font-size: 11px;
	font-style: italic;
}

.lounge-waiting-note,
.lounge-vote-hint,
.lounge-draft-hint {
	margin: 0;
	color: var(--lounge-dim);
	font-size: 11px;
	font-style: italic;
}

.lounge-vote {
	margin-top: 8px;
}

.lounge-vote-hint {
	margin-bottom: 10px;
	color: var(--lounge-warn);
}

.lounge-vote-group {
	margin-bottom: 16px;
}

.lounge-vote-group:last-child {
	margin-bottom: 0;
}

.lounge-vote-group-title {
	margin: 0 0 8px;
	font-size: 11px;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	font-weight: normal;
	color: var(--lounge-dim);
}

.lounge-vote-buttons {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 8px;
}

.lounge-vote-btn {
	appearance: none;
	padding: 8px 4px;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	font-family: inherit;
}

.lounge-vote-btn:hover:not(:disabled) {
	background: var(--lounge-panel-hi);
}

.lounge-vote-btn.is-selected {
	background: rgba(60, 62, 26, 0.72);
	border-color: var(--lounge-hot);
}

.lounge-vote-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.lounge-vote-label {
	font-family: var(--lounge-mono);
	font-size: 14px;
	font-weight: bold;
	color: #FFF;
}

.lounge-vote-btn.is-selected .lounge-vote-label {
	color: var(--lounge-hot);
}

.lounge-vote-count {
	font-size: 11px;
	color: var(--lounge-dim);
}

.lounge-launching {
	text-align: center;
	padding: 60px 20px;
}

.lounge-launching h2 {
	margin: 0 0 8px;
	font-size: 20px;
	color: #FFF;
}

.lounge-launching p {
	color: var(--lounge-dim);
	margin: 0;
}

.lounge-results {
	padding: 8px 0 24px;
}

.lounge-results-header {
	text-align: center;
	margin-bottom: 16px;
}

.lounge-results-header h2 {
	margin: 0 0 4px;
	font-size: 20px;
	color: #FFF;
}

.lounge-results-sub {
	margin: 0;
	color: var(--lounge-dim);
	font-size: 12px;
	font-style: italic;
}

/* The editor's boxed list: a bevelled frame, hairlines between rows and a faint stripe
   down the even ones. */
.lounge-results-table,
.lounge-leaderboard-table {
	width: 100%;
	border-collapse: collapse;
	overflow: hidden;
	font-variant-numeric: tabular-nums;
}

/* Alignment for these two tables is set here and on their cells below, never per column:
   `.lounge-results-table td` outranks a lone column class, so a column that aligned itself
   moved its own heading and left the cells centred under it. */
.lounge-results-table th,
.lounge-leaderboard-table th {
	font-family: var(--lounge-mono);
	font-size: 11px;
	font-weight: normal;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	text-align: center;
	color: var(--lounge-legend);
	background: rgba(34, 34, 85, 0.55);
	padding: 5px 8px;
	border-bottom: solid 1px var(--lounge-frame);
}

.lounge-results-table td,
.lounge-leaderboard-row td {
	text-align: center;
}

.lounge-results-row td,
.lounge-leaderboard-row td {
	padding: 5px 8px;
	border-bottom: solid 1px var(--lounge-hair);
}

.lounge-results-row:nth-child(2n) td,
.lounge-leaderboard-row:nth-child(2n) td {
	background: var(--lounge-stripe);
}

.lounge-results-row.is-self td,
.lounge-leaderboard-row.is-self td {
	background: var(--lounge-self);
	color: var(--lounge-hot);
	font-weight: bold;
}

.lounge-results-place,
.lounge-lb-place {
	width: 60px;
	font-weight: bold;
}

.lounge-results-score,
.lounge-results-races,
.lounge-lb-mmr {
	white-space: nowrap;
}

.lounge-results-races.is-short {
	color: var(--lounge-warn);
	cursor: help;
}

.lounge-results-penalty {
	font-size: 11px;
	color: var(--lounge-bad);
}

.lounge-results-adjust {
	font-size: 11px;
	color: var(--lounge-dim);
}

/* a small one beside the heading it edits, and the page's usual bevelled buttons below */
.lounge-ratings-edit {
	margin-left: 10px;
	padding: 1px 10px;
	font-size: 11px;
	vertical-align: middle;
}

.lounge-ratings-actions .is-secondary {
	color: var(--lounge-dim);
}

.lounge-ratings-input {
	width: 80px;
	box-sizing: border-box;
	padding: 3px 6px;
	border: inset 2px var(--lounge-frame);
	border-radius: 3px;
	background: var(--lounge-ground);
	color: #fff;
	font: inherit;
	text-align: right;
}

.lounge-ratings-input:focus {
	outline: solid 1px var(--lounge-hot);
}

.lounge-ratings-help {
	max-width: 480px;
	margin: 8px auto;
	font-size: 11px;
	color: var(--lounge-dim);
}

.lounge-ratings-actions {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 6px;
}

.lounge-ratings-actions button:disabled {
	opacity: 0.5;
	cursor: wait;
}

.lounge-results-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 12px;
	margin-top: 20px;
}

/* sized against the Back button it stands next to, not the rules panel it is cloned from */
.lounge-results-actions .lounge-discord {
	padding: 4px 15px;
}

.lounge-results-actions .lounge-discord svg {
	width: 15px;
	height: 15px;
}

.lounge-empty {
	color: var(--lounge-dim);
	text-align: center;
	padding: 40px 20px;
	font-style: italic;
}

.lounge-rules-gate,
.lounge-access-block {
	grid-column: 1 / -1;
	max-width: 720px;
	margin: 0 auto;
	padding: 14px 20px 18px;
}

.lounge-rules-gate .lounge-bar {
	margin-bottom: 8px;
}

.lounge-rules-check {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 16px 0 14px;
	padding-top: 14px;
	border-top: solid 1px var(--lounge-frame);
	cursor: pointer;
	font-size: 14px;
}

.lounge-access-block li.is-met {
	color: #9BE08A;
}

.lounge-access-block li.is-unmet {
	color: var(--lounge-bad);
}

.lounge-access-note {
	color: var(--lounge-bad);
	font-weight: bold;
}

/* What the vote settled on, at the size of an answer: the one thing on this screen that has
   to carry across a room, so it takes the accent and the title outline. */
.lounge-verdict {
	text-align: center;
	margin: 0 0 14px;
}

.lounge-verdict-mode {
	margin: 0;
	font-family: var(--lounge-mono);
	font-size: 42px;
	font-weight: bold;
	line-height: 1.05;
	letter-spacing: 0.04em;
	color: var(--lounge-hot);
	text-shadow: var(--lounge-outline);
}

.lounge-verdict-note {
	margin: 3px 0 0;
	font-size: 12px;
	font-style: italic;
	color: var(--lounge-dim);
	text-shadow: 0 1px 2px #000, 0 0 4px #000;
}

.lounge-draft {
	margin-top: 16px;
}

.lounge-draft-turn {
	text-align: center;
	font-size: 14px;
	margin: 0 0 14px;
	color: var(--lounge-dim);
}

.lounge-draft-turn.is-mine {
	color: var(--lounge-hot);
	font-weight: bold;
}

/* two sides for a drafted mode, up to four for a drawn one */
.lounge-draft-teams {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 9px;
}

.lounge-draft-team {
	padding: 9px 11px;
}

.lounge-draft-team h3 {
	margin: 0 0 5px;
	font-family: var(--lounge-mono);
	font-size: 13px;
	color: var(--lounge-hot);
	text-shadow: var(--lounge-outline-thin);
}

.lounge-draft-team ol {
	margin: 0;
	padding-left: 17px;
	line-height: 1.65;
	font-size: 12px;
}

.lounge-draft-team li.is-captain {
	font-weight: bold;
}

.lounge-draft-pool {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	justify-content: center;
	margin-top: 14px;
}

.lounge-draft-pick {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1px;
	padding: 6px 14px;
}

.lounge-draft-pick:enabled:hover {
	background: var(--lounge-btn-hover);
}

.lounge-draft-pick:disabled {
	background: rgba(20, 22, 34, 0.7);
	color: var(--lounge-off);
	border-color: var(--lounge-frame-off);
	cursor: default;
}

.lounge-draft-pick-mmr {
	font-size: 10px;
	font-weight: normal;
	color: var(--lounge-dim);
}

.lounge-draft-pick:disabled .lounge-draft-pick-mmr {
	color: var(--lounge-off);
}

.lounge-draft-hint {
	text-align: center;
	margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
	.lounge-alerts-switch,
	.lounge-alerts-switch::after {
		transition: none;
	}
}

/* ---- Leaderboard: the split overview, the stats table, a player, a mogi ---- */

/* Two columns of equal weight, the way the ladder's own site reads: who is on top on the
   left, what was just played on the right. One column as soon as either would be cramped. */
.lounge-lb-split {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	align-items: start;
	gap: 14px;
}

.lounge-lb-card {
	padding: 8px 10px 10px;
	overflow: hidden;
}

/* A card is already the panel, so the list inside it is only a table. */
.lounge-lb-card .lounge-leaderboard-table,
.lounge-lb-card .lounge-matchlist {
	background: none;
	border: 0;
	border-radius: 0;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}

.lounge-lb-cardhead {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 6px;
}

.lounge-lb-cardhead h3 {
	margin: 0;
	font-family: var(--lounge-mono);
	font-size: 15px;
	color: var(--lounge-legend);
}

.lounge-lb-viewall,
.lounge-lb-back {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	font-family: inherit;
	font-size: 12px;
	font-weight: bold;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--lounge-hot);
	cursor: pointer;
	text-shadow: 0 1px 2px #000;
}

.lounge-lb-viewall:hover,
.lounge-lb-back:hover {
	text-decoration: underline;
}

.lounge-lb-back {
	display: inline-block;
	margin-bottom: 10px;
}

.lounge-lb-playerlink {
	color: inherit;
	text-decoration: none;
}

.lounge-lb-playerlink:hover {
	color: var(--lounge-hot);
	text-decoration: underline;
}

.lounge-lb-pending {
	color: var(--lounge-dim);
	font-style: italic;
}

/* Up is green, down is red - on a delta, on the arrow beside it, and on the win and loss
   columns that carry no sign of their own. */
.lounge-delta.is-up,
.lounge-arrow.is-up,
.lounge-lb-num.is-up {
	color: var(--lounge-good);
}

.lounge-delta.is-down,
.lounge-arrow.is-down,
.lounge-lb-num.is-down {
	color: var(--lounge-bad);
}

.lounge-delta.is-flat,
.lounge-arrow.is-flat {
	color: var(--lounge-off);
}

.lounge-delta {
	font-weight: bold;
}

.lounge-arrow {
	font-size: 10px;
}

/* The stats are paged, but a phone is narrower than even one page: there the table keeps its
   width and scrolls inside its own box rather than squeezing every column. */
.lounge-lb-scroll {
	overflow-x: auto;
}

.lounge-lb-stats {
	font-size: 12px;
}

.lounge-lb-stats th,
.lounge-lb-stats td {
	white-space: nowrap;
}

.lounge-lb-num {
	white-space: nowrap;
}

.lounge-lb-stats.is-page1 .lounge-lb-page2,
.lounge-lb-stats.is-page1 .lounge-lb-page3,
.lounge-lb-stats.is-page2 .lounge-lb-page1,
.lounge-lb-stats.is-page2 .lounge-lb-page3,
.lounge-lb-stats.is-page3 .lounge-lb-page1,
.lounge-lb-stats.is-page3 .lounge-lb-page2 {
	display: none;
}

.lounge-lb-pagerbuttons {
	display: inline-flex;
	gap: 4px;
}

.lounge-lb-pagerbutton {
	padding: 0 8px;
	border: solid 1px var(--lounge-frame-off);
	border-radius: 3px;
	background: transparent;
	color: inherit;
	font-size: 16px;
	line-height: 1.3;
	cursor: pointer;
}

.lounge-lb-pagerbutton:disabled,
.lounge-lb-pagerbutton.is-disabled {
	opacity: 0.3;
	cursor: default;
}

a.lounge-lb-pagerbutton {
	text-decoration: none;
}

.lounge-lb-pagerbutton:not(:disabled):hover,
.lounge-lb-pagerbutton:focus-visible {
	border-color: var(--lounge-hot);
	color: var(--lounge-hot);
}

.lounge-lb-mmr.is-strong {
	font-weight: bold;
}

/* The recent-matches list: an id, who scored what, and how long ago. */
.lounge-matchlist {
	width: 100%;
	border-collapse: collapse;
	overflow: hidden;
	font-variant-numeric: tabular-nums;
}

.lounge-match-row td {
	padding: 5px 8px;
	border-bottom: solid 1px var(--lounge-hair);
}

.lounge-match-row:nth-child(2n) td {
	background: var(--lounge-stripe);
}

.lounge-match-row:hover td {
	background: var(--lounge-panel-hi);
	cursor: pointer;
}

.lounge-match-id {
	width: 60px;
	font-weight: bold;
	color: var(--lounge-dim);
}

.lounge-match-ago,
.lounge-match-mmr,
.lounge-match-mine {
	text-align: right;
	white-space: nowrap;
}

.lounge-match-ago {
	width: 44px;
	color: var(--lounge-dim);
	font-size: 12px;
}

.lounge-matchchips {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

/* Mode and score in one chip, as the results posts read them: "FFA 252". */
.lounge-matchchip {
	display: inline-flex;
	align-items: baseline;
	gap: 5px;
	max-width: 100%;
	padding: 1px 7px;
	border: solid 1px var(--lounge-frame);
	border-radius: 3px;
	background: rgba(40, 48, 90, 0.55);
	font-size: 12px;
}

.lounge-matchchip-mode {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lounge-matchchip-score {
	font-weight: bold;
	font-size: 13px;
}

/* A team mogi's standings: one header row per side carrying its colour and its total, its
   members indented under it. */
.lounge-results-teamhead td {
	padding: 6px 8px 4px;
	border-bottom: solid 1px var(--lounge-frame-off);
	background: rgba(34, 34, 85, 0.35);
	font-weight: bold;
}

td.lounge-results-place.is-gold { color: #ffd23f; }
td.lounge-results-place.is-silver { color: #d4dbe3; }
td.lounge-results-place.is-bronze { color: #e0904a; }

.lounge-results-row.is-teamed .lounge-results-name {
	padding-left: 24px;
	text-align: left;
}

.lounge-results-total td {
	padding: 5px 8px;
	font-family: var(--lounge-mono);
	color: var(--lounge-legend);
	background: rgba(34, 34, 85, 0.45);
}

.lounge-results-totallabel {
	white-space: nowrap;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	font-size: 11px;
}

/* The rating block under a mogi's table: where they stood, what moved, where it left them. */
.lounge-ratings {
	max-width: 620px;
	margin: 16px auto 0;
}

.lounge-ratings-title {
	margin: 0 0 6px;
	font-family: var(--lounge-mono);
	font-size: 15px;
	color: var(--lounge-legend);
}

.lounge-ratings-table {
	width: 100%;
	border-collapse: collapse;
	overflow: hidden;
	font-variant-numeric: tabular-nums;
}

.lounge-ratings-row td {
	padding: 5px 8px;
	border-bottom: solid 1px var(--lounge-hair);
}

.lounge-ratings-row:nth-child(2n) td {
	background: var(--lounge-stripe);
}

.lounge-ratings-row.is-self td {
	background: var(--lounge-self);
	font-weight: bold;
}

.lounge-ratings-name {
	text-align: left;
	width: 40%;
}

.lounge-ratings-before,
.lounge-ratings-delta,
.lounge-ratings-after {
	text-align: right;
	white-space: nowrap;
}

.lounge-ratings-before {
	color: var(--lounge-dim);
}

.lounge-ratings-after {
	font-weight: bold;
}

.lounge-ratings-arrow,
.lounge-ratings-rank {
	text-align: center;
	width: 1%;
}

.lounge-placemove {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	color: var(--lounge-dim);
	white-space: nowrap;
}

.lounge-placemove-to {
	color: var(--lounge-ink);
}

/* A player's own page: name and rank, then the season's figures, then the climb. */
.lounge-profile-head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 12px;
}

.lounge-profile-name {
	margin: 0;
	font-size: 22px;
	color: #FFF;
}

.lounge-profile-when {
	color: var(--lounge-dim);
	font-size: 12px;
	text-shadow: 0 1px 2px #000;
}

.lounge-profile-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 2px 18px;
	padding: 10px 12px;
	margin-bottom: 14px;
	font-variant-numeric: tabular-nums;
}

.lounge-profile-stat {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	padding: 2px 0;
}

.lounge-profile-statlabel {
	font-size: 11px;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--lounge-dim);
}

.lounge-profile-statvalue {
	font-weight: bold;
}

.lounge-profile-chartbox {
	position: relative;
	padding: 10px 46px 10px 10px;
	margin-bottom: 14px;
}

.lounge-profile-chart {
	display: block;
	width: 100%;
	height: 150px;
}

.lounge-profile-charttop,
.lounge-profile-chartbottom {
	position: absolute;
	right: 8px;
	font-size: 11px;
	color: var(--lounge-dim);
	font-variant-numeric: tabular-nums;
}

.lounge-profile-charttop {
	top: 6px;
}

.lounge-profile-chartbottom {
	bottom: 6px;
}

.lounge-match-place {
	text-align: right;
	white-space: nowrap;
	width: 44px;
	color: var(--lounge-dim);
	font-size: 12px;
}

/* the row follows a real link now, so the focus ring belongs on what is focusable */
.lounge-match-link:focus-visible,
.lounge-lb-playerlink:focus-visible,
.lounge-lb-viewall:focus-visible,
.lounge-lb-back:focus-visible {
	outline: solid 2px var(--lounge-hot);
	outline-offset: 2px;
}

.lounge-playername {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.lounge-flag {
	width: 16px;
	height: 11px;
	border: solid 1px rgba(0, 0, 0, 0.4);
}

.lounge-match-link {
	color: inherit;
	text-decoration: none;
}

.lounge-match-row:hover .lounge-match-link {
	text-decoration: underline;
}

/* Each column is a run of races, the way the ladder splits a mogi's score up. */
.lounge-results-band {
	white-space: nowrap;
	color: var(--lounge-dim);
}

.lounge-results-row.is-self .lounge-results-band {
	color: inherit;
}

/* Staff's table editor: the text format they already use on Lorenzi, with the replayed
   ratings underneath as the preview. */
.lounge-table-editor {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lounge-table-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.lounge-table-field {
	display: flex;
	flex-direction: column;
	gap: 3px;
	font-size: 12px;
	color: var(--lounge-dim);
}

.lounge-table-field select,
.lounge-table-field input,
.lounge-table-text {
	box-sizing: border-box;
	padding: 4px 6px;
	border: inset 2px var(--lounge-frame);
	border-radius: 3px;
	background: var(--lounge-ground);
	color: #fff;
	font: inherit;
	color-scheme: dark;
}

.lounge-table-text {
	width: 100%;
	font-family: var(--lounge-mono);
	font-size: 13px;
	line-height: 1.5;
	resize: vertical;
}

.lounge-table-text:focus,
.lounge-table-field select:focus,
.lounge-table-field input:focus {
	outline: solid 1px var(--lounge-hot);
}

.lounge-table-editor .lounge-ratings-help {
	max-width: none;
	margin: 0;
	text-align: left;
}

.lounge-table-errors {
	margin: 0;
	padding-left: 18px;
	color: var(--lounge-bad);
	font-size: 12px;
}

.lounge-table-errors:empty {
	display: none;
}

.lounge-ratings-actions .is-danger {
	color: var(--lounge-bad);
}

.lounge-ratings-table th {
	padding: 5px 10px;
	font-family: var(--lounge-mono);
	font-size: 11px;
	font-weight: normal;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--lounge-legend);
	white-space: nowrap;
	border-bottom: solid 1px var(--lounge-frame-off);
}
