/*
 * Creativity Test V1 by CraftBook Magazine
 * Game stylesheet: theme tokens, responsive stage shell, HUD bars.
 * All animation uses transform and opacity only.
 */

/* ---------- Theme tokens ---------- */

.ctcb-game {
	/* Base surfaces */
	--ctcb-bg-0: #0d0d12;
	--ctcb-bg-1: #14141c;
	--ctcb-bg-2: #1c1c28;
	--ctcb-line: #2a2a38;

	/* Text */
	--ctcb-text: #e9e6dd;
	--ctcb-text-dim: #9a97a3;

	/* Accent metals (Atelier default) */
	--ctcb-metal: #c9a227;
	--ctcb-metal-bright: #e8c96a;
	--ctcb-metal-deep: #8a6d14;

	/* Crystals */
	--ctcb-ruby: #d84a5f;
	--ctcb-emerald: #3fbf8f;
	--ctcb-sapphire: #4a7fd8;
	--ctcb-violet: #9a6fd8;

	/* Type */
	--ctcb-font-display: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
	--ctcb-font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.ctcb-theme-ember {
	--ctcb-metal: #b87344;
	--ctcb-metal-bright: #e09a63;
	--ctcb-metal-deep: #7d4a28;
}

.ctcb-theme-frost {
	--ctcb-metal: #aab2c0;
	--ctcb-metal-bright: #dfe6f2;
	--ctcb-metal-deep: #6b7484;
}

/* ---------- Shell ---------- */

.ctcb-game {
	position: relative;
	width: 100%;
	max-width: 1200px;
	margin: 1.5em auto;
	background: radial-gradient(120% 90% at 50% 8%, var(--ctcb-bg-2) 0%, var(--ctcb-bg-1) 45%, var(--ctcb-bg-0) 100%);
	border: 1px solid var(--ctcb-line);
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
	color: var(--ctcb-text);
	font-family: var(--ctcb-font-ui);
	-webkit-tap-highlight-color: transparent;
}

.ctcb-game:fullscreen,
.ctcb-game:-webkit-full-screen {
	max-width: none;
	margin: 0;
	border-radius: 0;
	display: flex;
	flex-direction: column;
}

.ctcb-noscript {
	padding: 3em 1.5em;
	text-align: center;
	color: var(--ctcb-text-dim);
}

/* ---------- Stage ---------- */

.ctcb-stage-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	touch-action: none;
}

/* Fallback for browsers without aspect-ratio (older Silk builds) */
@supports not (aspect-ratio: 16 / 10) {
	.ctcb-stage-wrap {
		height: 0;
		padding-bottom: 62.5%;
	}
	.ctcb-stage-wrap > svg {
		position: absolute;
		inset: 0;
	}
}

.ctcb-game:fullscreen .ctcb-stage-wrap,
.ctcb-game:-webkit-full-screen .ctcb-stage-wrap {
	flex: 1 1 auto;
	aspect-ratio: auto;
	min-height: 0;
}

.ctcb-stage {
	display: block;
	width: 100%;
	height: 100%;
	user-select: none;
	-webkit-user-select: none;
}

/* ---------- Wordmark and shared SVG text ---------- */

.ctcb-wordmark-title {
	font-family: var(--ctcb-font-display);
	fill: var(--ctcb-metal-bright);
	letter-spacing: 0.35em;
}

.ctcb-wordmark-sub {
	font-family: var(--ctcb-font-ui);
	fill: var(--ctcb-text-dim);
	letter-spacing: 0.4em;
	text-transform: uppercase;
}

/* ---------- Etched artwork style ---------- */

.ctcb-etch {
	stroke: var(--ctcb-metal);
	stroke-width: 2;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
	vector-effect: non-scaling-stroke;
}

.ctcb-etch-fill {
	fill: rgba(20, 20, 28, 0.85);
}

.ctcb-etch-faint {
	stroke: var(--ctcb-metal-deep);
	opacity: 0.75;
}

.ctcb-etch-bright {
	stroke: var(--ctcb-metal-bright);
}

.ctcb-crystal {
	stroke: var(--ctcb-violet);
}

.ctcb-gear-teeth {
	stroke-dasharray: 5 4;
}

.ctcb-pedestal {
	fill: rgba(13, 13, 18, 0.9);
}

.ctcb-artifact-label {
	font-family: var(--ctcb-font-ui);
	fill: var(--ctcb-text-dim);
	letter-spacing: 0.12em;
	opacity: 0;
	transition: opacity 0.4s ease;
}

/* Artifacts hidden until the opening reveals them. */
.ctcb-artifact {
	opacity: 0;
	transition: opacity 1.1s ease;
}

.ctcb-artifact-visible {
	opacity: 1;
}

.ctcb-artifact-idle:hover .ctcb-artifact-label,
.ctcb-artifact-idle:focus .ctcb-artifact-label {
	opacity: 1;
}

.ctcb-artifact-idle:hover .ctcb-etch,
.ctcb-artifact-idle:focus .ctcb-etch {
	stroke: var(--ctcb-metal-bright);
}

.ctcb-hub-hint {
	letter-spacing: 0.18em;
}

/* ---------- Hub artifact states ---------- */

.ctcb-interactive {
	cursor: pointer;
}

.ctcb-artifact:focus {
	outline: none;
}

.ctcb-artifact:focus-visible .ctcb-pedestal {
	stroke: var(--ctcb-metal-bright);
	stroke-width: 3;
}

.ctcb-artifact-next .ctcb-etch {
	stroke: var(--ctcb-metal-bright);
}

.ctcb-artifact-next .ctcb-artifact-body {
	filter: drop-shadow(0 0 10px rgba(232, 201, 106, 0.45));
}

.ctcb-artifact-complete .ctcb-etch {
	stroke: var(--ctcb-metal);
	opacity: 0.95;
}

.ctcb-artifact-complete .ctcb-artifact-body {
	filter: drop-shadow(0 0 6px rgba(201, 162, 39, 0.35));
}

.ctcb-artifact-locked {
	opacity: 0.55;
}

.ctcb-artifact-locked .ctcb-etch {
	stroke: var(--ctcb-metal-deep);
}

/* ---------- Artifact transformation ---------- */

.ctcb-artifact-body {
	transform-box: fill-box;
	transform-origin: center;
}

.ctcb-artifact-transform .ctcb-artifact-body {
	animation: ctcb-artifact-bloom 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ctcb-artifact-bloom {
	0% { transform: scale(1); }
	32% { transform: scale(1.16); }
	100% { transform: scale(1); }
}

.ctcb-artifact-transform .ctcb-etch {
	stroke: var(--ctcb-metal-bright);
}

.ctcb-transform-ring {
	fill: none;
	stroke: var(--ctcb-metal-bright);
	stroke-width: 3;
	transform-box: fill-box;
	transform-origin: center;
	animation: ctcb-transform-ring 1.4s ease-out forwards;
	pointer-events: none;
}

@keyframes ctcb-transform-ring {
	0% { opacity: 0.85; transform: scale(0.5); }
	100% { opacity: 0; transform: scale(4.5); }
}

@media (prefers-reduced-motion: reduce) {
	.ctcb-artifact-transform .ctcb-artifact-body { animation: none; }
	.ctcb-transform-ring { animation: none; opacity: 0; }
}

/* ---------- Toast ---------- */

.ctcb-toast {
	position: absolute;
	left: 50%;
	bottom: 18px;
	transform: translate(-50%, 12px);
	opacity: 0;
	background: var(--ctcb-bg-1);
	border: 1px solid var(--ctcb-metal-deep);
	color: var(--ctcb-text);
	border-radius: 8px;
	padding: 9px 16px;
	font-size: 13.5px;
	max-width: 84%;
	text-align: center;
	z-index: 5;
	transition: opacity 0.35s ease, transform 0.35s ease;
	pointer-events: none;
	box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}

.ctcb-toast-in {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------- Ghost button ---------- */

.ctcb-btn-ghost {
	background: transparent;
	margin-left: 10px;
	color: var(--ctcb-text-dim);
}

/* ---------- Chapter UI layer ---------- */

.ctcb-chapter-ui {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 10px 14px 12px;
	background: linear-gradient(180deg, rgba(13, 13, 18, 0) 0%, rgba(13, 13, 18, 0.88) 40%);
	pointer-events: none;
}

.ctcb-chapter-ui .ctcb-prompt,
.ctcb-chapter-ui .ctcb-controls {
	pointer-events: auto;
}

.ctcb-prompt {
	color: var(--ctcb-text);
	font-size: 14px;
	text-align: center;
	max-width: 860px;
	line-height: 1.45;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.ctcb-controls {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
}

.ctcb-ctl-group {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border: 1px solid var(--ctcb-line);
	border-radius: 8px;
	padding: 2px 4px;
	background: rgba(20, 20, 28, 0.7);
}

.ctcb-ctl-label {
	color: var(--ctcb-text-dim);
	font-size: 12px;
	letter-spacing: 0.08em;
	min-width: 46px;
	text-align: center;
}

.ctcb-timer-chip {
	position: absolute;
	top: 12px;
	right: 14px;
	z-index: 3;
	background: rgba(20, 20, 28, 0.85);
	border: 1px solid var(--ctcb-line);
	border-radius: 20px;
	color: var(--ctcb-text);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	padding: 5px 14px;
}

.ctcb-timer-low {
	border-color: var(--ctcb-ruby);
	color: var(--ctcb-ruby);
}

.ctcb-card-panel {
	text-align: center;
	max-width: 640px;
}

.ctcb-card-line {
	color: var(--ctcb-text);
	font-size: 14.5px;
	line-height: 1.6;
	margin: 0 0 14px;
}

.ctcb-shine {
	fill: var(--ctcb-metal-bright);
	opacity: 0;
	transform-origin: center;
	animation: ctcb-shine-pulse 1s ease-out forwards;
	pointer-events: none;
}

@keyframes ctcb-shine-pulse {
	0% { opacity: 0.55; transform: scale(0.4); }
	100% { opacity: 0; transform: scale(6); }
}

@media (prefers-reduced-motion: reduce) {
	.ctcb-shine { animation: none; opacity: 0; }
}

/* ---------- Options ---------- */

.ctcb-options {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.ctcb-option {
	min-width: 96px;
	font-size: 15px;
	padding: 8px 16px;
}

.ctcb-option-glyph {
	min-width: 64px;
	padding: 5px 10px;
	line-height: 0;
}

/* ---------- Sealed Cube ---------- */

.ctcb-glyph-shape {
	fill: rgba(13, 13, 18, 0.6);
	stroke-width: 2.4;
	vector-effect: non-scaling-stroke;
}

.ctcb-glyph-pip {
	fill: var(--ctcb-metal-bright);
}

.ctcb-ring {
	transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.35, 1);
	transform-box: view-box;
}

.ctcb-gear {
	transform-box: view-box;
}

.ctcb-corner-light {
	fill: var(--ctcb-line);
	stroke: var(--ctcb-metal-deep);
	stroke-width: 1.5;
	transition: fill 0.5s ease;
}

.ctcb-corner-light-on {
	fill: var(--ctcb-metal-bright);
	stroke: var(--ctcb-metal);
	stroke-width: 3.5;
}

/* ---------- Lens Array ---------- */

.ctcb-lens-great {
	fill: rgba(28, 28, 40, 0.55);
}

.ctcb-lens-small {
	transition: fill 0.5s ease;
}

.ctcb-lens-active {
	stroke: var(--ctcb-metal-bright);
}

.ctcb-lens-done {
	fill: rgba(201, 162, 39, 0.28);
}

.ctcb-lens-word {
	font-family: var(--ctcb-font-display);
	fill: var(--ctcb-text);
	letter-spacing: 0.06em;
}

/* ---------- Gear Cabinet ---------- */

.ctcb-socket {
	fill: rgba(13, 13, 18, 0.4);
	stroke: var(--ctcb-metal-deep);
	stroke-width: 1.6;
	stroke-dasharray: 5 5;
	cursor: pointer;
}

.ctcb-socket:hover,
.ctcb-socket:focus-visible {
	stroke: var(--ctcb-metal-bright);
	outline: none;
}

.ctcb-spindle {
	fill: rgba(20, 20, 28, 0.9);
	transition: fill 0.4s ease;
}

.ctcb-spindle-ok {
	fill: rgba(63, 191, 143, 0.45);
	stroke: var(--ctcb-emerald);
}

.ctcb-spindle-clash {
	stroke: var(--ctcb-ruby);
}

.ctcb-req-chip {
	font-family: var(--ctcb-font-ui);
	fill: var(--ctcb-metal-bright);
	letter-spacing: 0.1em;
	transition: opacity 0.3s ease;
}

.ctcb-req-flash {
	animation: ctcb-req-flash 1s ease 2;
}

@keyframes ctcb-req-flash {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.25; }
}

.ctcb-gear-spin {
	animation: ctcb-gear-turn 2.4s linear infinite;
}

@keyframes ctcb-gear-turn {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.ctcb-ring { transition: none; }
	.ctcb-gear-spin { animation: none; }
	.ctcb-req-flash { animation: none; }
}

/* ---------- Text entry ---------- */

.ctcb-entry-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	max-width: 720px;
}

.ctcb-text-input {
	flex: 1 1 220px;
	min-width: 170px;
	background: rgba(20, 20, 28, 0.92);
	border: 1px solid var(--ctcb-metal-deep);
	border-radius: 8px;
	color: var(--ctcb-text);
	font: inherit;
	font-size: 15px;
	padding: 9px 12px;
}

.ctcb-text-input:focus-visible {
	outline: 2px solid var(--ctcb-metal);
	outline-offset: 1px;
}

.ctcb-text-input::placeholder {
	color: var(--ctcb-text-dim);
}

.ctcb-text-area {
	resize: none;
	line-height: 1.4;
}

.ctcb-entry-count {
	color: var(--ctcb-metal-bright);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	min-width: 24px;
	text-align: center;
}

/* ---------- Open Panel ---------- */

.ctcb-panel-surface {
	fill: rgba(232, 201, 106, 0.06);
}

.ctcb-mote {
	fill: var(--ctcb-metal-bright);
	animation: ctcb-mote-rise 2.5s ease-out forwards;
	pointer-events: none;
}

@keyframes ctcb-mote-rise {
	0% { opacity: 0.9; transform: translateY(0); }
	100% { opacity: 0; transform: translateY(-320px); }
}

.ctcb-sort-wrap {
	width: 100%;
	max-width: 900px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 46vh;
	overflow: auto;
}

.ctcb-chip-pool {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	padding: 4px;
}

.ctcb-chip {
	appearance: none;
	max-width: 240px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	background: rgba(28, 28, 40, 0.95);
	border: 1px solid var(--ctcb-line);
	color: var(--ctcb-text);
	border-radius: 14px;
	padding: 4px 12px;
	font-size: 13px;
	cursor: pointer;
}

.ctcb-chip-selected {
	border-color: var(--ctcb-metal-bright);
	color: var(--ctcb-metal-bright);
}

.ctcb-bins {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.ctcb-bin {
	border: 1px dashed var(--ctcb-metal-deep);
	border-radius: 10px;
	padding: 6px 8px;
	min-width: 120px;
	max-width: 220px;
	cursor: pointer;
	background: rgba(13, 13, 18, 0.6);
}

.ctcb-bin-title {
	color: var(--ctcb-metal-bright);
	font-size: 13px;
	letter-spacing: 0.06em;
	margin-bottom: 4px;
	text-align: center;
}

.ctcb-bin-body {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	min-height: 26px;
	justify-content: center;
}

/* ---------- Crystal Matrix ---------- */

.ctcb-crystal-node {
	fill: rgba(20, 20, 28, 0.85);
	stroke: var(--ctcb-violet);
	transition: fill 0.8s ease, stroke 0.8s ease;
}

.ctcb-crystal-common {
	fill: rgba(216, 74, 95, 0.5);
	stroke: var(--ctcb-ruby);
}

.ctcb-crystal-uncommon {
	fill: rgba(63, 191, 143, 0.5);
	stroke: var(--ctcb-emerald);
}

.ctcb-crystal-rare {
	fill: rgba(74, 127, 216, 0.6);
	stroke: var(--ctcb-sapphire);
	filter: drop-shadow(0 0 10px rgba(74, 127, 216, 0.7));
}

.ctcb-crystal-question {
	font-size: 34px;
}

/* ---------- Maker's Choice ---------- */

.ctcb-approach-grid,
.ctcb-comp-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 8px;
	width: 100%;
	max-width: 940px;
	max-height: 42vh;
	overflow: auto;
}

.ctcb-approach {
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-align: left;
	padding: 10px 14px;
	white-space: normal;
}

.ctcb-approach-label {
	color: var(--ctcb-metal-bright);
	font-family: var(--ctcb-font-display);
	font-size: 15px;
	letter-spacing: 0.05em;
}

.ctcb-approach-text {
	color: var(--ctcb-text-dim);
	font-size: 12.5px;
	line-height: 1.4;
}

.ctcb-comp-grid {
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.ctcb-comp {
	white-space: normal;
	font-size: 13.5px;
	padding: 9px 10px;
}

.ctcb-comp-on {
	border-color: var(--ctcb-metal-bright);
	color: var(--ctcb-metal-bright);
	background: rgba(201, 162, 39, 0.12);
}

.ctcb-device-label {
	fill: var(--ctcb-text);
	font-family: var(--ctcb-font-ui);
}

.ctcb-device-lit {
	stroke: var(--ctcb-metal-bright);
	filter: drop-shadow(0 0 8px rgba(232, 201, 106, 0.5));
}

@media (prefers-reduced-motion: reduce) {
	.ctcb-mote { animation: none; opacity: 0; }
	.ctcb-crystal-node { transition: none; }
}

@media (max-width: 520px) {
	.ctcb-sort-wrap,
	.ctcb-approach-grid,
	.ctcb-comp-grid {
		max-height: 38vh;
	}
}

.ctcb-btn-off {
	opacity: 0.45;
	text-decoration: line-through;
}

/* ---------- Closing beams ---------- */

.ctcb-beam {
	stroke: var(--ctcb-metal-bright);
	stroke-width: 2.5;
	fill: none;
	opacity: 0;
	transition: opacity 1.2s ease;
	pointer-events: none;
	filter: drop-shadow(0 0 6px rgba(232, 201, 106, 0.6));
}

.ctcb-beam-on {
	opacity: 0.85;
}

/* ---------- Results ---------- */

.ctcb-results-panel {
	max-width: 620px;
	text-align: center;
}

.ctcb-cq-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.ctcb-dial-num {
	font-family: var(--ctcb-font-display);
}

.ctcb-dial-arc {
	transition: stroke-dashoffset 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.ctcb-cq-text {
	max-width: 330px;
	text-align: left;
}

.ctcb-cq-band {
	font-family: var(--ctcb-font-display);
	color: var(--ctcb-metal-bright);
	font-size: 24px;
	letter-spacing: 0.08em;
	margin-bottom: 6px;
}

.ctcb-cq-explain {
	color: var(--ctcb-text-dim);
	font-size: 12.5px;
	line-height: 1.5;
	margin: 0;
}

.ctcb-radar-wrap {
	display: flex;
	justify-content: center;
	margin: 6px 0 10px;
}

.ctcb-radar-poly {
	transform-origin: center;
	animation: ctcb-radar-grow 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ctcb-radar-grow {
	from { transform: scale(0.1); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

.ctcb-archetype-name {
	font-family: var(--ctcb-font-display);
	color: var(--ctcb-metal-bright);
	font-size: 26px;
	letter-spacing: 0.1em;
	margin: 6px 0 8px;
}

.ctcb-archetype-desc {
	color: var(--ctcb-text);
	font-size: 14.5px;
	line-height: 1.55;
	margin: 0 0 10px;
}

.ctcb-tips-title {
	font-family: var(--ctcb-font-display);
	color: var(--ctcb-metal);
	font-size: 16px;
	letter-spacing: 0.08em;
	margin: 14px 0 8px;
}

.ctcb-tip {
	color: var(--ctcb-text-dim);
	font-size: 13.5px;
	line-height: 1.5;
	margin: 0 0 8px;
	text-align: left;
}

.ctcb-cta {
	display: inline-block;
	margin: 12px 0 4px;
	text-decoration: none;
}

.ctcb-result-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 14px 0 6px;
}

.ctcb-history {
	margin-bottom: 10px;
}

.ctcb-history-row {
	color: var(--ctcb-text-dim);
	font-size: 13px;
	padding: 4px 0;
	border-bottom: 1px dashed var(--ctcb-line);
}

.ctcb-results-close {
	margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
	.ctcb-beam { transition: none; }
	.ctcb-dial-arc { transition: none; }
	.ctcb-radar-poly { animation: none; }
}

/* ---------- Opening sequence ---------- */

.ctcb-shroud {
	fill: #0d0d12;
	opacity: 1;
	transition: opacity 2.4s ease;
	pointer-events: none;
}

.ctcb-shroud-lift {
	opacity: 0.55;
}

.ctcb-shroud-clear {
	opacity: 0;
}

.ctcb-seq-item {
	opacity: 0;
	transition: opacity 1.2s ease;
	pointer-events: none;
}

.ctcb-seq-in {
	opacity: 1;
}

.ctcb-seq-fadeout {
	opacity: 0 !important;
}

.ctcb-skip {
	position: absolute;
	right: 14px;
	top: 12px;
	opacity: 0.85;
	z-index: 4;
}

@media (prefers-reduced-motion: reduce) {
	.ctcb-artifact,
	.ctcb-shroud,
	.ctcb-seq-item,
	.ctcb-artifact-label {
		transition: none;
	}
}

/* ---------- Top bar ---------- */

.ctcb-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--ctcb-line);
	background: linear-gradient(0deg, var(--ctcb-bg-1), var(--ctcb-bg-0));
}

.ctcb-chapter-title {
	font-family: var(--ctcb-font-display);
	font-size: 17px;
	color: var(--ctcb-text);
	letter-spacing: 0.1em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ctcb-constellation {
	width: 200px;
	height: 28px;
	flex: 0 0 auto;
	color: var(--ctcb-metal);
}

.ctcb-star-halo {
	fill: none;
	stroke: var(--ctcb-metal-deep);
	stroke-width: 1;
	opacity: 0.5;
}

.ctcb-star-core {
	fill: var(--ctcb-line);
	transition: fill 0.6s ease;
}

.ctcb-star-lit .ctcb-star-core {
	fill: var(--ctcb-metal-bright);
}

.ctcb-star-lit .ctcb-star-halo {
	stroke: var(--ctcb-metal);
	opacity: 0.9;
}

/* ---------- Controls in the bottom bar ---------- */

.ctcb-bottombar {
	flex-wrap: wrap;
}

.ctcb-zoomwrap,
.ctcb-controls-right {
	display: flex;
	align-items: center;
	gap: 6px;
}

.ctcb-btn-icon {
	min-width: 34px;
	padding: 5px 8px;
	line-height: 1;
	font-size: 15px;
}

.ctcb-zoom-slider {
	width: 120px;
}

.ctcb-vol-slider {
	width: 70px;
}

.ctcb-zoom-slider,
.ctcb-vol-slider {
	accent-color: var(--ctcb-metal);
	cursor: pointer;
}

.ctcb-zoom-slider:focus-visible,
.ctcb-vol-slider:focus-visible {
	outline: 2px solid var(--ctcb-metal);
	outline-offset: 2px;
}

/* ---------- Overlays ---------- */

.ctcb-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(13, 13, 18, 0.82);
	z-index: 6;
	padding: 20px;
	opacity: 1;
	transition: opacity 0.45s ease;
}

.ctcb-overlay-out {
	opacity: 0;
	pointer-events: none;
}

.ctcb-hidden {
	display: none;
}

.ctcb-overlay-panel {
	max-width: 560px;
	width: 100%;
	max-height: 100%;
	overflow: auto;
	background: var(--ctcb-bg-1);
	border: 1px solid var(--ctcb-line);
	border-radius: 10px;
	padding: 22px 26px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ctcb-overlay-title {
	font-family: var(--ctcb-font-display);
	color: var(--ctcb-metal-bright);
	font-size: 22px;
	margin: 0 0 12px;
	letter-spacing: 0.06em;
}

.ctcb-overlay-list {
	margin: 0 0 14px;
	padding-left: 20px;
	color: var(--ctcb-text);
	font-size: 14px;
	line-height: 1.55;
}

.ctcb-overlay-list li {
	margin-bottom: 8px;
}

.ctcb-overlay-note {
	color: var(--ctcb-text-dim);
	font-size: 13px;
	margin: 0 0 16px;
}

/* ---------- Title screen ---------- */

.ctcb-title-screen {
	background:
		radial-gradient(90% 70% at 50% 20%, rgba(201, 162, 39, 0.06) 0%, rgba(13, 13, 18, 0) 60%),
		rgba(13, 13, 18, 0.94);
}

.ctcb-title-panel {
	text-align: center;
	max-width: 620px;
	padding: 20px;
}

.ctcb-title-word {
	font-family: var(--ctcb-font-display);
	font-size: clamp(34px, 6vw, 58px);
	color: var(--ctcb-metal-bright);
	letter-spacing: 0.3em;
	margin-bottom: 8px;
	padding-left: 0.3em; /* optically balance the letter-spacing */
}

.ctcb-title-sub {
	font-size: 13px;
	letter-spacing: 0.55em;
	text-transform: uppercase;
	color: var(--ctcb-text-dim);
	margin-bottom: 26px;
	padding-left: 0.55em;
}

.ctcb-title-line {
	color: var(--ctcb-text);
	font-size: 15px;
	line-height: 1.6;
	margin: 0 0 26px;
}

.ctcb-btn-primary {
	background: linear-gradient(180deg, var(--ctcb-metal-bright), var(--ctcb-metal));
	border-color: var(--ctcb-metal-deep);
	color: #17130a;
	font-weight: 600;
	font-size: 16px;
	letter-spacing: 0.12em;
	padding: 10px 42px;
	text-transform: uppercase;
}

.ctcb-title-mins {
	margin: 18px 0 0;
	color: var(--ctcb-text-dim);
	font-size: 12.5px;
	letter-spacing: 0.06em;
}

/* ---------- Fullscreen CSS fallback ---------- */

.ctcb-maximised {
	position: fixed !important;
	inset: 0;
	z-index: 99999;
	max-width: none;
	margin: 0;
	border-radius: 0;
	display: flex;
	flex-direction: column;
}

.ctcb-maximised .ctcb-stage-wrap {
	flex: 1 1 auto;
	aspect-ratio: auto;
	min-height: 0;
}

.ctcb-noscroll {
	overflow: hidden;
}

/* ---------- Bottom bar ---------- */

.ctcb-bottombar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 16px;
	border-top: 1px solid var(--ctcb-line);
	background: linear-gradient(180deg, var(--ctcb-bg-1), var(--ctcb-bg-0));
	font-size: 13px;
	color: var(--ctcb-text-dim);
}

.ctcb-board-title {
	font-family: var(--ctcb-font-display);
	color: var(--ctcb-metal-bright);
	letter-spacing: 0.08em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ctcb-version {
	font-variant-numeric: tabular-nums;
	opacity: 0.7;
	white-space: nowrap;
}

/* ---------- Screen-reader only ---------- */

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

/* ---------- Buttons (shared, used from Phase 2 onward) ---------- */

.ctcb-btn {
	touch-action: manipulation;
	appearance: none;
	background: var(--ctcb-bg-2);
	border: 1px solid var(--ctcb-line);
	color: var(--ctcb-text);
	border-radius: 6px;
	padding: 6px 12px;
	font: inherit;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.ctcb-btn:hover {
	opacity: 0.85;
}

.ctcb-btn:focus-visible {
	outline: 2px solid var(--ctcb-metal);
	outline-offset: 2px;
}

/* ---------- Small screens ---------- */

@media (max-width: 520px) {
	.ctcb-game {
		margin: 1em auto;
		border-radius: 8px;
	}
	.ctcb-bottombar {
		font-size: 12px;
		padding: 8px 10px;
	}
}
