/* Mascot Matchup – memory game. Palette pulled from the magazine spread. */
.shmm {
	--shmm-ink: #231f20;
	--shmm-muted: #6d6a6b;
	--shmm-purple: #7b52a3;
	--shmm-green: #8cc63f;
	--shmm-blue: #00aeef;
	--shmm-paper: #ffffff;
	--shmm-line: #e6e3e4;
	--shmm-radius: 14px;
	--shmm-font: "Montserrat", "Poppins", "Avenir Next", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

	font-family: var(--shmm-font-b);
	color: var(--shmm-ink);
	/* Fill whatever column the theme gives us (e.g. the Divi row's width). */
	width: 100%;
	max-width: none;
	margin: 2rem 0;
	padding: 0;
	box-sizing: border-box;
	line-height: 1.45;
}
.shmm *, .shmm *::before, .shmm *::after { box-sizing: border-box; }

/* Header ---------------------------------------------------------------- */
.shmm-title {

	font-weight: 900;
	font-size: clamp(2rem, 6vw, 3.6rem);
	letter-spacing: -0.02em;
	line-height: 1;
	text-transform: uppercase;
	margin: 0 0 .6rem;
	color: var(--shmm-ink);
}
.shmm-title span { color: var(--shmm-purple); }
/* Keep theme (e.g. Divi) heading styles from recolouring the game. */
.shmm h2.shmm-title, .shmm h3.shmm-subhead, .shmm h3.shmm-win__title { padding: 0; }
.shmm h2.shmm-title, .shmm h3.shmm-subhead { color: var(--shmm-ink); }
.shmm h3.shmm-win__title { color: var(--shmm-purple); }
.shmm-intro { max-width: 60ch; margin: 0 0 1.5rem; font-size: 1.02rem; }

/* Toolbar --------------------------------------------------------------- */
.shmm-bar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: 12px 20px;
	padding: 12px 16px;
	border: 2px solid var(--shmm-ink);
	border-radius: var(--shmm-radius);
	background: var(--shmm-paper);
}
.shmm-stats { display: flex; gap: 22px; }
.shmm-stat { display: flex; flex-direction: column; min-width: 56px; }
.shmm-stat__label {
	font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--shmm-blue);
}
.shmm-stat__val { font-size: 1.3rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.shmm-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shmm-size { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.shmm-size select {
	font: inherit; font-size: .95rem; text-transform: none; letter-spacing: 0;
	padding: 6px 10px; border: 2px solid var(--shmm-ink); border-radius: 999px; background: #fff; color: var(--shmm-ink);
}
.shmm-btn {
	font: inherit; font-weight: 800; font-size: .85rem; letter-spacing: .05em; text-transform: uppercase;
	padding: 9px 18px; border-radius: 999px; cursor: pointer;
	border: 2px solid var(--shmm-ink); background: #fff; color: var(--shmm-ink);
	transition: transform .15s ease, background .15s ease, color .15s ease;
}
.shmm-btn:hover { background: var(--shmm-ink); color: #fff; }
.shmm-btn--primary { background: var(--shmm-purple); border-color: var(--shmm-purple); color: #fff; }
.shmm-btn--primary:hover { background: var(--shmm-ink); border-color: var(--shmm-ink); }
.shmm-btn:focus-visible, .shmm-size select:focus-visible { outline: 3px solid var(--shmm-blue); outline-offset: 2px; }
.shmm-best { margin: 10px 2px 16px; font-size: .85rem; color: var(--shmm-muted); }

/* Full-bleed layout ------------------------------------------------------
 * In full mode the section fills its theme column normally. Only .shmm-stage
 * (toolbar + board) reaches out to the window edges, via negative side margins
 * that game.js measures. Auto width + negative margins never widen the column.
 */
.shmm--full .shmm-stage {
	width: auto;
	margin-left: var(--shmm-bleed-l, 0);
	margin-right: var(--shmm-bleed-r, 0);
	padding: 0 var(--shmm-gutter, 16px);
}

/* Board ----------------------------------------------------------------- */
.shmm-board { position: relative; }
.shmm-grid {
	display: grid;
	min-width: 0;
	/* --shmm-cols is chosen by game.js from the board width and card count. */
	grid-template-columns: repeat(var(--shmm-cols, 4), minmax(0, 1fr));
	gap: var(--shmm-gap, 14px);
}
@media (max-width: 600px) {
	.shmm-grid { --shmm-gap: 8px; }
}

/* Card ------------------------------------------------------------------ */
.shmm-card {
	all: unset;
	display: block;
	position: relative;
	aspect-ratio: 1 / 1;
	perspective: 1000px;
	container-type: inline-size;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	border-radius: var(--shmm-radius);
}
.shmm-card:focus-visible { outline: 3px solid var(--shmm-blue); outline-offset: 3px; }
.shmm-card__inner {
	position: absolute; inset: 0;
	transform-style: preserve-3d;
	transition: transform .5s cubic-bezier(.2,.8,.25,1);
}
.shmm-card.is-flipped .shmm-card__inner { transform: rotateY(180deg); }
.shmm-card:not(.is-flipped):hover .shmm-card__inner { transform: translateY(-3px) rotate(-1deg); }

.shmm-card__face {
	position: absolute; inset: 0;
	border-radius: var(--shmm-radius);
	backface-visibility: hidden; -webkit-backface-visibility: hidden;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	padding: 7cqi; text-align: center; overflow: hidden;
}

/* Back – purple halftone with a green "?" dot */
.shmm-card__back {
	background-color: var(--shmm-purple);
	background-image: radial-gradient(rgba(255,255,255,.18) 1.4px, transparent 1.6px);
	background-size: 9px 9px;
	color: #fff;
	box-shadow: 0 2px 0 rgba(0,0,0,.12);
}
.shmm-card__q {
	width: 50%; aspect-ratio: 1; border-radius: 50%;
	display: grid; place-items: center;
	background: var(--shmm-green);
	font-size: 2rem; font-size: 24cqi; font-weight: 900; line-height: 1;
	box-shadow: 0 0 0 max(3px, 2.5cqi) rgba(255,255,255,.9);
}
.shmm-card__brand {
	margin-top: 8cqi; font-size: .58rem; font-size: clamp(.5rem, 6.2cqi, .8rem); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .9; white-space: nowrap;
}

/* Front */
.shmm-card__front {
	transform: rotateY(180deg);
	background: var(--shmm-paper);
	border: 2px solid var(--shmm-line);
	gap: 4cqi;
}
.shmm-card__photo {
	width: 72%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; flex: 0 0 auto;
	background: var(--shmm-line);
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--shmm-ink);
}
.shmm-card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shmm-card__tag { font-size: .6rem; font-size: clamp(.5rem, 6cqi, .8rem); white-space: nowrap; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--shmm-muted); }

.shmm-card--name .shmm-card__front { background: var(--ring); border-color: var(--ring); color: #fff; }
.shmm-card__name { font-size: .95rem; font-size: clamp(.72rem, 10.5cqi, 1.6rem); overflow-wrap: anywhere; hyphens: auto; font-weight: 900; line-height: 1.15; text-transform: uppercase; letter-spacing: .01em; }
.shmm-card__sub { font-size: .7rem; font-size: clamp(.6rem, 7cqi, 1rem); margin-top: 3cqi; font-weight: 700; opacity: .92; }

.shmm-ring--purple { --ring: var(--shmm-purple); }
.shmm-ring--green  { --ring: #6fa52a; }
.shmm-ring--blue   { --ring: #0097d1; }

/* States */
.shmm-card.is-wrong .shmm-card__front { animation: shmm-shake .4s ease; border-color: #e0465a; }
.shmm-card--name.is-wrong .shmm-card__front { box-shadow: inset 0 0 0 3px #e0465a; }
.shmm-card.is-matched { cursor: default; }
.shmm-card.is-matched .shmm-card__front { animation: shmm-pop .45s ease; box-shadow: 0 0 0 3px var(--shmm-green); }
.shmm-card.is-matched::after {
	content: "✓"; position: absolute; top: 6px; right: 6px; z-index: 2;
	width: 22px; height: 22px; border-radius: 50%;
	display: grid; place-items: center;
	background: var(--shmm-green); color: #fff; font-size: .75rem; font-weight: 900;
}
@keyframes shmm-shake { 0%,100% { transform: rotateY(180deg) translateX(0); } 25% { transform: rotateY(180deg) translateX(-5px); } 75% { transform: rotateY(180deg) translateX(5px); } }
@keyframes shmm-pop { 0% { transform: rotateY(180deg) scale(1); } 50% { transform: rotateY(180deg) scale(1.06); } 100% { transform: rotateY(180deg) scale(1); } }

/* Toast */
.shmm-live {
	position: sticky; bottom: 16px; z-index: 5;
	width: max-content; max-width: calc(100% - 32px); margin: 14px auto 0;
	padding: 10px 18px; border-radius: 999px;
	background: var(--shmm-ink); color: #fff; font-weight: 800; font-size: .9rem;
	opacity: 0; transform: translateY(8px); pointer-events: none;
}
.shmm-live.is-shown { animation: shmm-toast 2.6s ease forwards; }
@keyframes shmm-toast { 0% { opacity: 0; transform: translateY(8px); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(8px); } }

/* Win overlay */
.shmm-win {
	position: absolute; inset: 0; z-index: 6;
	display: flex; align-items: center; justify-content: center;
	background: rgba(255,255,255,.82);
	-webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
	border-radius: var(--shmm-radius);
	padding: 16px;
}
.shmm-win[hidden] { display: none; }
.shmm-win__card {
	background: #fff; border: 3px solid var(--shmm-ink); border-radius: 20px;
	padding: 28px 32px; text-align: center; max-width: 380px; width: 100%;
	box-shadow: 8px 8px 0 var(--shmm-green);
	animation: shmm-pop-in .35s cubic-bezier(.2,.9,.3,1.3);
}
.shmm-win__title { margin: 0; font-size: 1.8rem; font-weight: 900; text-transform: uppercase; color: var(--shmm-purple); }
.shmm-win__stars { margin: 6px 0 0; font-size: 2rem; letter-spacing: .1em; color: #f5b301; }
.shmm-win__verdict { margin: 4px 0; font-weight: 800; }
.shmm-win__stats { margin: 0 0 18px; color: var(--shmm-muted); font-size: .9rem; }
@keyframes shmm-pop-in { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* Matches + answer key --------------------------------------------------- */
.shmm-log, .shmm-key { margin-top: 28px; }
.shmm-subhead, .shmm-key summary {
	font-size: 1.15rem; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 6px;
}
.shmm-muted { color: var(--shmm-muted); font-size: .9rem; margin: 0 0 12px; }
.shmm-key {
	border-top: 2px solid var(--shmm-ink); padding-top: 18px;
}
.shmm-key summary {
	cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 10px;
	padding: 10px 18px; border-radius: 999px; background: var(--shmm-blue); color: #fff; margin-bottom: 12px;
}
.shmm-key summary::-webkit-details-marker { display: none; }
.shmm-key summary::after { content: "+"; font-size: 1.2rem; line-height: 1; }
.shmm-key[open] summary::after { content: "–"; }
.shmm-key summary:focus-visible { outline: 3px solid var(--shmm-purple); outline-offset: 2px; }

.shmm-answers {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.shmm-answer {
	display: flex; gap: 14px; align-items: flex-start;
	padding: 14px; border-radius: var(--shmm-radius);
	border: 2px solid var(--shmm-line); background: #fff;
	animation: shmm-pop-in .3s ease;
}
.shmm-answer__img {
	flex: 0 0 72px; width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
	background: var(--ring); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ring);
}
.shmm-ring--green .shmm-answer__img { --ring: var(--shmm-green); }
.shmm-ring--blue .shmm-answer__img { --ring: var(--shmm-blue); }
.shmm-answer__body p { margin: 0; }
.shmm-answer__headline { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--shmm-blue); margin-bottom: 2px !important; }
.shmm-answer__name { font-weight: 900; font-size: 1.02rem; line-height: 1.2; }
.shmm-answer__brand { font-weight: 700; font-size: .82rem; color: var(--shmm-purple); }
.shmm-answer__clues { margin: 6px 0 0; padding: 0; list-style: none; }
.shmm-answer__clues li { font-size: .78rem; color: var(--shmm-muted); line-height: 1.35; }
.shmm-answer__clues li::before { content: "› "; color: var(--shmm-green); font-weight: 900; }

@media (prefers-reduced-motion: reduce) {
	.shmm-card__inner { transition: none; }
	.shmm-card.is-wrong .shmm-card__front,
	.shmm-card.is-matched .shmm-card__front,
	.shmm-win__card, .shmm-answer { animation: none; }
	.shmm-live.is-shown { animation: none; opacity: 1; transform: none; }
}

/* Small tiles (phones): drop the tiny labels, shrink the check badge. */
@container (max-width: 125px) {
	.shmm-card__brand, .shmm-card__tag { display: none; }
	.shmm-card__photo { width: 84%; }
	.shmm-card__q { width: 56%; }
}
@media (max-width: 600px) {
	.shmm-card.is-matched::after { width: 18px; height: 18px; top: 4px; right: 4px; font-size: .62rem; }
}
@media (max-width: 600px) {
	.shmm--full .shmm-stage { padding: 0 min(var(--shmm-gutter, 16px), 10px); }
}

/* Contained layout inside a full-width row: keep a gutter at the screen edges. */
.shmm.shmm--edge { padding: 0 var(--shmm-gutter, 16px); }
@media (max-width: 600px) { .shmm.shmm--edge { padding: 0 min(var(--shmm-gutter, 16px), 10px); } }


/* ==========================================================================
 * Fonts & sizes (set in Settings → Mascot Matchup → Fonts & sizes)
 * Desktop values everywhere; mobile values at 767px and below.
 * !important is used deliberately so theme / Divi text styles can't shrink
 * or restyle the game.
 * ======================================================================== */
.shmm {
	--shmm-font-h: "Montserrat", "Helvetica Neue", Arial, sans-serif;
	--shmm-font-b: "Montserrat", "Helvetica Neue", Arial, sans-serif;
	--shmm-fs-title: var(--shmm-fs-title-d, 60px);
	--shmm-fs-intro: var(--shmm-fs-intro-d, 20px);
	--shmm-fs-statval: var(--shmm-fs-statval-d, 26px);
	--shmm-fs-statlabel: var(--shmm-fs-statlabel-d, 13px);
	--shmm-fs-button: var(--shmm-fs-button-d, 15px);
	--shmm-fs-card: var(--shmm-fs-card-d, 1);
	--shmm-fs-subhead: var(--shmm-fs-subhead-d, 26px);
	--shmm-fs-helper: var(--shmm-fs-helper-d, 16px);
	--shmm-fs-headline: var(--shmm-fs-headline-d, 14px);
	--shmm-fs-name: var(--shmm-fs-name-d, 24px);
	--shmm-fs-brand: var(--shmm-fs-brand-d, 18px);
	--shmm-fs-clue: var(--shmm-fs-clue-d, 17px);
	--shmm-fs-toast: var(--shmm-fs-toast-d, 17px);
}
@media (max-width: 767px) {
	.shmm {
		--shmm-fs-title: var(--shmm-fs-title-m, 40px);
		--shmm-fs-intro: var(--shmm-fs-intro-m, 18px);
		--shmm-fs-statval: var(--shmm-fs-statval-m, 24px);
		--shmm-fs-statlabel: var(--shmm-fs-statlabel-m, 12px);
		--shmm-fs-button: var(--shmm-fs-button-m, 15px);
		--shmm-fs-card: var(--shmm-fs-card-m, 1.1);
		--shmm-fs-subhead: var(--shmm-fs-subhead-m, 24px);
		--shmm-fs-helper: var(--shmm-fs-helper-m, 16px);
		--shmm-fs-headline: var(--shmm-fs-headline-m, 14px);
		--shmm-fs-name: var(--shmm-fs-name-m, 24px);
		--shmm-fs-brand: var(--shmm-fs-brand-m, 18px);
		--shmm-fs-clue: var(--shmm-fs-clue-m, 17px);
		--shmm-fs-toast: var(--shmm-fs-toast-m, 16px);
	}
}

/* --- Shield from theme list / paragraph styles (Divi adds bullets, indents, padding) */
.shmm ul.shmm-answers, .shmm ul.shmm-answer__clues {
	list-style: none !important; margin: 0 !important; padding: 0 !important;
}
.shmm ul.shmm-answers > li, .shmm ul.shmm-answer__clues > li {
	list-style: none !important; margin: 0; padding: 0;
}
.shmm ul.shmm-answers > li::marker, .shmm ul.shmm-answer__clues > li::marker { content: none; }
.shmm p { padding: 0 !important; }
.shmm .shmm-answer__body p { margin: 0 !important; }
.shmm .shmm-key > .shmm-muted { margin: 0 0 14px !important; }

/* --- Fonts (skipped when "Your site's font" is chosen) */
.shmm.shmm--theme-b { font-family: inherit; }
.shmm:not(.shmm--theme-h) .shmm-title,
.shmm:not(.shmm--theme-h) .shmm-subhead,
.shmm:not(.shmm--theme-h) .shmm-key summary,
.shmm:not(.shmm--theme-h) .shmm-stat__label,
.shmm:not(.shmm--theme-h) .shmm-stat__val,
.shmm:not(.shmm--theme-h) .shmm-size,
.shmm:not(.shmm--theme-h) .shmm-size select,
.shmm:not(.shmm--theme-h) .shmm-btn,
.shmm:not(.shmm--theme-h) .shmm-card,
.shmm:not(.shmm--theme-h) .shmm-card *,
.shmm:not(.shmm--theme-h) .shmm-answer__headline,
.shmm:not(.shmm--theme-h) .shmm-answer__name,
.shmm:not(.shmm--theme-h) .shmm-live,
.shmm:not(.shmm--theme-h) .shmm-win__title,
.shmm:not(.shmm--theme-h) .shmm-win__verdict { font-family: var(--shmm-font-h) !important; }

.shmm:not(.shmm--theme-b) .shmm-intro,
.shmm:not(.shmm--theme-b) .shmm-best,
.shmm:not(.shmm--theme-b) .shmm-muted,
.shmm:not(.shmm--theme-b) .shmm-answer__brand,
.shmm:not(.shmm--theme-b) .shmm-answer__clues li,
.shmm:not(.shmm--theme-b) .shmm-win__stats { font-family: var(--shmm-font-b) !important; }

/* --- Sizes */
.shmm h2.shmm-title { font-size: var(--shmm-fs-title) !important; line-height: 1 !important; font-weight: 900 !important; }
.shmm p.shmm-intro { font-size: var(--shmm-fs-intro) !important; line-height: 1.5 !important; font-weight: 400 !important; max-width: 62ch; }
.shmm .shmm-stat__val { font-size: var(--shmm-fs-statval) !important; line-height: 1.15 !important; }
.shmm .shmm-stat__label { font-size: var(--shmm-fs-statlabel) !important; line-height: 1.3 !important; }
.shmm .shmm-size, .shmm .shmm-size select, .shmm .shmm-btn { font-size: var(--shmm-fs-button) !important; line-height: 1.2 !important; }
.shmm .shmm-size select { min-height: 2.6em; }
.shmm .shmm-btn { padding: .7em 1.4em; }
.shmm h3.shmm-subhead, .shmm .shmm-key summary { font-size: var(--shmm-fs-subhead) !important; line-height: 1.2 !important; font-weight: 900 !important; }
.shmm p.shmm-best, .shmm p.shmm-muted { font-size: var(--shmm-fs-helper) !important; line-height: 1.45 !important; font-weight: 400 !important; }
.shmm p.shmm-answer__headline { font-size: var(--shmm-fs-headline) !important; line-height: 1.3 !important; font-weight: 800 !important; margin-bottom: 4px !important; }
.shmm p.shmm-answer__name { font-size: var(--shmm-fs-name) !important; line-height: 1.2 !important; font-weight: 800 !important; color: var(--shmm-ink) !important; }
.shmm p.shmm-answer__brand { font-size: var(--shmm-fs-brand) !important; line-height: 1.3 !important; font-weight: 700 !important; margin-top: 2px !important; }
.shmm ul.shmm-answer__clues { margin-top: .55em !important; }
.shmm ul.shmm-answer__clues li { font-size: var(--shmm-fs-clue) !important; line-height: 1.45 !important; font-weight: 400 !important; color: #4f4c4d !important; padding-left: 1em !important; text-indent: -1em; margin-bottom: .2em; }
.shmm .shmm-live { font-size: var(--shmm-fs-toast) !important; line-height: 1.3 !important; }
.shmm h3.shmm-win__title { font-size: calc(var(--shmm-fs-subhead) * 1.3) !important; line-height: 1.1 !important; }
.shmm p.shmm-win__verdict { font-size: var(--shmm-fs-brand) !important; }
.shmm p.shmm-win__stats { font-size: var(--shmm-fs-helper) !important; }

/* Card text scales with the tile AND the "Text on cards" setting */
.shmm .shmm-card__name { font-size: clamp(calc(.72rem * var(--shmm-fs-card)), calc(10.5cqi * var(--shmm-fs-card)), calc(1.7rem * var(--shmm-fs-card))) !important; line-height: 1.12 !important; font-weight: 900 !important; }
.shmm .shmm-card__sub { font-size: clamp(calc(.62rem * var(--shmm-fs-card)), calc(7.2cqi * var(--shmm-fs-card)), calc(1.05rem * var(--shmm-fs-card))) !important; line-height: 1.2 !important; font-weight: 700 !important; }
.shmm .shmm-card__brand, .shmm .shmm-card__tag { font-size: clamp(.5rem, calc(6.2cqi * var(--shmm-fs-card)), .85rem) !important; line-height: 1.2 !important; }
.shmm .shmm-card__q { font-size: calc(24cqi * var(--shmm-fs-card)) !important; line-height: 1 !important; }

/* Answer cards: roomier, image scales a little with the name size */
.shmm .shmm-answers { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.shmm .shmm-answer { padding: 18px; gap: 18px; }
.shmm .shmm-answer__img { flex: 0 0 auto; width: calc(var(--shmm-fs-name) * 3.6); height: calc(var(--shmm-fs-name) * 3.6); max-width: 110px; max-height: 110px; }
@media (max-width: 767px) {
	.shmm .shmm-answer { padding: 16px; gap: 14px; }
	.shmm .shmm-answer__img { max-width: 76px; max-height: 76px; }
}
/* Phones: photo floats left beside the name; clues use the full card width below it. */
@media (max-width: 767px) {
	.shmm .shmm-answer { display: block; }
	.shmm .shmm-answer::after { content: ""; display: table; clear: both; }
	.shmm .shmm-answer__img { float: left; margin: 2px 14px 8px 2px; }
	.shmm ul.shmm-answer__clues { clear: left; padding-top: .2em !important; }
}
