/* Call Your Shot — application styles.
   The prototype's editorial structure in the club's colours: Dodger blue,
   white flannel, and the red off the jersey numbers used sparingly. */

:root {
	--paper: #e7edf3;
	--card: #ffffff;
	/* Text blue is darker than the brand blue: #005a9c is a headline colour,
	   not a body-copy one. */
	--ink: #0a2240;
	--dodger: #005a9c;
	--soft: #5a7189;
	--red: #ef3e42;
	--line: #bed0e0;
	--line-soft: #dbe5ef;
	--on-blue-dim: #9dc2e2;
	--on-blue-mid: #cfe3f4;
}

* {
	box-sizing: border-box;
}

/* `hidden` has to beat the `display` rules below it, or a hidden flex
   container stays on screen. */
[hidden] {
	display: none !important;
}

html,
body {
	margin: 0;
	padding: 0;
}

body.cys-app {
	background: var(--paper);
	color: var(--ink);
	font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 16px;
	line-height: 1.45;
	-webkit-text-size-adjust: 100%;
}

.cys-app .wrap {
	max-width: 520px;
	margin: 0 auto;
	padding: 22px 16px calc(56px + env(safe-area-inset-bottom));
}

/* Header */

.app-header {
	border-bottom: 2px solid var(--dodger);
	padding-bottom: 10px;
	margin-bottom: 18px;
}

.app-header h1 {
	font-family: 'Barlow Condensed', 'Barlow', sans-serif;
	font-weight: 700;
	font-size: 44px;
	line-height: 0.92;
	letter-spacing: -0.01em;
	margin: 0;
	color: var(--dodger);
}

.dateline {
	color: var(--soft);
	font-size: 14px;
	margin: 6px 0 0;
	display: flex;
	justify-content: space-between;
	gap: 10px;
	align-items: baseline;
}

.dateline .code {
	font-family: 'Barlow Condensed', sans-serif;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--dodger);
}

/* Lead banner */

.lead {
	background: var(--dodger);
	color: #fff;
	padding: 20px 18px 18px;
	margin-bottom: 22px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
}

.lead > :first-child {
	flex: 1;
	min-width: 0;
}

.lead:empty {
	display: none;
}

.lead .tag {
	font-size: 13px;
	color: var(--on-blue-dim);
	margin: 0 0 2px;
}

.lead .name {
	font-family: 'Barlow Condensed', 'Barlow', sans-serif;
	font-weight: 700;
	font-size: 50px;
	line-height: 0.9;
	margin: 0;
}

.lead .line {
	font-size: 15px;
	color: var(--on-blue-mid);
	margin: 10px 0 0;
}

.lead.quiet .name {
	font-size: 24px;
	color: var(--on-blue-mid);
	font-weight: 600;
	line-height: 1.15;
}

/* Blocks */

h2 {
	font-family: 'Barlow Condensed', 'Barlow', sans-serif;
	font-weight: 600;
	font-size: 22px;
	margin: 0 0 10px;
	color: var(--dodger);
}

section {
	margin-bottom: 26px;
}

.note {
	color: var(--soft);
	font-size: 14px;
	margin: 0 0 12px;
}

.err {
	color: var(--red);
	font-size: 14px;
	margin: 0 0 12px;
}

/* Player cards.
   One look, used by the draft board and the watching list alike. A called
   shot is the same card, only larger — nothing about it is a different
   colour, weight, or ground. */

.pick,
.hitter {
	width: 100%;
	text-align: left;
	background: var(--card);
	border: 1px solid var(--line-soft);
	border-left: 3px solid var(--line);
	border-radius: 0;
	padding: 12px 13px;
	margin-bottom: 7px;
	font-family: inherit;
	font-size: 16px;
	color: inherit;
}

/* The draft board's rows are a single line. */
.pick {
	display: flex;
	align-items: center;
	gap: 11px;
}

/* A watching card stacks: the head, then what it opens to reveal. */
.hitter {
	display: block;
}

.pick {
	cursor: pointer;
}

.pick[disabled] {
	opacity: 0.45;
	cursor: default;
}

.pick .pos,
.hitter__pos {
	flex: none;
	width: 28px;
	font-size: 13px;
	color: var(--soft);
}

.pick .nm {
	flex: 1;
	font-weight: 500;
}

.pick .taken {
	font-size: 13px;
	color: var(--soft);
	text-align: right;
}

/* Where a hitter bats, carried on every card. */

.spot {
	flex: none;
	width: 30px;
	text-align: center;
	line-height: 1.05;
}

.spot__no {
	display: block;
	font-family: 'Barlow Condensed', 'Barlow', sans-serif;
	font-weight: 700;
	font-size: 17px;
	color: var(--ink);
}

.spot__pos {
	display: block;
	font-size: 11px;
	color: var(--soft);
}

/* Watching. The card is a grid so the face, the batting slot, the name and the
   number sit on the same rails whatever their heights. */

.hitter__head {
	display: grid;
	grid-template-columns: auto auto 1fr auto 12px;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
}

.hitter__who {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.hitter__owner {
	font-size: 13px;
	color: var(--soft);
}

.hitter__name {
	font-weight: 500;
	font-size: 16px;
	line-height: 1.2;
}

.hitter__score {
	font-family: 'Barlow Condensed', 'Barlow', sans-serif;
	font-weight: 700;
	font-size: 23px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	text-align: right;
	min-width: 26px;
	color: var(--ink);
}

.hitter__chev {
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--line);
	border-bottom: 2px solid var(--line);
	transform: rotate(45deg) translateY(-2px);
}

.hitter.is-open .hitter__chev {
	transform: rotate(225deg) translateY(-2px);
}

/* What the number is made of */

.hitter__detail {
	margin-top: 11px;
	padding-top: 9px;
	border-top: 1px solid var(--line-soft);
}

.tally {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 3px 0;
	font-size: 14px;
	color: var(--soft);
}

.tally__pts {
	flex: none;
	font-variant-numeric: tabular-nums;
}

.tally--total {
	margin-top: 5px;
	padding-top: 6px;
	border-top: 1px solid var(--line-soft);
	color: var(--ink);
	font-weight: 600;
}

.tally--total .tally__pts {
	font-family: 'Barlow Condensed', 'Barlow', sans-serif;
	font-weight: 700;
	font-size: 18px;
}

.tally__none {
	padding: 3px 0;
	font-size: 14px;
	color: var(--soft);
}

/* A called shot. Every card is the same size now; the only difference is the
   blue edge and the tabs sitting on top of it — one per person backing him,
   because two people can call the same hitter and a single name would have to
   leave one of them out. */

.callable {
	margin-bottom: 7px;
}

.callable .hitter {
	margin-bottom: 0;
}

.callable.is-called .hitter {
	border-left-color: var(--dodger);
}

.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 3px;
	padding-left: 3px;
}

.tab {
	background: var(--dodger);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.35;
	padding: 3px 10px 2px;
	border-radius: 3px 3px 0 0;
	max-width: 40vw;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Roster rows */

.slot {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid var(--line-soft);
}

.slot:first-of-type {
	border-top: 1px solid var(--line);
}

.slot .who {
	font-weight: 600;
	min-width: 70px;
}

.slot .got {
	flex: 1;
	color: var(--soft);
	font-size: 15px;
}

.slot.waiting .got {
	font-style: italic;
}

.slot.you .who::after {
	content: '(you)';
	margin-left: 5px;
	font-weight: 400;
	color: var(--soft);
	font-size: 13px;
}

/* Scoreboard */

.board {
	background: var(--card);
	border-left: 3px solid var(--line);
	padding: 12px 14px 10px;
	margin-bottom: 20px;
}

.board.is-live {
	border-left-color: var(--red);
}

.board__row {
	display: grid;
	grid-template-columns: 42px 1fr auto;
	align-items: baseline;
	gap: 10px;
	padding: 2px 0;
}

.board__abbr {
	font-family: 'Barlow Condensed', 'Barlow', sans-serif;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.06em;
	color: var(--soft);
}

.board__team {
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.board__runs {
	font-family: 'Barlow Condensed', 'Barlow', sans-serif;
	font-weight: 700;
	font-size: 27px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	min-width: 26px;
	text-align: right;
}

.board__row.is-us .board__abbr,
.board__row.is-us .board__runs {
	color: var(--dodger);
}

.board__state {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	margin-top: 9px;
	padding-top: 8px;
	border-top: 1px solid var(--line-soft);
	font-size: 13px;
	color: var(--soft);
}

.countdown {
	font-variant-numeric: tabular-nums;
}

/* Controls */

button {
	font-family: 'Barlow', sans-serif;
	font-size: 15px;
	font-weight: 500;
	padding: 9px 14px;
	border-radius: 3px;
	cursor: pointer;
	border: 1px solid var(--dodger);
	background: none;
	color: var(--dodger);
}

button:focus-visible,
input:focus-visible {
	outline: 2px solid var(--red);
	outline-offset: 2px;
}

button[disabled] {
	opacity: 0.5;
	cursor: default;
}

.solid {
	background: var(--dodger);
	color: #fff;
	border-color: var(--dodger);
}

.wide {
	width: 100%;
}

.small {
	font-size: 14px;
	padding: 6px 11px;
}

.ghost {
	border-color: var(--line);
	color: var(--soft);
}

.warn {
	border-color: var(--red);
	color: var(--red);
}

input.text {
	font-family: 'Barlow', sans-serif;
	font-size: 16px;
	padding: 10px 11px;
	border: 1px solid var(--line);
	background: var(--card);
	color: var(--ink);
	border-radius: 2px;
	width: 100%;
}

input.text.code {
	font-family: 'Barlow Condensed', sans-serif;
	font-size: 22px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-weight: 600;
}

.pair {
	display: flex;
	gap: 8px;
}

.pair .solid {
	flex: none;
}

.stack > * + * {
	margin-top: 8px;
}

/* Welcome screen */

.code-badge {
	background: var(--card);
	border-left: 3px solid var(--dodger);
	padding: 14px;
	margin-bottom: 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.code-badge .val {
	color: var(--dodger);
	font-family: 'Barlow Condensed', sans-serif;
	font-weight: 700;
	font-size: 32px;
	letter-spacing: 0.16em;
	line-height: 1;
}

.code-badge .cap {
	font-size: 13px;
	color: var(--soft);
}

/* Notifications bar */

.pushbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	background: var(--card);
	border-left: 3px solid var(--line);
	padding: 11px 13px;
	margin-bottom: 20px;
	font-size: 14px;
}

.pushbar.on {
	border-left-color: var(--dodger);
}

.pushbar .txt {
	flex: 1;
	color: var(--soft);
}

.pushbar.on .txt {
	color: var(--ink);
}

/* Footer */

.cys-app footer {
	border-top: 1px solid var(--line);
	padding-top: 14px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* Live toast */

.toast {
	position: fixed;
	left: 50%;
	bottom: calc(18px + env(safe-area-inset-bottom));
	transform: translateX(-50%);
	background: var(--ink);
	color: #fff;
	padding: 11px 16px;
	font-size: 15px;
	max-width: calc(100vw - 32px);
	box-shadow: 0 6px 22px rgb(10 34 64 / 30%);
	z-index: 20;
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		animation: none !important;
	}
}
