/* Three tasks, three stages. No colour carries right or wrong: a chosen box
   gets an outline, and the dimension-shift task says "Right" or "Wrong" in
   words, as the published task gives feedback. */

.cb-note { font-size: 13.5px; color: var(--text-soft); }
.cb-part { margin: 36px 0 0; }
.cb-part h2 { margin: 0 0 8px; font-size: 21px; }
/* The status line sits below the pause button, which the shared layout pins to the top right. */
.cb-stage { cursor: default; padding-top: 58px; }
.cb-status { margin: 0; min-height: 1.4em; font-size: 14.5px; color: var(--text-soft); text-align: center; max-width: 36em; }
.cb-stage[data-odak-state="running"] .odak-stage-msg { display: none; }

/* Paired associates: eight boxes on a ring, the probe in the middle. */
.pal-ring { position: relative; width: min(340px, 80vw); aspect-ratio: 1; }
.pal-box {
	position: absolute;
	width: 19%;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	padding: 6%;
	border: 2px solid var(--border);
	border-radius: 10px;
	background: var(--text-soft);
	cursor: pointer;
	touch-action: manipulation;
}
.pal-box:disabled { cursor: default; opacity: 1; }
.pal-box.is-open { background: var(--surface); }
.pal-box.is-chosen { outline: 3px solid var(--accent); outline-offset: 2px; }
.pal-box:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pal-box svg, .pal-center svg { display: block; width: 100%; height: 100%; }
.pal-center {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 26%;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	padding: 4%;
	border-radius: 12px;
}
.pal-center:not(:empty) { background: var(--surface); border: 2px solid var(--border); }

/* Tower: pegs that hold three, two and one ball. */
.tower-boards { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 12px 32px; }
.cb-stage:not([data-odak-state="running"]) .tower-boards,
.cb-stage:not([data-odak-state="running"]) .ied-pair { display: none; }
.tower-figure { margin: 0; text-align: center; }
.tower-figure figcaption { font-size: 13.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.tower-board {
	--slot: 40px;
	display: flex;
	gap: 10px;
	padding: 10px 12px 0;
	border-bottom: 6px solid var(--text-soft);
	border-radius: 4px;
}
.tower-board.is-goal { --slot: 28px; gap: 6px; }
.tower-peg {
	position: relative;
	width: calc(var(--slot) * 1.8);
	height: calc(var(--slot) * 3.6);
	padding: 0;
	border: 0;
	background: transparent;
	font: inherit;
	color: inherit;
}
button.tower-peg { cursor: pointer; border-radius: 8px; touch-action: manipulation; }
@media (hover: hover) {
	button.tower-peg:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
}
button.tower-peg:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tower-rod {
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 8px;
	transform: translateX(-50%);
	border-radius: 4px 4px 0 0;
	background: var(--text-soft);
}
.tower-peg.cap-3 .tower-rod { height: calc(var(--slot) * 3.2); }
.tower-peg.cap-2 .tower-rod { height: calc(var(--slot) * 2.2); }
.tower-peg.cap-1 .tower-rod { height: calc(var(--slot) * 1.2); }
.tower-stack { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column-reverse; align-items: center; }
.tower-ball {
	position: relative;
	width: var(--slot);
	height: var(--slot);
	border-radius: 50%;
	border: 2px solid rgb(0 0 0 / 0.25);
}
.tower-ball::after { content: ""; position: absolute; inset: 30%; background: #fff; }
.ball-r { background: #dc2626; }
.ball-r::after { border-radius: 50%; }
.ball-g { background: #16a34a; }
.ball-g::after { inset: 26% 26% 30%; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ball-b { background: #2563eb; }
.tower-ball.is-lifted { transform: translateY(-14px); outline: 3px solid var(--accent); outline-offset: 2px; }

/* Dimension shift: two boxes on a dark ground, so the white lines show in
   both themes. */
.ied-pair { display: flex; gap: 18px; justify-content: center; width: 100%; }
.ied-box {
	width: min(42%, 190px);
	aspect-ratio: 1;
	padding: 12px;
	border: 2px solid var(--border);
	border-radius: 12px;
	background: #1f2433;
	cursor: pointer;
	touch-action: manipulation;
}
.ied-box:disabled { cursor: default; opacity: 1; }
.ied-box svg { display: block; width: 100%; height: 100%; }
.ied-box.is-chosen { outline: 3px solid var(--accent); outline-offset: 3px; }
.ied-box:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.ied-feedback { margin: 0; min-height: 1.6em; font-size: 20px; font-weight: 700; text-align: center; }

@media (prefers-reduced-motion: reduce) {
	.tower-ball.is-lifted { transform: none; }
}
