/* =====================================================================
   Ember - plantilla de Noxera
   Tema oscuro con acento de brasa. Diseno propio: el marco entero son
   gradientes, bordes y sombras CSS, sin arte de terceros.
   ===================================================================== */

:root {
	--bg:        #0c0c0f;
	--bg-deep:   #08080a;
	--panel:     #16161b;
	--panel-2:   #1c1c22;
	--panel-3:   #212129;
	--line:      #2b2b34;
	--line-warm: #4a2318;

	--ember:     #ff6a1f;
	--ember-2:   #ff9445;
	--ember-dim: #a33f10;
	--crimson:   #b5241f;
	--gold:      #e8c07a;

	--text:      #ddd8d2;
	--text-hi:   #f4efe8;
	--muted:     #8d867e;

	--ok:        #5fd68a;
	--off:       #d65f5f;

	--radius:    10px;
	--radius-sm: 6px;

	--display: "Cinzel", Georgia, serif;
	--body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--body);
	font-size: 14px;
	line-height: 1.6;
	/* Brasas: dos focos calidos muy difusos, fijos al viewport. */
	background-image:
		radial-gradient(900px 500px at 12% -8%, rgba(255, 106, 31, .10), transparent 60%),
		radial-gradient(700px 420px at 88% 4%, rgba(181, 36, 31, .09), transparent 62%);
	background-attachment: fixed;
	background-repeat: no-repeat;
}

a { color: var(--ember-2); text-decoration: none; }
a:hover { color: var(--gold); text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ---------------------------------------------------------------- marco */

.em-shell {
	max-width: 1260px;
	margin: 0 auto;
	padding: 0 16px 48px;
}

/* ------------------------------------------------------------- cabecera */

.em-topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	padding: 10px 16px;
	background: rgba(8, 8, 10, .88);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
	box-shadow: 0 1px 0 rgba(255, 106, 31, .12), 0 8px 24px rgba(0, 0, 0, .5);
}

.em-topbar-inner {
	max-width: 1260px;
	margin: 0 auto;
	width: 100%;
	display: flex;
	align-items: center;
	gap: 16px;
}

.em-brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.em-brand:hover { text-decoration: none; }

.em-brand b {
	font-family: var(--display);
	font-weight: 900;
	font-size: 22px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--gold);
	background: linear-gradient(180deg, #ffffff 10%, var(--gold) 55%, var(--ember) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.em-brand span {
	font-size: 10px;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--muted);
}

.em-topbar-spacer { flex: 1; }

.em-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 5px 12px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--panel);
	font-size: 12px;
	color: var(--text);
	white-space: nowrap;
}

.em-pill b { color: var(--text-hi); font-weight: 600; }

.em-dot {
	width: 8px; height: 8px;
	border-radius: 50%;
	flex: none;
}
.em-dot-on  { background: var(--ok);  box-shadow: 0 0 0 3px rgba(95, 214, 138, .16); }
.em-dot-off { background: var(--off); box-shadow: 0 0 0 3px rgba(214, 95, 95, .16); }

/* ---------------------------------------------------------------- botones */

.em-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 9px 16px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line-warm);
	background: linear-gradient(180deg, var(--ember) 0%, var(--ember-dim) 100%);
	color: #1a0d05;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: .02em;
	cursor: pointer;
	text-decoration: none;
	transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 18px rgba(255, 106, 31, .18);
}
.em-btn:hover {
	filter: brightness(1.08);
	color: #1a0d05;
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 10px 26px rgba(255, 106, 31, .28);
}

.em-btn-ghost {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 16px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background: var(--panel-2);
	color: var(--text);
	font-weight: 600;
	font-size: 13px;
	text-decoration: none;
	transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.em-btn-ghost:hover {
	border-color: var(--ember-dim);
	color: var(--text-hi);
	background: var(--panel-3);
	text-decoration: none;
}

.em-btn-block { display: flex; width: 100%; }

/* ------------------------------------------------------------------ hero */

.em-hero {
	position: relative;
	margin: 20px 0 22px;
	padding: 40px 32px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	background-color: var(--bg-deep);
	background-position: center 32%;
	background-size: cover;
	text-align: center;
}

/* Velo para que el texto se lea encima del arte. */
.em-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(8, 8, 10, .55) 0%, rgba(8, 8, 10, .78) 65%, var(--bg) 100%),
		radial-gradient(600px 200px at 50% 120%, rgba(255, 106, 31, .22), transparent 70%);
}

.em-hero > * { position: relative; z-index: 1; }

.em-hero h1 {
	margin: 0 0 8px;
	font-family: var(--display);
	font-weight: 900;
	font-size: clamp(28px, 4.4vw, 46px);
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--text-hi);
	text-shadow: 0 2px 30px rgba(0, 0, 0, .8), 0 0 40px rgba(255, 106, 31, .22);
}

.em-hero p {
	margin: 0 auto 20px;
	max-width: 620px;
	color: #c9c2ba;
	font-size: 15px;
}

.em-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.em-hero-facts {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px 28px;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid rgba(255, 255, 255, .08);
}
.em-hero-facts div { text-align: center; }
.em-hero-facts b {
	display: block;
	font-family: var(--display);
	font-size: 20px;
	color: var(--gold);
	line-height: 1.2;
}
.em-hero-facts span {
	font-size: 10px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--muted);
}

/* ------------------------------------------------------------------ grid */

.em-grid {
	display: grid;
	grid-template-columns: 216px minmax(0, 1fr) 268px;
	gap: 20px;
	align-items: start;
}

/* ------------------------------------------------------------ navegacion */

.em-nav-group + .em-nav-group { margin-top: 8px; }

.em-nav-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: linear-gradient(180deg, var(--panel-2), var(--panel));
	color: var(--text-hi);
	font-family: var(--display);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	cursor: pointer;
	text-align: left;
}
.em-nav-head:hover { border-color: var(--ember-dim); }

.em-nav-head::after {
	content: "";
	width: 6px; height: 6px;
	border-right: 2px solid var(--muted);
	border-bottom: 2px solid var(--muted);
	transform: rotate(45deg) translateY(-2px);
	transition: transform .2s ease;
}
.em-nav-group.is-open .em-nav-head::after { transform: rotate(-135deg) translateY(-2px); }

.em-nav-body {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows .22s ease;
}
.em-nav-group.is-open .em-nav-body { grid-template-rows: 1fr; }

.em-nav-inner { overflow: hidden; }

.em-nav-body a {
	display: block;
	padding: 7px 12px 7px 20px;
	margin-top: 2px;
	border-left: 2px solid transparent;
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	color: var(--text);
	font-size: 13px;
	text-decoration: none;
	transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.em-nav-body a:hover {
	background: var(--panel-2);
	border-left-color: var(--ember-dim);
	color: var(--text-hi);
	text-decoration: none;
}
.em-nav-body a.is-active {
	background: linear-gradient(90deg, rgba(255, 106, 31, .16), transparent);
	border-left-color: var(--ember);
	color: var(--gold);
	font-weight: 600;
}

/* --------------------------------------------------------------- paneles */

.em-panel {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--panel);
	box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
	overflow: hidden;
}

.em-panel + .em-panel { margin-top: 16px; }

.em-panel > h3 {
	margin: 0;
	padding: 11px 14px;
	background: linear-gradient(180deg, #2b1013, #1d0b0d);
	border-bottom: 1px solid var(--line-warm);
	font-family: var(--display);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--gold);
}

.em-panel-body { padding: 14px; }

/* Caja de conexion */
.em-connect dl { margin: 0 0 12px; }
.em-connect dt {
	font-size: 10px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--muted);
}
.em-connect dd {
	margin: 0 0 8px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 14px;
	color: var(--text-hi);
	-webkit-user-select: all;
	user-select: all;
}

/* Caja de estado */
.em-status-big { text-align: center; padding: 4px 0 2px; }
.em-status-big strong {
	display: block;
	font-family: var(--display);
	font-size: 40px;
	line-height: 1;
	color: var(--gold);
	text-shadow: 0 0 26px rgba(255, 106, 31, .3);
}
.em-status-big small {
	display: block;
	margin-top: 6px;
	font-size: 11px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--muted);
}
.em-status-big .em-offline { color: var(--off); font-size: 22px; }

/* Buscador de personaje */
.em-search { display: flex; gap: 8px; }
.em-search input {
	flex: 1;
	min-width: 0;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--bg-deep);
	color: var(--text-hi);
	font-family: inherit;
	font-size: 13px;
}
.em-search input:focus {
	outline: none;
	border-color: var(--ember-dim);
	box-shadow: 0 0 0 3px rgba(255, 106, 31, .14);
}

.em-search button {
	padding: 8px 14px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line-warm);
	background: linear-gradient(180deg, var(--ember), var(--ember-dim));
	color: #1a0d05;
	font-family: inherit;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
	flex: none;
}
.em-search button:hover { filter: brightness(1.08); }

/* ------------------------------------------------- contenido de MyAAC */

.em-main { min-width: 0; }

.em-crumb {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	font-size: 12px;
	color: var(--muted);
}
.em-crumb a { color: var(--muted); }
.em-crumb a:hover { color: var(--ember-2); }
.em-crumb b { color: var(--text-hi); font-weight: 600; }

.em-tickers { margin-bottom: 14px; }
.em-tickers:empty { display: none; }

/* Tablas anchas: que scrollee el contenido, no la pagina entera. */
.em-content { padding: 18px; overflow-x: auto; }

.em-content h1, .em-content h2, .em-content h3, .em-content h4 {
	font-family: var(--display);
	color: var(--text-hi);
	letter-spacing: .04em;
}
.em-content h1 { font-size: 24px; margin-top: 0; }
.em-content h2 { font-size: 19px; }
.em-content h3 { font-size: 16px; }

/*
   MyAAC escribe bgcolor inline en las filas (darkborder / lightborder /
   vdarkborder de config.ini), asi que el fondo de las tablas ya viene
   oscuro. Lo que hay que garantizar aqui es el color del TEXTO: por
   defecto seria oscuro y quedaria ilegible sobre ese fondo.

   Y ojo con .white: en el HTML de MyAAC significa "texto claro", no fondo
   blanco. Se deja claro a proposito.
*/
.em-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 10px 0;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	overflow: hidden;
}
.em-content td, .em-content th {
	padding: 8px 10px;
	border-bottom: 1px solid rgba(255, 255, 255, .05);
	color: var(--text);
	font-size: 13px;
	vertical-align: middle;
}
.em-content th { color: var(--gold); font-weight: 700; text-align: left; }
.em-content tr:last-child td { border-bottom: 0; }
.em-content .white, .em-content .white td, .em-content .white a { color: var(--text-hi); }
.em-content td a { color: var(--ember-2); }
.em-content td a:hover { color: var(--gold); }

.em-content input[type=text],
.em-content input[type=password],
.em-content input[type=email],
.em-content input[type=number],
.em-content select,
.em-content textarea {
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--bg-deep);
	color: var(--text-hi);
	font-family: inherit;
	font-size: 13px;
	max-width: 100%;
}
.em-content input:focus, .em-content select:focus, .em-content textarea:focus {
	outline: none;
	border-color: var(--ember-dim);
	box-shadow: 0 0 0 3px rgba(255, 106, 31, .14);
}

.em-content input[type=submit],
.em-content input[type=button],
.em-content button {
	padding: 8px 16px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line-warm);
	background: linear-gradient(180deg, var(--ember), var(--ember-dim));
	color: #1a0d05;
	font-family: inherit;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
}
.em-content input[type=submit]:hover,
.em-content input[type=button]:hover,
.em-content button:hover { filter: brightness(1.08); }

/* -------------------------------------------------------------- footer */

.em-footer {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
	text-align: center;
	font-size: 12px;
	color: var(--muted);
}
.em-footer a { color: var(--muted); text-decoration: underline; }
.em-footer a:hover { color: var(--ember-2); }

/* ---------------------------------------------------------- responsive */

@media (max-width: 1080px) {
	.em-grid { grid-template-columns: 200px minmax(0, 1fr); }
	.em-rail-right {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
		gap: 16px;
	}
	.em-rail-right .em-panel + .em-panel { margin-top: 0; }
}

@media (max-width: 760px) {
	.em-grid { grid-template-columns: minmax(0, 1fr); }
	.em-rail-left { order: 2; }
	.em-main { order: 1; }
	.em-rail-right { order: 3; }
	.em-hero { padding: 28px 18px; }
	.em-topbar { padding: 8px 12px; }
	.em-brand span { display: none; }
	.em-hide-sm { display: none; }
}
