/**
 * Beyond the Game — public theme.
 * Same tokens as the admin application, so a colour changed in one place holds
 * everywhere: dashboard, public site, and printed tag.
 */

:root {
	--blue: #1666d8;
	--yellow: #f2b705;
	--green: #16a34a;
	--red: #dc2626;

	--ink: #0b1f3a;
	--body: #334155;
	--muted: #64748b;
	--line: #e2e8f0;
	--surface: #fff;
	--canvas: #f6f8fb;

	--radius: 16px;
	--shadow: 0 1px 2px rgba(11,31,58,.06), 0 8px 24px rgba(11,31,58,.06);
	--wrap: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--canvas);
	color: var(--body);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	/* Room for the fixed bottom bar on phones. */
	padding-bottom: env(safe-area-inset-bottom);
}

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

a { color: var(--blue); }

.btg-skip {
	position: absolute; left: -9999px;
	background: var(--ink); color: #fff; padding: 12px 18px; z-index: 100;
}
.btg-skip:focus { left: 12px; top: 12px; }

/* ---------- Header ---------- */

.site-header {
	position: sticky; top: 0; z-index: 40;
	background: rgba(255,255,255,.92);
	backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid var(--line);
}

.site-header__inner { display: flex; align-items: center; gap: 16px; min-height: 62px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }

.brand__mark {
	width: 38px; height: 38px;
	border-radius: 11px;
	object-fit: contain;
	flex: none;
}

/* Only the lettered fallback needs the dark tile behind it; a real logo sits
   on the page background so a transparent PNG does not get boxed in. */
.brand__mark--text {
	display: grid; place-items: center;
	background: var(--ink); color: #fff;
	font-size: 12px; font-weight: 800; letter-spacing: .04em;
}

.brand__text strong { display: block; font-size: 15px; line-height: 1.15; }
.brand__text small { display: block; font-size: 11.5px; color: var(--muted); }

.site-nav { margin-left: auto; }
.site-nav__list { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.site-nav__list a { color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.site-nav__list a:hover { color: var(--blue); }

@media (max-width: 720px) { .site-nav { display: none; } }

/* ---------- Hero ---------- */

.hero {
	background: linear-gradient(160deg, #0b1f3a 0%, #123a6b 58%, #1666d8 100%);
	color: #fff;
	padding: 56px 0 60px;
	text-align: center;
}

.hero__eyebrow {
	margin: 0 0 10px;
	font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
	color: rgba(255,255,255,.72);
}

.hero__title {
	margin: 0;
	font-size: clamp(30px, 7vw, 54px);
	line-height: 1.08;
	letter-spacing: -0.03em;
	font-weight: 800;
}

.hero__meta {
	display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center;
	margin: 14px 0 0; color: rgba(255,255,255,.85); font-size: 15px;
}

.hero__actions { margin-top: 28px; }

/* ---------- Countdown ---------- */

.countdown { display: flex; gap: 10px; justify-content: center; margin-top: 26px; }

.countdown__unit {
	min-width: 76px; padding: 12px 8px;
	background: rgba(255,255,255,.12);
	border: 1px solid rgba(255,255,255,.2);
	border-radius: 13px;
}

.countdown__unit b { display: block; font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; }
.countdown__unit i { display: block; font-style: normal; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .78; }
.countdown__live { font-size: 18px; font-weight: 700; }

/* ---------- Sections ---------- */

.section { padding: 44px 0; }
.section--muted { background: var(--surface); border-block: 1px solid var(--line); }

.section__title {
	margin: 0 0 20px;
	font-size: clamp(21px, 3.4vw, 28px);
	color: var(--ink);
	letter-spacing: -0.02em;
	font-weight: 750;
}

.prose { max-width: 68ch; }
.prose p { margin: 0 0 16px; }

/* ---------- Stats ---------- */

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }

.stat {
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--radius); box-shadow: var(--shadow);
	padding: 22px; text-align: center;
}

.stat__value { display: block; font-size: 40px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__label { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; }

/* ---------- Teams ---------- */

.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }

.team-card {
	position: relative; overflow: hidden;
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--radius); box-shadow: var(--shadow);
	padding: 20px 20px 20px 26px;
}

/* Colour bar plus the written team name — never colour alone. */
.team-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: var(--team); }

.team-card--blue   { --team: var(--blue); }
.team-card--yellow { --team: var(--yellow); }
.team-card--green  { --team: var(--green); }
.team-card--red    { --team: var(--red); }

.team-card__name {
	display: block; font-size: 12px; font-weight: 800;
	letter-spacing: .1em; text-transform: uppercase;
	color: var(--ink);
}

.team-card__count { display: block; font-size: 34px; font-weight: 800; color: var(--ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.team-card__unit { display: block; font-size: 13px; color: var(--muted); }

/* ---------- Buttons ---------- */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 24px;
	border: 0; border-radius: 12px;
	background: var(--blue); color: #fff;
	font-size: 15.5px; font-weight: 700; text-decoration: none; cursor: pointer;
	transition: transform .12s ease, filter .12s ease;
}

.btn:hover { filter: brightness(1.08); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }

.btn--lg { min-height: 58px; font-size: 17px; padding: 0 34px; border-radius: 14px; }
.btn--block { width: 100%; }
.btn--disabled { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); cursor: not-allowed; }

.hero .btn:not(.btn--disabled) { background: #fff; color: var(--ink); }

/* ---------- Forms ---------- */

.form { max-width: 520px; }

.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 6px; font-weight: 650; color: var(--ink); font-size: 14.5px; }

.field input[type="text"], .field input[type="tel"], .field input[type="email"],
.field input[type="date"], .field select {
	width: 100%; min-height: 50px; padding: 10px 14px;
	border: 1px solid var(--line); border-radius: 12px;
	background: var(--surface); font-size: 16px; color: var(--ink);
	/* 16px minimum stops iOS Safari zooming on focus. */
}

.field input:focus, .field select:focus { border-color: var(--blue); outline: 3px solid #dbeafe; }

.field--check label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14.5px; }
.field--check input { margin-top: 4px; width: 20px; height: 20px; flex: none; }

.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.req { color: var(--red); }

/* Honeypot: hidden from people, reachable by bots. Not display:none, because
   some bots skip fields that are hidden that way. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Notices, cards, empty ---------- */

.notice { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); max-width: 560px; }
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin: 0; }
.notice--warn { background: #fdf4dc; border-color: #f4dfa0; color: #7a5a00; }

.card-list { display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card__title { margin: 0 0 6px; font-size: 19px; }
.card__title a { color: var(--ink); text-decoration: none; }

.empty { text-align: center; padding: 60px 20px; }
.empty__icon { font-size: 40px; }
.empty h1 { color: var(--ink); margin: 8px 0; }
.empty p { color: var(--muted); margin: 0 0 22px; }

/* ---------- Footer & bottom nav ---------- */

.site-footer { background: var(--ink); color: rgba(255,255,255,.78); padding: 40px 0 96px; margin-top: 40px; }
.site-footer__brand { margin: 0 0 10px; color: #fff; font-size: 17px; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; padding: 0; margin: 0 0 16px; }
.site-footer__nav a { color: rgba(255,255,255,.8); text-decoration: none; font-size: 14px; }
.site-footer__legal { margin: 0; font-size: 12.5px; color: rgba(255,255,255,.55); max-width: 60ch; }

.bottom-nav { display: none; }

@media (max-width: 720px) {
	.bottom-nav {
		position: fixed; inset: auto 0 0 0; z-index: 50;
		display: grid; grid-template-columns: repeat(3, 1fr);
		background: rgba(255,255,255,.96);
		backdrop-filter: blur(10px);
		border-top: 1px solid var(--line);
		padding-bottom: env(safe-area-inset-bottom);
	}

	.bottom-nav a {
		display: flex; flex-direction: column; align-items: center; gap: 2px;
		padding: 9px 4px 8px;
		text-decoration: none; color: var(--muted);
		font-size: 11px; font-weight: 650;
	}

	.bottom-nav a span { font-size: 19px; }
	.site-footer { padding-bottom: 110px; }
}

@media (prefers-reduced-motion: reduce) {
	.btn { transition: none; }
	* { scroll-behavior: auto !important; }
}

/* ---------- Preloader ---------- */

.preloader {
	position: fixed; inset: 0; z-index: 9999;
	display: grid; place-items: center;
	background: linear-gradient(160deg, #0b1f3a 0%, #123a6b 60%, #1666d8 100%);
	color: #fff;
	opacity: 1;
	transition: opacity .45s ease, visibility .45s ease;
}

.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader__inner { text-align: center; display: grid; justify-items: center; gap: 4px; }

.preloader__mark {
	width: 76px; height: 76px; margin-bottom: 14px;
	border-radius: 22px;
	object-fit: contain;
	animation: btg-pulse 1.6s ease-in-out infinite;
	/* A white pad behind the logo so a dark or transparent mark stays legible
	   against the dark splash gradient. */
	background: #fff;
	padding: 10px;
	box-sizing: border-box;
	box-shadow: 0 10px 30px rgba(0,0,0,.22);
}

.preloader__mark--text {
	display: grid; place-items: center;
	background: rgba(255,255,255,.14);
	border: 1px solid rgba(255,255,255,.26);
	color: #fff; padding: 0;
	font-size: 21px; font-weight: 800; letter-spacing: .05em;
	box-shadow: none;
}

.preloader__name { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.preloader__by { font-size: 12.5px; opacity: .72; margin-bottom: 18px; }

.preloader__bar {
	display: block; width: 148px; height: 3px;
	background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden;
}

.preloader__bar i { display: block; height: 100%; width: 40%; background: #fff; border-radius: 99px; animation: btg-slide 1.15s ease-in-out infinite; }

@keyframes btg-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes btg-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(310%); } }

/* Someone who asked their device for less motion did not ask for a splash
   screen either — they get the page immediately. */
@media (prefers-reduced-motion: reduce) {
	.preloader { display: none; }
	.preloader__mark, .preloader__bar i { animation: none; }
}

.btg-skip-visually {
	position: absolute; width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* ---------- Mobile menu ---------- */

.nav-toggle {
	display: none;
	margin-left: auto;
	width: 44px; height: 44px;
	align-items: center; justify-content: center;
	background: transparent; border: 1px solid var(--line); border-radius: 12px;
	cursor: pointer;
}

.nav-toggle__bars { display: grid; gap: 4px; }
.nav-toggle__bars i { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }

.mobile-nav { position: fixed; inset: 0; z-index: 90; }
.mobile-nav[hidden] { display: none; }

.mobile-nav__backdrop { position: absolute; inset: 0; background: rgba(11,31,58,.5); backdrop-filter: blur(2px); }

.mobile-nav__sheet {
	position: absolute; inset: 0 0 0 auto;
	width: min(84vw, 330px);
	background: var(--surface);
	padding: 20px 22px calc(28px + env(safe-area-inset-bottom));
	box-shadow: -14px 0 40px rgba(11,31,58,.2);
	display: flex; flex-direction: column; gap: 8px;
	transform: translateX(100%);
	animation: btg-slide-in .24s ease forwards;
	overflow-y: auto;
}

@keyframes btg-slide-in { to { transform: translateX(0); } }

.mobile-nav__close {
	align-self: flex-end;
	width: 42px; height: 42px;
	font-size: 27px; line-height: 1;
	background: transparent; border: 0; color: var(--muted); cursor: pointer;
}

.mobile-nav__list { list-style: none; margin: 0 0 18px; padding: 0; }
.mobile-nav__list li { border-bottom: 1px solid var(--line); }
.mobile-nav__list a {
	display: block; padding: 15px 2px;
	color: var(--ink); text-decoration: none;
	font-size: 17px; font-weight: 650;
}

body.nav-open { overflow: hidden; }

@media (max-width: 720px) {
	.nav-toggle { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
	.mobile-nav__sheet { animation: none; transform: none; }
}
