/* Bunny's Angle Adventure - math10.com. Everything is scoped to the game root (#bunny-angles.ba).
   Colours, type and the m10- components follow the Math10 design system. */
.ba {
	--ba-paper: #ffffff; --ba-sunken: #f7f7f7; --ba-panel: #caddf6; --ba-panel-line: #d8e6fc;
	--ba-line: #e6e6e6; --ba-line-strong: #8b8f94; --ba-ink: #1a1a1a; --ba-muted: #444746;
	--ba-orange: #ee6600; --ba-orange-text: #9a4200; --ba-orange-soft: #fff1e6;
	--ba-blue: #006699; --ba-blue-strong: #004d73; --ba-blue-soft: #e6f0f8;
	--ba-lime: #b2df5d; --ba-lime-soft: #edf8da;
	--ba-correct: #1f5bb8; --ba-correct-soft: #e3ecfa; --ba-wrong: #b3261e; --ba-wrong-soft: #fbe4e1;
	--ba-font: Onest, Verdana, system-ui, -apple-system, "Segoe UI", sans-serif;
	font-family: var(--ba-font); font-size: 17px; line-height: 28px; color: var(--ba-ink);
	margin: 16px 0 24px; min-height: 420px; text-align: left;
}
.ba *, .ba *::before, .ba *::after { box-sizing: border-box; }
.ba p { margin: 0; }
.ba [hidden] { display: none !important; }
.ba :focus-visible { outline: 2px solid var(--ba-blue-strong); outline-offset: 2px; }

/* ---------- Math10 components (scoped copies) ---------- */
.ba .m10-btn {
	font: inherit; font-size: 14px; line-height: 20px; font-weight: 600; min-height: 44px; margin: 0;
	padding: 0 16px; border-radius: 8px; border: 1px solid var(--ba-line-strong); background: var(--ba-paper);
	color: var(--ba-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
	gap: 8px; text-decoration: none; -webkit-tap-highlight-color: transparent; white-space: normal; text-align: center;
}
.ba .m10-btn:hover { border-color: var(--ba-muted); }
.ba .m10-btn-primary { background: var(--ba-blue); border-color: var(--ba-blue); color: #ffffff; }
.ba .m10-btn-primary:hover { background: var(--ba-blue-strong); border-color: var(--ba-blue-strong); }
.ba .m10-btn-ghost { background: transparent; border-color: transparent; color: var(--ba-blue); }
.ba .m10-btn-ghost:hover { background: var(--ba-blue-soft); border-color: transparent; }
.ba .m10-btn:disabled { opacity: .5; cursor: not-allowed; }
.ba .m10-tag {
	display: inline-flex; align-items: center; gap: 4px; font-size: 13px; line-height: 18px; font-weight: 500;
	letter-spacing: .02em; padding: 2px 8px; border-radius: 4px; background: var(--ba-sunken); color: var(--ba-muted);
}
.ba .m10-tag-new { background: var(--ba-lime); color: #1a1a1a; }
.ba .m10-feedback {
	display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 12px;
	font-size: 15px; line-height: 24px; color: var(--ba-ink);
}
.ba .m10-feedback-icon {
	flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
	font-weight: 700; font-size: 14px; line-height: 1;
}
.ba .m10-feedback strong { display: block; font-weight: 600; }
.ba .m10-feedback-correct { background: var(--ba-correct-soft); }
.ba .m10-feedback-correct .m10-feedback-icon { background: var(--ba-correct); color: var(--ba-correct-soft); }
.ba .m10-feedback-correct strong { color: var(--ba-correct); }
.ba .m10-feedback-wrong { background: var(--ba-wrong-soft); }
.ba .m10-feedback-wrong .m10-feedback-icon { background: var(--ba-wrong); color: var(--ba-wrong-soft); }
.ba .m10-feedback-wrong strong { color: var(--ba-wrong); }
.ba .m10-panel { background: var(--ba-paper); border: 1px solid var(--ba-panel-line); border-radius: 12px; overflow: hidden; }
.ba .m10-panel-head { background: var(--ba-panel); padding: 8px 16px; }
.ba .ba-panel-title { font-size: 18px; line-height: 26px; font-weight: 700; color: var(--ba-orange-text); }
.ba .m10-panel-body { padding: 12px 16px 16px; font-size: 15px; line-height: 24px; }
.ba .m10-answer { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.ba .m10-field { display: flex; flex-direction: column; gap: 4px; }
.ba .m10-field label { font-size: 14px; line-height: 20px; font-weight: 600; }
.ba .m10-input {
	font: inherit; font-size: 17px; min-height: 44px; margin: 0; padding: 0 12px; width: 12em; max-width: 100%;
	border: 1px solid var(--ba-line-strong); border-radius: 8px; background: var(--ba-paper); color: var(--ba-ink);
}
.ba .m10-input:focus-visible { outline: 2px solid var(--ba-blue-strong); outline-offset: 2px; }
.ba .m10-answer .m10-btn { margin-top: 24px; }
.ba .m10-hint { font-size: 13px; line-height: 18px; color: var(--ba-muted); }

/* ---------- the game card ---------- */
.ba-card {
	border: 1px solid var(--ba-panel-line); border-radius: 12px; overflow: hidden; background: var(--ba-paper);
	box-shadow: 0 1px 2px rgba(26, 31, 39, .06), 0 2px 8px rgba(26, 31, 39, .04);
}
.ba-h2 { font-size: 20px; line-height: 28px; font-weight: 700; color: var(--ba-orange-text); }
.ba-h3 { font-size: 18px; line-height: 26px; font-weight: 600; }
.ba-h4 { font-size: 17px; line-height: 24px; font-weight: 600; }
.ba-h3, .ba-h4, .ba-line, .ba-xbody p { overflow-wrap: anywhere; }
.ba-over { font-size: 13px; line-height: 18px; font-weight: 500; letter-spacing: .02em; color: var(--ba-muted); text-transform: uppercase; }
.ba-stars { display: inline-flex; gap: 2px; flex: none; }

/* stage menu */
.ba-band {
	background: var(--ba-panel); padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center;
	justify-content: space-between; gap: 12px;
}
.ba-totals { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 15px; line-height: 24px; }
.ba-tot { display: inline-flex; align-items: center; gap: 6px; }
.ba-tot b { font-weight: 600; }
.ba .ba-snd { min-width: 44px; padding: 0 10px; }
.ba-body { padding: 24px; display: flex; flex-direction: column; gap: 32px; }
.ba-stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.ba-stage {
	display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--ba-line);
	border-radius: 12px; background: var(--ba-paper); min-width: 0;
}
.ba-stage.ba-cur { padding: 15px; border: 2px solid var(--ba-blue); }
.ba-stage.ba-cur .ba-over { color: var(--ba-blue); }
.ba-stage-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ba-icon { height: 96px; background: var(--ba-blue-soft); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.ba-icon svg { width: 100%; max-width: 132px; height: 88px; }
.ba-line { font-size: 15px; line-height: 24px; color: var(--ba-muted); flex-grow: 1; }
.ba-prog { display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 18px; color: var(--ba-muted); }
.ba-bar { height: 6px; border-radius: 999px; background: var(--ba-sunken); overflow: hidden; }
.ba-bar > div { height: 6px; background: var(--ba-blue); }
.ba .ba-small { min-height: 36px; font-size: 13px; }
.ba-more { display: flex; flex-direction: column; gap: 16px; }
.ba-extras { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.ba-extra { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--ba-line); border-radius: 12px; min-width: 0; }
.ba-extra.ba-cur { padding: 15px; border: 2px solid var(--ba-blue); }
.ba-xicon {
	flex: none; width: 44px; height: 44px; border-radius: 8px; background: var(--ba-orange-soft); color: var(--ba-orange-text);
	display: flex; align-items: center; justify-content: center;
}
.ba-xbody { display: flex; flex-direction: column; gap: 4px; flex-grow: 1; min-width: 0; }
.ba-xbody p { font-size: 15px; line-height: 22px; color: var(--ba-muted); }
.ba-xbody p.ba-info { font-size: 14px; line-height: 20px; color: var(--ba-ink); font-weight: 500; }
.ba-xbtns { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 4px; }
.ba .ba-linkbtn {
	border-color: transparent; background: transparent; color: #0275d8; padding: 0 8px; margin-left: -8px;
	text-decoration: underline; text-underline-offset: 3px;
}
.ba .ba-linkbtn:hover { background: var(--ba-blue-soft); border-color: transparent; color: var(--ba-blue-strong); }
.ba-how { background: var(--ba-sunken); border-radius: 12px; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.ba-how ol { margin: 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 24px; }
.ba-how li { margin: 0; padding: 0; }
.ba-how b { font-weight: 600; }
.ba-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; line-height: 20px; }
.ba-chips-label { font-weight: 600; margin-right: 4px; }
.ba-chip { background: var(--ba-paper); border: 1px solid var(--ba-line); border-radius: 999px; padding: 4px 12px; }

/* a search */
.ba-play { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.ba-top { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 44px; flex-wrap: wrap; }
.ba-top-l, .ba-top-r { display: flex; align-items: center; gap: 12px; }
.ba-top-r { gap: 20px; }
.ba .ba-back { padding: 0 10px; }
.ba-name { font-size: 15px; line-height: 24px; font-weight: 600; }
.ba-dots { display: flex; align-items: center; gap: 6px; }
.ba-dot {
	width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ba-line-strong); flex: none;
	display: inline-block;
}
.ba-dot-done { border: 0; background: var(--ba-orange); }
.ba-dot-miss {
	width: 14px; height: 14px; border: 0; background: var(--ba-wrong); color: #ffffff; font-size: 9px; line-height: 14px;
	font-weight: 700; text-align: center;
}
.ba-dot-cur { width: 14px; height: 14px; border: 3px solid var(--ba-blue); background: var(--ba-blue-soft); }
.ba-count, .ba-timer { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; line-height: 24px; }
.ba-count b, .ba-timer b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ba-timer { color: var(--ba-orange-text); }
.ba-banner { font-size: 14px; line-height: 20px; padding: 6px 12px; border-radius: 8px; background: var(--ba-orange-soft); color: var(--ba-orange-text); font-weight: 500; }
.ba-banner-info { background: var(--ba-sunken); color: var(--ba-muted); }
.ba-prompt { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.ba-ask { font-size: 20px; line-height: 28px; font-weight: 600; }
.ba-target { font-size: 34px; line-height: 42px; font-weight: 700; color: var(--ba-orange-text); }
.ba-target.ba-target-long { font-size: 26px; line-height: 34px; }
.ba-searchof { font-size: 14px; line-height: 20px; color: var(--ba-muted); white-space: nowrap; }
.ba-fieldwrap { position: relative; }
.ba-field {
	display: block; width: 100%; height: auto; border: 1px solid var(--ba-line); border-radius: 12px; background: #ffffff;
	touch-action: none; cursor: pointer; -webkit-user-select: none; user-select: none; overflow: hidden;
	-webkit-tap-highlight-color: transparent;
}
.ba .ba-field { overflow: hidden; }
.ba-field.ba-ro { cursor: default; touch-action: auto; }
.ba-field:focus-visible { outline: 2px solid var(--ba-blue-strong); outline-offset: 2px; }
.ba-field text { font-family: var(--ba-font); }
.ba-sl { font-size: 13px; font-weight: 500; fill: var(--ba-muted); text-anchor: middle; dominant-baseline: central; }
.ba-scale text, .ba-marks text { font-size: 13px; font-weight: 500; text-anchor: middle; dominant-baseline: central; }
.ba-scale[font-weight="700"] text { font-weight: 700; }
.ba-marks text { font-size: 15px; font-weight: 600; fill: var(--ba-muted); }
.ba-svg-l, .ba-badge text, .ba-legend text {
	font-size: 15px; font-weight: 700; dominant-baseline: central;
	paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round;
}
.ba-svg-l, .ba-badge text { text-anchor: middle; }
.ba-badge text { stroke: none; }
.ba-legend text { font-size: 14px; font-weight: 600; }
.ba-controls { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.ba-turns { display: flex; gap: 8px; flex: none; }
.ba .ba-turns .m10-btn { min-width: 56px; font-variant-numeric: tabular-nums; }
.ba-hint { flex: 1 1 220px; font-size: 14px; line-height: 20px; color: var(--ba-muted); text-align: right; }
.ba-phone-hint { display: none; font-size: 14px; line-height: 20px; color: var(--ba-muted); text-align: center; }
.ba-after { display: flex; align-items: center; gap: 16px; }
.ba-after .ba-next { flex: none; }
.ba-fb { flex: 1 1 auto; min-width: 0; }
.ba-fb:empty { display: none; }
.ba-answerrow { align-items: flex-start; }
.ba-last { min-height: 24px; font-size: 15px; line-height: 24px; color: var(--ba-muted); }

/* dash: countdown and the +n toast */
.ba-overlay {
	position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
	background: rgba(255, 255, 255, .78); border-radius: 12px; color: var(--ba-orange-text); pointer-events: none;
}
.ba-ready { font-size: 20px; line-height: 28px; font-weight: 600; }
.ba-count3 { font-size: 96px; line-height: 104px; font-weight: 700; }
.ba-toast-host { position: absolute; left: 0; right: 0; top: 10px; display: flex; justify-content: center; pointer-events: none; }
.ba-toast {
	padding: 2px 14px; border-radius: 999px; font-size: 18px; line-height: 28px; font-weight: 700;
	animation: ba-fade 1s ease-out forwards;
}
.ba-toast-ok { background: var(--ba-orange); color: #1a1a1a; }
.ba-toast-no { background: var(--ba-wrong-soft); color: var(--ba-wrong); border: 1.5px solid var(--ba-wrong); }

/* results */
.ba-res { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.ba-res-main { display: flex; gap: 32px; }
.ba-res-left { width: 340px; flex: none; display: flex; flex-direction: column; gap: 20px; }
.ba-res-right { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ba-res-title { font-size: 34px; line-height: 42px; font-weight: 700; letter-spacing: -.01em; margin-top: 4px; }
.ba-res-title:focus { outline: none; }
.ba-score { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 12px; background: var(--ba-orange-soft); }
.ba-score-row { display: flex; align-items: center; gap: 12px; }
.ba-score-row p { font-size: 20px; line-height: 28px; }
.ba-score-row b { font-size: 40px; line-height: 48px; font-weight: 700; }
.ba-note { font-size: 15px; line-height: 24px; color: var(--ba-muted); }
.ba-table-title { color: var(--ba-orange-text); font-weight: 700; font-size: 20px; line-height: 28px; }
.ba-tablewrap { overflow-x: auto; }
.ba-tablewrap-scroll { max-height: 420px; overflow-y: auto; }
.ba-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; font-variant-numeric: tabular-nums; margin: 0; border: 0; background: none; }
.ba-table th, .ba-table td { padding: 6px 10px; border: 0; border-bottom: 1px solid var(--ba-line); text-align: left; vertical-align: top; background: none; }
.ba-table thead th {
	font-size: 13px; line-height: 18px; font-weight: 500; letter-spacing: .02em; color: var(--ba-muted);
	text-transform: uppercase; border-bottom-color: var(--ba-line-strong); padding-top: 8px; padding-bottom: 8px;
}
.ba-table .ba-num { text-align: right; }
.ba-table .ba-c { font-weight: 600; }
.ba-table tfoot th, .ba-table tfoot td { border-bottom: 0; padding-top: 10px; font-weight: 700; }
.ba-table tr.ba-row-miss td { background: var(--ba-wrong-soft); }
.ba-rowtag { font-size: 13px; font-weight: 600; color: var(--ba-wrong); margin-left: 4px; white-space: nowrap; }
.ba-res-btns { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }

/* ---------- animation ---------- */
.ba-dirt { display: none; }
.ba-digging .ba-dirt { display: inline; }
.ba-digging .ba-bunny-art { animation: ba-hop .6s ease-in-out; }
.ba-digging .ba-d1 { animation: ba-dirt1 .6s ease-out; }
.ba-digging .ba-d2 { animation: ba-dirt2 .6s ease-out; }
.ba-digging .ba-d3 { animation: ba-dirt3 .6s ease-out; }
.ba-pop { transform-box: fill-box; transform-origin: 50% 100%; animation: ba-pop .35s ease-out; }
@keyframes ba-hop { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-12px); } 50% { transform: translateY(0); } 75% { transform: translateY(-6px); } }
@keyframes ba-dirt1 { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(-16px, -18px); opacity: 0; } }
@keyframes ba-dirt2 { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(16px, -16px); opacity: 0; } }
@keyframes ba-dirt3 { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(2px, -24px); opacity: 0; } }
@keyframes ba-pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ba-fade { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
	.ba *, .ba *::before, .ba *::after { animation: none !important; transition: none !important; }
	.ba-toast { opacity: 1; }
}

/* ---------- narrow (under 760 px): results stack ---------- */
.ba-narrow .ba-res-main { flex-direction: column; gap: 24px; }
.ba-narrow .ba-res-left { width: auto; }

/* ---------- phone (under 600 px) ---------- */
.ba-phone { font-size: 17px; }
.ba-phone .ba-band { padding: 12px 16px; }
.ba-phone .ba-body { padding: 16px; gap: 24px; }
.ba-phone .ba-stages { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.ba-phone .ba-stage { padding: 12px; gap: 10px; }
.ba-phone .ba-stage.ba-cur { padding: 11px; }
.ba-phone .ba-how { padding: 16px; }
.ba-phone .ba-play { padding: 16px; gap: 14px; }
.ba-phone .ba-play .ba-top {
	display: grid; grid-template-columns: 44px 1fr auto auto; grid-template-areas: "back name count snd" "dots dots dots dots";
	gap: 8px 8px; align-items: center;
}
.ba-phone .ba-top-l, .ba-phone .ba-top-r { display: contents; }
.ba-phone .ba-back { grid-area: back; min-width: 44px; padding: 0; font-size: 22px; }
.ba-phone .ba-name { grid-area: name; text-align: center; }
.ba-phone .ba-count { grid-area: count; }
.ba-phone .ba-timer { grid-area: dots; justify-self: center; font-size: 17px; }
.ba-phone .ba-snd { grid-area: snd; }
.ba-phone .ba-dots { grid-area: dots; justify-content: center; gap: 8px; }
.ba-phone .ba-wide-label {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.ba-phone .ba-prompt { flex-direction: column; align-items: center; text-align: center; gap: 0; }
.ba-phone .ba-ask { display: flex; flex-direction: column; align-items: center; font-size: 15px; line-height: 22px; font-weight: 400; color: var(--ba-muted); }
.ba-phone .ba-target { font-size: 44px; line-height: 52px; }
.ba-phone .ba-target.ba-target-long { font-size: 24px; line-height: 32px; }
.ba-phone .ba-searchof { display: none; }
.ba-phone .ba-phone-hint { display: block; }
.ba-phone .ba-hint { display: none; }
.ba-phone .ba-controls { flex-direction: column; align-items: stretch; gap: 12px; }
.ba-phone .ba-turns { gap: 12px; }
.ba-phone .ba-turns .m10-btn { flex: 1; min-height: 48px; font-size: 17px; }
.ba-phone .ba-t10 { display: none; }
.ba-phone .ba-dig { min-height: 56px; font-size: 18px; }
.ba-phone .ba-after { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
.ba-phone .ba-next { min-height: 56px; font-size: 18px; }
.ba-phone .m10-answer { flex-direction: column; align-items: stretch; }
.ba-phone .m10-input { width: 100%; }
.ba-phone .m10-answer .m10-btn { margin-top: 0; min-height: 56px; font-size: 18px; }
.ba-phone .ba-res { padding: 16px; }
.ba-phone .ba-res-title { font-size: 28px; line-height: 36px; }
.ba-phone .ba-res-btns { flex-direction: column-reverse; }
.ba-phone .ba-res-btns .m10-btn { width: 100%; min-height: 48px; }
.ba-phone .ba-table th, .ba-phone .ba-table td { padding: 6px 4px; }
.ba-phone .ba-table { font-size: 14px; }
.ba-phone .ba-table thead th { font-size: 11px; line-height: 14px; letter-spacing: 0; text-transform: none; }
.ba-phone .ba-off { display: none; }
.ba-phone .ba-rowtag { display: block; margin-left: 0; white-space: normal; font-size: 12px; line-height: 16px; }
/* the playfield on phones: bigger numbers, labels and lines (the viewBox is cropped in the script) */
.ba-phone .ba-scale text { font-size: 19px; }
.ba-phone .ba-sl { font-size: 21px; }
.ba-phone .ba-marks text { font-size: 24px; }
.ba-phone .ba-field path[stroke-width="3"] { stroke-width: 4.5; }
