/*
 * Jornada Galáctica — Territórios da Evidência
 * Front-end design system for the Canal Ciência investigative game.
 * Cosmic theme: deep-space gradients, glassmorphism, glowing accents.
 * Built mobile-first; respects prefers-reduced-motion and a high-contrast mode.
 */

.cc-jornada {
	--cc-bg-0: #0b1026;
	--cc-bg-1: #131a3a;
	--cc-bg-2: #1b2350;
	--cc-ink: #eaf0ff;
	--cc-ink-dim: #aab4dd;
	--cc-brand: #38bdf8;
	--cc-accent: #f472b6;
	--cc-good: #34d399;
	--cc-warn: #fbbf24;
	--cc-bad: #fb7185;
	--cc-glass: rgba(255, 255, 255, 0.06);
	--cc-glass-bd: rgba(255, 255, 255, 0.14);
	--cc-radius: 18px;
	--cc-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
	--cc-ring: 0 0 0 3px rgba(56, 189, 248, 0.55);

	/* Fullscreen app: break out of the theme layout and fill the whole viewport,
	 * above any sticky theme header/admin bar so nothing overlaps it. */
	position: fixed;
	inset: 0;
	width: 100%;
	z-index: 2147483000;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	margin: 0;
	color: var(--cc-ink);
	font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
	background:
		radial-gradient(1200px 800px at 15% -10%, #1e2a6b 0%, transparent 55%),
		radial-gradient(900px 700px at 110% 10%, #3a1d5c 0%, transparent 50%),
		linear-gradient(160deg, var(--cc-bg-0), var(--cc-bg-1) 60%, var(--cc-bg-2));
	overflow-x: hidden;
}

.cc-jornada * { box-sizing: border-box; }

/* The [hidden] attribute must always win over the component display rules below
 * (otherwise modals/onboarding never hide when JS sets element.hidden = true). */
.cc-jornada [hidden] { display: none !important; }

/* Force readable text inside the game regardless of the active WordPress theme,
 * which may color headings/labels (e.g. green) and clash with the dark UI. */
.cc-jornada h1,
.cc-jornada h2,
.cc-jornada h3,
.cc-jornada h4,
.cc-jornada label,
.cc-jornada summary,
.cc-jornada strong { color: var(--cc-ink); }

/* Lock the page behind the fullscreen game (class + :has() fallback, so the
 * theme can never scroll/overlap behind it regardless of page detection). */
html:has( .cc-jornada ),
body:has( .cc-jornada ) { overflow: hidden; }
body.cc-jornada-fullscreen { overflow: hidden; }

/* High-contrast variant (toggle adds .cc-contrast). */
.cc-jornada.cc-contrast {
	--cc-ink: #ffffff;
	--cc-ink-dim: #e6ecff;
	--cc-glass: rgba(0, 0, 0, 0.65);
	--cc-glass-bd: #ffffff;
	background: #000018;
}

.cc-skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	z-index: 50;
	background: var(--cc-brand);
	color: #04122a;
	padding: 10px 16px;
	border-radius: 0 0 12px 0;
	font-weight: 700;
}
.cc-skip-link:focus { left: 0; }

/* ---------- Top bar ---------- */
.cc-topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: linear-gradient(180deg, rgba(11, 16, 38, 0.92), rgba(11, 16, 38, 0.4));
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--cc-glass-bd);
}
.cc-topbar__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cc-topbar__title {
	font-weight: 800;
	font-size: 1rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cc-logo {
	width: 30px; height: 30px; flex: 0 0 30px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #9be7ff, var(--cc-brand) 45%, #6d28d9 100%);
	box-shadow: 0 0 18px rgba(56, 189, 248, 0.7);
}
.cc-topbar__actions { display: flex; align-items: center; gap: 10px; }
.cc-score {
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--cc-glass);
	border: 1px solid var(--cc-glass-bd);
	color: var(--cc-warn);
}
.cc-iconbtn {
	display: inline-grid; place-items: center;
	width: 42px; height: 42px;
	border-radius: 12px;
	border: 1px solid var(--cc-glass-bd);
	background: var(--cc-glass);
	color: var(--cc-ink);
	cursor: pointer;
}
.cc-iconbtn:focus-visible { outline: none; box-shadow: var(--cc-ring); }

/* ---------- Screens ---------- */
.cc-screen { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 24px 16px 110px; }

.cc-onboarding__panel {
	width: min(460px, 100%);
	padding: 28px;
	border-radius: var(--cc-radius);
	background: var(--cc-glass);
	border: 1px solid var(--cc-glass-bd);
	box-shadow: var(--cc-shadow);
	backdrop-filter: blur(14px);
	animation: cc-rise 0.5s ease both;
}
.cc-onboarding__title { margin: 0 0 6px; font-size: 1.6rem; line-height: 1.2; }
.cc-onboarding__tagline { margin: 0 0 20px; color: var(--cc-ink-dim); }

.cc-join-form { display: flex; flex-direction: column; gap: 8px; }
.cc-join-form label { font-weight: 600; font-size: 0.92rem; margin-top: 8px; }
.cc-input {
	width: 100%;
	padding: 14px 16px;
	font-size: 1rem;
	color: var(--cc-ink);
	background: rgba(255, 255, 255, 0.04);
	border: 1.5px solid var(--cc-glass-bd);
	border-radius: 12px;
}
.cc-input:focus-visible { outline: none; box-shadow: var(--cc-ring); border-color: var(--cc-brand); }
.cc-input--code { letter-spacing: 0.35em; text-transform: uppercase; font-weight: 800; text-align: center; }
.cc-join-error { color: var(--cc-bad); font-weight: 600; margin: 4px 0 0; }
.cc-privacy-note { color: var(--cc-ink-dim); font-size: 0.82rem; margin: 10px 0 0; }

.cc-join-label { font-weight: 600; font-size: 0.92rem; margin-top: 10px; }
.cc-avatars { display: flex; gap: 10px; margin: 6px 0; }
.cc-avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var( --cc-glass-bd ); background: var( --c, #6d28d9 ); cursor: pointer; }
.cc-avatar.is-sel { box-shadow: 0 0 0 3px var( --cc-brand ); }
.cc-avatar:focus-visible { outline: none; box-shadow: var( --cc-ring ); }

/* ---------- Buttons ---------- */
.cc-btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	font-weight: 700;
	font-size: 1rem;
	padding: 14px 20px;
	border-radius: 14px;
	color: #04122a;
	background: linear-gradient(135deg, #9be7ff, var(--cc-brand));
	box-shadow: 0 8px 24px rgba(56, 189, 248, 0.35);
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
	margin-top: 14px;
}
.cc-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.cc-btn:active { transform: translateY(0); }
.cc-btn:focus-visible { outline: none; box-shadow: var(--cc-ring); }
.cc-btn--ghost {
	background: var(--cc-glass);
	color: var(--cc-ink);
	border: 1px solid var(--cc-glass-bd);
	box-shadow: none;
}

/* ---------- Stage / map ---------- */
.cc-stage { position: relative; padding-bottom: 96px; }
.cc-stage__map { position: relative; width: 100%; height: calc(100vh - 64px - 84px); }
.cc-canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; }

/* The world canvas IS interactive (tap-to-move); capture pointers and stop the
 * browser from scrolling/zooming on touch over the game. */
.cc-stage__map canvas { pointer-events: auto; touch-action: none; display: block; }

/* Accessible territory list mirrors canvas nodes (screen reader + keyboard). */
.cc-territory-list { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; z-index: 3; }
.cc-territory-list .cc-node-btn {
	position: absolute;
	transform: translate(-50%, -50%);
	pointer-events: auto;
	min-width: 132px;
	padding: 10px 12px;
	border-radius: 14px;
	border: 1.5px solid var(--cc-glass-bd);
	background: rgba(8, 12, 32, 0.55);
	color: var(--cc-ink);
	font-weight: 700;
	font-size: 0.82rem;
	text-align: center;
	cursor: pointer;
	backdrop-filter: blur(4px);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.cc-node-btn[data-locked="1"] { opacity: 0.5; cursor: not-allowed; }
.cc-node-btn:not([data-locked="1"]):hover { transform: translate(-50%, -54%); }
.cc-node-btn:focus-visible { outline: none; box-shadow: var(--cc-ring); }
.cc-node-btn .cc-node-state { display: block; font-size: 0.7rem; color: var(--cc-ink-dim); font-weight: 600; }

/* ---------- World HUD: interact prompt + virtual joystick ---------- */
.cc-interact {
	position: fixed;
	left: 50%;
	bottom: 100px;
	transform: translateX( -50% );
	z-index: 26;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 7px 7px 14px;
	background: rgba( 8, 12, 32, 0.9 );
	border: 1px solid var( --cc-glass-bd );
	border-radius: 999px;
	box-shadow: var( --cc-shadow );
	max-width: 90vw;
}
.cc-interact__icon { color: var( --cc-brand ); }
.cc-interact__name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-interact__btn {
	border: 0;
	cursor: pointer;
	font-weight: 800;
	padding: 8px 16px;
	border-radius: 999px;
	color: #04122a;
	background: linear-gradient( 135deg, #9be7ff, var( --cc-brand ) );
}
.cc-interact__btn:focus-visible { outline: none; box-shadow: var( --cc-ring ); }
.cc-interact[data-locked="1"] .cc-interact__icon { color: var( --cc-ink-dim ); }
.cc-interact[data-locked="1"] .cc-interact__btn { filter: grayscale( 1 ); opacity: 0.6; }

.cc-joy {
	position: fixed;
	left: 18px;
	bottom: 100px;
	z-index: 25;
	width: 108px;
	height: 108px;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.08 );
	border: 1px solid var( --cc-glass-bd );
	touch-action: none;
	backdrop-filter: blur( 4px );
}
.cc-joy__thumb {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 50px;
	height: 50px;
	margin: -25px 0 0 -25px;
	border-radius: 50%;
	background: rgba( 56, 189, 248, 0.75 );
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.4 );
}
/* Hide the joystick on mouse/desktop (keyboard + tap-to-move are used there). */
@media ( hover: hover ) and ( pointer: fine ) {
	.cc-joy { display: none; }
}

/* ---------- Dialogue (NPC / guide) ---------- */
.cc-dialogue__who { margin: 0 0 8px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var( --cc-brand ); }
.cc-dialogue__text { margin: 0 0 16px; font-size: 1.08rem; line-height: 1.55; }
.cc-dialogue__choices { display: grid; gap: 10px; }

/* ---------- Evidence HUD + conclusion + minigame ---------- */
.cc-evidence {
	padding: 6px 12px;
	border-radius: 999px;
	font-weight: 800;
	font-size: 0.82rem;
	background: var( --cc-glass );
	border: 1px solid var( --cc-glass-bd );
	color: var( --cc-good );
	white-space: nowrap;
}
/* Exploration HUD: current-objective chip (translucent, auto-hides on small widths) */
.cc-objective {
	flex: 0 1 auto;
	min-width: 0;
	margin: 0 10px;
	padding: 6px 14px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.82rem;
	background: var( --cc-glass );
	border: 1px solid var( --cc-glass-bd );
	color: var( --cc-ink );
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cc-jornada.cc-reduce .cc-objective { transition: none; }
@media ( max-width: 560px ) {
	/* keep ~70% of the screen for the map: drop the objective chip on phones */
	.cc-objective { display: none; }
}

/* Mini-map with discovery fog */
.cc-minimap {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 6;
	width: 134px;
	padding: 8px 8px 10px;
	background: var( --cc-glass );
	border: 1px solid var( --cc-glass-bd );
	border-radius: 14px;
	backdrop-filter: blur( 6px );
}
.cc-minimap__title { display: block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var( --cc-ink ); opacity: 0.7; margin-bottom: 6px; }
.cc-minimap__plot { position: relative; width: 100%; padding-top: 72%; border-radius: 10px; overflow: hidden; background: radial-gradient( circle at 50% 40%, rgba( 56, 189, 248, 0.12 ), rgba( 8, 12, 32, 0.55 ) ); }
.cc-mm-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 1.5px solid rgba( 255, 255, 255, 0.55 ); background: #64748b; }
.cc-mm-dot.is-locked { opacity: 0.32; filter: blur( 0.6px ); }
.cc-mm-dot.is-unlocked { background: #38bdf8; }
.cc-mm-dot.is-done { background: #34d399; box-shadow: 0 0 0 2px rgba( 52, 211, 153, 0.35 ); }
.cc-mm-dot.is-bridge { border-radius: 3px; background: #fbbf24; }
.cc-mm-dot.is-current { border-color: #fbbf24; box-shadow: 0 0 10px rgba( 251, 191, 36, 0.85 ); transform: scale( 1.35 ); }
.cc-jornada:not( .cc-reduce ) .cc-mm-dot.is-current { animation: cc-mm-pulse 1.4s ease-in-out infinite; }
@keyframes cc-mm-pulse { 0%, 100% { box-shadow: 0 0 6px rgba( 251, 191, 36, 0.6 ); } 50% { box-shadow: 0 0 15px rgba( 251, 191, 36, 1 ); } }
@media ( max-width: 560px ) { .cc-minimap { width: 110px; top: 8px; right: 8px; } }

/* NPC portrait in dialogue */
.cc-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect( 0 0 0 0 ); white-space: nowrap; border: 0; }
.cc-dialogue__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cc-portrait {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 1.3rem;
	color: #fff;
	background:
		radial-gradient( circle at 30% 28%, rgba( 255, 255, 255, 0.35 ), rgba( 255, 255, 255, 0 ) 60% ),
		var( --c, #fbbf24 );
	box-shadow: 0 0 0 2px rgba( 255, 255, 255, 0.18 ), 0 4px 10px rgba( 0, 0, 0, 0.3 );
}
.cc-portrait__name { font-weight: 800; font-size: 1rem; color: var( --cc-ink ); }

/* Visual medals: HUD strip + celebratory popup */
.cc-medals { display: inline-flex; gap: 2px; align-items: center; }
.cc-medal { font-size: 0.95rem; line-height: 1; filter: drop-shadow( 0 1px 2px rgba( 0, 0, 0, 0.4 ) ); }
.cc-medal-pop {
	position: absolute;
	left: 50%;
	top: 22%;
	transform: translate( -50%, -8px ) scale( 0.9 );
	z-index: 9;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 18px;
	border-radius: 16px;
	background: var( --cc-glass );
	border: 1px solid var( --cc-glass-bd );
	backdrop-filter: blur( 8px );
	box-shadow: 0 10px 30px rgba( 0, 0, 0, 0.4 );
	opacity: 0;
	pointer-events: none;
}
.cc-medal-pop__icon { font-size: 1.8rem; }
.cc-medal-pop__label { font-weight: 800; color: var( --cc-ink ); }
.cc-medal-pop.is-show { animation: cc-medal-in 3.2s ease forwards; }
@keyframes cc-medal-in {
	0% { opacity: 0; transform: translate( -50%, -8px ) scale( 0.85 ); }
	12% { opacity: 1; transform: translate( -50%, 0 ) scale( 1.04 ); }
	20% { transform: translate( -50%, 0 ) scale( 1 ); }
	85% { opacity: 1; transform: translate( -50%, 0 ) scale( 1 ); }
	100% { opacity: 0; transform: translate( -50%, -10px ) scale( 0.96 ); }
}
.cc-jornada.cc-reduce .cc-medal-pop.is-show { animation: none; opacity: 1; }

.cc-field__label { display: block; font-weight: 700; font-size: 0.9rem; margin: 14px 0 6px; }

.cc-evid-list { display: grid; gap: 8px; }
.cc-evid {
	text-align: left;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1.5px solid var( --cc-glass-bd );
	border-left: 5px solid var( --cc-t-color, var( --cc-brand ) );
	background: rgba( 255, 255, 255, 0.04 );
	color: var( --cc-ink );
	cursor: pointer;
	font-weight: 600;
}
.cc-evid.is-on { box-shadow: inset 0 0 0 1px var( --cc-good ); }
.cc-evid:not( .is-on ) { opacity: 0.45; }

.cc-mg__item { margin: 14px 0; padding-bottom: 12px; border-bottom: 1px solid var( --cc-glass-bd ); }
.cc-mg__text { margin: 0 0 8px; font-size: 1.02rem; }
.cc-mg__cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-mg__cat {
	padding: 8px 14px;
	border-radius: 999px;
	border: 1.5px solid var( --cc-glass-bd );
	background: rgba( 255, 255, 255, 0.04 );
	color: var( --cc-ink );
	cursor: pointer;
	font-weight: 600;
}
.cc-mg__cat.is-sel { border-color: var( --cc-brand ); background: rgba( 56, 189, 248, 0.18 ); }
.cc-mg__result { margin-top: 14px; font-weight: 700; color: var( --cc-good ); }

/* ---------- Card Mode ---------- */
.cc-cardmode { padding: 16px; display: grid; gap: 16px; }
.cc-card2 {
	border-radius: var(--cc-radius);
	border: 1px solid var(--cc-glass-bd);
	background: var(--cc-glass);
	padding: 18px;
	box-shadow: var(--cc-shadow);
	border-left: 5px solid var(--cc-t-color, var(--cc-brand));
}
.cc-card2__title { margin: 0 0 4px; font-size: 1.15rem; }
.cc-card2__focus { margin: 0 0 12px; color: var(--cc-ink-dim); font-size: 0.9rem; }

/* ---------- Mission UI ---------- */
.cc-mission__prompt { font-size: 1.12rem; line-height: 1.5; margin: 4px 0 16px; }
.cc-mission__guide { color: var(--cc-ink-dim); font-size: 0.85rem; margin-bottom: 12px; }
.cc-options { display: grid; gap: 10px; }
.cc-option {
	text-align: left;
	width: 100%;
	padding: 16px;
	font-size: 1rem;
	line-height: 1.4;
	border-radius: 14px;
	border: 1.5px solid var(--cc-glass-bd);
	background: rgba(255, 255, 255, 0.04);
	color: var(--cc-ink);
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.cc-option:hover { border-color: var(--cc-brand); }
.cc-option:focus-visible { outline: none; box-shadow: var(--cc-ring); }
.cc-option[data-state="correct"] { border-color: var(--cc-good); background: rgba(52, 211, 153, 0.16); }
.cc-option[data-state="wrong"] { border-color: var(--cc-bad); background: rgba(251, 113, 133, 0.16); }
.cc-option__mark { float: right; font-weight: 800; }

.cc-feedback {
	margin-top: 16px;
	padding: 14px 16px;
	border-radius: 14px;
	border-left: 5px solid var(--cc-brand);
	background: rgba(255, 255, 255, 0.05);
}
.cc-feedback--correct { border-left-color: var(--cc-good); }
.cc-feedback--partial { border-left-color: var(--cc-warn); }
.cc-feedback--inadequate { border-left-color: var(--cc-warn); }

.cc-open-answer { display: grid; gap: 10px; }
.cc-open-answer__input {
	width: 100%;
	padding: 14px 16px;
	font-size: 1rem;
	font-family: inherit;
	color: var(--cc-ink);
	background: rgba(255, 255, 255, 0.04);
	border: 1.5px solid var(--cc-glass-bd);
	border-radius: 12px;
	resize: vertical;
}
.cc-open-answer__input:focus-visible { outline: none; box-shadow: var(--cc-ring); border-color: var(--cc-brand); }
.cc-feedback__objective { display: block; margin-top: 8px; color: var(--cc-ink-dim); font-size: 0.85rem; }

/* ---------- Modals ---------- */
.cc-modal {
	position: fixed;
	inset: 0;
	z-index: 40;
	display: grid;
	place-items: end center;
	background: rgba(4, 6, 18, 0.6);
	backdrop-filter: blur(4px);
	padding: 0;
}
.cc-modal__panel {
	position: relative;
	width: min(560px, 100%);
	max-height: 88vh;
	overflow-y: auto;
	padding: 26px 22px;
	border-radius: 22px 22px 0 0;
	background: linear-gradient(180deg, var(--cc-bg-2), var(--cc-bg-1));
	border: 1px solid var(--cc-glass-bd);
	box-shadow: var(--cc-shadow);
	animation: cc-sheet 0.28s ease both;
}
.cc-modal__close {
	position: absolute; top: 12px; right: 12px;
	width: 40px; height: 40px;
	display: grid; place-items: center;
	border-radius: 12px;
	border: 1px solid var(--cc-glass-bd);
	background: var(--cc-glass);
	color: var(--cc-ink);
	cursor: pointer;
}
.cc-modal__close:focus-visible { outline: none; box-shadow: var(--cc-ring); }

.cc-switch { display: flex; align-items: center; gap: 12px; padding: 12px 0; font-size: 1rem; border-bottom: 1px solid var(--cc-glass-bd); }
.cc-switch input { width: 22px; height: 22px; accent-color: var(--cc-brand); }

@media (min-width: 720px) {
	.cc-modal { place-items: center; }
	.cc-modal__panel { border-radius: 22px; }
}

/* ---------- Bottom nav ---------- */
.cc-bottomnav {
	position: fixed;
	bottom: 0; left: 0; right: 0;
	z-index: 25;
	display: flex;
	justify-content: space-around;
	gap: 2px;
	padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
	background: linear-gradient(0deg, rgba(11, 16, 38, 0.98), rgba(11, 16, 38, 0.8));
	border-top: 1px solid var(--cc-glass-bd);
	backdrop-filter: blur(10px);
	overflow-x: auto;
}
.cc-bottomnav__btn {
	flex: 1 0 auto;
	min-width: 60px;
	display: grid;
	justify-items: center;
	gap: 2px;
	padding: 6px 4px;
	border: 0;
	background: transparent;
	color: var(--cc-ink-dim);
	cursor: pointer;
	border-radius: 12px;
	font-size: 0.66rem;
}
.cc-bottomnav__btn.is-active { color: var(--cc-brand); background: var(--cc-glass); }
.cc-bottomnav__btn:focus-visible { outline: none; box-shadow: var(--cc-ring); }
.cc-bottomnav__btn .dashicons { font-size: 22px; width: 22px; height: 22px; }

/* ---------- Toast ---------- */
.cc-toast {
	position: fixed;
	left: 50%;
	bottom: 96px;
	transform: translateX(-50%);
	z-index: 45;
	max-width: 90%;
	padding: 12px 18px;
	border-radius: 14px;
	background: rgba(8, 12, 32, 0.95);
	border: 1px solid var(--cc-glass-bd);
	box-shadow: var(--cc-shadow);
	font-weight: 600;
	animation: cc-rise 0.25s ease both;
}

/* ---------- Evidence dossier ---------- */
.cc-dossier h2 { margin: 0 0 4px; }
.cc-dossier__intro { color: var(--cc-ink-dim); margin: 0 0 16px; }
.cc-dossier__field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.cc-dossier__field label { font-weight: 700; font-size: 0.9rem; }
.cc-dossier__field textarea,
.cc-dossier__field input {
	width: 100%;
	padding: 12px 14px;
	font-size: 0.98rem;
	color: var(--cc-ink);
	background: rgba(255, 255, 255, 0.04);
	border: 1.5px solid var(--cc-glass-bd);
	border-radius: 12px;
	font-family: inherit;
	resize: vertical;
}
.cc-dossier__field textarea:focus-visible,
.cc-dossier__field input:focus-visible { outline: none; box-shadow: var(--cc-ring); border-color: var(--cc-brand); }
.cc-dossier__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cc-dossier__status { margin: 8px 0 0; color: var(--cc-good); font-weight: 600; }

/* ---------- Mission tech console + guide robot ---------- */
#cc-mission-modal .cc-modal__panel {
	border: 1px solid rgba(56, 189, 248, 0.5);
	box-shadow:
		inset 0 0 0 1px rgba(56, 189, 248, 0.2),
		inset 0 -60px 80px -60px rgba(56, 189, 248, 0.35),
		var(--cc-shadow);
	background:
		linear-gradient(180deg, rgba(56, 189, 248, 0.05), rgba(56, 189, 248, 0)),
		repeating-linear-gradient(0deg, transparent 0 23px, rgba(56, 189, 248, 0.05) 23px 24px),
		linear-gradient(180deg, var(--cc-bg-2), var(--cc-bg-1));
}
.cc-mission__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.95rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--cc-brand);
}
.cc-mission__title::before { content: "\25C8"; font-size: 0.9em; }

.cc-mission__stage { display: flex; gap: 14px; align-items: flex-start; margin: 10px 0 14px; }
.cc-bot { flex: 0 0 86px; width: 86px; filter: drop-shadow(0 6px 14px rgba(56, 189, 248, 0.25)); }
.cc-bot__svg { width: 86px; height: auto; display: block; animation: cc-bot-bob 3.2s ease-in-out infinite; }
.cc-bot__head,
.cc-bot__body { fill: #0e1838; stroke: var(--cc-bot-color, #38bdf8); stroke-width: 2.5; }
.cc-bot__visor { fill: rgba(56, 189, 248, 0.12); stroke: var(--cc-bot-color, #38bdf8); stroke-width: 1.5; }
.cc-bot__eye {
	fill: var(--cc-bot-color, #38bdf8);
	transform-box: fill-box;
	transform-origin: center;
	animation: cc-bot-blink 4.5s infinite;
}
.cc-bot__smile { fill: none; stroke: var(--cc-bot-color, #38bdf8); stroke-width: 2.5; stroke-linecap: round; }
.cc-bot__antenna,
.cc-bot__arm { stroke: var(--cc-bot-color, #38bdf8); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.cc-bot__tip { fill: #fde68a; animation: cc-bot-pulse 1.5s ease-in-out infinite; }
.cc-bot__led { fill: var(--cc-good); animation: cc-bot-pulse 1.1s ease-in-out infinite; }

.cc-speech {
	position: relative;
	flex: 1;
	min-width: 0;
	padding: 12px 14px;
	background: rgba(8, 12, 32, 0.7);
	border: 1px solid rgba(56, 189, 248, 0.35);
	border-radius: 14px;
	animation: cc-pop 0.32s ease both;
}
.cc-speech::before {
	content: "";
	position: absolute;
	left: -7px;
	top: 24px;
	width: 0;
	height: 0;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	border-right: 7px solid rgba(8, 12, 32, 0.7);
}
.cc-speech__who { margin: 0 0 6px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cc-brand); }
.cc-speech__prompt { margin: 0; font-size: 1.08rem; line-height: 1.5; }
.cc-speech__cursor { display: inline-block; margin-left: 3px; color: var(--cc-brand); animation: cc-cursor 1s step-end infinite; }
.cc-mission__intro { margin: 0 0 12px; color: var(--cc-ink-dim); font-size: 0.86rem; }

/* Authored YouTube video inside the mission dialog */
.cc-mission__video { margin: 0 0 14px; }
.cc-mission__video-label { margin: 0 0 6px; font-size: 0.86rem; font-weight: 600; color: var(--cc-ink-dim); }
.cc-mission__video iframe {
	display: block; width: 100%; aspect-ratio: 16 / 9; border: 0;
	border-radius: 12px; background: #000;
}

/* Team badge (top bar) */
.cc-team {
	max-width: 38vw;
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 800;
	color: #04122a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Mediation pause overlay */
.cc-pause { text-align: center; }
.cc-pause h2 { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--cc-warn); }
.cc-pause__hint { color: var(--cc-ink-dim); margin: 4px 0 12px; }
.cc-pause__q { font-size: 1.3rem; line-height: 1.45; font-weight: 700; margin: 0 0 18px; }

/* ---------- Animations ---------- */
@keyframes cc-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cc-sheet { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes cc-bot-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes cc-bot-blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(0.12); } }
@keyframes cc-bot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes cc-pop { from { opacity: 0; transform: translateX(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes cc-cursor { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* Reduced motion: honor system preference and the in-game toggle. */
@media (prefers-reduced-motion: reduce) {
	.cc-jornada *, .cc-jornada *::before, .cc-jornada *::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}
.cc-jornada.cc-reduce *, .cc-jornada.cc-reduce *::before, .cc-jornada.cc-reduce *::after {
	animation-duration: 0.001ms !important;
	transition-duration: 0.001ms !important;
}

/* ---- Sequencing mission: tap steps into order ---- */
.cc-order { display: grid; gap: 12px; }
.cc-order__label {
	margin: 0 0 2px;
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cc-ink-dim);
}
.cc-order__zone {
	display: grid;
	gap: 8px;
	min-height: 56px;
	padding: 10px;
	border: 1.5px dashed var(--cc-glass-bd);
	border-radius: 14px;
}
.cc-order__zone--seq { border-style: solid; border-color: rgba(56, 189, 248, 0.45); }
.cc-order__empty { margin: 0; align-self: center; color: var(--cc-ink-dim); font-size: 0.92rem; }
.cc-order__item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 12px 14px;
	text-align: left;
	font: inherit;
	font-size: 1rem;
	line-height: 1.35;
	color: var(--cc-ink);
	background: rgba(255, 255, 255, 0.04);
	border: 1.5px solid var(--cc-glass-bd);
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.cc-order__item:hover { border-color: var(--cc-brand); }
.cc-order__item:focus-visible { outline: none; box-shadow: var(--cc-ring); }
.cc-order__item:disabled { cursor: default; }
.cc-order__num {
	flex: none;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	font-size: 0.85rem;
	font-weight: 800;
	color: var(--cc-brand);
	background: rgba(56, 189, 248, 0.18);
}
.cc-order__item[data-state="correct"] { border-color: var(--cc-good); background: rgba(52, 211, 153, 0.16); }
.cc-order__item[data-state="wrong"] { border-color: var(--cc-bad); background: rgba(251, 113, 133, 0.16); }

/* ---- Spot-the-clue mission: mark suspicious passages ---- */
.cc-spot { display: grid; gap: 12px; }
.cc-spot__text { display: flex; flex-wrap: wrap; gap: 6px 8px; line-height: 1.5; }
.cc-spot__seg {
	font: inherit;
	font-size: 1rem;
	text-align: left;
	color: var(--cc-ink);
	background: rgba(255, 255, 255, 0.04);
	border: 1.5px solid var(--cc-glass-bd);
	border-radius: 10px;
	padding: 8px 12px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.cc-spot__seg:hover { border-color: var(--cc-brand); }
.cc-spot__seg:focus-visible { outline: none; box-shadow: var(--cc-ring); }
.cc-spot__seg:disabled { cursor: default; }
.cc-spot__seg[aria-pressed="true"] { border-color: var(--cc-warn); background: rgba(251, 191, 36, 0.18); }
.cc-spot__seg[data-state="flag"] { border-color: var(--cc-good); background: rgba(52, 211, 153, 0.18); }
.cc-spot__seg[data-state="missed"] { border-color: var(--cc-good); border-style: dashed; background: transparent; }
.cc-spot__seg[data-state="wrong"] { border-color: var(--cc-bad); background: rgba(251, 113, 133, 0.16); text-decoration: line-through; }
