/* Damos en el Blanco · paquet Fable 2026-11 · lot E · delit.
 * Joc de la diana i marcador (E1/E3), píndola del 28-D (E5), bloc del 404 (E7)
 * i detector de fum (T1). Només tokens del DS. Classes pròpies: .deb-egg-*.
 * Es carrega al <head> on es veu alguna cosa en obrir la pàgina (detector, 404,
 * 28-D); per al joc, el porta s11-eggs.js en obrir-lo. */

.deb-egg-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

html.deb-egg-lock { overflow: hidden; }

/* ------------------------------------------------------------- E1 · joc -- */
.deb-egg-game {
	position: fixed;
	inset: 0;
	z-index: 1000001; /* per sobre del banner de galetes i del mode sense fum */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-4);
}
.deb-egg-game[hidden] { display: none; }
.deb-egg-game__backdrop {
	position: absolute;
	inset: 0;
	background: var(--overlay, rgba(15, 15, 15, .72));
}
.deb-egg-game__panel {
	position: relative;
	width: min(520px, 100%);
	max-height: calc(100vh - 2 * var(--space-4));
	max-height: calc(100dvh - 2 * var(--space-4));
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--bg, #1f1f1f);
	color: var(--text);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-lg);
	padding: var(--space-6);
	box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}
.deb-egg-game__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-4);
}
.deb-egg-game__t {
	margin: 0;
	font-family: var(--font-display);
	font-weight: var(--fw-medium);
	font-size: var(--text-xl);
	line-height: var(--leading-snug);
	letter-spacing: var(--tracking-tight);
	color: var(--text-strong);
}
.deb-egg-game__x {
	flex: none;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid var(--border);
	border-radius: var(--radius-pill);
	color: var(--text-strong);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
.deb-egg-game__x:hover { border-color: var(--border-strong); }
.deb-egg-game__intro,
.deb-egg-game__how {
	margin: var(--space-2) 0 0;
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	line-height: var(--leading-normal);
	color: var(--text-muted);
}
.deb-egg-game__intro { color: var(--text); font-family: var(--font-sans); font-size: var(--text-base); margin-top: var(--space-3); }
.deb-egg-game__board {
	width: min(300px, 100%);
	aspect-ratio: 1;
	margin: var(--space-5) auto var(--space-3);
	cursor: crosshair;
	touch-action: manipulation;
	-webkit-user-select: none;
	user-select: none;
}
.deb-egg-game__board svg { display: block; width: 100%; height: 100%; overflow: visible; }
.deb-egg-game__ring { fill: none; stroke: var(--text-strong, #fff); stroke-width: 2; }
.deb-egg-game__ring--mid { fill: rgba(255, 255, 255, .06); }
.deb-egg-game__ring--in { fill: rgba(255, 255, 255, .14); }
.deb-egg-game__bull { fill: var(--text-strong, #fff); }
.deb-egg-game__sight circle,
.deb-egg-game__sight path { fill: none; stroke: var(--text-strong, #fff); stroke-width: 2.5; }
.deb-egg-game__sight circle { stroke-dasharray: 3 3; }
.deb-egg-game__dart circle { fill: var(--bg, #1f1f1f); stroke: var(--text-strong, #fff); stroke-width: 2.5; }
.deb-egg-game__dart { animation: debEggDart .22s cubic-bezier(.2, .7, .2, 1); transform-box: fill-box; }
@keyframes debEggDart { from { opacity: 0; } to { opacity: 1; } }

.deb-egg-game__play {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
	flex-wrap: wrap;
}
.deb-egg-game__play[hidden],
.deb-egg-game__end[hidden] { display: none; }
.deb-egg-game__n {
	margin: 0;
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	color: var(--text-muted);
}
.deb-egg-game__verdict {
	margin: 0 0 var(--space-4);
	font-family: var(--font-display);
	font-weight: var(--fw-medium);
	font-size: var(--text-lg);
	line-height: var(--leading-snug);
	color: var(--text-strong);
}
.deb-egg-game__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.deb-egg-game__st { min-height: 1.4em; margin: var(--space-2) 0 0; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.deb-egg-game__contact {
	margin-top: var(--space-6);
	padding-top: var(--space-5);
	border-top: 1px solid var(--border);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
}
.deb-egg-game__contact p { margin: 0; font-family: var(--font-display); font-size: var(--text-md); color: var(--text-strong); }
.deb-egg-game :focus-visible { outline: none; box-shadow: var(--ring-focus, 0 0 0 2px rgba(255, 255, 255, .75)); }

/* ------------------------------------------------------- E3 · marcador -- */
.deb-egg-score {
	margin-top: var(--space-6);
	padding-top: var(--space-5);
	border-top: 1px solid var(--border);
}
.deb-egg-score[hidden] { display: none; }
.deb-egg-score__t {
	margin: 0;
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	font-weight: var(--fw-regular);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	color: var(--text-strong);
}
.deb-egg-score__p { margin: var(--space-1) 0 var(--space-3); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.deb-egg-score__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.deb-egg-score__it {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	color: var(--text-subtle);
}
.deb-egg-score__it.is-on { color: var(--text-strong); }
.deb-egg-score__dot {
	flex: none;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 1.5px solid currentColor;
}
.deb-egg-score__it.is-on .deb-egg-score__dot { background: currentColor; box-shadow: inset 0 0 0 2px var(--bg, #1f1f1f); }
.deb-egg-score__all {
	margin-top: var(--space-4);
	padding: var(--space-4);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-md);
}
.deb-egg-score__all p { margin: 0 0 var(--space-3); color: var(--text); }
.deb-egg-score__all .deb-egg-score__all-t { font-family: var(--font-display); font-size: var(--text-lg); color: var(--text-strong); margin-bottom: var(--space-2); }

/* -------------------------------------------------------- E5 · amb fum -- */
.deb-egg-pill {
	position: fixed;
	left: var(--space-4);
	bottom: var(--space-4);
	z-index: 90;
	max-width: calc(100vw - 2 * var(--space-4));
	padding: 9px 14px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-pill);
	background: var(--surface, #262625);
	color: var(--text-strong);
	font-family: var(--font-mono);
	font-size: var(--text-2xs);
	letter-spacing: .04em;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
	transition: background var(--dur-fast, .15s) ease, color var(--dur-fast, .15s) ease;
}
.deb-egg-pill:hover { background: var(--surface-hover, #363634); }
.deb-egg-pill.is-on { background: var(--accent, #fff); color: var(--accent-ink, #1f1f1f); border-color: transparent; }
.deb-egg-pill:focus-visible { outline: none; box-shadow: var(--ring-focus, 0 0 0 2px rgba(255, 255, 255, .75)); }
.deb-egg-fum { font-style: italic; }

/* ---------------------------------------------------------- E7 · 404 ---- */
.deb-egg-404 { padding: 0 var(--page-margin) var(--section-y, var(--space-24)); }
.deb-egg-404__in {
	max-width: 760px;
	margin: 0;
	padding-top: var(--space-10);
	border-top: 1px solid var(--border);
	text-align: left;
}
.deb-egg-404__t {
	margin: 0 0 var(--space-3);
	font-family: var(--font-display);
	font-weight: var(--fw-medium);
	font-size: var(--text-xl);
	line-height: var(--leading-snug);
	color: var(--text-strong);
}
.deb-egg-404__d { margin: 0 0 var(--space-4); color: var(--text-muted); max-width: 60ch; }
.deb-egg-404__prompt {
	margin: 0;
	padding: var(--space-4) var(--space-5);
	white-space: pre-wrap;
	word-break: break-word;
	background: var(--surface-inset, #171716);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	line-height: var(--leading-relaxed);
	color: var(--text);
}
.deb-egg-404__prompt:focus-visible { outline: none; box-shadow: var(--ring-focus, 0 0 0 2px rgba(255, 255, 255, .75)); }
.deb-egg-404__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-4); }
.deb-egg-404__status { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.deb-egg-404__or { margin: var(--space-6) 0 0; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-muted); }

/* ----------------------------------------------------- T1 · detector ---- */
.deb-egg-det { margin-top: clamp(2.5rem, 6vw, 4.5rem); max-width: 72rem; min-width: 0; }
.deb-egg-det__form { display: grid; gap: var(--space-3); }
.deb-egg-det__label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	color: var(--text-strong);
}
.deb-egg-det__in {
	width: 100%;
	min-height: 11rem;
	resize: vertical;
	font-family: var(--font-sans);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
	padding: var(--space-4);
}
.deb-egg-det__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.deb-egg-det__priv { margin: 0; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.deb-egg-det__out { margin-top: var(--space-10); scroll-margin-top: 110px; }
.deb-egg-det__out[hidden] { display: none; }
.deb-egg-det__count {
	margin: 0 0 var(--space-2);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	color: var(--text-muted);
}
.deb-egg-det__level {
	margin: 0;
	font-family: var(--font-display);
	font-weight: var(--fw-medium);
	font-size: var(--display-3, 2.25rem);
	line-height: var(--leading-tight);
	letter-spacing: var(--tracking-tight);
	color: var(--text-strong);
}
.deb-egg-det__level:focus { outline: none; }
.deb-egg-det__desc { margin: var(--space-3) 0 0; max-width: 60ch; color: var(--text); font-size: var(--text-md); line-height: var(--leading-normal); }
.deb-egg-det__text {
	margin-top: var(--space-6);
	padding: var(--space-5);
	background: var(--surface-inset, #171716);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	white-space: pre-wrap;
	word-break: break-word;
	line-height: 1.8;
	color: var(--text);
	max-height: 26rem;
	overflow-y: auto;
}
.deb-egg-det__text:focus-visible { outline: none; box-shadow: var(--ring-focus, 0 0 0 2px rgba(255, 255, 255, .75)); }
.deb-egg-det__mark {
	background: var(--accent, #fff);
	color: var(--accent-ink, #1f1f1f);
	padding: .05em .2em;
	border-radius: 2px;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}
.deb-egg-det__ft {
	margin: var(--space-8) 0 var(--space-3);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	font-weight: var(--fw-regular);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	color: var(--text-strong);
}
.deb-egg-det__found { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--border); }
.deb-egg-det__row {
	display: grid;
	grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
	gap: var(--space-2) var(--space-6);
	padding: var(--space-3) 0;
	border-bottom: 1px solid var(--border);
}
.deb-egg-det__row dt { font-family: var(--font-display); font-size: var(--text-md); color: var(--text-strong); }
.deb-egg-det__x { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.deb-egg-det__row dd { margin: 0; color: var(--text); }
.deb-egg-det__ml {
	display: block;
	font-family: var(--font-mono);
	font-size: var(--text-2xs);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	color: var(--text-subtle);
}
.deb-egg-det__none { margin: 0; color: var(--text-muted); }
.deb-egg-det__share { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); margin-top: var(--space-6); }
.deb-egg-det__st { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }

@media (max-width: 640px) {
	.deb-egg-game { align-items: flex-end; padding: 0; }
	.deb-egg-game__panel { width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 100vh; max-height: 100dvh; padding: var(--space-5) var(--space-4); }
	.deb-egg-game__board { width: min(260px, 100%); }
	.deb-egg-det__row { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
	.deb-egg-game__dart { animation: none; }
	.deb-egg-pill { transition: none; }
}
