/* Error / 404 / timeout pages with the live Webauthor robot (lib/error/_oops.cfm). Works without oops.js:
   the stage then shows the robot PNG and every button is a plain link. */
:root {
	--oops-bg: #f7f4ee; --oops-bg2: #efe9df; --oops-dot: rgba(58, 50, 38, .07);
	--oops-ink: #2b251d; --oops-soft: #6f6555; --oops-muted: #9a907f; --oops-line: #e3dccf;
	--oops-card: #ffffff; --oops-accent: #0e927a; --oops-accent-ink: #ffffff; --oops-accent-soft: rgba(14, 146, 122, .12);
	--oops-chip: #d93a2f; --oops-chip-bg: rgba(217, 58, 47, .1);
	--oops-stage: radial-gradient(120% 90% at 50% 20%, #ffffff 0%, #f3eee5 70%, #ebe4d7 100%);
	--oops-night: radial-gradient(120% 100% at 50% 10%, #1a2436 0%, #0d131d 65%, #080c13 100%);
	--oops-shadow: 0 30px 60px -30px rgba(58, 42, 20, .35), 0 2px 6px rgba(58, 42, 20, .06);
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--oops-bg: #0b1019; --oops-bg2: #0d131d; --oops-dot: rgba(233, 238, 245, .05);
		--oops-ink: #e9eef5; --oops-soft: #b4bfcd; --oops-muted: #7a879a; --oops-line: #243042;
		--oops-card: #121a27; --oops-accent: #2dd4bf; --oops-accent-ink: #062520; --oops-accent-soft: rgba(45, 212, 191, .14);
		--oops-chip: #ff7a6b; --oops-chip-bg: rgba(255, 122, 107, .12);
		--oops-stage: radial-gradient(120% 90% at 50% 20%, #1a2436 0%, #111927 70%, #0d131d 100%);
		--oops-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3);
	}
}
:root[data-theme="dark"] {
	--oops-bg: #0b1019; --oops-bg2: #0d131d; --oops-dot: rgba(233, 238, 245, .05);
	--oops-ink: #e9eef5; --oops-soft: #b4bfcd; --oops-muted: #7a879a; --oops-line: #243042;
	--oops-card: #121a27; --oops-accent: #2dd4bf; --oops-accent-ink: #062520; --oops-accent-soft: rgba(45, 212, 191, .14);
	--oops-chip: #ff7a6b; --oops-chip-bg: rgba(255, 122, 107, .12);
	--oops-stage: radial-gradient(120% 90% at 50% 20%, #1a2436 0%, #111927 70%, #0d131d 100%);
	--oops-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.oops {
	font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--oops-ink);
	background: var(--oops-bg);
	background-image: radial-gradient(var(--oops-dot) 1.2px, transparent 1.3px);
	background-size: 22px 22px;
	min-height: 100vh; min-height: 100dvh;
	display: grid; place-items: center;
	padding: 24px 16px;
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
}
.oops-wrap {
	width: 100%; max-width: 980px;
	display: grid; gap: 28px 56px; align-items: center;
	grid-template-columns: 1fr;
	justify-items: center; text-align: center;
	animation: oopsUp .6s cubic-bezier(.16, 1, .3, 1) both;
}
@media (min-width: 860px) {
	.oops-wrap { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); justify-items: start; text-align: left; }
}
@keyframes oopsUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- stage ---------- */
.oops-stage {
	position: relative; width: 100%; max-width: 440px; aspect-ratio: 44 / 36;
	border-radius: 28px; background: var(--oops-stage); box-shadow: var(--oops-shadow);
	border: 1px solid var(--oops-line); overflow: hidden; justify-self: center;
	cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
body[data-oops="lost"] .oops-stage { background: var(--oops-night); border-color: #1d2738; cursor: crosshair; }
.oops-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.oops-stage .oops-fallback { position: absolute; left: 50%; bottom: 8%; width: 46%; transform: translateX(-50%); }
.oops-live .oops-stage .oops-fallback { display: none; }
.oops-stage-hint {
	position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; pointer-events: none;
	font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--oops-muted); opacity: 0; transition: opacity .4s;
}
body[data-oops="lost"] .oops-stage-hint { color: #7a879a; }
.oops-live .oops-stage-hint { opacity: 1; }
.oops-stage-hint.gone { opacity: 0 !important; }

/* ---------- copy ---------- */
.oops-copy { max-width: 520px; width: 100%; }
.oops-chip {
	display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
	background: var(--oops-chip-bg); color: var(--oops-chip); font-weight: 800; font-size: 13px; letter-spacing: .04em;
}
.oops-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: oopsBlip 1.6s ease-in-out infinite; }
@keyframes oopsBlip { 50% { opacity: .3; } }
.oops h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.08; font-weight: 900; letter-spacing: -.01em; margin: 14px 0 12px; }
.oops-lede { font-size: 17px; line-height: 1.55; color: var(--oops-soft); margin: 0; }
.oops-quip { min-height: 1.5em; margin: 14px 0 0; font-size: 15px; font-weight: 700; color: var(--oops-muted); }
.oops-quip span { display: inline-block; animation: oopsQuip .45s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes oopsQuip { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* retry countdown */
.oops-retry { margin-top: 20px; display: none; max-width: 360px; }
.oops-retry.on { display: block; }
.oops-retry-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 700; color: var(--oops-muted); margin-bottom: 8px; }
.oops-meter { height: 8px; border-radius: 8px; background: var(--oops-accent-soft); overflow: hidden; }
.oops-meter i { display: block; height: 100%; width: 0; border-radius: 8px; background: var(--oops-accent); transition: width .25s linear; }

/* buttons */
.oops-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; justify-content: center; }
@media (min-width: 860px) { .oops-actions { justify-content: flex-start; } }
.oops-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
	border-radius: 14px; border: 1px solid var(--oops-line); background: var(--oops-card); color: var(--oops-ink);
	font: 800 14px/1 "Nunito", system-ui, sans-serif; text-decoration: none; cursor: pointer;
	transition: transform .15s, box-shadow .15s, background .15s;
}
.oops-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .25); }
.oops-btn:focus-visible { outline: 3px solid var(--oops-accent); outline-offset: 2px; }
.oops-btn.primary { background: var(--oops-accent); border-color: transparent; color: var(--oops-accent-ink); box-shadow: 0 10px 22px -10px var(--oops-accent); }
.oops-btn svg { width: 16px; height: 16px; flex: none; }

.oops-ref { margin-top: 24px; font-size: 12px; color: var(--oops-muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
@media (min-width: 860px) { .oops-ref { justify-content: flex-start; } }
.oops-ref code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--oops-bg2); border: 1px solid var(--oops-line); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.oops-ref button { font: 700 12px "Nunito", sans-serif; background: none; border: 0; color: var(--oops-accent); cursor: pointer; padding: 2px 4px; }
.oops-admin { margin-top: 14px; font-size: 12px; color: var(--oops-soft); text-align: left; }
.oops-admin summary { cursor: pointer; font-weight: 800; }
.oops-admin pre { white-space: pre-wrap; word-break: break-word; background: var(--oops-bg2); border: 1px solid var(--oops-line); border-radius: 10px; padding: 10px; max-height: 220px; overflow: auto; }

/* ---------- game ---------- */
.oops-game {
	position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 16px;
	background: rgba(8, 12, 19, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.oops-game.open { display: grid; animation: oopsFade .25s ease both; }
@keyframes oopsFade { from { opacity: 0; } }
.oops-game-card {
	width: 100%; max-width: 860px; background: var(--oops-card); color: var(--oops-ink); border-radius: 24px;
	border: 1px solid var(--oops-line); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); overflow: hidden;
	animation: oopsUp .35s cubic-bezier(.16, 1, .3, 1) both;
}
.oops-game-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--oops-line); }
.oops-tabs { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.oops-tab { font: 800 14px "Nunito", sans-serif; border: 0; background: none; color: var(--oops-soft); padding: 8px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.oops-tab[aria-selected="true"] { background: var(--oops-accent-soft); color: var(--oops-ink); }
.oops-x { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--oops-bg2); color: var(--oops-ink); font-size: 20px; line-height: 1; cursor: pointer; flex: none; }
.oops-pane { display: none; }
.oops-pane.on { display: block; }
.oops-run { position: relative; height: min(420px, 62vh); background: #0d131d; }
.oops-run canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }
.oops-run-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 18px; font-size: 13px; font-weight: 700; color: var(--oops-muted); }
.oops-arcade { padding: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.oops-arcade button {
	display: grid; gap: 4px; justify-items: center; padding: 18px 10px; border-radius: 16px; cursor: pointer;
	border: 1px solid var(--oops-line); background: var(--oops-bg); color: var(--oops-ink); font: 800 14px "Nunito", sans-serif;
	transition: transform .15s, border-color .15s;
}
.oops-arcade button:hover { transform: translateY(-2px); border-color: var(--oops-accent); }
.oops-arcade button b { font-size: 28px; line-height: 1.1; }
.oops-arcade button small { font-weight: 600; color: var(--oops-muted); }
.oops-frame { display: none; }
.oops-frame.on { display: block; }
.oops-frame iframe { width: 100%; height: min(480px, 64vh); border: 0; display: block; background: #fff; }

.oops-toast {
	position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 30px); opacity: 0; z-index: 60; pointer-events: none;
	background: var(--oops-ink); color: var(--oops-bg); padding: 10px 16px; border-radius: 12px; font-weight: 800; font-size: 14px;
	transition: opacity .25s, transform .25s; display: flex; gap: 12px; align-items: center;
}
.oops-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.oops-toast button { font: 800 13px "Nunito", sans-serif; border: 0; border-radius: 8px; padding: 6px 10px; background: var(--oops-accent); color: var(--oops-accent-ink); cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
	.oops-wrap, .oops-game-card, .oops-quip span { animation: none; }
	.oops-chip::before { animation: none; }
}
.oops-needs-js { display: none !important; }
.oops-live .oops-needs-js { display: inline-flex !important; }
.oops-found { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 800; color: var(--oops-accent); }

/* ---------- static (Cloudflare) page slots: lib/error/robot/build-static.mjs ---------- */
.oops-box { margin-top: 22px; }
.oops-box:empty { display: none; }
.oops-note { margin: 14px 0 0; font-size: 13px; font-weight: 700; color: var(--oops-muted); }
.oops-details { margin-top: 18px; font-size: 13px; color: var(--oops-soft); text-align: left; }
.oops-details summary { cursor: pointer; font-weight: 800; width: max-content; }
.oops-details .oops-cf { margin-top: 10px; padding: 12px 14px; max-height: 240px; overflow: auto; background: var(--oops-bg2); border: 1px solid var(--oops-line); border-radius: 12px; font-size: 12px; line-height: 1.5; }
.oops-details .oops-cf h1, .oops-details .oops-cf h2, .oops-details .oops-cf h3, .oops-details .oops-cf p, .oops-details .oops-cf ul { margin: 0 0 6px; font-size: inherit; line-height: inherit; letter-spacing: normal; color: inherit; }
.oops-details .oops-cf a, .oops-details a { color: var(--oops-accent); }
.oops-details ul { margin: 6px 0 12px; padding-left: 18px; }
.oops-details h3 { margin: 12px 0 4px; font-size: 14px; color: var(--oops-ink); }
.oops-form { margin-top: 20px; display: grid; gap: 12px; text-align: left; max-width: 460px; }
.oops-form label { display: grid; gap: 5px; font-size: 13px; font-weight: 800; }
.oops-form input, .oops-form textarea {
	width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--oops-line); background: var(--oops-card); color: var(--oops-ink);
	font: 600 15px "Nunito", system-ui, sans-serif;
}
.oops-form textarea { min-height: 90px; resize: vertical; }
.oops-form input:focus, .oops-form textarea:focus { outline: 3px solid var(--oops-accent-soft); border-color: var(--oops-accent); }
.oops-alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 700; margin-top: 16px; }
.oops-alert.bad { background: var(--oops-chip-bg); color: var(--oops-chip); }
.oops-alert.good { background: var(--oops-accent-soft); color: var(--oops-ink); }
