/* Same look as the website: white, Verdana, Courier, black lines, red/green/pink */

:root {
	--ink: #000;
	--red: rgb(230, 0, 0);
	--green: rgb(0, 134, 23);
	--pink: rgb(240, 25, 217);
	--pink-text: rgb(190, 0, 170);   /* darker pink for small text: 5.6:1 on white */
	--line: #000;
	--nav: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: #fff; }

body {
	color: var(--ink);
	font: 19px/1.35 Verdana, Geneva, Tahoma, sans-serif;
	-webkit-text-size-adjust: 100%;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

[hidden] { display: none !important; }

.mono { font-family: "Courier New", Courier, monospace; }

.note { font-size: 15px; }

.center { text-align: center; }

.sr-only {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Buttons */

.btn {
	display: inline-block;
	padding: 12px 16px;
	border: 3px solid var(--red);
	background: #fff;
	color: var(--red);
	font: bold 20px/1.15 "Courier New", Courier, monospace;
	cursor: pointer;
	border-radius: 0;
}

.btn:hover:not(:disabled), .btn:active:not(:disabled) { background: var(--red); color: #fff; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.small { padding: 8px 12px; font-size: 17px; border-width: 2px; min-height: 44px; }
.btn.ghost { border-color: var(--ink); color: var(--ink); }
.btn.ghost:hover, .btn.ghost:active { background: var(--ink); color: #fff; }

:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }

/* Headings get focus after a page change (for screen readers); no ring needed there */
[tabindex="-1"]:focus { outline: none; }

/* Login */

.login-page {
	max-width: 1040px;
	margin: 0 auto;
	padding: 32px 32px 56px;
	padding-left: max(32px, env(safe-area-inset-left));
	padding-right: max(32px, env(safe-area-inset-right));
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 40px;
	align-items: center;
}

/* The C is also the secret door to the login (7 taps): no zoom, selection or callout on taps */
.hero {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	touch-action: manipulation;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}

.title {
	font-size: 22px;
	line-height: 1.15;
	font-weight: normal;
	margin-bottom: 24px;
}

.login label {
	display: block;
	font-size: 16px;
	margin: 14px 0 4px;
}

.login .title + label { margin-top: 0; }

.login input {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: 2px solid var(--ink);
	border-radius: 0;
	background: #fff;
	color: var(--ink);
	font: inherit;
}

.login input:focus { outline: 3px solid var(--pink); outline-offset: 0; }

.login .btn { display: block; width: 100%; margin-top: 20px; font-size: 22px; padding: 14px 16px; }

.error { color: var(--red); font-size: 16px; margin-top: 8px; }

.login .note { margin-top: 12px; color: var(--pink-text); }

.accepted { color: var(--green); font-weight: bold; margin: -12px 0 18px; }
.switch { margin-top: 16px; font-size: 17px; }
.hint { font-size: 15px; margin-top: 4px; }

/* New account: the Congres ID */

.welcome {
	max-width: 560px;
	margin: 0 auto;
	padding: calc(32px + env(safe-area-inset-top)) 16px 56px;
	overflow-wrap: anywhere;   /* a long username without spaces must not widen the page */
}

.welcome > p { margin: 16px 0; }
.welcome .mono:first-child { margin-top: 0; color: var(--green); }
.welcome .title { margin-bottom: 16px; }
.welcome .btn { display: block; width: 100%; font-size: 22px; padding: 14px 16px; }

.persona {
	display: flex;
	gap: 16px;
	align-items: center;
	padding: 18px;
	border: 3px solid var(--pink);
}

.persona .emoji { font-size: 64px; line-height: 1; }
.persona b { display: block; font-size: 22px; line-height: 1.2; margin-bottom: 6px; }
.persona div span { display: block; font-size: 16px; }

.persona.small { padding: 12px 14px; border-width: 2px; }
.persona.small .emoji { font-size: 40px; }
.persona.small b { font-size: 18px; }

.hello { font-size: 19px; font-weight: normal; }

/* App shell */

.is-app .bar-top,
.is-app .view { max-width: 560px; margin: 0 auto; }

.bar-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
	border-bottom: 2px dashed var(--line);
}

.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 18px; }
.brand img { width: 26px; height: 26px; }

.demo {
	color: var(--pink);
	text-shadow: rgba(170, 206, 0, .8) 0 0 6px, rgba(170, 206, 0, .8) 0 0 3px;
	font-weight: bold;
	text-transform: uppercase;
}

.view { padding: 24px 16px calc(var(--nav) + 40px + env(safe-area-inset-bottom)); }

.view > section:not(:first-child):not(.first) {
	margin-top: 32px;
	padding-top: 28px;
	border-top: 2px dashed var(--line);
}

.view .first { margin-top: 16px; }

.view h2 { font-size: 19px; font-weight: normal; margin-bottom: 14px; }
.view h2.day { margin: 24px 0 8px; color: var(--green); }

.page-title { font-size: 26px; font-weight: normal; margin-bottom: 8px; }

.space { margin-top: 14px; }

.empty { font-style: italic; }

.flash {
	margin: 12px 0;
	padding: 10px 14px;
	border: 2px solid var(--green);
	color: var(--green);
	font-weight: bold;
}

.tabs {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	display: flex;
	justify-content: center;
	background: #fff;
	border-top: 2px dashed var(--line);
	padding-bottom: env(safe-area-inset-bottom);
}

.tabs a {
	flex: 1;
	max-width: 140px;
	height: var(--nav);
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	font: 17px "Courier New", Courier, monospace;
}

.tabs a[aria-current] { color: var(--red); font-weight: bold; text-decoration: underline; text-underline-offset: 4px; }

/* Info */

.date {
	margin-top: 16px;
	padding: 16px 18px;
	border: 3px solid var(--red);
	color: var(--red);
	font-weight: bold;
	font-size: 22px;
	line-height: 1.15;
}

.date small { display: block; font-size: 16px; margin-bottom: 6px; }

.countdown { margin-top: 10px; color: var(--red); }

.arrows { list-style: none; }
.arrows li { padding-left: 1.4em; text-indent: -1.4em; margin-bottom: 6px; }
.arrows li::before { content: "→ "; }

.account { display: flex; gap: 12px; flex-wrap: wrap; }

/* Line-up */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }

.chip {
	min-height: 44px;
	padding: 6px 10px;
	border: 2px solid var(--ink);
	background: #fff;
	color: var(--ink);
	font: 16px "Courier New", Courier, monospace;
	cursor: pointer;
}

.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }

.acts { list-style: none; }

.act {
	display: grid;
	grid-template-columns: 62px 1fr 44px;
	gap: 8px;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px dashed var(--line);
}

.act .time { font-weight: bold; }
.act b { display: block; font-weight: bold; }
.act small { font-size: 15px; }

.kind-music small, .kind-dj small { color: var(--red); }
.kind-theatre small, .kind-performance small { color: var(--pink-text); }
.kind-market small, .kind-buffet small { color: var(--green); }
.kind-cup small { color: var(--ink); font-weight: bold; }

.star {
	width: 44px; height: 44px;
	border: 0;
	background: none;
	font-size: 26px;
	cursor: pointer;
	color: var(--ink);
}

.star[aria-pressed="true"] { color: var(--red); }

/* Tickets */

.ticket {
	border: 2px solid var(--ink);
	padding: 14px;
	margin-bottom: 16px;
}

.ticket header {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
	padding-bottom: 10px;
	margin-bottom: 12px;
	border-bottom: 2px dashed var(--line);
}

.ticket p { margin-top: 10px; }
.ticket .note { color: var(--pink-text); }

.qr { width: 220px; max-width: 100%; margin: 0 auto; }
.qr.small { width: 170px; }
.qr svg { width: 100%; height: auto; }

.offers { list-style: none; }

.offer { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.offer p { margin: 6px 0 12px; font-size: 17px; }
.offer-head { display: flex; justify-content: space-between; gap: 8px; }

.price { font-weight: bold; white-space: nowrap; }

.pay {
	padding: 12px;
	border: 3px solid var(--red);
}

.pay .note { color: var(--pink-text); }
.pay .row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* Tokens */

.balance {
	margin-top: 16px;
	padding: 16px 18px;
	border: 3px solid var(--green);
	color: var(--green);
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.balance small { font-size: 17px; }
.balance span { font-size: 48px; font-weight: bold; line-height: 1; }

.packs {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-top: 12px;
}

.packs .btn { width: 100%; font-size: 22px; }
.packs .btn span { font-size: 15px; font-weight: normal; }
.packs .wide { grid-column: 1 / -1; }

.bar { list-style: none; }

.bar li {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: 12px;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px dashed var(--line);
}

.history { list-style: none; font-size: 16px; }

.history li {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 10px;
	padding: 6px 0;
	border-bottom: 1px dashed var(--line);
}

.plus { color: var(--green); }
.minus { color: var(--red); }

/* Sub-pages under More */

.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 4px; text-decoration: none; font-size: 16px; }
.back:hover { text-decoration: underline; }

/* More */

.more { list-style: none; margin-top: 12px; }

.more a {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 2px 12px;
	padding: 14px 0;
	border-bottom: 1px dashed var(--line);
	text-decoration: none;
}

.more b { font-weight: bold; font-size: 20px; }
.more small { grid-row: 2; font-size: 15px; }
.more span { grid-row: 1 / 3; grid-column: 2; font-size: 22px; }
.more a:hover b, .more a:active b { color: var(--red); }

/* Menu */

.have { margin: 12px 0 4px; }
.bar + .note { margin-top: 12px; }

/* Guestbook */

.sign label { display: block; font-size: 16px; margin: 12px 0 4px; }

.sign textarea {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: 2px solid var(--ink);
	border-radius: 0;
	background: #fff;
	color: var(--ink);
	font: inherit;
	resize: vertical;
}

.sign textarea:focus { outline: 3px solid var(--pink); outline-offset: 0; }
.sign .btn { margin-top: 12px; }
.sign .reward { margin-top: 8px; font-size: 16px; color: var(--green); font-weight: bold; }
.sign .note { margin-top: 8px; color: var(--pink-text); }

.entries { list-style: none; }
.entries li { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.entries small { display: block; margin-top: 4px; font-size: 15px; }

/* A text link that is a button; the padding makes a 44px tap area without moving the line */
.link {
	padding: 12px 6px;
	margin: -12px -6px;
	border: 0;
	background: none;
	color: var(--red);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* Play */

.hands {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.hand {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 12px 4px;
	border: 3px solid var(--red);
	background: #fff;
	color: var(--red);
	font: bold 17px "Courier New", Courier, monospace;
	cursor: pointer;
}

.hand span { font-size: 40px; line-height: 1; }
.hand:hover, .hand:active { background: var(--red); color: #fff; }

.result {
	margin-bottom: 20px;
	padding: 14px 16px;
	border: 3px solid var(--ink);
}

.result .shown { font-size: 44px; line-height: 1.1; margin-bottom: 6px; }
.result .shown small { font-size: 17px; vertical-align: middle; }
.result.win { border-color: var(--green); color: var(--green); }
.result.loss { border-color: var(--red); color: var(--red); }

/* The cup */

.match-card {
	padding: 16px;
	border: 3px solid var(--red);
}

.match-card h2 { margin-bottom: 8px; }
.match-card .btn { margin-top: 12px; }
.match-card .hands { margin-top: 14px; }

.stage { font-size: 15px; color: var(--red); margin-bottom: 6px; }
.versus small { font-size: 16px; }
.score { font-size: 44px; font-weight: bold; line-height: 1.1; }
.hand-result { font-size: 16px; margin-top: 4px; }
.hand-result span { font-size: 22px; margin-right: 4px; }
.hand-result span small { font-size: 15px; }
.hand-result.win { color: var(--green); }
.hand-result.loss { color: var(--red); }

.champion { padding: 16px; border: 3px solid var(--green); color: var(--green); text-align: center; }
.champion .cup { font-size: 64px; line-height: 1.1; }
.champion h2 { font-weight: bold; }

table.group {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
	margin-bottom: 12px;
}

table.group caption { text-align: left; font-weight: bold; padding: 6px 0; }
table.group th, table.group td { padding: 6px 4px; border-bottom: 1px dashed var(--line); text-align: right; }
table.group th[scope="row"] { text-align: left; font-weight: normal; width: 100%; }
table.group thead th { font-family: "Courier New", Courier, monospace; font-weight: bold; white-space: nowrap; }
table.group thead th:nth-child(2) { text-align: left; }
table.group abbr { text-decoration: none; }
table.group td:first-child { text-align: left; font-family: "Courier New", Courier, monospace; }
table.group .through td:first-child { color: var(--green); font-weight: bold; }
table.group .me th, table.group .me td { color: var(--red); font-weight: bold; }

.view h3 { font-size: 17px; font-weight: bold; margin: 14px 0 6px; }

.bracket { list-style: none; font-size: 16px; }
.bracket li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.bracket b { margin: 0 6px; white-space: nowrap; }
.bracket .won { font-weight: bold; }
.bracket .me { color: var(--red); }
.bracket .tbd { font-family: "Courier New", Courier, monospace; font-size: 15px; }

details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸"; width: 1.2em; }
details[open] summary::before { content: "▾"; }
details[open] summary { margin-bottom: 8px; }

.schedule { list-style: none; font-size: 16px; }
.schedule li { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 4px 0; }
.schedule .mono { white-space: nowrap; }

/* Phones */

@media (max-width: 760px) {
	body { font-size: 17px; }
	.login-page { grid-template-columns: 1fr; gap: 24px; padding: 20px 16px 40px; }
	/* Keep the C small enough that the login form fits on the first screen */
	.login-page .hero { width: min(100%, 40vh); width: min(100%, 40svh); }
	.title { font-size: 20px; }
	.login .btn { font-size: 20px; }
	.date { font-size: 20px; }
	.date small { font-size: 15px; }
}
