/*
 * Wired AdvenHTure: El Laboratorio del Circuito (assets/adventure.js).
 * Pozo (dentro de la web, templates/lab.php), N.U.B.E., marcador de la cámara y
 * resultados. Con el estilo de la web: tarjetas claras con borde blanco de 2px y
 * contorno negro, y franjas de widget partidas en dos tonos. Sin degradados suaves.
 */

.hwg-lab,
.hwg-nube-box,
.hwg-adv-hud,
.hwg-adv-objective,
.hwg-adv-result {
	font-family: 'Ubuntu', Arial, Helvetica, sans-serif;
}

/* ─── Piezas comunes ───────────────────────────────────────────────────── */

.hwg-lab-wing,
.hwg-nube-box,
.hwg-adv-result-card {
	border: 2px solid #fff;
	border-radius: 10px;
	background: #f5f9fb;
	box-shadow: 0 0 0 2px #000;
	color: #1b3a4b;
}

.hwg-lab-wing-band,
.hwg-adv-result-band {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 7px 12px;
	border-bottom: 2px solid rgb(0 2 2 / 32%);
	background: linear-gradient(180deg, rgb(0, 104, 145) 50%, rgb(0, 88, 123) 50%);
	color: #fff;
	font-size: .85rem;
	font-weight: bold;
	letter-spacing: 1px;
	text-transform: uppercase;
	text-shadow: 1px 1px rgb(0 0 0 / 48%);
}

.hwg-stars .fa-star {
	margin-right: 2px;
	color: #c7d6de;
}

.hwg-stars .fa-star.is-on {
	color: #f5b400;
}

/* ─── N.U.B.E. ─────────────────────────────────────────────────────────── */

.hwg-nube-box {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 10px 12px;
	cursor: pointer;
	text-align: left;
}

.hwg-nube-portrait {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 60px;
	height: 52px;
	border-radius: 8px;
	background: #006891;
	box-shadow: inset 0 -3px 0 #004960;
}

/* La nube y el ojo ocupan la misma casilla, uno encima del otro, a 40x40 siempre:
   la nube es pixel art y no se escala en ningún retrato. */
.hwg-nube-portrait > .hwg-nube-cloud,
.hwg-nube-portrait > .hwg-nube-face {
	grid-area: 1 / 1;
	display: block;
	width: 40px;
	height: 40px;
	max-width: none;
}

.hwg-nube-cloud {
	image-rendering: pixelated;
}

/* Posicionado: el ojo queda encima aunque la nube lleve filtro (enfadada, triste). */
.hwg-nube-face {
	position: relative;
}

.hwg-nube-eye {
	fill: #0d2a38;
	transform-origin: 20px 22px;
	animation: hwg-nube-blink 5s infinite;
}

.hwg-nube-pupil {
	fill: #3fd3ff;
	transform-origin: 20px 22px;
	animation: hwg-nube-blink 5s infinite, hwg-nube-look 7s ease-in-out infinite;
}

@keyframes hwg-nube-blink {
	0%, 93%, 100% { transform: scaleY(1); }
	95% { transform: scaleY(.1); }
}

@keyframes hwg-nube-look {
	0%, 40%, 100% { translate: 0 0; }
	50%, 60% { translate: 1px 0; }
	70%, 80% { translate: -1px 0; }
}

.hwg-nube-body {
	min-width: 0;
}

.hwg-nube-speaker {
	display: block;
	margin-bottom: 2px;
	font-size: .75rem;
	font-weight: bold;
	letter-spacing: 1px;
	color: #006891;
}

.hwg-nube-speaker em {
	margin-left: 6px;
	padding: 1px 6px;
	border-radius: 4px;
	background: #eeab14;
	color: #fff;
	font-style: normal;
	letter-spacing: 0;
	text-shadow: 1px 1px rgb(0 0 0 / 30%);
}

.hwg-nube-text {
	margin: 0;
	font-size: .95rem;
	line-height: 1.45;
	min-height: 1.45em;
	color: #1b3a4b;
}

.hwg-nube-text.is-typing::after {
	content: '';
	display: inline-block;
	width: 7px;
	height: 1em;
	margin-left: 2px;
	vertical-align: -2px;
	background: #006891;
	animation: hwg-nube-caret .8s steps(1) infinite;
}

@keyframes hwg-nube-caret {
	50% { opacity: 0; }
}

/* ─── Pozo (dentro de la web) ──────────────────────────────────────────── */

.ht-wired-app.hwg-theme-lab {
	width: 100%;
	height: auto;
	min-height: 0;
	background: transparent;
}

.hwg-lab-error {
	padding: 30px 16px;
	color: #b00000;
	text-align: center;
}

.hwg-theme-lab .ht-wired-loading {
	padding: 40px 0;
	color: #004960;
}

.hwg-lab {
	padding: 16px 14px 10px;
	text-align: left;
}

.hwg-lab-top {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.hwg-lab-title h2 {
	margin: 0;
	font-size: 1.35rem;
	color: #004960;
}

.hwg-lab-title p {
	margin: 2px 0 0;
	font-size: .9rem;
	color: #4d6b7a;
}

.hwg-lab-totals {
	display: flex;
	gap: 8px;
}

.hwg-lab-totals span {
	padding: 5px 10px;
	border: 2px solid #fff;
	border-radius: 8px;
	background: #f5f9fb;
	box-shadow: 0 0 0 2px #000;
	font-size: .9rem;
	color: #004960;
	white-space: nowrap;
}

.hwg-lab-totals .fa-star {
	color: #f5b400;
}

.hwg-nube-box.is-pozo {
	margin: 0 2px 20px;
}

.hwg-lab-shaft {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 2px;
}

.hwg-lab-wing {
	overflow: hidden;
}

/* Quienes han completado la historia: tabla al final del pozo. */
.hwg-fin-wrap {
	overflow-x: auto;
}

.hwg-fin-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 14px;
}

.hwg-fin-table th,
.hwg-fin-table td {
	padding: 6px 10px;
	border-bottom: 1px solid rgba(0, 0, 0, .08);
	text-align: left;
	white-space: nowrap;
}

.hwg-fin-table th {
	color: #5b6b75;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
}

.hwg-fin-table tr.is-me td {
	background: #fff8d6;
}

.hwg-fin-table .hwg-fin-pos {
	width: 32px;
	font-weight: 700;
}

.hwg-fin-table .hwg-fin-user a {
	color: inherit;
}

.hwg-fin-table .fa-star {
	color: #f5b301;
}

.hwg-fin-table small {
	opacity: .6;
}

.hwg-lab-floors {
	display: flex;
	flex-direction: column;
}

.hwg-lab-floor {
	display: grid;
	grid-template-columns: 50px 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 10px 12px;
	border-top: 1px solid #d5e3ea;
}

.hwg-lab-floor:first-child {
	border-top: 0;
}

.hwg-lab-floor-num {
	display: grid;
	place-items: center;
	height: 40px;
	border-radius: 8px;
	background: #006891;
	box-shadow: inset 0 -3px 0 #004960;
	font-size: 1.15rem;
	font-weight: bold;
	color: #fff;
	text-shadow: 1px 1px rgb(0 0 0 / 40%);
}

.hwg-lab-floor-body h3 {
	margin: 0;
	font-size: 1rem;
	color: #004960;
}

.hwg-lab-floor-body p {
	margin: 1px 0 0;
	font-size: .85rem;
	color: #4d6b7a;
}

.hwg-lab-floor-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	align-items: center;
	margin-top: 4px;
	font-size: .8rem;
	color: #4d6b7a;
}

.hwg-lab-floor-action {
	display: flex;
	gap: 10px;
	align-items: center;
}

.hwg-lab-floor-action .button {
	text-decoration: none;
}

.hwg-lab-floor.is-done .hwg-lab-floor-num {
	background: #1a9a1a;
	box-shadow: inset 0 -3px 0 #137b00;
}

.hwg-lab-floor.is-current {
	background: #fff6dc;
	box-shadow: inset 4px 0 0 #eeab14;
}

.hwg-lab-floor.is-locked .hwg-lab-floor-num,
.hwg-lab-floor.is-empty .hwg-lab-floor-num {
	background: #a9bcc6;
	box-shadow: inset 0 -3px 0 #8ea3ae;
}

.hwg-lab-floor.is-locked .hwg-lab-floor-body,
.hwg-lab-floor.is-empty .hwg-lab-floor-body {
	opacity: .7;
}

.hwg-lab-floor.is-empty {
	grid-template-columns: 50px 1fr;
}

.hwg-lab-lock {
	padding: 0 8px;
	font-size: 1.1rem;
	color: #8ea3ae;
}

.hwg-lab-wing.is-sealed .hwg-lab-wing-band {
	background: linear-gradient(180deg, #7b8d97 50%, #6a7b85 50%);
}

.hwg-lab-wing.is-secret .hwg-lab-wing-band {
	background: linear-gradient(180deg, #5b3a8c 50%, #472c70 50%);
}

.hwg-lab-sealed {
	margin: 0;
	padding: 8px 12px;
	font-size: .85rem;
	color: #4d6b7a;
}

.hwg-lab-others,
.hwg-lab-finishers {
	margin-top: 22px;
}

.hwg-lab-foot {
	margin: 18px 0 0;
	font-size: .9rem;
}

@media (max-width: 600px) {
	.hwg-lab-floor {
		grid-template-columns: 40px 1fr;
	}

	.hwg-lab-floor-action {
		grid-column: 1 / -1;
		justify-self: end;
	}
}

/* ─── Dentro de la cámara ──────────────────────────────────────────────── */

/* Arriba solo queda el objetivo del paso; N.U.B.E. habla en el chat de la sala. */
.hwg-quest.is-adventure {
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: min(640px, calc(100% - 24px));
	min-width: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}

.hwg-nube-box.is-quest .hwg-nube-text {
	font-size: .9rem;
}

.hwg-nube-box.is-hint {
	background: #fff6dc;
}

.hwg-adv-objective,
.hwg-adv-hud-card {
	border: 2px solid #fff;
	border-radius: 8px;
	background: #f5f9fb;
	box-shadow: 0 0 0 2px #000;
	color: #004960;
}

.hwg-adv-objective {
	display: flex;
	gap: 10px;
	align-items: center;
	align-self: center;
	padding: 5px 12px 5px 6px;
	font-size: .85rem;
}

.hwg-adv-objective div {
	display: flex;
	flex-direction: column;
}

.hwg-adv-objective div span {
	color: #4d6b7a;
}

.hwg-adv-objective-mark {
	flex: 0 0 auto;
	min-width: 30px;
	padding: 3px 6px;
	border-radius: 6px;
	background: #006891;
	font-weight: bold;
	text-align: center;
	color: #fff;
}

.hwg-adv-objective.is-done .hwg-adv-objective-mark {
	background: #1a9a1a;
}

/* Marcador: arriba a la izquierda del stage. */
.hwg-adv-hud {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 7;
	display: none;
	flex-direction: column;
	gap: 8px;
	align-items: flex-start;
}

.hwg-adv-hud.is-visible {
	display: flex;
}

/* Con el inventario plegado, su botón queda en el borde: el marcador le deja sitio. */
.hwg-layout.is-left-collapsed:not(.is-left-hidden) .hwg-adv-hud {
	left: 40px;
}

.hwg-adv-hud-main,
.hwg-adv-hud-notices {
	display: grid;
	gap: 8px;
}

.hwg-adv-hud-notices:empty {
	display: none;
}

/* "Nuevo en el Códice" va debajo de la tarjeta del marcador, con su mismo ancho. */
.hwg-adv-hud-notices .hwg-codex-toast {
	position: static;
	width: 176px;
}

.hwg-adv-hud-notices .hwg-codex-toast-band {
	padding: 6px 8px;
	font-size: .68rem;
	letter-spacing: .5px;
	white-space: nowrap;
}

.hwg-adv-hud-notices .hwg-codex-toast .hwg-btn {
	font-size: .85rem;
}

/* Con el inventario abierto, el marcador va dentro de su panel, debajo de las piezas
   (app.js calcula la altura): así no tapa la sala. */
.hwg-layout:not(.is-left-hidden):not(.is-left-collapsed) .hwg-adv-hud {
	top: 190px;
	left: 14px;
}

.hwg-adv-hud-card {
	width: 176px;
	overflow: hidden;
	font: bold .85rem 'Ubuntu', Arial, sans-serif;
}

/* Planta: franja de widget de la web, partida en dos tonos. */
.hwg-adv-hud-band {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 5px 10px;
	border-bottom: 2px solid rgb(0 2 2 / 32%);
	background: linear-gradient(180deg, rgb(0, 104, 145) 50%, rgb(0, 88, 123) 50%);
	color: #fff;
}

.hwg-adv-hud-band span {
	font-size: .72rem;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.hwg-adv-hud-band b {
	font-size: 1.25rem;
	line-height: 1;
}

.hwg-adv-timer {
	display: flex;
	gap: 6px;
	align-items: center;
	padding: 7px 10px 6px;
}

.hwg-adv-hud-group,
.hwg-adv-hud-nav {
	display: grid;
	gap: 4px;
	padding: 6px;
	border-top: 1px solid #d4e2ea;
}

.hwg-adv-hud-nav {
	grid-template-columns: 1fr;
	background: #eaf2f6;
}

.hwg-adv-hud-btn {
	display: flex;
	gap: 6px;
	align-items: center;
	justify-content: center;
	min-height: 30px;
	padding: 4px 8px;
	border: 1px solid #c9dae3;
	border-radius: 6px;
	background: #fff;
	color: #004960;
	font: inherit;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.hwg-adv-hud-group .hwg-adv-hud-btn {
	justify-content: flex-start;
}

.hwg-adv-hud-btn:hover:not(:disabled) {
	border-color: #9cc3d6;
	background: #e3eef3;
}

.hwg-adv-hud-btn.is-armed {
	border-color: #e0c77a;
	background: #fff6dc;
	color: #7a4a00;
}

.hwg-adv-hud-btn:disabled {
	opacity: .55;
	cursor: not-allowed;
}

.hwg-adv-timer small {
	font-weight: normal;
	color: #4d6b7a;
}

.hwg-adv-timer.is-over b {
	color: #b00000;
}

/* Un panel oculto no deja su flecha (app.css les da display y ganaba a [hidden]). */
.hwg-panel-toggle[hidden],
.hwg-mode[hidden] {
	display: none !important;
}

.hwg-layout.is-right-hidden .hwg-panel {
	transform: translateX(100%);
	pointer-events: none;
}

.hwg-layout.is-right-hidden .hwg-panel-toggle.is-right {
	display: none;
}

/* Panel del jugador: los wireds de la sala. */
.hwg-adv-circuit h2 {
	margin: 0 0 4px;
	font: bold .95rem 'Ubuntu', Arial, sans-serif;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.hwg-adv-circuit > p {
	margin: 0 0 12px;
	font-size: .85rem;
	opacity: .8;
}

.hwg-adv-wired {
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	gap: 10px;
	align-items: center;
	margin-bottom: 10px;
	padding: 8px 10px;
	border: 2px solid #fff;
	border-radius: 8px;
	background: #f5f9fb;
	box-shadow: 0 0 0 2px #000;
	color: #004960;
	font-family: 'Ubuntu', Arial, sans-serif;
}

.hwg-adv-wired img {
	max-width: 40px;
	max-height: 40px;
}

.hwg-adv-wired div {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.hwg-adv-wired small {
	font-size: .75rem;
	color: #4d6b7a;
}

.hwg-adv-wired .fa-check-circle {
	color: #1a9a1a;
	font-size: 1.1rem;
}

.hwg-adv-wired.is-selected {
	background: #fff6dc;
}

/* Mover y Recoger, en los Wired que colocó el jugador. */
/* .hwg-adv-wired div pone los div en columna: esta fila va en horizontal. */
.hwg-adv-wired .hwg-adv-wired-tools {
	flex-direction: row;
	grid-column: 1 / -1;
	gap: 6px;
}

.hwg-adv-tool {
	display: inline-flex;
	flex: 1;
	gap: 6px;
	align-items: center;
	justify-content: center;
	padding: 4px 8px;
	border: 1px solid #c9dae3;
	border-radius: 6px;
	background: #fff;
	color: #004960;
	font: bold .78rem 'Ubuntu', Arial, sans-serif;
	cursor: pointer;
}

.hwg-adv-tool:hover {
	border-color: #9cc3d6;
	background: #e3eef3;
}

.hwg-adv-locked-title {
	margin: 14px 0 8px;
	font: bold .8rem 'Ubuntu', Arial, sans-serif;
	letter-spacing: 1px;
	text-transform: uppercase;
	opacity: .85;
}

.hwg-adv-wired.is-locked {
	background: #e8edf0;
}

.hwg-adv-wired.is-locked img {
	filter: grayscale(1);
}

.hwg-adv-wired.is-locked .fa-lock {
	color: #6b8594;
}

/* Pilas de "Ya montados en la sala": una tarjeta por pila, plegable. */
.hwg-adv-stack {
	margin-bottom: 10px;
	border: 2px solid #fff;
	border-radius: 8px;
	background: #e8edf0;
	box-shadow: 0 0 0 2px #000;
	color: #004960;
	font-family: 'Ubuntu', Arial, sans-serif;
	overflow: hidden;
}

.hwg-adv-stack > summary {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 10px;
	align-items: center;
	padding: 8px 10px;
	background: #f5f9fb;
	cursor: pointer;
	list-style: none;
}

.hwg-adv-stack > summary::-webkit-details-marker {
	display: none;
}

.hwg-adv-stack > summary img {
	max-width: 40px;
	max-height: 40px;
	filter: grayscale(1);
}

.hwg-adv-stack > summary div {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.hwg-adv-stack > summary small {
	font-size: .75rem;
	color: #4d6b7a;
}

.hwg-adv-stack > summary .fa-chevron-down {
	color: #6b8594;
	transition: transform .2s ease;
}

.hwg-adv-stack[open] > summary {
	border-bottom: 2px solid #c9dae3;
}

.hwg-adv-stack[open] > summary .fa-chevron-down {
	transform: rotate(180deg);
}

/* Dentro de la pila, los Wired van como filas, sin tarjeta propia. */
.hwg-adv-wired.is-in-stack {
	margin: 0;
	padding: 6px 10px;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.hwg-adv-wired.is-in-stack + .hwg-adv-wired.is-in-stack {
	border-top: 1px solid #d3dee5;
}

.hwg-adv-wired.is-in-stack img {
	max-width: 32px;
	max-height: 32px;
}

.hwg-wired-readonly {
	margin: 0 0 8px;
	padding: 6px 8px;
	border-radius: 6px;
	background: #fff6dc;
	color: #7a4a00;
	font-size: 12px;
}

.hwg-adv-wired .hwg-btn {
	padding: 6px 10px;
	border-radius: 6px;
}

/* Barra de abajo de la cámara: solo la casilla de hablar, como el chat de Habbo. */
.hwg-simbar.is-adventure {
	display: flex;
	gap: 8px;
	width: auto;
}

.hwg-simbar.is-adventure .hwg-chat {
	display: flex;
	gap: 8px;
}

.hwg-simbar.is-adventure .hwg-chat input {
	width: min(360px, 60vw);
}

/* Sonido, en la barra de arriba con el idioma y el usuario. */
.hwg-sound-toggle {
	display: inline-grid;
	place-items: center;
	width: 30px;
	height: 30px;
	padding: 0;
	line-height: 1;
	border: 1px solid rgb(255 255 255 / 35%);
	border-radius: 6px;
	background: transparent;
	color: #fff;
	font-size: 13px;
	cursor: pointer;
}

/* Los dos iconos de altavoz tienen anchos distintos: caja fija para que no bailen. */
.hwg-sound-toggle i {
	width: 16px;
	text-align: center;
}

.hwg-sound-toggle:hover {
	background: rgb(255 255 255 / 15%);
}

.hwg-sound-toggle[aria-pressed="true"] {
	color: #ffd0c8;
}

/* En una cámara los avisos van arriba, bajo el objetivo: abajo habla N.U.B.E. */
.is-adventure-play .hwg-toast {
	top: 120px;
	bottom: auto;
}

/* N.U.B.E. (la historia): su propio chat, encima de la barra de Decir, con su cara
   a la izquierda del bocadillo. */
.hwg-adv-talk {
	position: absolute;
	left: 50%;
	bottom: 84px;
	z-index: 7;
	display: none;
	width: min(620px, calc(100% - 24px));
	transform: translateX(-50%);
	pointer-events: none;
}

.hwg-adv-talk.is-visible {
	display: block;
}

.hwg-adv-say {
	display: flex;
	gap: 14px;
	align-items: flex-end;
	cursor: pointer;
	pointer-events: auto;
	animation: hwg-adv-bubble-in .25s cubic-bezier(.2, .9, .3, 1.2) both;
}

.hwg-adv-say > .hwg-nube-portrait {
	width: 52px;
	height: 52px;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 2px #000, inset 0 -3px 0 #004960;
}

.hwg-adv-bubble {
	position: relative;
	flex: 1;
	min-width: 0;
	padding: 9px 14px;
	border: 2px solid #000;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 3px 0 rgb(0 0 0 / 35%);
	color: #1b3a4b;
	font-family: 'Ubuntu', Arial, sans-serif;
}

/* Piquito hacia N.U.B.E., a la altura de su cara. */
.hwg-adv-bubble::before {
	content: '';
	position: absolute;
	left: -9px;
	bottom: 16px;
	width: 14px;
	height: 14px;
	border-bottom: 2px solid #000;
	border-left: 2px solid #000;
	background: inherit;
	transform: rotate(45deg);
}

.hwg-adv-bubble p {
	margin: 0;
	font-size: .92rem;
	line-height: 1.4;
}

.hwg-adv-bubble b {
	color: #006891;
}

.hwg-adv-say.is-hint .hwg-adv-bubble {
	background: #fff6dc;
}

.hwg-adv-say.is-hint .hwg-adv-bubble b {
	color: #9a6200;
}

/* N.U.B.E. en reposo: su cara y su nombre sobre la barra de Decir, para repetirla. */
.hwg-adv-talk.is-idle {
	display: block;
}

.hwg-adv-replay {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	pointer-events: auto;
	animation: hwg-adv-bubble-in .3s ease-out both;
}

/* 44 px: la nube de 40x40 cabe entera dentro del borde, sin escalarla. */
.hwg-adv-replay > .hwg-nube-portrait {
	width: 44px;
	height: 44px;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 2px #000, inset 0 -3px 0 #004960;
}

.hwg-adv-replay-label {
	padding: 4px 10px;
	border: 2px solid #fff;
	border-radius: 8px;
	background: #f5f9fb;
	box-shadow: 0 0 0 2px #000;
	color: #004960;
	font: bold .8rem 'Ubuntu', Arial, sans-serif;
}

.hwg-adv-replay:hover .hwg-adv-replay-label {
	background: #e3eef3;
}

.hwg-adv-talk.is-leaving .hwg-adv-say {
	animation: hwg-adv-bubble-out .6s ease-in both;
}

@keyframes hwg-adv-bubble-in {
	from { opacity: 0; transform: translateY(12px) scale(.96); }
}

@keyframes hwg-adv-bubble-out {
	to { opacity: 0; transform: translateY(-40px); }
}

/* Chat de los avatares al estilo Habbo: una capa sobre la sala; cada mensaje se
   coloca con translateY desde adventure.js (say) y sube a saltos, sin deslizarse. */
.hwg-room-chat {
	position: absolute;
	inset: 0;
	z-index: 6;
	display: none;
	overflow: hidden;
	pointer-events: none;
}

.hwg-room-chat.is-visible {
	display: block;
}

.hwg-chat-row {
	position: absolute;
	top: 0;
	left: 0;
	max-width: min(320px, calc(100% - 16px));
}

/* Aparece de golpe, como en Habbo; solo se desvanece al salir por arriba. */
.hwg-chat-row.is-leaving {
	opacity: 0;
	transition: opacity .5s;
}

/* La burbuja es pixel art, como la de Habbo: borde de 1 px con las esquinas en escalera
   (una imagen de 7 x 7 px partida en nueve; sin escalar, nítida) y sin sombra. */
.hwg-chat-bubble {
	position: relative;
	display: flex;
	gap: 5px;
	align-items: center;
	padding: 1px 8px 1px 2px;
	border: 3px solid transparent;
	border-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAMElEQVR42mNkQID/SGxGOMHAwPD//3+EHCMjRI4RXQJZARMDHkBQkhFqB1Y7cboWAJWKChJjqkz1AAAAAElFTkSuQmCC) 3 fill / 3px stretch;
	image-rendering: pixelated;
	background: none;
	color: #111;
	font: 12px/1.35 'Ubuntu', Arial, sans-serif;
}

.hwg-chat-bubble p {
	margin: 0;
	padding: 2px 0;
}

.hwg-chat-bubble b {
	color: #000;
}

/* La cabeza de Habbo (imagen de 54x62, sin escalar) se enseña entera, sombrero incluido:
   ocupa una casilla pequeña y la cabeza sobresale por arriba, por abajo y por la
   izquierda de la burbuja, como en Habbo, sin hacerla más alta. */
/* Notificación del Wired Mensaje: cuadro de color con su icono, como en Habbo. */
.hwg-chat-notice {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 20px;
	margin: -3px 0 -3px -3px;
	border-radius: 3px;
	color: #fff;
	font-size: 12px;
}

.hwg-chat-row.is-notice .hwg-chat-bubble {
	padding-left: 3px;
}

.hwg-chat-row.is-width-narrow {
	max-width: min(200px, calc(100% - 16px));
}

.hwg-chat-row.is-width-wide {
	max-width: min(460px, calc(100% - 16px));
}

.hwg-chat-icon {
	position: relative;
	flex: 0 0 auto;
	display: block;
	width: 28px;
	height: 20px;
	margin: -3px 0 -3px -8px;
}

.hwg-chat-icon img {
	position: absolute;
	top: -17px;
	left: -14px;
	display: block;
	max-width: none;
	pointer-events: none;
}

/* Un furni que habla (grabación, Relojero): su icono entero y centrado, sin escalar. */
.hwg-chat-icon.is-furni {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 32px;
	margin: -5px 0 -5px -6px;
	overflow: hidden;
}

.hwg-chat-icon.is-furni img {
	position: static;
	margin: 0;
	image-rendering: pixelated;
}

/* Piquito escalonado hacia quien habla (su posición la pone adventure.js). Su primera
   fila tapa el borde de abajo de la burbuja, así queda unido a ella. */
.hwg-chat-tail {
	position: absolute;
	bottom: -4px;
	width: 9px;
	height: 5px;
	background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAFCAYAAACXU8ZrAAAAMUlEQVR42nWNQQoAMAzCkv7/z+6wjcFovYgSUSBJmKRS2x0BwHrZFujGOd/z/wX/YgExQAsOpQScwwAAAABJRU5ErkJggg==) no-repeat;
	image-rendering: pixelated;
}

/* Un estilo de burbuja por personaje, como los estilos de chat de Habbo. */
/* Sujeto 7. */
.hwg-chat-row.is-style-seven .hwg-chat-bubble {
	border-image-source: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAOUlEQVR42mNkgIIaXaH/MHbL5XeMDMgS/99ehWOYQsYaXaH/zQcOM6CDWgdbBiYGPACvJH478bkWAEM7KirP7q/yAAAAAElFTkSuQmCC);
}

.hwg-chat-row.is-style-seven .hwg-chat-tail {
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAFCAYAAACXU8ZrAAAANElEQVR42mOs0RX633zgMAMuUOtgC2HU6Ar9///2Kgau0RX6j6IDXSGGAnSFOBUgK0QXAwBxMTKSv4H2hQAAAABJRU5ErkJggg==);
}

.hwg-chat-row.is-style-seven .hwg-chat-bubble b {
	color: #9a3412;
}

/* Robots (Recadero, Mensajero...), como el estilo bot de Habbo. */
.hwg-chat-row.is-style-bot .hwg-chat-bubble {
	border-image-source: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAL0lEQVR42mNkgAIer7z/MPaXbZMYGZAlHnz6B8dwhegSyAqYGPAAvJJ47WTE51oAa3o8fpx3GhMAAAAASUVORK5CYII=);
}

.hwg-chat-row.is-style-bot .hwg-chat-tail {
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAFCAYAAACXU8ZrAAAANElEQVR42mPk8cr7f2XFBAZcQCeiAMLg8cr7/+DTPwzM45X3H0UHukIMBegKcSpAVoguBgC9YDNhJ5lZ6gAAAABJRU5ErkJggg==);
}

.hwg-chat-row.is-style-bot .hwg-chat-bubble b {
	color: #075985;
}

/* El Relojero: metálico. */
.hwg-chat-row.is-style-clock .hwg-chat-bubble {
	border-image-source: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAOUlEQVR42mNkgAJ5TfP/MPbD6ycZGZAlnj5/DccwhYzymub/j+3bwoAOrJx8GJgY8AC8kvjtxOdaAKS+KMLe4wfpAAAAAElFTkSuQmCC);
}

.hwg-chat-row.is-style-clock .hwg-chat-tail {
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAFCAYAAACXU8ZrAAAANElEQVR42mOU1zT/f2zfFgZcwMrJB8KQ1zT///T5awwsr2n+H0UHukIMBegKcSpAVoguBgCYQDBY4xfHagAAAABJRU5ErkJggg==);
}

.hwg-chat-row.is-style-clock .hwg-chat-bubble b {
	color: #374151;
}

/* Grabaciones, terminales y antenas que hablan: holograma. */
.hwg-chat-row.is-style-holo .hwg-chat-bubble {
	border-image-source: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAL0lEQVR42mNkgAL+srz/MPbHrkmMDMgSZ35/hGO4QnQJZAVMDHgAXkm8djLicy0Ac+E8kNWvIHoAAAAASUVORK5CYII=);
}

.hwg-chat-row.is-style-holo .hwg-chat-tail {
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAFCAYAAACXU8ZrAAAANElEQVR42mPkL8v7v7e1mQEXcK6uhTD4y/L+n/n9EQPzl+X9R9GBrhBDAbpCnAqQFaKLAQDkpTQBfG1FrgAAAABJRU5ErkJggg==);
}

.hwg-chat-row.is-style-holo .hwg-chat-bubble b {
	color: #115e59;
}

/* Carteles y tablones: papel. */
.hwg-chat-row.is-style-note .hwg-chat-bubble {
	border-image-source: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAOUlEQVR42mNkgIJCe6H/MHb/wXeMDMgS/34ehmOYQsZCe6H/vbs2MqCDYjd/BiYGPACvJH478bkWAEFPKiOvQqfpAAAAAElFTkSuQmCC);
}

.hwg-chat-row.is-style-note .hwg-chat-tail {
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAFCAYAAACXU8ZrAAAANElEQVR42mMstBf637trIwMuUOzmD2EU2gv9//fzMAYutBf6j6IDXSGGAnSFOBUgK0QXAwBpwzKL1cXzKwAAAABJRU5ErkJggg==);
}

.hwg-chat-row.is-style-note .hwg-chat-bubble b {
	color: #854d0e;
}

.hwg-stage.is-descending .hwg-room-chat,
.hwg-stage.is-descending .hwg-adv-talk {
	opacity: 0;
	transition: opacity .3s;
}

/* Saltar la conversación de llegada (secuencias que bloquean al jugador). */
.hwg-seq-skip {
	position: absolute;
	right: 16px;
	bottom: 96px;
	z-index: 13;
	display: inline-flex;
	gap: 8px;
	align-items: center;
	padding: 6px 14px;
	border: 2px solid #fff;
	border-radius: 8px;
	background: #f5f9fb;
	box-shadow: 0 0 0 2px #000;
	color: #004960;
	font: bold .85rem 'Ubuntu', Arial, sans-serif;
	cursor: pointer;
	animation: hwg-adv-fade .4s ease-out both;
}

.hwg-seq-skip:hover {
	background: #e3eef3;
}

/* Secuencia "abrir los ojos": pantalla negra con un hueco con forma de ojo en el
   centro que se entreabre, parpadea y se abre del todo (duración en --eyes-ms). */
.hwg-eyes {
	position: absolute;
	inset: 0;
	z-index: 12;
	overflow: hidden;
	pointer-events: none;
}

.hwg-eye-hole {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 160%;
	height: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 200vmax #000;
	transform: translate(-50%, -50%);
}

.hwg-eyes.is-opening .hwg-eye-hole {
	animation: hwg-eye-open var(--eyes-ms, 2800ms) ease-in-out forwards;
}

@keyframes hwg-eye-open {
	0% { height: 0; }
	22% { height: 28%; }
	32% { height: 1%; }
	50% { height: 55%; }
	58% { height: 12%; }
	100% { height: 320%; }
}

/* Caída a la planta de abajo: la sala sube y desaparece antes de los resultados. */
.hwg-stage.is-descending .hwg-room-wrap {
	transition: transform .9s cubic-bezier(.55, 0, .8, .4), opacity .9s ease-in;
	transform: translateY(-38%);
	opacity: 0;
}

.hwg-stage.is-descending .hwg-quest,
.hwg-stage.is-descending .hwg-simbar,
.hwg-stage.is-descending .hwg-adv-hud {
	opacity: 0;
	pointer-events: none;
	transition: opacity .4s;
}

/* ─── Resultados ───────────────────────────────────────────────────────── */

/* Mientras se comprueba si el navegador deja sonar: nada encima (o negro si la cámara
   empieza con los ojos cerrados). Si no deja, sale la tarjeta de entrada. */
.hwg-adv-result.is-pending {
	background: transparent;
}

.hwg-adv-result.is-pending.is-dark,
.hwg-adv-result.is-gate {
	background: #000;
}

.hwg-adv-result.is-pending.is-visible {
	animation: none;
}

.hwg-adv-gate {
	width: min(420px, 100%);
}

.hwg-adv-gate h2 {
	text-align: center;
}

.hwg-adv-gate .hwg-adv-result-actions {
	padding-top: 4px;
}

/* Botones de la puerta, uno por línea. */
.hwg-adv-gate .hwg-adv-gate-actions {
	flex-direction: column;
	align-items: stretch;
	padding-left: 16px;
	padding-right: 16px;
}

.hwg-adv-gate .hwg-adv-gate-actions .hwg-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	text-align: center;
}

/* Jugar sin cuenta: nombre, hotel y aviso. */
.hwg-adv-guest {
	margin: 0 16px 12px;
	text-align: left;
}

.hwg-adv-guest label {
	display: block;
	margin-bottom: 4px;
	font-weight: bold;
	color: #004960;
}

.hwg-adv-guest-row {
	display: flex;
	gap: 8px;
}

.hwg-adv-guest select {
	flex: 0 0 auto;
	padding: 7px 8px;
	border: 2px solid #9fb8c6;
	border-radius: 6px;
	background: #fff;
	color: #1b3a4b;
	font: inherit;
}

.hwg-adv-guest small {
	display: block;
	margin-top: 5px;
	color: #4a6676;
	font-size: .78rem;
}

.hwg-adv-guest input {
	box-sizing: border-box;
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	padding: 7px 10px;
	border: 2px solid #9fb8c6;
	border-radius: 6px;
	background: #fff;
	color: #1b3a4b;
	font: inherit;
}

.hwg-adv-guest input:focus {
	border-color: #0f7fa8;
	outline: none;
}

.hwg-adv-guest input.is-invalid {
	border-color: #c0392b;
}

.hwg-adv-guest p {
	margin: 8px 0 0;
	padding: 6px 10px;
	border-radius: 6px;
	background: #fff1d6;
	color: #7a4a00;
	font-size: .82rem;
	line-height: 1.35;
}

.hwg-adv-result {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: none;
	place-items: center;
	padding: 16px;
	background: rgb(0 20 30 / 78%);
	overflow-y: auto;
}

.hwg-adv-result.is-visible {
	display: grid;
	animation: hwg-adv-fade .3s ease-out both;
}

@keyframes hwg-adv-fade {
	from { opacity: 0; }
}

.hwg-adv-result-card {
	width: min(540px, 100%);
	overflow: hidden;
	text-align: center;
}

.hwg-adv-result-band {
	justify-content: center;
}

.hwg-adv-result-card h2 {
	margin: 14px 16px 12px;
	font-size: 1.45rem;
	color: #004960;
}

.hwg-adv-result-stars {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin: 0 16px 14px;
}

.hwg-adv-goal {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	max-width: 150px;
	font-size: .8rem;
	color: #8ea3ae;
}

.hwg-adv-goal .fa-star {
	font-size: 2.1rem;
	color: #c7d6de;
}

.hwg-adv-goal.is-on {
	color: #004960;
	font-weight: bold;
}

.hwg-adv-goal.is-on .fa-star {
	color: #f5b400;
	text-shadow: 2px 2px 0 #b07800;
	animation: hwg-adv-star .45s cubic-bezier(.2, 1.6, .4, 1) var(--d, 0ms) both;
}

@keyframes hwg-adv-star {
	from { transform: scale(0); opacity: 0; }
}

.hwg-adv-result-stats {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 0 16px 14px;
}

.hwg-adv-result-stats span {
	display: flex;
	flex-direction: column;
	min-width: 90px;
	padding: 5px 10px;
	border-radius: 8px;
	background: #e3eef3;
	color: #004960;
}

.hwg-adv-result-stats small {
	font-size: .72rem;
	color: #4d6b7a;
}

.hwg-adv-result-stats b {
	font-size: 1.1rem;
}

.hwg-adv-result-stats em {
	font-size: .7rem;
	font-style: normal;
	font-weight: bold;
	color: #1a9a1a;
}

.hwg-nube-box.is-result {
	margin: 0 16px 14px;
	background: #fff;
}

.hwg-adv-result-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0 16px 16px;
}

/* Botones como los de la web (sin el tema cargado en la pantalla completa). */
.hwg-adv-result-actions .hwg-btn {
	padding: 8px 14px;
	border: 2px solid #fff;
	border-radius: 8px;
	background: linear-gradient(180deg, rgb(0, 104, 145) 50%, rgb(0, 88, 123) 50%);
	box-shadow: 0 0 0 2px #000;
	color: #fff;
	font: bold .9rem 'Ubuntu', Arial, sans-serif;
	text-decoration: none;
	text-shadow: 1px 1px rgb(0 0 0 / 40%);
}

.hwg-adv-result-actions .hwg-btn-primary {
	background: linear-gradient(180deg, #1a9a1a 50%, #137b00 50%);
}

.hwg-adv-result-actions .hwg-btn:hover {
	filter: brightness(1.08);
}

/* Bajada entre plantas. */
.hwg-adv-descent {
	display: flex;
	flex-direction: column;
	align-items: center;
	color: #fff;
	text-align: center;
}

.hwg-adv-descent small {
	font-size: .9rem;
	font-weight: bold;
	letter-spacing: 1px;
	text-transform: uppercase;
	text-shadow: 1px 1px rgb(0 0 0 / 60%);
}

.hwg-adv-descent b {
	font-size: 4rem;
	line-height: 1.1;
	text-shadow: 3px 3px 0 #000;
	animation: hwg-adv-drop .6s cubic-bezier(.2, 1.4, .4, 1) both;
}

.hwg-adv-descent-shaft {
	display: none;
}

@keyframes hwg-adv-drop {
	from { transform: translateY(-40px); opacity: 0; }
}

/* Pantalla de carga de una cámara (antes de que arranque app.js). */
.ht-wired-loading.is-adventure {
	background: #0e2a38;
	color: #fff;
	font: bold 1.05rem 'Ubuntu', Arial, sans-serif;
}

/* Cámara de Aventura: todo negro mientras carga, también la barra de arriba. La
   cortina se desvanece al empezar la cámara (app.js, revealAdventureChamber). */
body.is-chamber-boot,
body.is-chamber-boot .ht-wired-loading {
	background: #000;
}

.hwg-boot-cover {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	background: #000;
	pointer-events: none;
	transition: opacity .6s ease;
}

/* Logo de Wired AdvenHTure: pixel art a su tamaño (600x205). Solo si no cabe se
   reduce, sin suavizar los píxeles. */
.hwg-adventure-logo {
	display: block;
	width: 600px;
	max-width: calc(100% - 32px);
	height: auto;
	image-rendering: pixelated;
}

.hwg-boot-cover .hwg-adventure-logo {
	animation: hwg-logo-in .5s ease-out both;
}

@keyframes hwg-logo-in {
	from { opacity: 0; transform: translateY(6px); }
}

/* Tarjeta "Entrar": el logo encima, sobre el negro. */
.hwg-adv-result.is-gate {
	align-content: center;
	gap: 22px;
}

/* Pozo: el logo arriba (y mientras carga, en el mismo sitio). */
.hwg-lab-logo,
.hwg-lab-loading {
	display: flex;
	justify-content: center;
	margin: 4px 0 14px;
}

.hwg-lab-loading {
	padding: 16px 0 40px;
}

.hwg-boot-cover.is-gone {
	opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
	.hwg-adv-descent b,
	.hwg-nube-eye,
	.hwg-nube-pupil,
	.hwg-adv-goal.is-on .fa-star {
		animation: none;
	}

	.hwg-stage.is-descending .hwg-room-wrap {
		transition-duration: .01ms;
	}
}

/* ─── Códice de Wired (assets/codex.js) ─────────────────────────────────── */

.hwg-adv-hud-btn {
	position: relative;
}

.hwg-adv-dot {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 11px;
	height: 11px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #1d9e3a;
	box-shadow: 0 0 0 1px #000;
}

.hwg-wired-codex-link {
	display: inline-flex;
	gap: 5px;
	align-items: center;
	margin-top: 5px;
	padding: 0;
	border: 0;
	background: none;
	color: #1c5f86;
	font: inherit;
	font-size: 11px;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

.hwg-codex-overlay {
	position: fixed;
	inset: 0;
	z-index: 99990;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgb(0 20 30 / 72%);
	font-family: 'Ubuntu', Arial, Helvetica, sans-serif;
}

.hwg-codex {
	display: flex;
	flex-direction: column;
	width: min(920px, 100%);
	height: min(640px, calc(100vh - 32px));
	overflow: hidden;
	border: 2px solid #fff;
	border-radius: 10px;
	background: #f5f9fb;
	box-shadow: 0 0 0 2px #000;
	color: #1b3a4b;
}

.hwg-codex-band {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 8px 10px 8px 14px;
	border-bottom: 2px solid rgb(0 2 2 / 32%);
	background: linear-gradient(180deg, rgb(0, 104, 145) 50%, rgb(0, 88, 123) 50%);
	color: #fff;
	font-weight: bold;
	letter-spacing: 1px;
}

.hwg-codex-band > span {
	flex: 1;
	text-transform: uppercase;
}

.hwg-codex-band small {
	font-size: .78rem;
	letter-spacing: 0;
	opacity: .9;
}

.hwg-codex-close {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 6px;
	background: #c0392b;
	box-shadow: 0 0 0 1px #000;
	color: #fff;
	cursor: pointer;
}

.hwg-codex-body {
	display: grid;
	flex: 1;
	grid-template-columns: 290px minmax(0, 1fr);
	min-height: 0;
}

.hwg-codex-nav {
	display: flex;
	flex-direction: column;
	min-height: 0;
	border-right: 2px solid #d4e2ea;
	background: #eaf2f6;
}

.hwg-codex-search {
	margin: 10px;
	padding: 7px 10px;
	border: 2px solid #b8cdd8;
	border-radius: 6px;
	font: inherit;
}

.hwg-codex-list {
	flex: 1;
	min-height: 0;
	padding: 0 10px 10px;
	overflow-y: auto;
}

.hwg-codex-group h3 {
	display: flex;
	justify-content: space-between;
	margin: 12px 2px 6px;
	color: #004960;
	font-size: .78rem;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.hwg-codex-group h3 small {
	color: #5b7a8a;
}

.hwg-codex-item {
	display: flex;
	gap: 8px;
	align-items: center;
	width: 100%;
	min-height: 40px;
	margin-bottom: 4px;
	padding: 4px 8px;
	border: 2px solid transparent;
	border-radius: 7px;
	background: #fff;
	color: #1b3a4b;
	font: inherit;
	font-size: .88rem;
	text-align: left;
	cursor: pointer;
}

.hwg-codex-item > .hwg-codex-name {
	flex: 1;
	min-width: 0;
	text-align: left;
}

.hwg-codex-item:hover:not(:disabled) {
	border-color: #9cc3d6;
}

.hwg-codex-item.is-active {
	border-color: #006891;
	background: #dff1f9;
}

.hwg-codex-item.is-locked {
	background: transparent;
	color: #7d97a4;
	cursor: default;
}

.hwg-codex-item.is-locked .hwg-codex-icon {
	filter: brightness(0);
	opacity: .3;
}

.hwg-codex-item em {
	padding: 1px 6px;
	border-radius: 4px;
	background: #1d9e3a;
	color: #fff;
	font-size: .68rem;
	font-style: normal;
	font-weight: bold;
	text-transform: uppercase;
}

.hwg-codex-icon {
	flex: 0 0 auto;
	max-width: 40px;
	max-height: 40px;
}

.hwg-codex-concept-icon {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #ffcf40;
	color: #6b4a00;
}

.hwg-codex-detail {
	min-height: 0;
	padding: 18px 24px;
	overflow-y: auto;
	line-height: 1.5;
}

.hwg-codex-detail h2 {
	margin: 4px 0 8px;
	color: #004960;
	font-size: 1.4rem;
}

.hwg-codex-detail h4 {
	margin: 18px 0 6px;
	color: #004960;
	font-size: .82rem;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.hwg-codex-detail p {
	margin: 0 0 10px;
}

.hwg-codex-kind {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 5px;
	background: #006891;
	color: #fff;
	font-size: .72rem;
	font-weight: bold;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.hwg-codex-kind.is-trigger { background: #0b7fb0; }
.hwg-codex-kind.is-condition { background: #c46a00; }
.hwg-codex-kind.is-effect { background: #6b3fb5; }
.hwg-codex-kind.is-addon,
.hwg-codex-kind.is-selector,
.hwg-codex-kind.is-variable { background: #3d5866; }
.hwg-codex-kind.is-concept { background: #b58600; }

.hwg-codex-head {
	display: flex;
	gap: 12px;
	align-items: center;
}

.hwg-codex-lead {
	font-size: 1.02rem;
}

.hwg-codex-example {
	margin: 12px 0;
	padding: 10px 12px;
	border: 2px solid #fff;
	border-radius: 8px;
	background: #fff6dc;
	box-shadow: 0 0 0 1px #e0c77a;
}

.hwg-codex-example b {
	color: #7a4a00;
	font-size: .78rem;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.hwg-codex-example p {
	margin: 2px 0 0;
}

.hwg-codex-fields {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hwg-codex-fields li {
	display: grid;
	gap: 1px;
	margin-bottom: 6px;
	padding: 7px 10px;
	border-radius: 6px;
	background: #fff;
}

.hwg-codex-fields span {
	color: #4f6d7c;
	font-size: .86rem;
}

/* Tarjeta con qué hace su tipo (causante, efecto...). */
.hwg-codex-role {
	margin: 18px 0 0;
	padding: 12px 14px;
	border: 2px solid #fff;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 0 0 1px #c9dae3;
}

.hwg-codex-role-head {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 6px;
}

.hwg-codex-role-head b {
	color: #004960;
	font-size: .98rem;
}

.hwg-codex-role p {
	margin: 0 0 10px;
}

.hwg-codex-chip {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	padding: 5px 10px;
	border: 1px solid #e0c77a;
	border-radius: 6px;
	background: #fff6dc;
	color: #7a4a00;
	font: inherit;
	font-size: .85rem;
	font-weight: bold;
	cursor: pointer;
}

.hwg-codex-chip:hover {
	background: #ffeec0;
}

/* Pie de la ficha: dónde lo viste y el botón del Sandbox, con aire. */
.hwg-codex-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: space-between;
	align-items: center;
	margin-top: 22px;
	padding-top: 16px;
	border-top: 2px solid #d4e2ea;
}

.hwg-codex-foot .hwg-codex-seen {
	margin: 0;
}

.hwg-codex-foot .hwg-btn {
	padding: 8px 16px;
}

.hwg-codex-link {
	padding: 0;
	border: 0;
	background: none;
	color: #006891;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.hwg-codex-seen {
	color: #4f6d7c;
	font-size: .88rem;
}

.hwg-codex-stack {
	display: inline-grid;
	gap: 2px;
	margin: 6px 0 12px;
	padding: 8px 12px;
	border-radius: 8px;
	background: #fff;
}

.hwg-codex-stack > div {
	display: flex;
	gap: 8px;
	align-items: center;
	font-size: .82rem;
	font-weight: bold;
}

.hwg-codex-locked {
	display: flex;
	gap: 8px;
	align-items: center;
	margin: 2px 0 4px;
	padding: 7px 10px;
	border: 2px dashed #b8cdd8;
	border-radius: 7px;
	color: #5b7a8a;
	font-size: .84rem;
}

/* Dibujo del panel de un Wired con sus partes numeradas. */
.hwg-codex-mock {
	width: min(300px, 100%);
	margin: 6px 0 12px;
	overflow: hidden;
	border: 1px solid #5d5d58;
	border-radius: 8px;
	background: #f2f2ec;
	box-shadow: 0 2px 0 rgb(0 0 0 / 25%);
	color: #252525;
	font-size: 12px;
}

.hwg-codex-mock-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 5px 7px;
	border-bottom: 1px solid #8c8c86;
	background: repeating-linear-gradient(135deg, #e2e2db 0 2px, #d4d4cc 2px 4px);
}

.hwg-codex-mock-head span {
	display: grid;
	place-items: center;
	width: 16px;
	height: 16px;
	border: 1px solid #5d5d58;
	border-radius: 50%;
	background: #fdfdfa;
	font-size: 11px;
	font-weight: bold;
	line-height: 1;
}

.hwg-codex-mock-body {
	padding: 6px 8px 8px;
}

.hwg-codex-mock-part {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 2px 8px;
	align-items: center;
	margin-bottom: 5px;
	padding: 6px 8px 6px 30px;
	border: 1px dashed #b8b8b0;
	border-radius: 6px;
	background: #fff;
}

.hwg-codex-mock-part small {
	flex-basis: 100%;
	font-weight: bold;
}

.hwg-codex-mock-part u {
	color: #1c5f86;
	font-size: 11px;
}

.hwg-codex-mock-n {
	position: absolute;
	top: 50%;
	left: 6px;
	display: grid;
	place-items: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #b58600;
	color: #fff;
	font-size: 11px;
	font-weight: bold;
	transform: translateY(-50%);
}

.hwg-codex-mock-slider {
	flex-basis: 100%;
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(90deg, #3a3a36 12%, #c9c9c1 12%);
}

.hwg-codex-mock-btn {
	padding: 2px 10px;
	border: 1px solid #8a8a8a;
	border-radius: 4px;
	background: linear-gradient(#fdfdfa, #dcdcd4);
	font-weight: bold;
}

.hwg-codex-mock-legend {
	margin: 0 0 10px;
}

.hwg-codex-detail .hwg-codex-mock-legend p {
	position: relative;
	margin: 0 0 6px;
	padding-left: 28px;
}

.hwg-codex-mock-legend .hwg-codex-mock-n {
	top: 1px;
	left: 0;
	transform: none;
}

.hwg-codex-empty {
	padding: 16px 4px;
	color: #5b7a8a;
}

/* Aviso "Nuevo en el Códice", arriba a la derecha de la sala. */
.hwg-codex-toast {
	position: absolute;
	top: 14px;
	right: 52px;
	z-index: 16;
	width: 250px;
	overflow: hidden;
	border: 2px solid #fff;
	border-radius: 10px;
	background: #f5f9fb;
	box-shadow: 0 0 0 2px #000;
	color: #1b3a4b;
	font-family: 'Ubuntu', Arial, Helvetica, sans-serif;
	animation: hwg-adv-bubble-in .3s ease-out both;
}

.hwg-codex-toast.is-leaving {
	opacity: 0;
	transition: opacity .4s;
}

.hwg-codex-toast-band {
	padding: 6px 10px;
	border-bottom: 2px solid rgb(0 2 2 / 32%);
	background: linear-gradient(180deg, rgb(29, 158, 58) 50%, rgb(22, 132, 47) 50%);
	color: #fff;
	font-size: .78rem;
	font-weight: bold;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.hwg-codex-toast ul {
	margin: 0;
	padding: 8px 10px 0;
	list-style: none;
}

.hwg-codex-toast li {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-bottom: 6px;
	font-size: .88rem;
	font-weight: bold;
}

.hwg-codex-toast p {
	margin: 0 10px 6px;
	font-size: .82rem;
}

.hwg-codex-toast .hwg-btn {
	display: block;
	width: calc(100% - 20px);
	margin: 4px 10px 10px;
}

@media (max-width: 720px) {
	.hwg-codex-body {
		grid-template-columns: 1fr;
		grid-template-rows: 40% 60%;
	}

	.hwg-codex-nav {
		border-right: 0;
		border-bottom: 2px solid #d4e2ea;
	}

	.hwg-codex-detail {
		padding: 14px 16px;
	}
}

/* Conceptos en negrita dentro de lo que dice N.U.B.E. (**concepto** en el texto). */
.hwg-nube-text strong {
	color: #004960;
	font-weight: 700;
}

/* ─── Modo de pruebas (solo editores) ─────────────────────────────────── */

.hwg-lab-debug,
.hwg-adv-debug {
	overflow: hidden;
	border: 2px solid #fff;
	border-radius: 10px;
	background: #f5f9fb;
	box-shadow: 0 0 0 2px #000;
	color: #1b3a4b;
}

.hwg-lab-debug {
	margin: 0 0 22px;
}

.hwg-lab-debug-band,
.hwg-adv-debug-band {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 7px 12px;
	border-bottom: 2px solid rgb(0 2 2 / 32%);
	background: linear-gradient(180deg, #e08400 50%, #c87400 50%);
	color: #fff;
	font-size: .85rem;
	font-weight: bold;
	letter-spacing: 1px;
	text-transform: uppercase;
	text-shadow: 1px 1px rgb(0 0 0 / 48%);
}

.hwg-lab-debug-band small {
	font-size: .72rem;
	letter-spacing: .5px;
	text-transform: none;
}

.hwg-lab-debug-body {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px;
}

.hwg-lab-debug-body p {
	flex: 1 1 320px;
	margin: 0;
	font-size: .9rem;
}

.hwg-lab-debug-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hwg-lab-try {
	text-decoration: none;
	white-space: nowrap;
}

/* Dentro de la cámara: tarjeta debajo del marcador, con su mismo ancho. */
.hwg-adv-debug {
	width: 176px;
	border-radius: 8px;
	font: bold .85rem 'Ubuntu', Arial, sans-serif;
}

.hwg-adv-debug-band {
	padding: 5px 10px;
	font-size: .72rem;
}

.hwg-adv-debug-band b {
	font-size: .8rem;
	letter-spacing: 0;
	text-transform: none;
}

.hwg-adv-debug .hwg-adv-hud-group {
	border-top: 0;
}

.hwg-adv-debug .hwg-adv-hud-btn.is-on {
	border-color: #e0a23a;
	background: #fff1d6;
	color: #7a4a00;
}

.hwg-adv-debug-floor {
	display: grid;
	gap: 3px;
	padding: 0 6px 6px;
	font-size: .72rem;
	color: #4d6b7a;
}

.hwg-adv-debug-floor select {
	width: 100%;
	min-height: 28px;
	border: 1px solid #c9dae3;
	border-radius: 6px;
	background: #fff;
	color: #004960;
	font: bold .78rem 'Ubuntu', Arial, sans-serif;
}

.hwg-adv-debug-note {
	margin: 0;
	padding: 5px 8px 6px;
	border-top: 1px solid #d4e2ea;
	background: #eaf2f6;
	font-size: .7rem;
	font-weight: normal;
	color: #4d6b7a;
	text-align: center;
}

.hwg-adv-result-debug {
	margin: -6px 16px 12px;
	padding: 5px 10px;
	border-radius: 6px;
	background: #fff1d6;
	color: #7a4a00;
	font-size: .82rem;
	font-weight: bold;
	text-align: center;
}

/* ─── Estado de ánimo de N.U.B.E. ───
   Enfadada (desde la planta -45): cara roja con ceja, burbuja con borde rojo que
   tiembla al aparecer e interferencias en el texto. Inestable: alterna. Triste: apagada. */
.hwg-nube-brow {
	display: none;
	fill: none;
	stroke: #2a0505;
	stroke-width: 2;
}

[data-nube-mood="angry"] .hwg-nube-brow,
[data-nube-mood="unstable"] .hwg-nube-brow {
	display: inline;
}

[data-nube-mood="angry"] .hwg-nube-portrait,
[data-nube-mood="unstable"] .hwg-nube-portrait {
	background: #8a1414;
	box-shadow: inset 0 -3px 0 #4a0808;
}

/* La nube se tiñe de rojo (sin escalar ni redibujar el pixel art). */
[data-nube-mood="angry"] .hwg-nube-cloud,
[data-nube-mood="unstable"] .hwg-nube-cloud {
	filter: sepia(.6) saturate(2.5) hue-rotate(-60deg) brightness(.98);
}

[data-nube-mood="sad"] .hwg-nube-cloud {
	filter: grayscale(.6) brightness(.92);
}

[data-nube-mood="angry"] .hwg-nube-pupil,
[data-nube-mood="unstable"] .hwg-nube-pupil {
	fill: #ff3b3b;
}

[data-nube-mood="sad"] .hwg-nube-portrait {
	background: #3f5a6c;
	box-shadow: inset 0 -3px 0 #273a47;
}

[data-nube-mood="sad"] .hwg-nube-pupil {
	fill: #a7bccb;
}

.hwg-adv-say.is-mood-angry .hwg-adv-bubble {
	border-color: #6b0000;
	background: #fff0f0;
	box-shadow: 0 3px 0 rgb(107 0 0 / 45%), 0 0 0 3px rgb(220 38 38 / 30%);
	color: #4a0b0b;
	animation: hwg-nube-angry-shake .38s steps(2) 1;
}

.hwg-adv-say.is-mood-angry .hwg-adv-bubble b {
	color: #b91c1c;
}

/* El piquito, del mismo rojo que el borde del bocadillo. */
.hwg-adv-say.is-mood-angry .hwg-adv-bubble::before {
	border-color: #6b0000;
}

.hwg-adv-say.is-mood-unstable .hwg-adv-bubble {
	animation: hwg-nube-unstable 2.4s steps(1) infinite;
}

.hwg-adv-say.is-mood-sad .hwg-adv-bubble {
	background: #eef2f6;
	color: #33475a;
}

.hwg-adv-say.is-mood-sad .hwg-adv-bubble b {
	color: #4f6578;
}

.hwg-nube-glitch {
	color: #dc2626;
	font-weight: bold;
}

@keyframes hwg-nube-angry-shake {
	0% { translate: -3px 1px; }
	25% { translate: 3px -1px; }
	50% { translate: -2px 0; }
	75% { translate: 2px 1px; }
	100% { translate: 0 0; }
}

@keyframes hwg-nube-unstable {
	0%, 70% { border-color: #000; background: #fff; }
	72%, 76% { border-color: #6b0000; background: #fff0f0; translate: 2px 0; }
	78%, 100% { border-color: #000; background: #fff; translate: 0 0; }
}

/* Temblor de la sala (acción de escena "shake") y parpadeo de luces ("flicker"). */
.hwg-room-quake {
	animation: hwg-room-quake .12s linear infinite;
}

@keyframes hwg-room-quake {
	0% { translate: 0 0; }
	25% { translate: calc(var(--quake, 4px) * -1) calc(var(--quake, 4px) * .5); }
	50% { translate: var(--quake, 4px) calc(var(--quake, 4px) * -.5); }
	75% { translate: calc(var(--quake, 4px) * -.5) var(--quake, 4px); }
	100% { translate: 0 0; }
}

.hwg-room-flicker {
	position: absolute;
	inset: 0;
	z-index: 5;
	background: #000;
	opacity: 0;
	pointer-events: none;
}

.hwg-room-flicker.is-on {
	animation: hwg-room-flicker .9s steps(1) 1;
}

@keyframes hwg-room-flicker {
	0% { opacity: .85; }
	12% { opacity: 0; }
	22% { opacity: .7; }
	30% { opacity: 0; }
	55% { opacity: .5; }
	62%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.hwg-room-quake,
	.hwg-adv-say.is-mood-angry .hwg-adv-bubble,
	.hwg-adv-say.is-mood-unstable .hwg-adv-bubble {
		animation: none;
	}

	.hwg-room-flicker.is-on {
		animation-duration: 0s;
	}
}

/* Pantalla de Aventura completada (la última planta): franja dorada y créditos. */
.hwg-adv-result-card.is-final .hwg-adv-result-band {
	background: linear-gradient(90deg, #b45309, #f59e0b, #b45309);
	color: #fff;
	text-shadow: 0 1px 0 rgb(0 0 0 / 35%);
}

.hwg-adv-result-card.is-final h2,
.hwg-adv-result-card.is-final .hwg-adv-credits {
	text-align: center;
}

.hwg-adv-credits {
	margin: 4px 0 10px;
	padding: 0 22px;
}

.hwg-adv-credits p {
	margin: 4px 0;
	text-align: center;
	color: #1b3a4b;
	font: .92rem/1.4 'Ubuntu', Arial, sans-serif;
}

.hwg-adv-credits-small {
	opacity: .7;
	font-size: .8rem !important;
}

/* Pozo: Prólogo y Epílogo, encima del pozo. */
.hwg-lab-scenes {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin: 10px 0 4px;
}
