/* =========================================================================
   Mexican Shiva Club — Theme CSS
   Brand: dark teal, mint highlights, premium-sporty.
   ========================================================================= */

/* --- Tokens (mirror of theme.json for the front, so we don't depend on
   block style injection for non-block content like plugin output) ----- */
:root {
	--msc-bg:               #0a1414;
	--msc-bg-deeper:        #060e0e;
	--msc-surface:          #102323;
	--msc-surface-2:        #1a3232;
	--msc-surface-hover:    #234141;
	--msc-mint:             #9eddd0;
	--msc-mint-bright:      #c7f0e4;
	--msc-mint-dim:         #6fa89c;
	--msc-accent:           #e57e3a;
	--msc-text:             #e8f4f1;
	--msc-text-muted:       #7a9c95;
	--msc-text-dim:         #4f6b67;
	--msc-border:           rgba(158, 221, 208, 0.16);
	--msc-border-strong:    rgba(158, 221, 208, 0.32);
	--msc-success:          #5ab37a;
	--msc-warning:          #e8b65a;
	--msc-danger:           #d6634a;

	--msc-radius-sm:  6px;
	--msc-radius-md:  12px;
	--msc-radius-lg:  20px;
	--msc-radius-pill: 999px;

	--msc-shadow-sm: 0 2px 6px rgba(0,0,0,.25);
	--msc-shadow-md: 0 8px 24px rgba(0,0,0,.35);
	--msc-shadow-glow: 0 0 32px rgba(158, 221, 208, 0.18);

	--msc-ff-display: 'Archivo Black', Impact, 'Arial Black', sans-serif;
	--msc-ff-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--msc-ff-mono:    'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

	--msc-container: 1240px;
	--msc-container-narrow: 720px;
}

/* --- Reset-ish ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background:
		radial-gradient(ellipse 80vw 60vh at 20% -10%, rgba(158, 221, 208, 0.06), transparent 60%),
		radial-gradient(ellipse 60vw 50vh at 100% 100%, rgba(229, 126, 58, 0.04), transparent 60%),
		var(--msc-bg);
	color: var(--msc-text);
	font-family: var(--msc-ff-body);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
}

/* Subtle film grain for premium feel — purely decorative */
body::before {
	content: "";
	position: fixed; inset: 0; pointer-events: none; z-index: 0;
	opacity: .035;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

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

a {
	color: var(--msc-mint);
	text-decoration: none;
	transition: color .15s ease;
}
a:hover { color: var(--msc-mint-bright); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--msc-ff-display);
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: -0.005em;
	color: var(--msc-mint-bright);
	margin: 0 0 .75em;
}
h1 { font-size: clamp(2rem, 3vw + 0.5rem, 3.25rem); text-transform: uppercase; letter-spacing: 0.01em; }
h2 { font-size: clamp(1.5rem, 1.5vw + 0.5rem, 2.25rem); }
h3 { font-size: clamp(1.15rem, 0.6vw + 0.9rem, 1.5rem); }

/* Hero h1 keeps the dramatic display size — opt-in via the hero class. */
.msc-hero__title { font-size: clamp(2.75rem, 5vw + 1rem, 5.5rem) !important; }

/* Page titles (rendered by templates/page.html via wp:post-title) */
.msc-page-title.wp-block-post-title { font-size: clamp(1.75rem, 2.5vw + 0.5rem, 2.5rem); margin-bottom: 1.25rem; }

p { margin: 0 0 1rem; }
strong { color: var(--msc-mint-bright); font-weight: 600; }

::selection { background: var(--msc-mint); color: var(--msc-bg); }

/* --- Layout primitives -------------------------------------------------- */
.msc-container {
	width: min(100% - 2rem, var(--msc-container));
	margin-inline: auto;
}
.msc-container--narrow { max-width: var(--msc-container-narrow); }

main.msc-main {
	position: relative;
	z-index: 1;
	flex: 1;
	padding-block: clamp(2rem, 4vw, 4rem);
}

/* --- Site header -------------------------------------------------------- */
.msc-header {
	position: sticky; top: 0; z-index: 100;
	background: rgba(10, 20, 20, 0.85);
	backdrop-filter: saturate(140%) blur(12px);
	-webkit-backdrop-filter: saturate(140%) blur(12px);
	border-bottom: 1px solid var(--msc-border);
}
.msc-header__inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1.5rem;
	padding-block: .85rem;
}
.msc-logo {
	display: flex; align-items: center; gap: .75rem;
	color: var(--msc-mint-bright);
	font-family: var(--msc-ff-display);
	font-size: 1.05rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.msc-logo img { height: 44px; width: auto; }
.msc-logo:hover { color: var(--msc-mint-bright); }

.msc-nav {
	display: flex; align-items: center; gap: 1.25rem;
}
.msc-nav a {
	font-family: var(--msc-ff-body);
	font-size: .95rem;
	font-weight: 500;
	color: var(--msc-text);
	padding: .35rem .25rem;
	border-bottom: 2px solid transparent;
}
.msc-nav a:hover,
.msc-nav .current-menu-item > a,
.msc-nav .current_page_item > a {
	color: var(--msc-mint-bright);
	border-bottom-color: var(--msc-mint);
}

/* Mobile header */
.msc-nav-toggle { display: none; }
@media (max-width: 768px) {
	.msc-nav {
		position: absolute; top: 100%; left: 0; right: 0;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		background: var(--msc-bg);
		border-bottom: 1px solid var(--msc-border);
		max-height: 0; overflow: hidden;
		transition: max-height .3s ease;
	}
	.msc-nav.is-open { max-height: 80vh; }
	.msc-nav a {
		padding: 1rem 1.5rem;
		border-bottom: 1px solid var(--msc-border);
	}
	.msc-nav-toggle {
		display: inline-flex; align-items: center; justify-content: center;
		width: 44px; height: 44px;
		background: none; border: 1px solid var(--msc-border);
		border-radius: var(--msc-radius-md);
		color: var(--msc-text); cursor: pointer;
	}
}

/* --- Site footer -------------------------------------------------------- */
.msc-footer {
	position: relative; z-index: 1;
	border-top: 1px solid var(--msc-border);
	background: var(--msc-bg-deeper);
	padding-block: 2.5rem 2rem;
	margin-top: 4rem;
}
.msc-footer__inner {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: 1fr;
	text-align: center;
}
@media (min-width: 768px) {
	.msc-footer__inner { grid-template-columns: 1fr auto 1fr; text-align: left; align-items: center; }
	.msc-footer__brand { justify-self: start; }
	.msc-footer__since { justify-self: center; }
	.msc-footer__nav   { justify-self: end; }
}
.msc-footer__brand {
	display: inline-flex; align-items: center; gap: .75rem;
	font-family: var(--msc-ff-display);
	color: var(--msc-mint-bright);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 1rem;
}
.msc-footer__brand img { height: 36px; }
.msc-footer__since {
	font-family: var(--msc-ff-mono);
	color: var(--msc-text-muted);
	font-size: .85rem;
	letter-spacing: 0.1em;
}
.msc-footer__nav {
	display: flex; gap: 1rem; flex-wrap: wrap; justify-content: flex-end;
	font-size: .9rem;
}
.msc-footer__nav a { color: var(--msc-text-muted); }
.msc-footer__nav a:hover { color: var(--msc-mint); }

/* --- Hero --------------------------------------------------------------- */
.msc-hero {
	padding-block: clamp(3rem, 8vw, 6rem);
	text-align: center;
	position: relative;
}
.msc-hero__crest {
	width: clamp(180px, 28vw, 320px);
	margin: 0 auto 1.5rem;
	filter: drop-shadow(0 8px 24px rgba(158, 221, 208, 0.15));
}
.msc-hero__eyebrow {
	font-family: var(--msc-ff-mono);
	color: var(--msc-mint);
	font-size: .85rem;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	margin-bottom: 1rem;
}
.msc-hero__title {
	margin: 0 0 1rem;
}
.msc-hero__subtitle {
	color: var(--msc-text-muted);
	font-size: clamp(1rem, 1.5vw + .5rem, 1.25rem);
	max-width: 36ch;
	margin: 0 auto 2rem;
	line-height: 1.5;
}
.msc-hero__actions {
	display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
}

/* --- Buttons ------------------------------------------------------------ */
.msc-btn, .wp-block-button__link, button.fp-submit {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
	font-family: var(--msc-ff-display);
	font-weight: 400;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: .95rem;
	background: var(--msc-mint);
	color: var(--msc-bg);
	padding: .85rem 1.75rem;
	border-radius: var(--msc-radius-pill);
	border: none;
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.msc-btn:hover, .wp-block-button__link:hover, button.fp-submit:hover {
	background: var(--msc-mint-bright);
	transform: translateY(-1px);
	box-shadow: var(--msc-shadow-glow);
	color: var(--msc-bg);
}
.msc-btn--ghost {
	background: transparent;
	color: var(--msc-mint);
	border: 1.5px solid var(--msc-border-strong);
}
.msc-btn--ghost:hover {
	background: rgba(158, 221, 208, 0.08);
	color: var(--msc-mint-bright);
	border-color: var(--msc-mint);
}

/* --- Section + Card ----------------------------------------------------- */
.msc-section { padding-block: clamp(2.5rem, 5vw, 4rem); }
.msc-section__header {
	display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
	margin-bottom: 1.5rem;
	padding-bottom: .75rem;
	border-bottom: 1px solid var(--msc-border);
}
.msc-section__title { margin: 0; }
.msc-section__action a {
	font-family: var(--msc-ff-mono);
	font-size: .8rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--msc-mint);
}

.msc-card {
	background: var(--msc-surface);
	border: 1px solid var(--msc-border);
	border-radius: var(--msc-radius-lg);
	padding: 1.5rem;
	transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.msc-card:hover {
	border-color: var(--msc-border-strong);
	box-shadow: var(--msc-shadow-md);
}

.msc-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}
@media (min-width: 640px) { .msc-grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) {
	.msc-grid--3 { grid-template-columns: repeat(3, 1fr); }
	.msc-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- Match card variant ------------------------------------------------- */
.msc-match {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 1rem;
	padding: 1.25rem;
	background: var(--msc-surface);
	border: 1px solid var(--msc-border);
	border-radius: var(--msc-radius-md);
}
.msc-match__team { display: flex; align-items: center; gap: .75rem; }
.msc-match__team--away { justify-content: flex-end; }
.msc-match__team img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.msc-match__name { font-weight: 600; }
.msc-match__score {
	font-family: var(--msc-ff-mono);
	font-size: 1.5rem;
	color: var(--msc-mint-bright);
	padding: 0 1rem;
	min-width: 80px;
	text-align: center;
}
.msc-match__time {
	font-family: var(--msc-ff-mono);
	font-size: .8rem;
	color: var(--msc-text-muted);
	letter-spacing: 0.05em;
	text-align: center;
}

/* --- Forms (registration, prediction) ----------------------------------- */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="search"],
input[type="tel"], input[type="date"], input[type="datetime-local"],
input[type="time"], select, textarea {
	background: var(--msc-surface);
	color: var(--msc-text);
	border: 1px solid var(--msc-border);
	border-radius: var(--msc-radius-sm);
	padding: .65rem .85rem;
	font-family: var(--msc-ff-body);
	font-size: 1rem;
	transition: border-color .15s ease, box-shadow .15s ease;
	width: 100%;
	max-width: 100%;
}
input:focus, select:focus, textarea:focus {
	outline: none;
	border-color: var(--msc-mint);
	box-shadow: 0 0 0 3px rgba(158, 221, 208, 0.15);
}
label { color: var(--msc-text-muted); font-size: .9rem; }

/* --- Tables (ranking, scores) ------------------------------------------ */
table {
	width: 100%;
	border-collapse: collapse;
	background: var(--msc-surface);
	border-radius: var(--msc-radius-md);
	overflow: hidden;
	font-size: .95rem;
}
th, td {
	padding: .75rem 1rem;
	text-align: left;
	border-bottom: 1px solid var(--msc-border);
}
th {
	font-family: var(--msc-ff-display);
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--msc-mint);
	font-size: .75rem;
	background: var(--msc-bg-deeper);
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(158, 221, 208, 0.04); }
td.msc-numeric, td.score, td.points, .pool-score, .pool-points {
	font-family: var(--msc-ff-mono);
	color: var(--msc-mint-bright);
}

/* --- Football Pool plugin overrides ----------------------------------- */
/* The plugin uses many table-based layouts and inline forms. We theme them
   to fit our brand without breaking the plugin's logic. */
.footballpool, .footballpool-form, .pool-ranking, .pool-matches {
	font-family: var(--msc-ff-body);
}
.footballpool table { background: var(--msc-surface); }
.footballpool .ranking_row, .footballpool .match_row {
	border-bottom: 1px solid var(--msc-border);
}
.footballpool input[type="number"] { max-width: 4rem; text-align: center; }
.footballpool .joker { color: var(--msc-accent); font-weight: 700; }
.footballpool .group-name, .footballpool .matchtype-name {
	font-family: var(--msc-ff-display);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--msc-mint);
	margin-top: 2rem;
}

/* --- Group standings table (.group-ranking) — override the plugin's grey cells --- */
table.ranking.group-ranking {
	background: var(--msc-surface);
	border: 1px solid var(--msc-border);
	border-radius: var(--msc-radius-md);
	overflow: hidden;
	width: 100% !important;
	max-width: none !important;
	margin-bottom: 1.5rem;
}
table.ranking.group-ranking caption,
table.ranking.group-ranking h2,
div.ranking h2 {
	background: linear-gradient(90deg, var(--msc-surface-2), var(--msc-surface)) !important;
	color: var(--msc-mint) !important;
	font-family: var(--msc-ff-display);
	font-size: 1rem !important;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 0.75rem 1.25rem !important;
	margin: 0 !important;
	border-left: 3px solid var(--msc-mint);
}
table.ranking.group-ranking th,
table.ranking.group-ranking td {
	background: transparent !important;
	color: var(--msc-text) !important;
	padding: 0.5rem 0.65rem !important;
	border-bottom: 1px solid var(--msc-border) !important;
	font-size: 0.9rem !important;
}
table.ranking.group-ranking tr:last-child td { border-bottom: 0 !important; }
table.ranking.group-ranking th {
	color: var(--msc-mint) !important;
	font-family: var(--msc-ff-display) !important;
	font-weight: 400 !important;
	font-size: 0.7rem !important;
	letter-spacing: 0.08em !important;
	text-transform: uppercase !important;
	background: var(--msc-bg-deeper) !important;
	border-bottom: 1px solid var(--msc-border-strong) !important;
}
table.ranking.group-ranking td.team {
	font-weight: 600;
}
table.ranking.group-ranking td.points,
table.ranking.group-ranking td.plays,
table.ranking.group-ranking td.wins,
table.ranking.group-ranking td.draws,
table.ranking.group-ranking td.losses {
	font-family: var(--msc-ff-mono) !important;
	text-align: center;
	color: var(--msc-mint-bright) !important;
}
table.ranking.group-ranking td.goals {
	font-family: var(--msc-ff-mono) !important;
	font-size: 0.75rem !important;
	color: var(--msc-text-muted) !important;
	text-align: center;
}
div.ranking {
	border: 0 !important;
	padding: 0 !important;
	margin: 0 0 1.5rem 0 !important;
	max-width: none !important;
}

/* --- Team detail / venue page — real photos now downloaded from Wikipedia --- */
img.team-photo,
img.stadium-photo {
	width: auto !important;
	max-width: 240px !important;
	max-height: 180px !important;
	height: auto !important;
	object-fit: cover !important;
	border-radius: var(--msc-radius-md) !important;
	border: 1px solid var(--msc-border) !important;
	display: block !important;
	box-shadow: var(--msc-shadow-sm) !important;
}
img.team-photo.thumb,
img.stadium-photo.thumb {
	max-width: 100% !important;
	max-height: 140px !important;
}
/* Stadium hero photo: full column width on detail page */
body.msc-page-stadiums img.stadium-photo,
.football-pool img.stadium-photo:not(.thumb) {
	width: 100% !important;
	max-width: 100% !important;
	max-height: 460px !important;
	height: auto !important;
	object-fit: cover !important;
	cursor: zoom-in !important;
}
/* Team hero photo on detail page — also full column, centered */
body.msc-page-teams img.team-photo,
.football-pool img.team-photo:not(.thumb) {
	max-width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	cursor: zoom-in !important;
}

/* --- Team and stadium list pages: grid layout of cards --- */
ol.football-pool.team-list,
ol.football-pool.stadium-list {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	counter-reset: msc-listcount;
}
@media (min-width: 600px) {
	ol.football-pool.team-list,
	ol.football-pool.stadium-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
	ol.football-pool.team-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	ol.football-pool.stadium-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
ol.football-pool.team-list > li,
ol.football-pool.stadium-list > li,
ol.football-pool.team-list > div,
ol.football-pool.stadium-list > div {
	background: var(--msc-surface) !important;
	border: 1px solid var(--msc-border) !important;
	border-radius: var(--msc-radius-md) !important;
	padding: 1.25rem 1rem !important;
	margin: 0 !important;
	transition: border-color .15s ease, transform .15s ease;
	display: flex !important;
	flex-direction: column !important;
	gap: 0.75rem !important;
	align-items: center !important;
	text-align: center !important;
}
ol.football-pool.team-list > li:hover,
ol.football-pool.stadium-list > li:hover,
ol.football-pool.team-list > div:hover,
ol.football-pool.stadium-list > div:hover {
	border-color: var(--msc-border-strong) !important;
	transform: translateY(-1px);
}
ol.football-pool.team-list img,
ol.football-pool.stadium-list img {
	flex: 0 0 auto !important;
	float: none !important;
	margin: 0 auto !important;
	max-width: 96px !important;
	max-height: 96px !important;
	width: auto !important;
	height: auto !important;
	display: block !important;
}
ol.football-pool.stadium-list img {
	max-width: 100% !important;
	max-height: 200px !important;
	width: 100% !important;
	object-fit: cover !important;
}
ol.football-pool.team-list h2,
ol.football-pool.stadium-list h2 {
	font-size: 1rem !important;
	margin: 0 !important;
	color: var(--msc-mint-bright) !important;
	font-family: var(--msc-ff-display) !important;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}
ol.football-pool.team-list h2 a,
ol.football-pool.stadium-list h2 a { color: inherit; text-decoration: none; }
ol.football-pool.team-list h2 a:hover,
ol.football-pool.stadium-list h2 a:hover { color: var(--msc-mint-bright); }
/* Hide the OL counters (they look bad with cards) */
ol.football-pool.team-list,
ol.football-pool.stadium-list { counter-reset: none; }
ol.football-pool.team-list > li::marker,
ol.football-pool.stadium-list > li::marker { content: ''; }

/* "partidos" / "matches" subhead on team and stadium pages */
h2.tournament-matches-header,
h2.team-matches-header,
body.msc-page-teams h2,
body.msc-page-stadiums h2 {
	font-family: var(--msc-ff-display) !important;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--msc-mint) !important;
	font-size: 1.1rem !important;
	margin-top: 2rem !important;
	margin-bottom: 0.75rem !important;
}

/* The plugin's team-info table — fit our dark theme */
table.team.info {
	background: var(--msc-surface);
	border-radius: var(--msc-radius-md);
	border: 1px solid var(--msc-border);
	margin-bottom: 2rem;
}
table.team.info tr td,
table.team.info tr th {
	padding: 0.75rem 1rem !important;
	border-bottom: 1px solid var(--msc-border) !important;
}
table.team.info tr:last-child td,
table.team.info tr:last-child th { border-bottom: 0 !important; }
table.team.info tr th {
	color: var(--msc-mint) !important;
	font-family: var(--msc-ff-display) !important;
	font-weight: 400 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.08em !important;
	font-size: 0.75rem !important;
	min-width: 8rem;
}
table.team.info tr td { color: var(--msc-text) !important; }
table.team.info ol, table.team.info ul { margin: 0 0 0 1.25rem !important; padding: 0 !important; }

/* "matches" sub-header on team page */
.tournament-matches-header,
h2.tournament-matches,
.team-matches-header { color: var(--msc-mint-bright); margin-top: 2rem; font-size: 1.25rem; }

/* --- Plugin match list (.matchinfo > .matchtype + .match cards) -------- */
.matchinfo {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin-top: 1rem;
}
@media (min-width: 720px) {
	.matchinfo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1080px) {
	.matchinfo { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.matchtype {
	grid-column: 1 / -1;
	font-family: var(--msc-ff-display);
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--msc-mint);
	padding: 0.85rem 1.25rem;
	background: linear-gradient(90deg, var(--msc-surface-2), var(--msc-surface));
	border-left: 3px solid var(--msc-mint);
	border-radius: var(--msc-radius-sm);
	margin-top: 2rem;
}
.matchtype:first-child { margin-top: 0; }

/* The plugin's pool.css already targets .matchinfo.new-layout .match-card with
   flexbox + width:50% on every child. To override cleanly we use the plugin's
   own scope prefix (.matchinfo.new-layout) so our specificity matches/exceeds
   theirs without needing !important.

   DOM order inside .match-card:
   1. .match-card-header (date + time)
   2. .flag.home          (image container for home flag)
   3. .flag.away          (image container for away flag)
   4. .home               (home team name link)
   5. .away               (away team name link)
   6. .score, .score      (home then away score) */

/* Reset the plugin's 5px div padding inside our cards */
.matchinfo.new-layout .match.match-card > div { padding: 0; }
.matchinfo.new-layout .match.match-card .flag,
.matchinfo.new-layout .match.match-card .home,
.matchinfo.new-layout .match.match-card .away,
.matchinfo.new-layout .match.match-card .score { width: auto; }

.matchinfo.new-layout .match.match-card {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto;
	grid-template-areas:
		"header  header  header  header  header"
		"flagH   nameH   score   nameA   flagA";
	align-items: center;
	gap: 0.55rem 0.75rem;
	padding: 1.1rem 1.25rem;
	background: var(--msc-surface);
	border: 1px solid var(--msc-border);
	border-radius: var(--msc-radius-md);
	transition: border-color .15s ease, transform .15s ease;
}
.matchinfo.new-layout .match.match-card:hover {
	border-color: var(--msc-border-strong);
	transform: translateY(-1px);
}

.matchinfo.new-layout .match.match-card > .match-card-header {
	grid-area: header;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--msc-border);
	font-family: var(--msc-ff-mono);
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--msc-text-muted);
}
.match-card-header .time { color: var(--msc-mint); }

.matchinfo.new-layout .match.match-card > .flag.home  { grid-area: flagH; justify-self: end; }
.matchinfo.new-layout .match.match-card > .flag.away  { grid-area: flagA; justify-self: start; }
.matchinfo.new-layout .match.match-card > .home:not(.flag) { grid-area: nameH; justify-self: end; }
.matchinfo.new-layout .match.match-card > .away:not(.flag) { grid-area: nameA; justify-self: start; }
.matchinfo.new-layout .match.match-card > .score { grid-area: score; }

.matchinfo.new-layout .match.match-card .home a,
.matchinfo.new-layout .match.match-card .away a {
	color: var(--msc-text);
	font-weight: 600;
	font-size: 0.95rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 14ch;
}
.matchinfo.new-layout .match.match-card .home a:hover,
.matchinfo.new-layout .match.match-card .away a:hover { color: var(--msc-mint-bright); }

/* Flag container + image. The image is positioned absolutely INSIDE the
   container so its layout is independent of whatever the plugin's CSS
   or pseudo-elements try to do. */
.matchinfo.new-layout .match.match-card div.flag.home,
.matchinfo.new-layout .match.match-card div.flag.away {
	position: relative !important;
	width: 38px !important;
	height: 26px !important;
	border-radius: 3px !important;
	overflow: hidden !important;
	background: var(--msc-surface-2) !important;
	box-shadow: inset 0 0 0 1px var(--msc-border) !important;
	padding: 0 !important;
	display: block !important;
}
.matchinfo.new-layout .match.match-card div.flag.home::before,
.matchinfo.new-layout .match.match-card div.flag.away::before { content: none !important; }
.matchinfo.new-layout .match.match-card div.flag.home img,
.matchinfo.new-layout .match.match-card div.flag.away img {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	color: transparent !important;
	font-size: 0 !important;
	max-width: none !important;
	max-height: none !important;
}

.matchinfo.new-layout .match.match-card .score {
	font-family: var(--msc-ff-mono);
	font-size: 1.25rem;
	color: var(--msc-mint-bright);
	text-align: center;
	min-width: 2.5rem;
}
.matchinfo.new-layout .match.match-card .score a { color: inherit; text-decoration: none; }

/* Read-only views (tournament / user pages): unplayed → show "vs" mid, played → "-" mid.
   SCOPED to NOT(.input) so the prediction form (which has class "input" on wrapper)
   shows both inputs side by side instead. */
.matchinfo.new-layout:not(.input) .match.match-card.open .score:nth-of-type(2) { display: none; }
.matchinfo.new-layout:not(.input) .match.match-card.open .score:nth-of-type(1) {
	font-family: var(--msc-ff-display);
	font-size: 0.82rem;
	letter-spacing: 0.1em;
	color: var(--msc-text-muted);
	text-transform: uppercase;
}
.matchinfo.new-layout:not(.input) .match.match-card.open .score:nth-of-type(1):empty::before,
.matchinfo.new-layout:not(.input) .match.match-card.open .score:nth-of-type(1) a:empty::before {
	content: "vs";
}
.matchinfo.new-layout:not(.input) .match.match-card:not(.open) .score:nth-of-type(1)::after {
	content: "-";
	color: var(--msc-text-muted);
	margin-left: 0.5rem;
}

/* ============================================================
   PREDICTION FORM (matchinfo.new-layout.input on /pool/)
   - Show BOTH score inputs side-by-side with a separator
   - Style inputs as big mono numeric fields
   - Style the Balón de Oro icon (overrides the plugin's joker.png)
   ============================================================ */
.matchinfo.new-layout.input .match.match-card {
	grid-template-columns: auto minmax(0, 1fr) auto auto auto minmax(0, 1fr) auto;
	grid-template-areas:
		"header header header header header header header"
		"flagH  nameH  scoreH sep    scoreA nameA  flagA"
		"footer footer footer footer footer footer footer";
}
/* :nth-of-type counts ALL <div> siblings (the score divs aren't the 1st/2nd
   divs), so we use the adjacent-sibling trick: every .score defaults to the
   home cell; any .score preceded by another .score is the away one. */
.matchinfo.new-layout.input .match.match-card > .score          { grid-area: scoreH; }
.matchinfo.new-layout.input .match.match-card > .score + .score { grid-area: scoreA; }
.matchinfo.new-layout.input .match.match-card > .match-card-footer { grid-area: footer; }
.matchinfo.new-layout.input .match.match-card::after {
	content: "—";
	grid-area: sep;
	color: var(--msc-text-muted);
	font-family: var(--msc-ff-mono);
	font-size: 1.5rem;
	align-self: center;
	justify-self: center;
}
.matchinfo.new-layout.input .match.match-card .score input.prediction {
	width: 3rem !important;
	height: 2.75rem !important;
	text-align: center !important;
	background: var(--msc-bg) !important;
	border: 2px solid var(--msc-border-strong) !important;
	border-radius: var(--msc-radius-sm) !important;
	color: var(--msc-mint-bright) !important;
	font-family: var(--msc-ff-mono) !important;
	font-size: 1.35rem !important;
	font-weight: 700 !important;
	padding: 0 !important;
	margin: 0 !important;
	box-sizing: border-box !important;
	-moz-appearance: textfield;
}
.matchinfo.new-layout.input .match.match-card .score input.prediction::-webkit-outer-spin-button,
.matchinfo.new-layout.input .match.match-card .score input.prediction::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.matchinfo.new-layout.input .match.match-card .score input.prediction:focus {
	outline: none !important;
	border-color: var(--msc-mint) !important;
	box-shadow: 0 0 0 3px rgba(158, 221, 208, 0.22) !important;
}
.matchinfo.new-layout.input .match.match-card .score input.prediction.saving {
	border-color: var(--msc-warning) !important;
	color: var(--msc-warning) !important;
}

/* Match-card footer: emphasize the Balón de Oro as the primary action.
   Hide the stats-link icon (not useful pre-match) and keep the user-score
   text small / muted. Joker dead-center with a clear label below. */
.matchinfo.new-layout.input .match.match-card > .match-card-footer {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	gap: 1.5rem;
	padding-top: 1.1rem;
	padding-bottom: 1.4rem;
	margin-top: 0.5rem;
	border-top: 1px solid var(--msc-border);
}
/* On the prediction form, the only meaningful action in the footer is the
   Balón de Oro. The plugin also renders a stats-link icon and a user-score
   text — neither adds value pre-match (no stats yet, score = 0). Hide both
   so the joker is dead-center. */
.matchinfo.new-layout.input .match-card-footer .fp-icon:not(:last-child),
.matchinfo.new-layout.input .match-card-footer .user-score {
	display: none !important;
}
/* Override the plugin's height:40px / line-height:40px on .match-card-footer
   divs so the joker box and its label can stack as two block rows. Higher
   specificity than the plugin selector (.input adds one class), so no
   !important needed for height/line-height. */
.matchinfo.new-layout.input .match-card-footer .fp-icon:last-child {
	flex: 0 0 auto !important;
	height: auto;
	line-height: 1.2;
	text-align: center;
	padding: 4px 0 6px;
}
.matchinfo.new-layout.input .match-card-footer .fp-icon:last-child .fp-joker-box {
	display: block !important;
	margin: 0 auto 6px !important;
}

/* Balón de Oro icon — override plugin's PNG with a gold soccer ball SVG.
   Active state (fp-joker): bright gold, soft glow.
   Inactive (fp-nojoker): outlined, muted.
   Readonly (.readonly): disabled, low opacity. */
.matchinfo.new-layout .fp-joker-box {
	width: 36px !important;
	height: 36px !important;
	border-radius: 999px;
	transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
	background-position: center !important;
	background-size: 28px 28px !important;
	background-repeat: no-repeat !important;
}
.matchinfo.new-layout .fp-nojoker {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%237a9c95' stroke-width='1.4'><circle cx='16' cy='16' r='13'/><path d='M16 5 L20 9 L18 14 L14 14 L12 9 Z M16 27 L12 23 L14 18 L18 18 L20 23 Z M3 16 L8 14 L12 18 L8 22 L3 16 Z M29 16 L24 14 L20 18 L24 22 L29 16 Z'/></svg>") !important;
	opacity: 0.55;
}
.matchinfo.new-layout .fp-nojoker:hover { opacity: 0.85; transform: scale(1.05); }
.matchinfo.new-layout .fp-joker {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs><radialGradient id='g' cx='40%25' cy='35%25'><stop offset='0%25' stop-color='%23fff1c0'/><stop offset='60%25' stop-color='%23e8b65a'/><stop offset='100%25' stop-color='%23a37820'/></radialGradient></defs><circle cx='16' cy='16' r='13' fill='url(%23g)' stroke='%238b6116' stroke-width='1'/><path d='M16 5 L20 9 L18 14 L14 14 L12 9 Z M16 27 L12 23 L14 18 L18 18 L20 23 Z M3 16 L8 14 L12 18 L8 22 L3 16 Z M29 16 L24 14 L20 18 L24 22 L29 16 Z' fill='%238b6116'/></svg>") !important;
	box-shadow: 0 0 18px rgba(229, 182, 90, 0.55);
	transform: scale(1.05);
}
.matchinfo.new-layout .fp-joker-box.readonly {
	opacity: 0.25 !important;
	filter: grayscale(80%);
	cursor: not-allowed !important;
}
.matchinfo.new-layout .fp-joker-box.readonly:hover { transform: none; opacity: 0.25 !important; }
/* Subtle "1 por fase" hint on hover for nojoker boxes */
.matchinfo.new-layout .fp-nojoker { cursor: pointer; }

/* "Balón de Oro" label, rendered as a block row below the joker box. */
.matchinfo.new-layout.input .match-card-footer .fp-icon:last-child::after {
	content: "Balón de Oro";
	display: block;
	font-family: var(--msc-ff-display);
	font-size: 0.7rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--msc-text-muted);
	line-height: 1.2;
	white-space: nowrap;
	transition: color .15s ease, opacity .15s ease;
}
/* When the box is active (.fp-joker), the label glows gold. */
.matchinfo.new-layout.input .match-card-footer .fp-icon:last-child:has(.fp-joker)::after {
	color: var(--msc-warning);
	font-weight: 700;
	text-shadow: 0 0 8px rgba(229, 182, 90, 0.45);
}
/* When this match's joker is blocked (already used in another match of this
   phase), the label fades out. */
.matchinfo.new-layout.input .match-card-footer .fp-icon:last-child:has(.readonly)::after {
	opacity: 0.25;
}

/* Tab filtering needs an explicit display:none. The default user-agent rule
   `[hidden] { display: none }` is too low-specificity to override our
   `.matchinfo.new-layout .match.match-card { display: grid }`. */
.matchinfo.new-layout .match-card[hidden],
.matchinfo.new-layout .matchtype[hidden] {
	display: none !important;
}

/* =====================================================
   PHASE TABS (built by JS in footer.html — see msc-phase-tabs)
   Lets users jump between Fase de Grupos / Octavos / Cuartos /
   Semifinal / Final without scrolling 104 matches.
   ===================================================== */
.msc-phase-tabs {
	display: flex;
	gap: 0.5rem;
	margin: 0 0 1.75rem 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--msc-border-strong) transparent;
	padding-bottom: 0.5rem;
}
.msc-phase-tabs::-webkit-scrollbar { height: 6px; }
.msc-phase-tabs::-webkit-scrollbar-thumb { background: var(--msc-border-strong); border-radius: 999px; }
.msc-phase-tabs button {
	padding: 0.65rem 1.2rem;
	background: transparent;
	border: 1px solid var(--msc-border);
	color: var(--msc-text-muted);
	border-radius: var(--msc-radius-md);
	cursor: pointer;
	white-space: nowrap;
	font-family: var(--msc-ff-display);
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	transition: color .15s ease, border-color .15s ease, background .15s ease, transform .15s ease;
}
.msc-phase-tabs button:hover {
	color: var(--msc-mint-bright);
	border-color: var(--msc-border-strong);
	transform: translateY(-1px);
}
.msc-phase-tabs button.active {
	background: var(--msc-surface-2);
	color: var(--msc-mint-bright);
	border-color: var(--msc-mint);
	box-shadow: 0 0 14px rgba(158, 221, 208, 0.22);
}
.msc-phase-tabs button .count {
	display: inline-block;
	margin-left: 0.4rem;
	padding: 0.05rem 0.45rem;
	background: var(--msc-bg);
	border: 1px solid var(--msc-border);
	border-radius: 999px;
	font-family: var(--msc-ff-mono);
	font-size: 0.7rem;
	color: var(--msc-text-muted);
	letter-spacing: 0;
}
.msc-phase-tabs button.active .count {
	color: var(--msc-mint-bright);
	border-color: var(--msc-mint);
}

/* Mobile: keep prediction form usable */
@media (max-width: 600px) {
	.matchinfo.new-layout.input .match.match-card {
		grid-template-columns: auto auto auto;
		grid-template-areas:
			"header header header"
			"flagH  nameH  scoreH"
			"flagA  nameA  scoreA"
			"footer footer footer";
	}
	.matchinfo.new-layout.input .match.match-card::after { display: none; }
}

/* Mobile: stack vertically below ~480px */
@media (max-width: 480px) {
	.matchinfo.new-layout .match.match-card {
		grid-template-columns: auto 1fr;
		grid-template-areas:
			"header  header"
			"flagH   nameH"
			"score   score"
			"flagA   nameA";
		gap: 0.5rem 0.6rem;
	}
	.matchinfo.new-layout .match.match-card > .flag.home,
	.matchinfo.new-layout .match.match-card > .flag.away   { justify-self: start; }
	.matchinfo.new-layout .match.match-card > .home:not(.flag),
	.matchinfo.new-layout .match.match-card > .away:not(.flag) { justify-self: start; }
}

/* --- Utility classes ---------------------------------------------------- */
.msc-mono { font-family: var(--msc-ff-mono); }
.msc-muted { color: var(--msc-text-muted); }
.msc-center { text-align: center; }
.msc-stack > * + * { margin-top: 1rem; }
.msc-stack-lg > * + * { margin-top: 2rem; }

/* --- Page-specific: home ------------------------------------------------ */
body.home .msc-hero { padding-block: clamp(4rem, 10vw, 8rem); }

/* --- Page-specific: predict form get more breathing room --------------- */
body.msc-page-predict main.msc-main,
body.msc-page-ranking main.msc-main {
	padding-top: 2rem;
}

/* --- Default WP block tweaks ------------------------------------------- */
.wp-block-button__link { font-family: var(--msc-ff-display) !important; }
.wp-block-quote { border-left: 3px solid var(--msc-mint); padding-left: 1.25rem; color: var(--msc-text-muted); font-style: italic; }
.wp-block-separator { border-color: var(--msc-border); margin-block: 2rem; }
.wp-block-image img { border-radius: var(--msc-radius-md); }

/* --- Login page tweak (subtle) ------------------------------------------ */
body.login {
	background: var(--msc-bg);
}

/* --- Balón de Oro confirmation modal ------------------------------------ */
body.msc-modal-open { overflow: hidden; }
.msc-modal {
	position: fixed;
	inset: 0;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.msc-modal[hidden] { display: none; }
.msc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 14, 14, 0.82);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}
.msc-modal__panel {
	position: relative;
	background: var(--msc-surface);
	border: 1px solid var(--msc-border-strong);
	border-radius: var(--msc-radius-md);
	padding: 2.25rem 2rem 1.75rem;
	width: 100%;
	max-width: 480px;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 40px rgba(229,182,90,0.12);
	animation: msc-modal-pop .22s ease-out;
}
@keyframes msc-modal-pop {
	from { transform: scale(0.92); opacity: 0; }
	to   { transform: scale(1);    opacity: 1; }
}
.msc-modal__icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 0.75rem;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs><radialGradient id='g' cx='40%25' cy='35%25'><stop offset='0%25' stop-color='%23fff1c0'/><stop offset='60%25' stop-color='%23e8b65a'/><stop offset='100%25' stop-color='%23a37820'/></radialGradient></defs><circle cx='16' cy='16' r='13' fill='url(%23g)' stroke='%238b6116' stroke-width='1'/><path d='M16 5 L20 9 L18 14 L14 14 L12 9 Z M16 27 L12 23 L14 18 L18 18 L20 23 Z M3 16 L8 14 L12 18 L8 22 L3 16 Z M29 16 L24 14 L20 18 L24 22 L29 16 Z' fill='%238b6116'/></svg>");
	background-size: contain;
	background-repeat: no-repeat;
	filter: drop-shadow(0 0 16px rgba(229, 182, 90, 0.5));
}
.msc-modal__title {
	font-family: var(--msc-ff-display);
	font-size: 1.35rem;
	color: var(--msc-mint-bright);
	margin: 0 0 1rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.msc-modal__body {
	color: var(--msc-text);
	line-height: 1.55;
	margin: 0 0 1.25rem;
	font-size: 0.95rem;
}
.msc-modal__body strong { color: var(--msc-mint-bright); }
.msc-modal__match {
	background: var(--msc-bg);
	border: 1px solid var(--msc-border);
	border-radius: var(--msc-radius-sm);
	padding: 0.75rem 1rem;
	margin: 0 0 1.25rem;
	font-family: var(--msc-ff-display);
	font-size: 0.95rem;
	letter-spacing: 0.06em;
	color: var(--msc-mint);
	text-transform: uppercase;
}
.msc-modal__match:empty { display: none; }
.msc-modal__warning {
	background: rgba(229, 182, 90, 0.08);
	border: 1px solid rgba(229, 182, 90, 0.35);
	border-radius: var(--msc-radius-sm);
	padding: 0.7rem 1rem;
	margin: 0 0 1.25rem;
	font-size: 0.85rem;
	color: var(--msc-warning);
	text-align: left;
}
.msc-modal__warning:empty { display: none; }
.msc-modal__actions {
	display: flex;
	gap: 0.75rem;
	justify-content: center;
	flex-wrap: wrap;
}
.msc-modal__actions button {
	font-family: var(--msc-ff-display);
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 0.7rem 1.4rem;
	border-radius: var(--msc-radius-sm);
	cursor: pointer;
	border: 1px solid transparent;
	transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.msc-modal__actions button:hover { transform: translateY(-1px); }
.msc-modal__actions [data-action="cancel"] {
	background: transparent;
	color: var(--msc-text-muted);
	border-color: var(--msc-border);
}
.msc-modal__actions [data-action="cancel"]:hover {
	color: var(--msc-text);
	border-color: var(--msc-border-strong);
}
.msc-modal__actions [data-action="confirm"] {
	background: linear-gradient(135deg, #e8b65a 0%, #a37820 100%);
	color: #1a1108;
	font-weight: 700;
	border-color: #a37820;
	box-shadow: 0 4px 14px rgba(229, 182, 90, 0.35);
}
.msc-modal__actions [data-action="confirm"]:hover {
	box-shadow: 0 6px 20px rgba(229, 182, 90, 0.5);
}

/* --- Lightbox (team / stadium photos) ----------------------------------- */
body.msc-lightbox-open { overflow: hidden; }
.msc-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(6, 14, 14, 0.92);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vmin;
	opacity: 0;
	transition: opacity .18s ease;
	cursor: zoom-out;
}
.msc-lightbox.is-open { opacity: 1; }
.msc-lightbox__img {
	max-width: 92vw;
	max-height: 88vh;
	width: auto;
	height: auto;
	border-radius: var(--msc-radius-md);
	border: 1px solid var(--msc-border-strong);
	box-shadow: var(--msc-shadow-md), var(--msc-shadow-glow);
	display: block;
	transform: scale(0.96);
	transition: transform .2s ease;
}
.msc-lightbox.is-open .msc-lightbox__img { transform: scale(1); }
.msc-lightbox__close {
	position: absolute;
	top: 1.25rem;
	right: 1.25rem;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	border: 1px solid var(--msc-border-strong);
	background: var(--msc-surface);
	color: var(--msc-mint-bright);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-family: var(--msc-ff-body);
	transition: background .15s ease, transform .15s ease;
}
.msc-lightbox__close:hover {
	background: var(--msc-surface-hover);
	transform: scale(1.05);
}
.msc-lightbox__close:focus-visible {
	outline: 2px solid var(--msc-mint);
	outline-offset: 2px;
}
