/* FootyMath Quiz: same tokens and fonts as footymath.com (dark violet), plus a light theme for embeds (?theme=light). */
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/fonts/plus-jakarta-sans.woff2) format('woff2'); }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500 800; font-display: swap; src: url(/assets/fonts/unbounded-700.woff2) format('woff2'); }
:root {
	--bg: #0B0A1A; --bg-2: #110F26; --panel: #161433; --panel-2: #1C1A40; --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
	--fg: #F3F1FF; --muted: #A7A3C9; --dim: #8B87B3;
	--violet: #7C3AED; --violet-2: #A78BFA;
	--ok: #34D399; --ok-bg: rgba(52, 211, 153, .18); --ok-line: rgba(52, 211, 153, .55);
	--close: #FBBF24; --close-bg: rgba(251, 191, 36, .16); --close-line: rgba(251, 191, 36, .55);
	--no-bg: rgba(255, 255, 255, .04); --no-line: rgba(255, 255, 255, .12);
	--r: 16px;
	--font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--head: 'Unbounded', 'Plus Jakarta Sans', system-ui, sans-serif;
	color-scheme: dark;
}
html.light {
	--bg: #F7F6FC; --bg-2: #FFFFFF; --panel: #FFFFFF; --panel-2: #F1EFFA; --line: rgba(20, 16, 60, .1); --line-2: rgba(20, 16, 60, .18);
	--fg: #17142F; --muted: #55507A; --dim: #6B668F;
	--violet-2: #6D28D9;
	--ok: #047857; --ok-bg: rgba(16, 185, 129, .16); --ok-line: rgba(4, 120, 87, .5);
	--close: #92400E; --close-bg: rgba(245, 158, 11, .2); --close-line: rgba(146, 64, 14, .45);
	--no-bg: rgba(20, 16, 60, .04); --no-line: rgba(20, 16, 60, .14);
	color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.6 var(--font); }
body.page::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 900px; pointer-events: none; z-index: -1;
	background: radial-gradient(800px 460px at 75% -10%, rgba(124, 58, 237, .28), transparent 60%), radial-gradient(600px 420px at -10% 100%, rgba(14, 165, 233, .1), transparent 60%); }
a { color: var(--violet-2); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); color: var(--fg); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
h1 { font-size: clamp(26px, 5vw, 38px); margin: 6px 0 10px; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 6px; }
.muted { color: var(--muted); }
.lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 700; }
button { font: inherit; }

/* ---------- page shell */
.top { position: sticky; top: 0; z-index: 30; background: rgba(11, 10, 26, .94); border-bottom: 1px solid var(--line); }
.top-in { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: 800; font-size: 18px; color: #fff; text-decoration: none; white-space: nowrap; }
.logo-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--violet), #C026D3); color: #fff; font-size: 12px; }
.logo span.q { color: var(--violet-2); }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; padding: 10px 12px; border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { background: var(--panel); color: var(--fg); }
.nav a[aria-current] { color: #fff; background: var(--panel-2); }
main.wrap { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; }
.lead { color: var(--muted); font-size: 16px; max-width: 640px; margin: 0 0 18px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.side-card + .side-card { margin-top: 16px; }
section.info { margin-top: 34px; }
.foot { border-top: 1px solid var(--line); margin-top: 30px; }
.foot-in { max-width: 980px; margin: 0 auto; padding: 20px 16px 30px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--dim); }
.foot a { color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.foot a:hover { color: var(--fg); }

/* ---------- game */
.game { position: relative; }
.modes { display: flex; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); padding: 4px; border-radius: 12px; margin-bottom: 14px; width: max-content; max-width: 100%; }
.modes button { background: none; border: 0; color: var(--muted); font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 9px; cursor: pointer; min-height: 40px; }
.modes button[aria-pressed="true"] { background: linear-gradient(90deg, var(--violet), rgba(124, 58, 237, .7)); color: #fff; }
.g-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.g-title { font-family: var(--head); font-size: 16px; font-weight: 700; }
.g-left { font-size: 13px; color: var(--muted); }
.g-left b { color: var(--fg); font-variant-numeric: tabular-nums; }

.combo { position: relative; margin-bottom: 14px; }
.combo label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--muted); }
.combo-in { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; min-height: 48px; }
.combo-in:focus-within { border-color: var(--violet-2); box-shadow: 0 0 0 3px rgba(124, 58, 237, .25); }
.combo-in svg { width: 18px; height: 18px; stroke: var(--dim); fill: none; stroke-width: 2; flex: none; }
.combo input { flex: 1; min-width: 0; background: none; border: 0; color: var(--fg); font: inherit; font-size: 16px; outline: none; padding: 10px 0; }
.combo input::placeholder { color: var(--dim); }
.combo input:disabled { cursor: not-allowed; }
.opts { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 4px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, .35); max-height: 320px; overflow-y: auto; }
.opts[hidden] { display: none; }
.opts li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; min-height: 44px; }
.opts li[aria-selected="true"], .opts li:hover { background: rgba(124, 58, 237, .28); }
.opts li .nm { font-weight: 700; }
.opts li .tm { color: var(--muted); font-size: 13px; margin-left: auto; text-align: right; }
.opts li.empty { cursor: default; color: var(--muted); }
.opts li.empty:hover { background: none; }

.crest { width: 28px; height: 28px; border-radius: 50%; background: #E4E1F3; display: inline-grid; place-items: center; flex: none; overflow: hidden; color: #17142F; font-size: 10px; font-weight: 800; }
.crest img { width: 80%; height: 80%; object-fit: contain; }

.cols, .row-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.cols { margin-bottom: 6px; }
.cols span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 700; text-align: center; }
.rows { display: flex; flex-direction: column; gap: 10px; }
.row-name { font-size: 13.5px; font-weight: 700; margin: 0 0 4px 2px; display: flex; align-items: center; gap: 8px; }
.row-name .n { color: var(--dim); font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.tile { position: relative; border-radius: 12px; border: 1px solid var(--no-line); background: var(--no-bg); min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	padding: 6px 2px; text-align: center; }
.tile.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.tile.close { background: var(--close-bg); border-color: var(--close-line); }
.tile .v { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1.1; display: inline-flex; align-items: center; gap: 2px; }
.tile .s { font-size: 10.5px; color: var(--muted); line-height: 1.2; max-width: 100%; overflow: hidden; padding: 0 2px; overflow-wrap: break-word;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile img.lg { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; background: #fff; padding: 2px; }
.tile img.fl { width: 30px; height: 20px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.tile .crest { width: 30px; height: 30px; }
.tile .mk { position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; }
.tile .mk svg { width: 14px; height: 14px; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tile.ok .mk svg { stroke: var(--ok); }
.tile.close .mk svg { stroke: var(--close); }
.tile.no .mk svg { stroke: var(--dim); }
.tile .ar { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.row.new .tile { animation: flip .42s ease-out both; }
.row.new .tile:nth-child(2) { animation-delay: .07s; } .row.new .tile:nth-child(3) { animation-delay: .14s; }
.row.new .tile:nth-child(4) { animation-delay: .21s; } .row.new .tile:nth-child(5) { animation-delay: .28s; } .row.new .tile:nth-child(6) { animation-delay: .35s; }
@keyframes flip { from { transform: rotateX(80deg); opacity: 0; } to { transform: none; opacity: 1; } }
.empty-rows { display: flex; flex-direction: column; gap: 8px; }
.slot { height: 64px; border-radius: 12px; border: 1px dashed var(--line-2); opacity: .55; }

.result { margin-top: 16px; border-radius: var(--r); padding: 18px; background: linear-gradient(140deg, rgba(76, 29, 149, .55), rgba(124, 58, 237, .35) 60%, rgba(192, 38, 211, .25)); border: 1px solid rgba(167, 139, 250, .35); }
html.light .result { background: linear-gradient(140deg, #EDE9FE, #F5F3FF 60%, #FAE8FF); border-color: #C4B5FD; }
.result h2 { font-size: 18px; margin-bottom: 6px; }
.answer { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; }
.answer .crest { width: 48px; height: 48px; }
.answer b { font-family: var(--head); font-size: 17px; display: block; line-height: 1.2; }
.answer span { color: var(--muted); font-size: 13.5px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none;
	border: 1px solid var(--line-2); background: var(--panel-2); color: var(--fg); }
.btn:hover { border-color: var(--violet-2); }
.btn.pri { background: linear-gradient(135deg, var(--violet), #C026D3); border-color: transparent; color: #fff; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.next { font-size: 13px; color: var(--muted); margin-top: 12px; }
.next b { color: var(--fg); font-variant-numeric: tabular-nums; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 14px; z-index: 60; }
.toast[hidden] { display: none; }
.ctrl { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.ctrl[hidden] { display: none; }
.ctrl .btn { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.yday { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.yday b { color: var(--fg); }
.giveup { background: none; border: 0; color: var(--dim); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 10px 0; min-height: 44px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stats b { display: block; font-family: var(--head); font-size: 20px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 11px; color: var(--muted); }
.dist { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.dist div { display: grid; grid-template-columns: 14px 1fr; gap: 8px; align-items: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.dist i { display: block; height: 18px; border-radius: 5px; background: var(--panel-2); color: var(--fg); font-style: normal; font-weight: 700; font-size: 11px; padding: 0 6px; text-align: right; line-height: 18px; min-width: 22px; }
.dist i.hi { background: var(--violet); color: #fff; }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.legend li { display: flex; gap: 10px; align-items: flex-start; }
.legend .sw { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--no-line); background: var(--no-bg); display: grid; place-items: center; }
.legend .sw.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.legend .sw.close { background: var(--close-bg); border-color: var(--close-line); }
.legend .sw svg { width: 14px; height: 14px; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.legend .sw.ok svg { stroke: var(--ok); } .legend .sw.close svg { stroke: var(--close); } .legend .sw.no svg { stroke: var(--dim); }

.embed-tools { display: grid; gap: 12px; }
.embed-tools select { background: var(--bg-2); color: var(--fg); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px; font: inherit; min-height: 44px; }
.embed-tools textarea { width: 100%; min-height: 150px; background: var(--bg-2); color: var(--fg); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.faq p { margin: 8px 0 0; color: var(--muted); }

/* ---------- mystery card */
.mystery { display: flex; gap: 14px; align-items: center; padding: 14px; margin-bottom: 14px; border-radius: 14px; background: linear-gradient(140deg, rgba(76, 29, 149, .5), rgba(28, 26, 64, .9));
	border: 1px solid rgba(167, 139, 250, .3); }
html.light .mystery { background: linear-gradient(140deg, #EDE9FE, #FFFFFF); border-color: #C4B5FD; }
.m-pic { flex: none; width: 64px; height: 64px; border-radius: 16px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; }
html.light .m-pic { background: #DDD6FE; }
.m-pic svg { width: 44px; height: 44px; fill: var(--violet-2); opacity: .75; }
.m-pic .crest.big { width: 52px; height: 52px; }
.m-body { min-width: 0; flex: 1; }
.m-name { margin: 0 0 8px; font-family: var(--head); font-size: 17px; font-weight: 700; line-height: 1.2; }
.m-name .ini { letter-spacing: .12em; }
.m-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mc { display: inline-flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.mc .lbl { font-size: 9.5px; }
.mc .mv { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.mc .mv img.lg { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; background: #fff; padding: 1px; }
.mc .mv img.fl { width: 22px; height: 15px; object-fit: cover; border-radius: 2px; }
.mc .mv .crest { width: 20px; height: 20px; }
.mc.wide .mv { white-space: normal; flex-wrap: wrap; gap: 4px 10px; }
.mc .pc { white-space: nowrap; }
.mc .pc i { font-style: normal; font-weight: 600; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.mc.locked { border-style: dashed; }
.mc.locked .mv { color: var(--dim); font-weight: 600; font-size: 12px; }
.mc.locked svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
@media (max-width: 560px) {
	.mystery { display: block; padding: 12px; }
	.m-pic { float: left; width: 40px; height: 40px; border-radius: 12px; margin-right: 10px; }
	.m-pic svg { width: 26px; height: 26px; }
	.m-pic .crest.big { width: 34px; height: 34px; }
	.m-name { line-height: 40px; margin-bottom: 10px; }
	.m-chips { clear: both; }
}

/* ---------- embed */
html.embed body { background: var(--bg); }
.embed-wrap { padding: 14px; max-width: 640px; margin: 0 auto; }
.embed-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.embed-top .logo { font-size: 15px; color: var(--fg); }
.embed-top .logo-mark { width: 26px; height: 26px; font-size: 10px; border-radius: 8px; }
.embed-credit { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; }
.embed-credit a { color: var(--violet-2); font-weight: 700; }

@media (max-width: 420px) {
	.tile { min-height: 58px; } .slot { height: 58px; }
	.tile .s { font-size: 9.5px; }
	.tile img.lg, .tile .crest { width: 26px; height: 26px; }
	.cols span { font-size: 9.5px; letter-spacing: .02em; }
	.nav a { padding: 10px 6px; font-size: 12.5px; }
	.nav a.nav-wide { display: none; }
	.top-in { gap: 8px; }
	.logo { font-size: 15px; gap: 8px; }
	.logo .q { display: none; }
	.tile { padding: 6px 1px; }
}
@media (prefers-reduced-motion: reduce) { .row.new .tile { animation: none; } }
