:root {
	--verde: #9cff8a;
	--verde-tenue: #5c9a52;
	--fondo-panel: rgba(8, 12, 8, 0.86);
	--borde: #2f4a2a;
	--rojo: #ff5a3c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
	margin: 0;
	height: 100%;
	overflow: hidden;
	background: #0b0d0b;
	color: var(--verde);
	font-family: 'VT323', ui-monospace, monospace;
	font-size: 20px;
	-webkit-user-select: none;
	user-select: none;
	touch-action: none;
}

#escena { position: fixed; inset: 0; }
#escena > * { position: absolute !important; inset: 0; }
#escena canvas { display: block; }

button, a.boton, #mano a {
	font: inherit;
	color: var(--verde);
	background: rgba(20, 34, 18, 0.95);
	border: 1px solid var(--borde);
	border-radius: 4px;
	padding: 6px 14px;
	cursor: pointer;
	text-decoration: none;
	letter-spacing: 1px;
}
button:hover, #mano a:hover { background: #26401f; }
button.principal { background: #2d5a22; color: #eaffe4; }
button.principal:hover { background: #3a7230; }

/* Pantalla de carga */
#cargando {
	position: fixed; inset: 0; z-index: 20;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
	background: radial-gradient(ellipse at center, #10200e 0%, #050705 70%);
	text-align: center; padding: 16px;
}
#cargando .logo { width: min(640px, 86vw); height: auto; filter: drop-shadow(0 0 22px rgba(255, 190, 200, 0.25)); }
#cargando .sub { letter-spacing: 12px; font-size: 26px; margin-top: -10px; }
#cargando-texto { color: var(--verde-tenue); min-height: 1.2em; }
#entrar { font-size: 28px; padding: 8px 40px; margin-top: 12px; }

/* Cabecera */
#cabecera {
	position: fixed; top: 0; left: 0; right: 0; z-index: 5;
	display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
	padding: 10px 16px; pointer-events: none;
}
#cabecera > * { pointer-events: auto; }
.marca { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.marca img { height: 30px; width: auto; filter: drop-shadow(0 1px 3px #000); }
.marca span { font-family: 'VT323', monospace; color: var(--verde); font-size: 18px; letter-spacing: 4px; }
.derecha { display: flex; gap: 8px; align-items: flex-start; }
#invertir { white-space: nowrap; padding: 6px 10px; }
#invertir.activo { background: #2d5a22; color: #eaffe4; }
#buscador { position: relative; width: min(340px, 52vw); }
#buscar {
	width: 100%; font: inherit; color: var(--verde); background: var(--fondo-panel);
	border: 1px solid var(--borde); border-radius: 4px; padding: 6px 10px; outline: none;
	-webkit-user-select: text; user-select: text;
}
#buscar::placeholder { color: var(--verde-tenue); }
#resultados {
	position: absolute; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 0; list-style: none;
	background: var(--fondo-panel); border: 1px solid var(--borde); border-radius: 4px; max-height: 50vh; overflow-y: auto;
}
#resultados li { padding: 5px 10px; cursor: pointer; border-top: 1px solid rgba(47, 74, 42, 0.5); }
#resultados li:first-child { border-top: 0; }
#resultados li:hover, #resultados li.activo { background: #26401f; }
#resultados li small { color: var(--verde-tenue); }

/* Ayuda */
#ayuda {
	position: fixed; left: 16px; bottom: 34px; z-index: 4; max-width: calc(100vw - 32px);
	color: var(--verde); text-shadow: 0 1px 3px #000; font-size: 18px; pointer-events: none; opacity: 0.85;
}

/* Caja en la mano */
#mano {
	position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 6;
	width: min(560px, calc(100vw - 32px));
	background: var(--fondo-panel); border: 1px solid var(--borde); border-radius: 6px; padding: 10px 14px;
	display: flex; flex-direction: column; gap: 8px;
}
#mano-titulo { font-size: 26px; line-height: 1; color: #eaffe4; }
#mano-datos { color: var(--verde-tenue); }
#mano .botones { display: flex; flex-wrap: wrap; gap: 8px; }
#mano .pista { color: var(--verde-tenue); font-size: 16px; }

/* Reproduciendo */
#reproduciendo {
	position: fixed; right: 16px; bottom: 34px; z-index: 6; max-width: calc(100vw - 32px);
	display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
	background: var(--fondo-panel); border: 1px solid var(--borde); border-radius: 6px; padding: 8px 10px;
}
#rep-titulo { color: #eaffe4; margin-right: 6px; }
#reproduciendo a {
	font: inherit; color: #eaffe4; background: #2d5a22; border: 1px solid var(--borde); border-radius: 4px;
	padding: 6px 14px; text-decoration: none; letter-spacing: 1px;
}
#reproduciendo a:hover { background: #3a7230; }

/* Joystick táctil */
#joystick {
	position: fixed; left: 24px; bottom: 60px; z-index: 4; width: 110px; height: 110px; border-radius: 50%;
	border: 2px solid rgba(156, 255, 138, 0.35); background: rgba(10, 20, 10, 0.25);
}
#joystick > div {
	position: absolute; left: 35px; top: 35px; width: 40px; height: 40px; border-radius: 50%;
	background: rgba(156, 255, 138, 0.45);
}

/* Pie */
#pie {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
	padding: 4px 16px; font-size: 14px; color: var(--verde-tenue); background: rgba(5, 8, 5, 0.7);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#pie a { color: var(--verde); }
#creditos {
	position: fixed; left: 16px; right: 16px; bottom: 34px; z-index: 6; max-width: 560px;
	padding: 12px 40px 12px 14px; font-size: 15px; color: var(--verde); background: var(--fondo-panel);
	border: 1px solid var(--borde); border-radius: 4px;
}
#creditos p { margin: 4px 0; }
#creditos a { color: var(--verde); }
#cerrar-creditos { position: absolute; top: 6px; right: 6px; padding: 2px 8px; }

/* La tele (CSS3D) */
.tele-video { width: 640px; height: 480px; overflow: hidden; background: #000; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tele-video iframe { width: 640px; height: 360px; border: 0; }

@media (max-width: 600px) {
	html, body { font-size: 18px; }
	.marca img { height: 22px; }
	.marca span { display: none; }
	#mano-titulo { font-size: 22px; }
	#ayuda { bottom: 180px; font-size: 16px; }
	#invertir { padding: 6px 8px; }
	#invertir span { display: none; }
}
