.cbtts {
	--ink: #1F2A33;
	--muted: #5B6670;
	--road: #EEF1F3;
	--line: #D5DBE0;
	--hard: #C62828;
	--easy: #1565C0;
	--neutral: #8A949C;
	--bg: #FFFFFF;
	font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 17px;
	line-height: 1.5;
	color: var(--ink);
	background: var(--bg);
	max-width: 760px;
	margin: 0 auto;
	box-sizing: border-box;
	padding: 0 16px 24px;
	font-variant-numeric: tabular-nums;
}
.cbtts *, .cbtts *::before, .cbtts *::after { box-sizing: border-box; }
.cbtts p { margin: 0; }
.cbtts a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.cbtts :focus-visible { outline: 3px solid var(--easy); outline-offset: 2px; }
.cbtts .cbtts-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cbtts .cbtts-title {
	font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
	font-weight: 700; font-size: clamp(34px, 7vw, 52px); line-height: 1.02;
	letter-spacing: -0.01em; margin: 20px 0 10px; max-width: 16ch; color: var(--ink);
}
.cbtts .cbtts-lede { margin-bottom: 18px; max-width: 60ch; }

/* Buttons */
.cbtts .cbtts-btn {
	font: 600 16px/1 "Barlow", system-ui, sans-serif; min-height: 48px; padding: 0 20px;
	border: 2px solid var(--ink); border-radius: 4px; background: var(--ink); color: #fff; cursor: pointer;
}
.cbtts .cbtts-btn--line { background: #fff; color: var(--ink); }

/* Pickers */
.cbtts .cbtts-pick { display: grid; gap: 12px; margin-bottom: 20px; }
@media (min-width: 600px) { .cbtts .cbtts-pick { grid-template-columns: 1fr 1fr; align-items: end; } .cbtts .cbtts-go { grid-column: 1 / -1; justify-self: start; } }
.cbtts .cbtts-field { position: relative; }
.cbtts .cbtts-field label { display: block; font-weight: 600; margin-bottom: 4px; }
.cbtts .cbtts-field select,
.cbtts .cbtts-field input {
	width: 100%; min-height: 48px; padding: 0 12px; font: 400 17px "Barlow", system-ui, sans-serif; color: var(--ink);
	background: #fff; border: 2px solid var(--ink); border-radius: 4px;
}
.cbtts .cbtts-field input { padding-right: 40px; }
.cbtts .cbtts-field[data-field="a"] label::before,
.cbtts .cbtts-field[data-field="b"] label::before {
	display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 3px;
	background: var(--ink); color: #fff; font: 700 14px "Barlow Condensed", "Arial Narrow", sans-serif; vertical-align: 1px;
}
.cbtts .cbtts-field[data-field="a"] label::before { content: "A"; }
.cbtts .cbtts-field[data-field="b"] label::before { content: "B"; }
.cbtts .cbtts-clear {
	position: absolute; right: 4px; bottom: 4px; width: 40px; height: 40px; border: 0; background: none;
	font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer;
}
.cbtts .cbtts-list {
	position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px 0; list-style: none;
	max-height: 280px; overflow-y: auto; background: #fff; border: 2px solid var(--ink); border-radius: 4px;
}
.cbtts .cbtts-list li { padding: 10px 12px; cursor: pointer; }
.cbtts .cbtts-list li[aria-selected="true"] { background: var(--road); outline: 2px solid var(--easy); outline-offset: -2px; }
.cbtts .cbtts-list li.cbtts-empty { color: var(--muted); cursor: default; }

/* Result */
.cbtts .cbtts-verdict {
	font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; font-size: 26px; line-height: 1.15;
	margin: 0 0 16px;
}
.cbtts .cbtts-mod { background: var(--road); border-radius: 6px; padding: 16px; margin-bottom: 16px; }
.cbtts .cbtts-h3 {
	font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; font-size: 24px; line-height: 1.1; margin: 0 0 6px;
}
.cbtts .cbtts-h3 span { font-weight: 500; color: var(--muted); }
.cbtts .cbtts-win { font-weight: 600; margin-bottom: 14px; }
.cbtts .cbtts-win--none { font-weight: 400; color: var(--muted); }

.cbtts .cbtts-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cbtts .cbtts-side { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 12px 10px; min-width: 0; }
.cbtts .cbtts-side.is-win { border: 2px solid var(--ink); padding: 11px 9px; }
.cbtts .cbtts-name { font-weight: 600; font-size: 15px; line-height: 1.25; min-height: 2.5em; overflow-wrap: anywhere; }
.cbtts .cbtts-rate {
	font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; font-size: 44px; line-height: 1; margin: 6px 0 8px;
	color: var(--ink);
}
.cbtts .cbtts-side--above .cbtts-rate { color: var(--easy); }
.cbtts .cbtts-side--below .cbtts-rate { color: var(--hard); }
.cbtts .cbtts-rate--none { font-size: 28px; color: var(--muted); }

.cbtts .cbtts-bar { position: relative; height: 10px; background: var(--road); border-radius: 2px; margin-bottom: 8px; }
.cbtts .cbtts-bar i { display: block; height: 100%; border-radius: 2px; background: var(--neutral); }
.cbtts .cbtts-side--above .cbtts-bar i { background: var(--easy); }
.cbtts .cbtts-side--below .cbtts-bar i { background: var(--hard); }
.cbtts .cbtts-bar b, .cbtts .cbtts-nat b { position: absolute; top: -3px; width: 2px; height: 16px; margin-left: -1px; background: var(--ink); }

.cbtts .cbtts-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; min-height: 24px; }
.cbtts .cbtts-tag { font-size: 13px; font-weight: 600; line-height: 1; padding: 5px 6px; border-radius: 3px; border: 1px solid var(--line); color: var(--ink); }
.cbtts .cbtts-tag--win { background: var(--ink); border-color: var(--ink); color: #fff; }
.cbtts .cbtts-tag--small { border-style: dashed; border-color: var(--muted); }

.cbtts .cbtts-meta { margin: 0; font-size: 14px; color: var(--muted); }
.cbtts dl.cbtts-meta div { padding: 4px 0; border-top: 1px solid var(--line); }
.cbtts dl.cbtts-meta dt { margin: 0; font-size: 13px; line-height: 1.3; }
.cbtts dl.cbtts-meta dd { margin: 0; color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.3; }

.cbtts .cbtts-nat { position: relative; margin-top: 12px; padding-left: 12px; font-size: 15px; }
.cbtts .cbtts-nat b { left: 1px; top: 4px; }

/* Footer */
.cbtts .cbtts-foot { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; font-size: 15px; }
.cbtts .cbtts-source { color: var(--muted); margin-bottom: 16px; }
.cbtts .cbtts-source a { color: inherit; }
.cbtts .cbtts-embed { border: 1px solid var(--line); border-radius: 4px; padding: 0 14px; margin-bottom: 16px; }
.cbtts .cbtts-embed summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.cbtts .cbtts-embed[open] { padding-bottom: 14px; }
.cbtts .cbtts-embed p { margin-bottom: 8px; }
.cbtts .cbtts-embed textarea {
	display: block; width: 100%; font: 13px/1.4 ui-monospace, Consolas, monospace; color: var(--ink);
	background: var(--road); border: 1px solid var(--line); border-radius: 4px; padding: 8px; margin-bottom: 10px; resize: vertical;
}
.cbtts .cbtts-copied { margin-left: 10px; font-weight: 600; }
.cbtts .cbtts-credit { color: var(--ink); }

/* ---------- v0.2: colour, steps and the guess game ---------- */
/* Scene colours (not data): A = hi-vis yellow, B = signal orange. Data stays harder / neutral / easier. */
.cbtts { --hivis: #C8E63C; --a: #C8E63C; --b: #F28C28; --tarmac: #4A545E; }
.cbtts [hidden] { display: none !important; }

.cbtts .cbtts-step { display: flex; align-items: center; gap: 10px; font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; font-size: 22px; line-height: 1.2; margin: 0 0 10px; }
.cbtts .cbtts-stepnum { flex: 0 0 32px; width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: 18px; }

.cbtts .cbtts-chip { display: inline-grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; margin-right: 8px; border-radius: 6px; border: 2px solid var(--ink); color: var(--ink); font: 700 16px/1 "Barlow Condensed", "Arial Narrow", sans-serif; vertical-align: middle; }
.cbtts .cbtts-chip--a { background: var(--a); }
.cbtts .cbtts-chip--b { background: var(--b); }
.cbtts .cbtts-field[data-field="a"] label::before { background: var(--a); color: var(--ink); border: 2px solid var(--ink); }
.cbtts .cbtts-field[data-field="b"] label::before { background: var(--b); color: var(--ink); border: 2px solid var(--ink); }
.cbtts .cbtts-field[data-field="a"] input, .cbtts .cbtts-field[data-field="a"] select { box-shadow: inset 0 -4px 0 var(--a); }
.cbtts .cbtts-field[data-field="b"] input, .cbtts .cbtts-field[data-field="b"] select { box-shadow: inset 0 -4px 0 var(--b); }

/* "Start here" tag on the first picker, until something is picked. */
.cbtts .cbtts-start {
	position: absolute; right: 0; top: -6px; z-index: 2; padding: 4px 10px; border: 2px solid var(--ink); border-radius: 6px;
	background: var(--hivis); color: var(--ink); font: 700 15px/1.1 "Barlow Condensed", "Arial Narrow", sans-serif; letter-spacing: .03em; text-transform: uppercase;
	animation: cbtts-bob 1.4s ease-in-out infinite;
}
.cbtts .cbtts-start::after { content: ""; position: absolute; left: 18px; bottom: -8px; width: 10px; height: 10px; background: var(--hivis); border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.cbtts:not(.is-game) .cbtts-start, .cbtts.is-started .cbtts-start { display: none; }
@keyframes cbtts-bob { 50% { transform: translateY(-3px); } }

/* Step 2: guess */
.cbtts .cbtts-game { background: var(--tarmac); color: #fff; border-radius: 10px; padding: 16px; margin: 0 0 20px; }
.cbtts .cbtts-game .cbtts-step { color: #fff; }
.cbtts .cbtts-game .cbtts-stepnum { background: var(--hivis); color: var(--ink); }
.cbtts .cbtts-guesses { display: grid; gap: 10px; margin-bottom: 10px; }
@media (min-width: 600px) { .cbtts .cbtts-guesses { grid-template-columns: 1fr 1fr; } }
.cbtts .cbtts-guess {
	display: flex; align-items: center; min-height: 56px; padding: 8px 14px; text-align: left; cursor: pointer;
	font: 600 17px/1.25 "Barlow", system-ui, sans-serif; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 6px;
	box-shadow: 0 4px 0 var(--ink); transition: transform .1s ease, box-shadow .1s ease;
}
.cbtts .cbtts-guess--a:hover { background: #F1F8D2; }
.cbtts .cbtts-guess--b:hover { background: #FDE8D3; }
.cbtts .cbtts-guess:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.cbtts .cbtts-guess:focus-visible { outline: 3px solid var(--hivis); outline-offset: 3px; }
.cbtts .cbtts-skip { background: none; border: 0; padding: 8px 0; min-height: 44px; color: #fff; font: 500 15px "Barlow", system-ui, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cbtts .cbtts-skip:focus-visible { outline-color: var(--hivis); }

/* Step 3: reveal (hidden until a guess when JS runs) */
.cbtts.is-game:not(.is-revealed) .cbtts-reveal { display: none; }
.cbtts:not(.is-game) .cbtts-step--3 { display: none; }
.cbtts .cbtts-feedback { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 0 0 14px; border-radius: 8px; border: 2px solid var(--ink); font-weight: 700; font-size: 18px; line-height: 1.3; background: #fff; }
.cbtts .cbtts-feedback.is-right { background: #E3EDF8; }
.cbtts .cbtts-feedback.is-half, .cbtts .cbtts-feedback.is-none { background: var(--road); }
.cbtts .cbtts-feedback.is-wrong { background: #F9E5E5; }
.cbtts .cbtts-feedback-icon { flex: 0 0 32px; width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: 18px; }
.cbtts .cbtts-feedback.is-right .cbtts-feedback-icon { background: var(--easy); }
.cbtts .cbtts-feedback.is-wrong .cbtts-feedback-icon { background: var(--hard); }

.cbtts .cbtts-verdict { background: var(--ink); color: #fff; border-radius: 8px; padding: 14px 16px; }

/* Colourful cards and bars */
.cbtts .cbtts-side { border-top: 6px solid var(--line); }
.cbtts .cbtts-side--a { border-top-color: var(--a); }
.cbtts .cbtts-side--b { border-top-color: var(--b); }
.cbtts .cbtts-side.is-win { border-top-width: 6px; padding-top: 12px; }
.cbtts .cbtts-side.is-win.cbtts-side--a { border-top-color: var(--a); }
.cbtts .cbtts-side.is-win.cbtts-side--b { border-top-color: var(--b); }
.cbtts .cbtts-name { display: flex; align-items: flex-start; }
.cbtts .cbtts-name .cbtts-chip { margin-top: -1px; }
.cbtts .cbtts-tag--win { background: var(--hivis); border-color: var(--ink); color: var(--ink); }
.cbtts .cbtts-bar { height: 16px; border-radius: 8px; background: repeating-linear-gradient(90deg, var(--road) 0 10px, #E2E7EB 10px 20px); }
.cbtts .cbtts-bar i { border-radius: 8px; animation: cbtts-grow .9s cubic-bezier(.2, .8, .2, 1) both; }
.cbtts .cbtts-bar b { top: -4px; height: 24px; width: 3px; }
@keyframes cbtts-grow { from { width: 0; } }

/* Share box */
.cbtts .cbtts-share { border: 2px dashed var(--ink); border-radius: 8px; padding: 14px; margin: 4px 0 16px; background: #fff; }
.cbtts .cbtts-share-head { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; font-size: 20px; margin-bottom: 6px; }
.cbtts .cbtts-share-text { font-weight: 600; margin-bottom: 4px; }
.cbtts .cbtts-share-url { font-size: 14px; overflow-wrap: anywhere; margin-bottom: 10px; color: var(--muted); }
.cbtts .cbtts-share-url a { color: var(--muted); }
.cbtts .cbtts-share-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cbtts .cbtts-again { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 20px; }
.cbtts .cbtts-score { font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
	.cbtts .cbtts-start, .cbtts .cbtts-bar i { animation: none !important; }
	.cbtts .cbtts-guess { transition: none; }
}

.cbtts--embed { padding-top: 4px; }
.cbtts--embed .cbtts-title { margin-top: 8px; }
