/**
 * Styles for the shared game shell (src/game/): header/logo, mode selector,
 * the welcome, info, end-game, ad/fact and sports modals, cookie banner and
 * footer — used by every game. Deployed once at the site root
 * (dist/game.css) and linked by each game's index.html after shared.css and
 * before the game's own styles.css, which holds only that game's overrides
 * (theme colours, per-field tile sizing).
 */

/* ── Header ────────────────────────────────────────────────────── */
header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 28px 0 6px;
	border-bottom: 1px solid var(--border);
	margin-bottom: 0;
}

.logo {
	display: flex;
	flex-direction: column;
	line-height: 1;
}

.logo-title {
	display: flex;
	align-items: center;
	gap: 0.15em;
	font-size: clamp(2.8rem, 6vw, 4.2rem);
	font-weight: 900;
	letter-spacing: -0.02em;
	color: #fff;
	text-transform: uppercase;
	line-height: 1;
}

.logo-title .logo-main span {
	color: var(--pitch);
	text-shadow: 0 0 30px var(--pitch-glow);
}

.logo-title .logo-hyphen {
	color: #ffffff;
	text-shadow: none;
	font-weight: 600;
	font-size: 75%;
}
.logo-title .logo-world {
	color: var(--pitch);
	text-shadow: 0 0 30px var(--pitch-glow);
	font-weight: 600;
	font-size: 75%;
}
.logo-title .logo-cup {
	color: #ffffff;
	text-shadow: none;
	font-weight: 600;
	font-size: 75%;
}

.logo-sub {
	font-size: 0.85rem;
	font-weight: 400;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--text-dim);
	margin-top: 4px;
}

/* ── Mode selector ─────────────────────────────────────────────── */
.mode-selector {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 6px 0;
	margin-bottom: 0;
	border-bottom: 1px solid var(--border);
}

.mode-selector-btns {
	display: flex;
	gap: 16px;
	justify-content: center;
}

.mode-selector-right {
	display: flex;
	justify-content: flex-end;
}

.mode-btn {
	background: transparent;
	border: 1.5px solid var(--text-dimmer);
	border-radius: 20px;
	color: var(--text-dimmer);
	font-family: "Barlow Condensed", sans-serif;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 4px 10px;
	min-width: 90px;
	text-align: center;
	cursor: pointer;
	transition: all var(--transition);
	white-space: nowrap;
}

.mode-btn:hover {
	border-color: var(--text-dim);
	color: var(--text);
}

.mode-btn.active {
	background: var(--pitch);
	border-color: var(--pitch);
	color: #000;
}

/* ── Info button ───────────────────────────────────────────────── */
.info-btn {
	background: transparent;
	border: 1.5px solid var(--pitch);
	border-radius: 50%;
	color: var(--pitch);
	font-family: "Barlow Condensed", sans-serif;
	font-size: 0.9rem;
	font-weight: 700;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all var(--transition);
	flex-shrink: 0;
}

.info-btn:hover {
	border-color: var(--pitch-bright);
	color: var(--pitch-bright);
}

/* ── Info modal (this game's instance of ui/Modal) ────────────────── */
#info-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 300;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

#info-modal.show {
	display: flex;
}

/* ── End game modal (bespoke shell — doesn't use ui/Modal, since it
   needs a custom close-button placement) ─────────────────────────── */
#end-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 300;
	align-items: flex-start;
	justify-content: center;
	padding: 16px 12px 24px;
	overflow-y: auto;
}

#end-modal.show {
	display: flex;
}

#end-modal .modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
}

.end-modal-close {
	position: absolute;
	top: -14px;
	right: -14px;
	background: var(--navy-4);
	border: 1px solid var(--border);
	border-radius: 50%;
	color: var(--text-dim);
	font-size: 0.85rem;
	cursor: pointer;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	transition: all var(--transition);
}

.end-modal-close:hover {
	color: #ffffff;
	background: var(--navy);
}

.end-modal-box {
	position: relative;
	z-index: 1;
	background: var(--navy-3);
	border: 1px solid var(--border);
	border-radius: 14px;
	width: 100%;
	max-width: 380px;
	text-align: center;
	overflow: visible;
	margin: auto;
	margin-top: 20px;
}

/* Coloured top band */
.end-modal-band {
	padding: 16px 24px 12px;
	background: var(--navy-4);
	border-radius: 14px 14px 0 0;
}

.end-headline {
	font-size: clamp(1.8rem, 5vw, 2.6rem);
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: -0.01em;
	line-height: 1;
	margin-bottom: 0;
	text-align: center;
}

.end-headline.won {
	color: #ffffff;
	text-shadow: none;
}
.end-headline.lost {
	color: var(--close);
}

.end-guess-count {
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-dim);
}

/* Player card */
.end-player-card {
	padding: 12px 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	border-bottom: 1px solid var(--border);
}

.end-player-img {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid var(--border);
	background: var(--navy-4);
}

.end-player-name {
	font-size: clamp(1.4rem, 4vw, 2rem);
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #ffffff;
	line-height: 1;
}

/* Action buttons */
.end-actions {
	display: flex;
	gap: 10px;
	padding: 12px 16px;
	justify-content: center;
}

.end-btn {
	flex: 1;
	font-family: "Barlow Condensed", sans-serif;
	font-size: 0.9rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 12px 16px;
	border-radius: var(--radius);
	cursor: pointer;
	transition: all var(--transition);
	border: none;
}

.end-band-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.end-btn-new {
	background: var(--pitch);
	color: #000;
}

.end-btn-new:hover {
	background: var(--pitch-bright);
	box-shadow: 0 0 20px var(--pitch-glow);
}

/* ── Sports switcher (currently hidden/unwired, carried forward from the
   original) ───────────────────────────────────────────────────────── */
.sports-tile {
	background: var(--wrong-bg);
	border: 1px solid var(--wrong);
	border-radius: var(--radius);
	cursor: pointer;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px;
	width: 52px;
	height: 52px;
	flex-shrink: 0;
	place-items: center;
	transition:
		border-color var(--transition),
		background var(--transition);
}

.sports-tile:hover {
	border-color: var(--text-dim);
	background: var(--navy-4);
}

.sports-tile span {
	font-size: 0.8rem;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	width: 100%;
	height: 100%;
}

#sports-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 300;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

#sports-modal.show {
	display: flex;
}

/* ── Welcome / how-to-play modal ───────────────────────────────── */
#welcome-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 400;
	align-items: flex-start;
	justify-content: center;
	padding: 16px 12px 24px;
	overflow-y: auto;
}

#welcome-modal.show {
	display: flex;
}

#welcome-modal .modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
}

.welcome-box {
	position: relative;
	z-index: 1;
	background: var(--navy-3);
	border: 1px solid var(--border);
	border-radius: 14px;
	width: 100%;
	max-width: 420px;
	margin: auto;
	margin-top: 16px;
	overflow: hidden;
}

.welcome-header {
	background: var(--navy-4);
	padding: 16px 20px 12px;
	border-bottom: 1px solid var(--border);
	text-align: center;
}

.welcome-title {
	font-size: 1.3rem;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #ffffff;
}

.welcome-subtitle {
	font-size: 0.75rem;
	color: #8899aa;
	margin-top: 4px;
	letter-spacing: 0.04em;
}

.welcome-body {
	padding: 14px 16px 16px;
}

.welcome-instruction {
	font-size: 0.78rem;
	color: #aabbcc;
	text-align: center;
	margin-bottom: 12px;
	line-height: 1.4;
}

/* Mini grid for the example */
.welcome-grid {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 14px;
}

.welcome-row {
	display: grid;
	grid-template-columns: 38px repeat(6, 1fr);
	gap: 3px;
}

.welcome-photo {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--navy-4);
	border: 1.5px solid rgba(255, 255, 255, 0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.6rem;
	color: #8899aa;
	overflow: hidden;
	flex-shrink: 0;
}

.welcome-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.wc {
	height: 38px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	color: #ffffff;
	font-family: "Barlow Condensed", sans-serif;
	letter-spacing: 0.02em;
	position: relative;
}

.wc.correct {
	background: var(--correct-bg);
	border: 1px solid var(--correct);
}
.wc.close {
	background: var(--close-bg);
	border: 1px solid var(--close);
}
.wc.wrong {
	background: var(--wrong-bg);
	border: 1px solid var(--wrong);
}

.wc .wc-tri {
	position: absolute;
	width: 0;
	height: 0;
	left: 50%;
	transform: translateX(-50%);
}
.wc .wc-tri.up {
	top: 3px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-bottom: 6px solid rgba(255, 255, 255, 0.8);
}
.wc .wc-tri.down {
	bottom: 3px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 6px solid rgba(255, 255, 255, 0.8);
}

.welcome-footer {
	text-align: center;
	padding: 10px 16px 16px;
	border-top: 1px solid var(--border);
	font-size: 0.75rem;
	color: #8899aa;
	line-height: 1.5;
}

.welcome-footer strong {
	color: #ffffff;
}

.welcome-start-btn {
	margin-top: 12px;
	background: var(--pitch);
	border: none;
	border-radius: 8px;
	color: #000;
	font-family: "Barlow Condensed", sans-serif;
	font-size: 0.9rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 10px 28px;
	cursor: pointer;
	transition: background var(--transition);
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.welcome-start-btn:hover {
	background: var(--pitch-bright);
}

/* Column labels for example grid */
.welcome-col-labels {
	display: grid;
	grid-template-columns: 38px repeat(6, 1fr);
	gap: 3px;
	margin-bottom: 4px;
}

.wc-tip {
	display: none;
	position: fixed;
	background: var(--navy);
	border: 1px solid var(--border);
	border-radius: 5px;
	color: #ffffff;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	white-space: normal;
	max-width: 240px;
	width: max-content;
	text-align: center;
	padding: 6px 10px;
	z-index: 600;
	pointer-events: none;
	text-transform: none;
	line-height: 1.4;
}

@media (hover: hover) {
	.wc:hover .wc-tip {
		display: block;
	}
}

.wcl {
	font-size: 0.48rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #8899aa;
	text-align: center;
	line-height: 1.2;
}

/* ── Cookie consent banner ── */
#cookie-banner {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: #1e2634;
	border-top: 1px solid var(--border);
	padding: 16px 20px;
	z-index: 9999;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	font-size: 0.78rem;
	color: #aabbcc;
	line-height: 1.5;
}
#cookie-banner.hidden {
	display: none;
}
.cookie-text {
	flex: 1;
	min-width: 200px;
}
.cookie-text a {
	color: var(--pitch);
}
.cookie-btns {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}
.cookie-btn {
	font-family: "Barlow Condensed", sans-serif;
	font-weight: 700;
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 7px 16px;
	border-radius: 6px;
	border: none;
	cursor: pointer;
	transition: all 0.15s;
}
.cookie-btn-accept {
	background: var(--pitch);
	color: #000;
}
.cookie-btn-accept:hover {
	background: var(--pitch-bright);
}
.cookie-btn-decline {
	background: transparent;
	color: var(--dim);
	border: 1px solid var(--border);
}
.cookie-btn-decline:hover {
	border-color: var(--text);
	color: var(--text);
}

/* ── Footer ── */
.site-footer {
	text-align: center;
	padding: 20px;
	font-size: 0.7rem;
	color: #484f58;
	letter-spacing: 0.06em;
}
.site-footer a,
.site-footer .footer-link-btn {
	color: var(--text-dim);
	text-decoration: none;
}
.site-footer a:hover,
.site-footer .footer-link-btn:hover {
	color: var(--text);
}
.site-footer .footer-link-btn {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	letter-spacing: inherit;
	cursor: pointer;
}

/* ── Ad / fact modal ── */
#ad-modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	z-index: 8000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
#ad-modal.hidden {
	display: none;
}
.ad-modal-box {
	background: var(--navy-3);
	border: 1px solid var(--border);
	border-radius: 14px;
	width: 100%;
	max-width: 380px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.ad-fact-section {
	padding: 24px 20px 20px;
	flex: 1;
}
.ad-fact-label {
	font-family: "Barlow Condensed", sans-serif;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #ffffff;
	margin-bottom: 10px;
	text-align: center;
}
.ad-fact-text {
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--text);
}

.ad-continue-section {
	padding: 12px 20px;
	border-top: 1px solid var(--border);
}
#ad-continue-btn {
	width: 100%;
	padding: 12px;
	border: none;
	border-radius: 8px;
	font-family: "Barlow Condensed", sans-serif;
	font-weight: 700;
	font-size: 0.9rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: not-allowed;
	background: var(--navy-4);
	color: var(--dim);
	transition: all 0.3s;
}
#ad-continue-btn.ready {
	background: var(--pitch);
	color: #000;
	cursor: pointer;
}
#ad-continue-btn.ready:hover {
	background: var(--pitch-bright);
}
