/* ==========================================================================
   WP Professor — main stylesheet
   ========================================================================== */

:root {
	--navy: #1e2a5a;
	--navy-2: #3b4a8c;
	--gold: #f5b82e;
	--coral: #ff6b5b;
	--teal: #19b3a6;
	--violet: #7a5cff;

	--bg: #fbf8f2;
	--surface: #ffffff;
	--surface-2: #f3efe5;
	--text: #1b2140;
	--muted: #5b6280;
	--border: #e8e2d4;
	--heading: #141a38;
	--link: #2f47b5;

	--radius: 18px;
	--radius-sm: 10px;
	--shadow: 0 1px 2px rgba(20, 26, 56, .06), 0 8px 28px rgba(20, 26, 56, .08);
	--shadow-lg: 0 20px 60px rgba(20, 26, 56, .16);
	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-display: "Fraunces", Georgia, "Times New Roman", serif;
	--wrap: 1200px;
	--gutter: clamp(16px, 4vw, 32px);
}

:root[data-theme="dark"] {
	--bg: #0f1330;
	--surface: #171c42;
	--surface-2: #1f2552;
	--text: #e6e8f5;
	--muted: #a3a9c9;
	--border: #2b3266;
	--heading: #ffffff;
	--link: #9db0ff;
	--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .3);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0f1330;
		--surface: #171c42;
		--surface-2: #1f2552;
		--text: #e6e8f5;
		--muted: #a3a9c9;
		--border: #2b3266;
		--heading: #ffffff;
		--link: #9db0ff;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .3);
	}
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 17px/1.7 var(--font);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img, svg, video, iframe { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--coral); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--heading); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3, .h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--gold); color: var(--navy); }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 999; background: var(--gold); color: var(--navy); padding: 10px 16px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { left: 8px; }

.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }
.center { text-align: center; }
.section { padding: clamp(48px, 7vw, 96px) 0; }
.icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }

/* ---------- Buttons & chips ---------- */
.btn {
	display: inline-flex; align-items: center; gap: .5em;
	background: var(--coral); color: #fff; border: 0; cursor: pointer;
	font: 700 1rem/1 var(--font); padding: .9em 1.35em; border-radius: 999px;
	text-decoration: none; box-shadow: 0 4px 0 rgba(0, 0, 0, .15);
	transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0, 0, 0, .15); }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.btn-sm { padding: .65em 1.1em; font-size: .9rem; }
.btn-lg { padding: 1.05em 1.6em; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--heading); box-shadow: inset 0 0 0 2px var(--border); }
.btn-ghost:hover { color: var(--coral); box-shadow: inset 0 0 0 2px var(--coral); }
.btn-ghost-light { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .4); }
.btn-ghost-light:hover { box-shadow: inset 0 0 0 2px var(--gold); color: var(--gold); }
.pill, .chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); color: var(--heading); text-decoration: none; }
.pill { background: color-mix(in srgb, var(--coral) 14%, transparent); color: var(--coral); text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; }
.chip span { opacity: .6; font-weight: 600; }
.chip:hover { background: var(--gold); color: var(--navy); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 1em 0; }
.eyebrow { display: inline-block; font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--coral); margin-bottom: .8em; }

/* ---------- Announcement + header ---------- */
.announce { background: var(--navy); color: #fff; font-size: .88rem; padding: 8px 0; text-align: center; }
.announce .container { display: flex; justify-content: center; align-items: center; gap: 8px; }
.announce .icon { color: var(--gold); }

.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(160%) blur(12px);
	border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 76px; }
.brand { flex: none; color: var(--heading); }
.site-logo, .custom-logo-link { display: block; color: var(--heading); }
.site-logo svg { width: 220px; height: auto; display: block; }
.custom-logo { max-height: 56px; width: auto; }

.primary-nav { margin-left: auto; }
.primary-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.primary-nav li { position: relative; }
.primary-nav a { display: block; padding: 10px 12px; font-weight: 600; font-size: .95rem; color: var(--heading); text-decoration: none; border-radius: 10px; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a { background: var(--surface-2); color: var(--coral); }
.primary-nav .menu-item-has-children > a::after { content: "▾"; font-size: .7em; margin-left: 5px; opacity: .6; }
.primary-nav .sub-menu {
	list-style: none; margin: 0; padding: 8px; position: absolute; left: 0; top: 100%;
	min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s;
}
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-nav .sub-menu a { font-weight: 500; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { background: transparent; border: 0; color: var(--heading); width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--coral); }
.nav-toggle { display: none; }

.search-overlay { background: var(--surface); border-bottom: 1px solid var(--border); padding: 24px 0; box-shadow: var(--shadow); position: sticky; top: 77px; z-index: 49; }
.search-hint { color: var(--muted); font-size: .9rem; margin: .8em 0 0; }
.search-form { display: flex; gap: 8px; max-width: 640px; }
.search-form input { flex: 1; min-width: 0; }

@media (max-width: 1080px) {
	.nav-toggle { display: grid; order: 3; }
	.header-actions { margin-left: auto; }
	.primary-nav {
		position: fixed; inset: 0 0 0 auto; width: min(360px, 88vw); background: var(--surface);
		padding: 90px 20px 30px; overflow-y: auto; transform: translateX(100%); transition: transform .25s, visibility .25s; z-index: 60; box-shadow: var(--shadow-lg); margin: 0; visibility: hidden;
	}
	.nav-open .primary-nav { transform: none; visibility: visible; }
	.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(10, 14, 40, .45); z-index: 55; }
	.nav-open .nav-toggle { position: fixed; right: 16px; top: 16px; z-index: 61; background: var(--surface-2); }
	.primary-nav .menu { flex-direction: column; }
	.primary-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 14px; background: transparent; min-width: 0; }
	.site-logo svg { width: 180px; }
	.header-actions .btn { display: none; }
}

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="search"], input[type="url"], textarea, select {
	font: inherit; font-size: 1rem; padding: .85em 1.1em; border-radius: 999px; border: 2px solid var(--border);
	background: var(--surface); color: var(--text); width: 100%;
}
textarea { border-radius: 16px; }
input:focus, textarea:focus, select:focus { border-color: var(--navy-2); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 45%, transparent); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 90px) 0 clamp(40px, 6vw, 70px);
	background:
		radial-gradient(900px 400px at 85% 10%, color-mix(in srgb, var(--gold) 26%, transparent), transparent 60%),
		radial-gradient(700px 400px at 10% 90%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 60%);
}
.hero-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.1rem); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 60ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6em 0; }
.stats { list-style: none; padding: 0; margin: 1.5em 0 0; display: flex; flex-wrap: wrap; gap: 28px; }
.stats li { display: flex; flex-direction: column; }
.stats strong { font-family: var(--font-display); font-size: 2rem; color: var(--heading); line-height: 1; }
.stats span { font-size: .85rem; color: var(--muted); }
.hero-art { position: relative; display: grid; place-items: center; }
.mascot-hero { width: min(340px, 80%); position: relative; z-index: 2; animation: float 5s ease-in-out infinite; }
.speech { position: absolute; top: 0; left: 0; z-index: 3; background: var(--surface); padding: 12px 16px; border-radius: 18px 18px 18px 4px; font-weight: 700; font-size: .95rem; box-shadow: var(--shadow); max-width: 220px; color: var(--heading); }
.blob { position: absolute; border-radius: 50%; filter: blur(2px); z-index: 1; }
.b1 { width: 300px; height: 300px; background: var(--gold); opacity: .35; bottom: 0; right: 10%; }
.b2 { width: 120px; height: 120px; background: var(--coral); opacity: .35; top: 20%; right: 0; }
@keyframes float { 50% { transform: translateY(-12px) rotate(-1deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
@media (max-width: 860px) {
	.hero-inner { grid-template-columns: 1fr; }
	.hero-art { order: -1; max-width: 300px; margin: 0 auto; }
	.speech { font-size: .85rem; max-width: 180px; }
}

/* ---------- Page hero ---------- */
.page-hero { padding: clamp(36px, 6vw, 70px) 0 clamp(28px, 4vw, 48px); background: linear-gradient(180deg, var(--surface-2), transparent); border-bottom: 1px solid var(--border); }
.page-hero-sm h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page-hero-inner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; }
.mascot-hero-sm { width: 150px; }
@media (max-width: 700px) { .page-hero-inner { grid-template-columns: 1fr; } .mascot-hero-sm { display: none; } }

.breadcrumbs ol { list-style: none; margin: 0 0 1em; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--coral); }

/* ---------- Section heads, grids, cards ---------- */
.section-head { margin-bottom: 2em; }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.section-head.row { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad, .pad { padding: clamp(20px, 3vw, 32px); }
.post-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-art { display: flex; align-items: end; width: 100%; height: 100%; padding: 20px; position: relative; }
.card-art::after { content: ""; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; border: 18px solid rgba(255, 255, 255, .14); }
.card-art-title { font-family: var(--font-display); color: #fff; font-weight: 800; font-size: 1.35rem; line-height: 1.15; max-width: 85%; text-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.card-body { padding: 20px 22px 24px; }
.card-title { font-size: 1.2rem; margin: .4em 0; }
.card-title a { color: var(--heading); text-decoration: none; }
.card-title a:hover { color: var(--coral); }
.card-body p { color: var(--muted); font-size: .95rem; margin: 0; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); transition: .18s; }
.tile strong { color: var(--heading); font-size: 1.05rem; }
.tile span:last-child { font-size: .88rem; color: var(--muted); line-height: 1.45; }
.tile-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--gold) 26%, transparent); color: var(--navy); margin-bottom: 8px; }
:root[data-theme="dark"] .tile-icon { color: var(--gold); }
.tile:nth-child(3n+2) .tile-icon { background: color-mix(in srgb, var(--coral) 18%, transparent); color: var(--coral); }
.tile:nth-child(3n) .tile-icon { background: color-mix(in srgb, var(--teal) 18%, transparent); color: var(--teal); }
.tile:hover { transform: translateY(-3px); border-color: var(--coral); box-shadow: var(--shadow); }

/* ---------- Bands ---------- */
.band { background: var(--surface-2); }
.band-dark { background: var(--navy); color: #d9ddf2; }
.band-dark h2 { color: #fff; }
.band-games { background: linear-gradient(135deg, color-mix(in srgb, var(--violet) 18%, var(--bg)), color-mix(in srgb, var(--teal) 16%, var(--bg))); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.module-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.module-list li { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; }
.module-list small { display: block; color: var(--muted); font-size: .85rem; }
.num { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-weight: 800; }

.terminal { background: #0b0f26; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid #2b3266; }
.terminal-bar { display: flex; gap: 6px; padding: 12px 14px; background: #151a3d; }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--coral); }
.terminal-bar i:nth-child(2) { background: var(--gold); }
.terminal-bar i:nth-child(3) { background: var(--teal); }
.terminal pre { margin: 0; padding: 20px; color: #e9ecff; font: 500 .92rem/1.65 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; }
.terminal .c { color: var(--gold); }

.game-badges { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.game-badges span { background: var(--surface); border-radius: 16px; padding: 18px 22px; font-weight: 800; font-size: 1.1rem; box-shadow: var(--shadow); color: var(--heading); }
.game-badges span:nth-child(odd) { transform: rotate(-2deg); }
.game-badges span:nth-child(even) { transform: rotate(2deg); }

/* ---------- Layouts ---------- */
.layout-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding-top: 40px; padding-bottom: 70px; }
@media (max-width: 960px) { .layout-sidebar { grid-template-columns: 1fr; } }
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar .widget { padding: 22px; }
.widget-title { font-size: 1.15rem; }
.widget-optin { text-align: center; background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 22%, var(--surface)), var(--surface)); }
.mascot-xs { width: 80px; margin: 0 auto 6px; display: block; }
.mascot-sm { width: 140px; }

/* ---------- Single ---------- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 100; }
.reading-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--coral), var(--gold)); }
.post-hero { padding: clamp(36px, 6vw, 70px) 0 20px; }
.post-hero h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); margin-top: .4em; }
.byline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .92rem; }
.byline img { border-radius: 50%; }
.post-thumb img { border-radius: var(--radius); width: 100%; }
.toc { padding: 18px 22px; margin-bottom: 2em; font-size: .95rem; }
.toc ol { margin: .5em 0 0; padding-left: 1.2em; }
.toc a { text-decoration: none; }

.entry-content { font-size: 1.07rem; }
.entry-content > * { max-width: 75ch; }
.entry-content .alignwide, .entry-content .wpp-full, .entry-content .wpp-dir, .entry-content .wpp-course, .entry-content .wpp-games, .entry-content .grid { max-width: none; }
.entry-content h2 { margin-top: 1.8em; font-size: clamp(1.5rem, 2.8vw, 2rem); scroll-margin-top: 100px; }
.entry-content h3 { margin-top: 1.5em; scroll-margin-top: 100px; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote { margin: 1.5em 0; padding: 1em 1.4em; border-left: 5px solid var(--gold); background: var(--surface-2); border-radius: 0 14px 14px 0; font-style: italic; }
.entry-content code { background: var(--surface-2); padding: .15em .45em; border-radius: 6px; font-size: .9em; }
.entry-content pre { background: #0b0f26; color: #e9ecff; padding: 18px 20px; border-radius: 14px; overflow-x: auto; font-size: .9rem; line-height: 1.6; }
.entry-content pre code { background: none; padding: 0; color: inherit; }
.entry-content table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--surface-2); }
.entry-content img { border-radius: 12px; }

.callout { border-radius: 16px; padding: 18px 22px 18px 64px; position: relative; margin: 1.6em 0; background: color-mix(in srgb, var(--teal) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--teal) 30%, transparent); }
.callout::before { content: "🎓"; position: absolute; left: 20px; top: 16px; font-size: 1.6rem; }
.callout.warn { background: color-mix(in srgb, var(--coral) 10%, var(--surface)); border-color: color-mix(in srgb, var(--coral) 30%, transparent); }
.callout.warn::before { content: "⚠️"; }
.callout.tip { background: color-mix(in srgb, var(--gold) 16%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.callout.tip::before { content: "💡"; }
.callout p:last-child { margin: 0; }

.entry-footer { margin-top: 3em; display: grid; gap: 24px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.share a, .share button { font: 600 .9rem var(--font); padding: 8px 14px; border-radius: 999px; background: var(--surface-2); color: var(--heading); text-decoration: none; border: 0; cursor: pointer; }
.share a:hover, .share button:hover { background: var(--gold); color: var(--navy); }
.post-optin { display: flex; gap: 20px; align-items: center; padding: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 20%, var(--surface)), var(--surface)); }
.post-optin h2 { font-size: 1.3rem; }
.post-optin .mascot-xs { margin: 0; }
@media (max-width: 600px) { .post-optin { flex-direction: column; text-align: center; } }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 20px; }
.post-navigation a { font-weight: 700; text-decoration: none; }
.related { margin-top: 3em; }
.comments { padding: 28px; margin-top: 3em; }
.comment-list { padding-left: 0; list-style: none; }
.comment-list .children { list-style: none; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--border); }

.pagination .nav-links, .nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.page-numbers { padding: 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; font-weight: 700; }
.page-numbers.current { background: var(--navy); color: #fff; }

.empty { text-align: center; padding: 40px 24px; display: grid; justify-items: center; gap: 6px; }
.big-404 { font-family: var(--font-display); font-weight: 800; font-size: clamp(5rem, 16vw, 10rem); color: var(--gold); line-height: 1; margin: 0; }

/* ---------- Opt-in ---------- */
.wpp-optin { display: grid; gap: 10px; }
.wpp-optin .fields { display: flex; gap: 8px; flex-wrap: wrap; }
.wpp-optin .fields input { flex: 1 1 200px; }
.wpp-optin.stacked .fields { flex-direction: column; }
.wpp-optin.stacked .fields input, .wpp-optin.stacked .fields button { flex: none; width: 100%; justify-content: center; }
.wpp-optin .consent { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: start; text-align: left; line-height: 1.4; }
.wpp-optin .consent input { margin-top: 3px; }
.wpp-optin .hp { position: absolute; left: -9999px; }
.wpp-optin .msg { font-weight: 700; margin: 0; }
.wpp-optin .msg.ok { color: var(--teal); }
.wpp-optin .msg.err { color: var(--coral); }
.wpp-optin-big { max-width: 620px; margin: 0 auto; }

/* ---------- Footer ---------- */
.footer-cta { background: linear-gradient(135deg, var(--gold), #ffd36b); color: var(--navy); padding: 50px 0; }
.footer-cta h2 { color: var(--navy); }
.footer-cta-inner { display: grid; grid-template-columns: auto 1fr; gap: 30px; align-items: center; }
.footer-cta p { max-width: 60ch; }
.footer-cta .consent { color: #3a3f5c; }
@media (max-width: 700px) { .footer-cta-inner { grid-template-columns: 1fr; text-align: center; } .footer-cta-mascot { justify-self: center; } }

.site-footer { background: var(--navy); color: #c8cde8; padding: 60px 0 30px; position: relative; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer .site-logo { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; }
.footer-grid h3 { color: var(--gold); font-family: var(--font); font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .95rem; }
.footer-brand p { margin-top: 1em; font-size: .95rem; }
.social { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 600; font-size: .9rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 40px; padding-top: 24px; font-size: .85rem; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.legal-menu { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; }
.disclosure, .tm-note { opacity: .75; }
.to-top { position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; border-radius: 50%; background: var(--coral) !important; color: #fff !important; display: grid; place-items: center; font-weight: 800; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .2s; z-index: 40; }
.scrolled .to-top { opacity: 1; pointer-events: auto; }

/* ---------- Directories ---------- */
.wpp-dir-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.wpp-dir-filter input { max-width: 340px; }
.wpp-dir-filter button { font: 700 .85rem var(--font); padding: 8px 14px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); color: var(--heading); cursor: pointer; }
.wpp-dir-filter button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.dir-item { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.dir-item h3 { margin: 0; font-size: 1.15rem; }
.dir-item h3 a { color: var(--heading); text-decoration: none; }
.dir-item h3 a:hover { color: var(--coral); }
.dir-item p { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.55; }
.dir-item .dir-top { display: flex; align-items: center; gap: 12px; }
.dir-avatar { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-family: var(--font-display); font-size: 1.2rem; }
.dir-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.dir-meta .chip { font-size: .72rem; padding: 3px 10px; }
.dir-item .badge { font-size: .7rem; font-weight: 800; color: var(--navy); background: var(--gold); border-radius: 6px; padding: 2px 8px; text-transform: uppercase; letter-spacing: .04em; }
.dir-link { font-weight: 700; font-size: .9rem; text-decoration: none; }
.dir-compact { list-style: none; margin: 0 0 1em; padding: 0; }
.dir-compact li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.dir-compact li:last-child { border: 0; }
.dir-compact strong a { color: var(--heading); text-decoration: none; }
.dir-compact small { display: block; color: var(--muted); line-height: 1.4; }
.dir-compact .dir-avatar { width: 36px; height: 36px; font-size: 1rem; border-radius: 10px; }
.more { font-weight: 700; text-decoration: none; }
.video-embed { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; position: relative; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed button { position: absolute; inset: 0; border: 0; cursor: pointer; background-size: cover; background-position: center; }
.video-embed button::after { content: "▶"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; border-radius: 50%; background: var(--coral); color: #fff; font-size: 1.6rem; display: grid; place-items: center; box-shadow: var(--shadow-lg); }

/* ---------- Tip + FAQ ---------- */
.tip-box { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; padding: 26px 30px; background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--teal) 10%, var(--surface))); }
.tip-box .mascot-xs { margin: 0; }
.tip-box h2 { font-size: 1.1rem; font-family: var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--coral); margin: 0 0 .3em; }
.tip-box p { font-size: 1.15rem; margin: 0; color: var(--heading); font-weight: 600; }
@media (max-width: 700px) { .tip-box { grid-template-columns: 1fr; text-align: center; } .tip-box .mascot-xs { margin: 0 auto; } }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 18px 22px; font-weight: 700; color: var(--heading); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--coral); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 22px 18px; color: var(--muted); }

/* ---------- Course ---------- */
.wpp-course { display: grid; gap: 22px; }
.course-progress { display: flex; align-items: center; gap: 16px; padding: 18px 22px; }
.course-progress .bar { flex: 1; height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.course-progress .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--gold)); transition: width .4s; }
.course-module { padding: 0; overflow: hidden; }
.course-module > header { display: flex; gap: 16px; align-items: center; padding: 20px 24px; background: var(--surface-2); }
.course-module > header h2 { font-size: 1.3rem; margin: 0; }
.course-module > header p { margin: 0; color: var(--muted); font-size: .92rem; }
.lesson-list { list-style: none; margin: 0; padding: 8px 12px 14px; }
.lesson-list li a { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; text-decoration: none; color: var(--heading); font-weight: 600; }
.lesson-list li a:hover { background: var(--surface-2); }
.lesson-list .check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); flex: none; display: grid; place-items: center; font-size: .8rem; color: #fff; }
.lesson-list li.done .check { background: var(--teal); border-color: var(--teal); }
.lesson-list .len { margin-left: auto; color: var(--muted); font-weight: 500; font-size: .85rem; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 2em; padding-top: 1.5em; border-top: 1px solid var(--border); }
.lesson-done-btn[aria-pressed="true"] { background: var(--teal); }

/* ---------- Games ---------- */
.wpp-games { display: grid; gap: 28px; }
.game-card { padding: clamp(18px, 3vw, 30px); }
.game-card > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.game-card h2, .game-card h3 { margin: 0; }
.scoreboard { display: flex; gap: 14px; font-weight: 800; color: var(--heading); font-size: .95rem; }
.scoreboard span { background: var(--surface-2); padding: 6px 12px; border-radius: 10px; }
.game-stage { position: relative; background: var(--surface-2); border-radius: 16px; min-height: 340px; overflow: hidden; user-select: none; touch-action: manipulation; }
.game-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; background: color-mix(in srgb, var(--surface) 88%, transparent); z-index: 5; padding: 20px; }
.game-overlay[hidden] { display: none; }
.game-overlay p { margin: 0; color: var(--muted); max-width: 40ch; }
.bug-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 16px; }
.bug-hole { aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 60%, #2b3266, #151a3d); border: 0; cursor: pointer; font-size: clamp(1.6rem, 6vw, 2.6rem); display: grid; place-items: center; transition: transform .08s; }
.bug-hole:active { transform: scale(.94); }
.bug-hole.hit { background: radial-gradient(circle, var(--teal), #0c6b63); }
.match-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px; }
.match-card { aspect-ratio: 3 / 2; border: 0; border-radius: 12px; background: var(--navy); color: #fff; font: 700 clamp(.7rem, 2vw, .92rem)/1.25 var(--font); cursor: pointer; padding: 6px; transition: transform .2s, background .2s; }
.match-card[data-state="up"] { background: var(--gold); color: var(--navy); }
.match-card[data-state="done"] { background: var(--teal); color: #fff; cursor: default; }
.match-card[data-state="down"] { font-size: 1.5rem; }
.catcher { position: relative; height: 380px; }
.catcher .paddle { position: absolute; bottom: 12px; width: 110px; height: 22px; border-radius: 12px; background: var(--coral); left: 50%; transform: translateX(-50%); }
.catcher .drop { position: absolute; top: 0; padding: 4px 10px; border-radius: 8px; font: 700 .8rem var(--font); color: #fff; white-space: nowrap; }
.catcher .drop.good { background: var(--navy-2); }
.catcher .drop.bad { background: #b0304a; }
.game-help { font-size: .88rem; color: var(--muted); margin-top: 10px; }

.quiz-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-bottom: 24px; }
.quiz-pick { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; line-height: 1.45; text-align: left; padding: 18px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.quiz-pick strong { display: block; color: var(--heading); font-size: 1.05rem; }
.quiz-pick small { color: var(--muted); }
.quiz-pick[aria-pressed="true"], .quiz-pick:hover { border-color: var(--coral); }
.quiz { padding: clamp(20px, 3vw, 32px); }
.quiz-q { font-family: var(--font-display); font-size: clamp(1.25rem, 2.5vw, 1.6rem); color: var(--heading); margin: .4em 0 1em; font-weight: 800; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt { text-align: left; padding: 14px 18px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); font: 600 1rem var(--font); color: var(--text); cursor: pointer; }
.quiz-opt:hover:not([disabled]) { border-color: var(--navy-2); }
.quiz-opt.right { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, var(--surface)); }
.quiz-opt.wrong { border-color: var(--coral); background: color-mix(in srgb, var(--coral) 12%, var(--surface)); }
.quiz-explain { margin-top: 14px; padding: 14px 18px; border-radius: 14px; background: var(--surface-2); }
.quiz-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 12px; flex-wrap: wrap; }
.quiz-progress { font-weight: 700; color: var(--muted); font-size: .9rem; }
.quiz-result { text-align: center; }
.quiz-result .score { font-family: var(--font-display); font-size: 4rem; color: var(--coral); font-weight: 800; line-height: 1; }

/* ---------- Misc blocks ---------- */
.steps { counter-reset: s; list-style: none; padding: 0 !important; display: grid; gap: 14px; }
.steps > li { counter-increment: s; position: relative; padding: 18px 20px 18px 70px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.steps > li::before { content: counter(s); position: absolute; left: 18px; top: 16px; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--navy); font-weight: 800; display: grid; place-items: center; }
.kicker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; list-style: none; padding: 0 !important; }
.kicker-list li { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; margin: 0; }
.kicker-list strong { display: block; color: var(--heading); margin-bottom: 4px; }

.wp-block-button__link { border-radius: 999px; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--muted); text-align: center; }
.sticky .card-title::before { content: "📌 "; }
.bypostauthor > .comment-body { border-left: 3px solid var(--gold); padding-left: 12px; }
.gallery-caption { font-size: .85rem; }
.scoreboard .extra:empty { display: none; }
