/* ===== Paleta: negro, grises y oro ===== */
/* Rajdhani (SIL OFL 1.1, fonts/OFL-Rajdhani.txt): servida desde la propia web, sin pedir nada a Google */
@font-face { font-family: "Rajdhani"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/rajdhani-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-display: swap; font-weight: 700; src: url("../fonts/rajdhani-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/rajdhani-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-display: swap; font-weight: 700; src: url("../fonts/rajdhani-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  /* Colores de los tipos de operación (en orden fijo: minería, salvamento, logística, incursión): los bronces y
     dorados del simulador de bodega. .t-0 … .t-3 ponen --t con el del tipo (OP_TYPE_ORDER y opTypeClass en layout.js) */
  --t-0: #c9a227; --t-1: #7c5b1e; --t-2: #e8d48b; --t-3: #b8742e;
  --black:     #0a0a0a;
  --gray-900:  #141414;
  --gray-800:  #1f1f1f;
  --gray-700:  #2e2e2e;
  --gray-500:  #6b6b6b;
  --gray-300:  #b3b3b3;
  --gray-100:  #e6e6e6;
  --gold:      #c9a227;
  --gold-light:#e0c068;
  --line:      #3d3d3d;   /* borde de las cajas dentro de una tarjeta (se ve sobre el fondo de la tarjeta) */

  --header-h: 80px;
  --header-h-compact: 48px;   /* header estrecho, sin logo (index, arriba del todo) */
  --gutter: 24px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Rajdhani", var(--font);
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--black);
  color: var(--gray-100);
  font-family: var(--font);
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

a { color: var(--gold); text-decoration: none; }
a:hover, a:focus-visible { color: var(--gold-light); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Reserva el hueco antes de que el JS pinte el header/footer (evita saltos) */
/* Header fijo al hacer scroll */
/* Su hueco en la página es fijo: cuando la barra crece, lo hace por encima del contenido (sin saltos) */
site-header { display: block; height: var(--header-flow, var(--header-h)); position: sticky; top: 0; z-index: 100; }

/* Que los enlaces internos (#actividades) no queden tapados por el header fijo */
[id] { scroll-margin-top: var(--header-h); }

/* Index: header estrecho y sin logo hasta que el logo del hero se esconde detrás de él */
body.has-hero-logo { --header-flow: var(--header-h-compact); }
body.has-hero-logo .header-bar { height: var(--header-h-compact); transition: height 0.25s ease; }
body.has-hero-logo .site-header.show-logo .header-bar { height: var(--header-h); }
body.has-hero-logo .site-header .logo img {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s 0.2s;
}
body.has-hero-logo .site-header.show-logo .logo img {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease 0.1s, visibility 0s 0s;
}
@media (prefers-reduced-motion: reduce) {
  body.has-hero-logo .header-bar,
  body.has-hero-logo .site-header .logo img { transition: none; }
}
site-footer { display: block; }

/* ===== Header ===== */
.site-header { position: relative; }

.header-bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  background: var(--gray-900);
  border-bottom: 1px solid var(--gold);
}

.logo { display: flex; align-items: center; height: 100%; flex-shrink: 0; }
.logo img { height: 56px; width: auto; }

/* Versión, pegada a la derecha */
.header-version {
  margin: 0 0 0 auto;
  padding-left: 16px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  text-align: right;
  white-space: nowrap;
}

/* "enviar reporte": texto rojo clicable (rojo claro para que se lea sobre el gris oscuro) */
.report-link {
  color: #e05a5a;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.report-link:hover,
.report-link:focus-visible { color: #ff7b7b; border-bottom-color: currentColor; }
.report-link:focus-visible { outline: 2px solid var(--gray-100); outline-offset: 2px; }

/* Versión: abre las novedades (con un punto dorado si hay alguna sin ver) */
.version-link {
  position: relative;
  padding: 0;
  border: 0;
  border-bottom: 1px dotted var(--gray-700);
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.version-link:hover, .version-link:focus-visible { color: var(--gold-light); border-bottom-color: currentColor; }
.version-link:focus-visible { outline: 2px solid var(--gray-100); outline-offset: 2px; }
.version-dot { position: absolute; top: -2px; right: -8px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px rgba(201, 162, 39, 0.8); }
.version-dot[hidden] { display: none; }

/* Ventana de novedades */
.changelog-dialog { width: min(640px, calc(100vw - 32px)); }
.changelog { max-height: min(62vh, 560px); overflow-y: auto; margin: 8px -6px 0 0; padding-right: 6px; display: grid; gap: 18px; }
.changelog-entry { display: grid; gap: 8px; }
.changelog-date { margin: 0; padding-bottom: 6px; border-bottom: 1px solid var(--gray-700); color: var(--gray-100); font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.04em; display: flex; align-items: center; gap: 10px; }
.changelog-latest { padding: 1px 8px; border: 1px solid var(--gold); border-radius: 999px; color: var(--gold-light); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.changelog-entry ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.changelog-entry li { display: grid; grid-template-columns: 78px 1fr; gap: 10px; align-items: baseline; color: var(--gray-300); font-size: 0.9rem; line-height: 1.45; }
.changelog-tag { justify-self: start; padding: 1px 7px; border: 1px solid currentColor; border-radius: 999px; font-family: var(--font-display); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.changelog-ver { color: var(--gray-500); font-size: 0.8rem; font-weight: 500; }
.changelog-empty { margin: 0; color: var(--gray-500); }
.changelog-tag--nuevo { color: var(--gold-light); }
.changelog-tag--mejora { color: #8cc0ff; }
.changelog-tag--arreglo { color: #5fd38a; }
.changelog-tag--seguridad { color: #ff8a8a; }
.changelog-more { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--gray-700); color: var(--gray-500); font-size: 0.85rem; }
.changelog-more .changelog-report { padding: 0; border: 0; background: none; color: var(--gold); font: inherit; text-decoration: underline; cursor: pointer; }   /* no todas las páginas cargan .btn-link (panel.css) */
.changelog-more .changelog-report:hover, .changelog-more .changelog-report:focus-visible { color: var(--gold-light); }
@media (max-width: 520px) {
  .changelog-entry li { grid-template-columns: 1fr; gap: 3px; }
}

/* ===== Holograma del header: proyector + regla-diagrama de actividad ===== */
.holo {
  position: relative;
  flex: 1;
  align-self: stretch;
  min-width: 0;
  margin: 0 clamp(32px, 4vw, 80px);   /* respiro respecto al logo y a la versión */
}
.holo-emitter {
  position: absolute;
  top: 0;
  left: 50%;
  width: 150px;
  height: 15px;
  transform: translateX(-50%);
  z-index: 2;
}
.holo-emitter-rail { fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: 0.55; }
.holo-emitter-body { fill: #3a3a3a; stroke: var(--gold); stroke-width: 1; }
.holo-emitter-lens { fill: #fff3c4; filter: drop-shadow(0 0 3px var(--gold-light)); }

/* Haz de luz: del proyector hacia abajo, abriéndose hasta el ancho de la regla */
.holo-beam {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  bottom: 0;
  clip-path: polygon(calc(50% - 5px) 0, calc(50% + 5px) 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(224, 192, 104, 0.2), rgba(224, 192, 104, 0.03) 45%, rgba(224, 192, 104, 0.06));
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* Pantalla del holograma: la regla ocupa el 50% inferior del header.
   Tope de los días = 80% de la regla (40% del header) */
.holo-screen {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 50%;
  cursor: crosshair;
  animation: holo-flicker 6s infinite steps(1);
}
/* Líneas de barrido solo sobre las barras (máscara), no sobre el fondo */
.holo-ruler {
  -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 2px, rgba(0, 0, 0, 0.45) 2px 3px);
          mask-image: repeating-linear-gradient(180deg, #000 0 2px, rgba(0, 0, 0, 0.45) 2px 3px);
}
.holo-ruler { display: block; width: 100%; height: 100%; overflow: visible; }
/* En reposo, tenue (decoración). Al pasar el ratón, se "enciende" para poder leerlo. */
.holo-day   { fill: var(--gold); opacity: 0.38; transition: opacity 0.3s ease; }
.holo:hover .holo-day   { opacity: 0.85; }
.holo:hover .holo-beam  { background: linear-gradient(180deg, rgba(224, 192, 104, 0.34), rgba(224, 192, 104, 0.06) 45%, rgba(224, 192, 104, 0.12)); }
.holo-hover { fill: #fff; opacity: 0; }
.holo.is-hovering .holo-hover { opacity: 0.35; }
.holo-screen { filter: drop-shadow(0 0 1.5px rgba(224, 192, 104, 0.35)); }

@keyframes holo-flicker {
  0%, 100% { opacity: 1; }
  47% { opacity: 0.86; }
  48% { opacity: 1; }
  83% { opacity: 0.92; }
  84% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .holo-screen { animation: none; } }

/* Ficha: debajo del header, sobre el día señalado */
.holo-tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  transform: translateX(-50%);
  padding: 5px 10px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: var(--gray-900);
  color: var(--gray-100);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 5;
}
.holo.is-hovering .holo-tip { opacity: 1; }

/* Sin sitio para leerlo (pantallas estrechas): no se muestra */
@media (max-width: 1000px) { .holo { display: none; } }

/* Cajón que cuelga del header: submenú + solapa */
.drawer {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;           /* no bloquea clics sobre el contenido */
}
.drawer > * { pointer-events: auto; }

/* Submenú: se despliega con animación de altura */
.submenu {
  width: 100%;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.submenu-inner {
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s 0.25s;
}
.site-header.is-open .submenu { grid-template-rows: 1fr; }
.site-header.is-open .submenu-inner { visibility: visible; transition-delay: 0s; }

.submenu nav {
  background: var(--gold);
  padding: 16px var(--gutter);
}
.submenu ul {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Separador "·" entre elementos */
.submenu li + li::before {
  content: "·";
  margin: 0 16px;
  color: var(--gray-700);
  font-weight: 700;
}
/* Nombre del usuario: dato, no enlace */
.submenu-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--black);
}
/* ===== Órdenes de refinería en el submenú ===== */
.refinery {
  background: var(--gold);              /* sigue la franja dorada del submenú */
  padding: 0 var(--gutter) 18px;
}
.refinery::before {                     /* divisor gris */
  content: "";
  display: block;
  max-width: 1300px;
  margin: 0 auto 12px;
  border-top: 1px solid var(--gray-700);
}
.refinery[hidden] { display: none; }
.refinery-title {
  margin: 0 0 10px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-800);
}
.refinery-list {
  display: grid !important;            /* no hereda el aspecto de la fila de enlaces */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px !important;
  max-width: 1300px;
  max-height: 45vh;                    /* con muchas órdenes, se desplaza en vez de tapar la página */
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.refinery-list li::before { content: none !important; }
.submenu .refinery-list { margin: 0 auto; }   /* centrado (gana a la regla general .submenu ul) */  /* sin separadores "·" */

/* Cápsula */
.refinery-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 8px 18px;
  border-radius: 999px;
  background: var(--gray-900);
  color: var(--gray-300);
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.pill-main { display: flex; flex-direction: column; line-height: 1.2; }
.pill-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--gray-100);
  white-space: nowrap;
}
.pill-date { font-size: 0.72rem; color: var(--gray-500); }
.pill-minerals { flex: 1; color: var(--gray-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-time {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.15);
  color: var(--gold-light);
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
/* Cuántas órdenes se ven (las más recientes van primero):
   grandes ≥1900px: 6 en 3 columnas · medianas: 4 en 2 columnas · una columna (≤1280px): 3
   (los cortes están donde las cápsulas caben sin recortar los minerales) */
.refinery-pill:nth-child(n+5) { display: none; }
@media (min-width: 1900px) {
  .submenu .refinery-list { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1800px; }
  .refinery::before { max-width: 1800px; }
  .refinery-pill:nth-child(n+5) { display: flex; }
  .refinery-pill:nth-child(n+7) { display: none; }
}
@media (max-width: 1280px) {
  .refinery-list { grid-template-columns: 1fr; }
  .submenu .refinery-list { max-width: 720px; }
  .refinery-pill:nth-child(n+4) { display: none; }
}

.submenu .refinery-more {             /* gana a la regla general de enlaces del submenú */
  display: block;
  width: max-content;
  margin: 10px auto 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-800);
  border-bottom: 1px solid currentColor;
}
.submenu .refinery-more[hidden] { display: none; }
.submenu .refinery-more:hover, .submenu .refinery-more:focus-visible { color: var(--black); }
.refinery-pill.is-ready .pill-time { background: rgba(47, 158, 87, 0.18); color: #5fd38a; }

/* Avatar en círculo gris, con el punto verde de "conectado" en la esquina */
.submenu-avatar {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gray-700);
  border: 2px solid var(--gray-800);
  overflow: visible;
}
.submenu-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.submenu-avatar-img[hidden] { display: none; }
.submenu-avatar svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  fill: var(--gray-300);
}
.submenu-avatar::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2f9e57;          /* conectado */
  border: 2px solid var(--gold);
}
.submenu a {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gray-800);
  border-bottom: 2px solid transparent;
}
.submenu a:hover,
.submenu a:focus-visible {
  color: var(--black);
  border-bottom-color: var(--gray-800);
}

/* Solapa "Empezar" */
.menu-tab {
  margin: -1px var(--gutter) 0 0;  /* tapa la línea dorada: parece pegada al header */
  padding: 8px 22px 10px;
  background: var(--gold);
  color: var(--gray-800);
  border: none;
  border-radius: 0 0 8px 8px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-tab::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.25s ease;
}
.site-header.is-open .menu-tab::after { transform: translateY(2px) rotate(-135deg); }
.menu-tab:hover,
.menu-tab:focus-visible { background: var(--gold-light); color: var(--black); }
.menu-tab:focus-visible { outline: 2px solid var(--gray-100); outline-offset: 2px; }

/* Ventanas pequeñas (mensaje privado, reporte): mismo estilo que la de login, más estrechas */
.small-dialog { width: min(520px, calc(100vw - 32px)); position: fixed; }
.small-dialog form { display: grid; gap: 12px; }
.small-dialog form[hidden], .small-dialog .dialog-done[hidden] { display: none; }
.small-dialog .login-title { margin-bottom: 4px; }
.small-dialog textarea { width: 100%; resize: vertical; }
.msg-counter { margin: -6px 0 0; color: var(--gray-500); font-size: 0.8rem; text-align: right; }
/* Reportar a un usuario (Comunidad y conversaciones) */
.report-reasons { margin: 0; padding: 0; border: none; display: grid; gap: 8px; }
.report-reasons legend { margin-bottom: 8px; padding: 0; }
.radio { display: flex; align-items: center; gap: 10px; color: var(--gray-100); cursor: pointer; }
.radio input { width: 18px; height: 18px; accent-color: var(--gold); margin: 0; cursor: pointer; }
.report-note { margin: 0; color: var(--gray-500); font-size: 0.82rem; }
/* Enviar reporte */
.rep-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.rep-kinds legend { width: 100%; margin-bottom: 6px; padding: 0; }
.rep-kind { position: relative; cursor: pointer; }
.rep-kind input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rep-kind span { display: inline-block; padding: 6px 12px; border: 1px solid var(--gray-700); border-radius: 4px; color: var(--gray-300); font-size: 0.88rem; }
.rep-kind:hover span { border-color: var(--gold); color: var(--gold-light); }
.rep-kind input:checked + span { background: var(--gold); border-color: var(--gold); color: var(--gray-800); font-weight: 600; }
.rep-kind input:focus-visible + span { outline: 2px solid var(--gray-100); outline-offset: 2px; }
.rep-tech { display: flex; align-items: flex-start; gap: 8px; color: var(--gray-300); font-size: 0.88rem; cursor: pointer; }
.rep-tech input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--gold); flex: none; }
.rep-tech small { color: var(--gray-500); }
.rep-meta { margin: 0; color: var(--gray-500); font-size: 0.8rem; overflow-wrap: anywhere; }
.seat-ico { width: 22px; height: 26px; object-fit: contain; flex: none; vertical-align: middle; }   /* icono de un puesto de nave */
/* Nave en un hexágono dorado (shipHex en layout.js): la capa dorada hace de borde y el interior oscuro
   se recorta con la misma forma, para que el dibujo dorado de la nave no se confunda con el marco */
.ship-hex {
  --hex-w: 40px; --hex-b: 1.5px;
  position: relative; display: inline-block; flex: none; vertical-align: middle;
  width: var(--hex-w); aspect-ratio: 1.155;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: linear-gradient(145deg, #f3d27a, var(--gold) 45%, #7c5b1e);
}
.ship-hex::before { content: ""; position: absolute; inset: var(--hex-b); clip-path: inherit; background: radial-gradient(circle at 50% 40%, #2a2414, #121212 70%); }
.ship-hex img { position: absolute; left: 14%; top: 13%; width: 72%; height: 74%; object-fit: contain; }
.ship-hex--md { --hex-w: 84px; --hex-b: 2px; }
.ship-hex--lg { --hex-w: 150px; --hex-b: 3px; }
.ship-hex--lg img { filter: drop-shadow(0 0 6px rgba(201, 162, 39, 0.35)); transition: transform 0.3s; }
.ship-hex.is-empty { background: #555; }
.ship-hex--lg.is-empty::after {
  content: "Sin imagen"; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--gray-500); font-family: var(--font-display); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) { .ship-hex--lg img { transition: none; } }
.has-hex { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.rep-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dialog-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.dialog-actions .btn-gold, .dialog-done .btn-gold { border: none; cursor: pointer; }
@media (max-width: 760px) { .small-dialog { padding: 28px 20px; } }

/* Contador de mensajes sin leer (solapa y submenú): oscuro sobre dorado */
.msg-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gray-800);
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}
.msg-count[hidden] { display: none; }
.submenu-msgs .msg-count { margin-left: 8px; vertical-align: 2px; }

/* Solapa en modo "Iniciar sesión": abre una ventana, no un desplegable (sin flecha) */
.menu-tab.is-login::after { display: none; }

/* "Cerrar sesión" dentro del submenú: mismo aspecto que los enlaces, en rojo */
.submenu-logout {
  padding: 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #8a1414;               /* rojo oscuro: contraste suficiente sobre el dorado */
  cursor: pointer;
}
.submenu-logout:hover,
.submenu-logout:focus-visible { color: #6b0e0e; border-bottom-color: #6b0e0e; }

/* ===== Ventana de login (común a todas las páginas) ===== */
.login-dialog {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 40px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--gray-900);
  color: var(--gray-100);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  overflow: auto;
}
.login-dialog::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(3px); }
.login-dialog[open] { animation: login-in 0.2s ease; }
@keyframes login-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .login-dialog[open] { animation: none; } }

.login-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--gray-300);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.login-close:hover, .login-close:focus-visible { color: var(--gold-light); }

.login-panes { display: grid; }
.login-dialog.login-main { width: min(480px, calc(100vw - 32px)); }   /* la de iniciar sesión: una sola columna */
.login-panes[hidden] { display: none; }
.login-pane .eyebrow { margin-bottom: 0.4em; }
.login-title {
  margin: 0 0 0.4em;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-100);
}
.login-text { margin: 0 0 24px; color: var(--gray-300); }
.login-note { margin: 20px 0 0; font-size: 0.8rem; color: var(--gray-500); }

.login-providers { display: grid; gap: 12px; }
.btn-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--gray-700);
  border-radius: 4px;
  background: var(--gray-800);
  color: var(--gray-100);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.btn-provider svg { width: 20px; height: 20px; color: var(--gold); }
.btn-provider:hover:not(:disabled) { border-color: var(--gold); background: var(--gray-700); }
.btn-provider:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.btn-provider:disabled { opacity: 0.6; cursor: progress; }
/* Google/Discord sin configurar: no es "cargando", es "no se puede" */
.btn-provider.is-off:disabled { opacity: 0.45; cursor: not-allowed; }
.login-providers[aria-busy="true"] .btn-provider { cursor: progress; }

/* Usuarios de prueba (solo en local) */
.login-dev { margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--gray-700); }
.login-dev-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--gold);
}
.login-dev-title span { color: var(--gray-500); text-transform: none; letter-spacing: 0; font-weight: 500; }
.login-error {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #e07a5f;
  background: rgba(224, 122, 95, 0.08);
  color: #f0b8a8;
  font-size: 0.9rem;
}

/* Campos de formulario (comunes) */
.field { display: grid; gap: 6px; }
.field-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-300);
}
.field input,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-700);
  border-radius: 4px;
  background: var(--black);
  color: var(--gray-100);
  font: inherit;
  resize: vertical;
}
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25); }
.field-error { display: none; font-size: 0.8rem; color: #e07a5f; }
.was-validated .field :invalid { border-color: #e07a5f; }
.was-validated .field :invalid ~ .field-error { display: block; }

/* Mensaje final (sesión iniciada) */
.login-done { max-width: 460px; margin: 0 auto; text-align: center; padding: 12px 0; }
.login-done .btn-gold { border: none; cursor: pointer; }

@media (max-width: 720px) {
  .login-dialog { padding: 28px 20px; }
}

/* ===== Index: hero ===== */
/* Altura dividida en 4 cuartos: el texto va centrado en el 2º (25%–50%) */
main { flex: 1; }

.hero {
  height: calc(100vh - var(--header-flow, var(--header-h)));
  height: calc(100svh - var(--header-flow, var(--header-h)));
  position: relative;
  display: grid;
  grid-template-rows: 1fr 1fr 2fr;
  align-items: center;
  min-height: 420px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Degradado a la izquierda para que el texto se lea sobre cualquier imagen */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg,
    rgba(10, 10, 10, 0.85) 0%,
    rgba(10, 10, 10, 0.45) 45%,
    rgba(10, 10, 10, 0) 75%);
}

/* Fundido a negro en la parte baja: elimina el corte con la sección siguiente */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(10, 10, 10, 0) 55%,
    var(--black) 100%);
}

/* Indicador de "desliza" */
.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 2;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  animation: hero-scroll-bounce 2s ease-in-out infinite;
  transition: opacity 0.3s ease, visibility 0s 0s;
}
.hero-scroll.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}
.hero-scroll::before {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.hero-scroll:hover,
.hero-scroll:focus-visible { color: var(--gold-light); border-color: var(--gold-light); }

@keyframes hero-scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-scroll { animation: none; }
}

.hero-content {
  grid-row: 2;
  position: relative;
  z-index: 2;
  padding: 0 clamp(var(--gutter), 6vw, 96px);
}

/* Logo grande sobre el título */
.hero-logo {
  width: clamp(220px, 30vw, 440px);
  height: auto;
  margin: 0 0 clamp(16px, 3vh, 32px);
}

.hero-title {
  max-width: 600px;   /* el ancho limita solo al título; la línea de actividades va aparte */
  margin: 0 0 0.4em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 5.5vw, 4.75rem);
  line-height: 1.05;
  color: var(--gray-100);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.hero-tags {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  /* Siempre en una línea: si no cabe, la letra se reduce hasta caber */
  font-size: min(clamp(1rem, 1.8vw, 1.4rem), calc((100vw - 2 * clamp(24px, 6vw, 96px)) / 34));
  letter-spacing: 0.2em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--gold);
}
@media (max-width: 600px) {
  /* En móvil, menos espaciado entre letras para que la letra no baje tanto */
  .hero-tags { letter-spacing: 0.1em; font-size: min(1rem, calc((100vw - 48px) / 29.5)); }
}
.hero-tags span { white-space: nowrap; }  /* si no cabe, salta entre palabras, no dentro */

.t-0 { --t: var(--t-0); } .t-1 { --t: var(--t-1); } .t-2 { --t: var(--t-2); } .t-3 { --t: var(--t-3); }

/* ===== Index: qué es la web (antes de las actividades) ===== */
.what { padding: 0 var(--gutter); }
.section-intro.what-intro { padding-bottom: 0; }   /* el texto va justo debajo del título */
.what-lead { max-width: 760px; margin: 14px auto 0; color: var(--gray-300); font-size: 1.08rem; line-height: 1.6; text-align: center; }
.what-lead strong { color: var(--gray-100); }
.what-steps { max-width: 1180px; margin: 44px auto 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.what-step { position: relative; padding: 22px 22px 24px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, 0.02); }
.what-step-n { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-light); font-family: var(--font-display); font-weight: 700; }
.what-step h3 { margin: 14px 0 6px; color: var(--gray-100); font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.what-step p { margin: 0; color: var(--gray-300); font-size: 0.94rem; line-height: 1.55; }
/* Flecha entre pasos */
.what-step:not(:last-child)::after { content: ""; position: absolute; top: 38px; right: -14px; width: 9px; height: 9px; border-top: 2px solid var(--gold); border-right: 2px solid var(--gold); transform: rotate(45deg); opacity: 0.6; }
.what-more { max-width: 1180px; margin: 22px auto 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.what-more-label { margin-right: 4px; color: var(--gray-500); font-size: 0.85rem; }
.what-chip { padding: 7px 14px; border: 1px solid var(--gray-700); border-radius: 999px; color: var(--gray-300); font-size: 0.88rem; text-decoration: none; }
.what-chip:hover, .what-chip:focus-visible { border-color: var(--gold); color: var(--gold-light); }
.what-chip:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
@media (max-width: 860px) {
  .what-steps { grid-template-columns: 1fr; gap: 12px; margin-top: 32px; }
  .what-step::after { display: none; }
}

/* ===== Index: sección de actividades ===== */
/* Sin relleno inferior: el espacio hasta la siguiente sección lo pone la cabecera de esa sección
   (si no, se suman los dos y queda un hueco doble) */
.activities { padding-bottom: 0; }

/* ===== Index: cabecera de la sección de actividades ===== */
.section-intro {
  padding: clamp(56px, 10vh, 104px) var(--gutter) clamp(32px, 5vh, 48px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.75em;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--gold);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--gray-100);
}

/* ===== Index: modos (paneles colapsables) ===== */
.modes {
  --strip: clamp(72px, 10vw, 144px);   /* 144px en pantallas grandes; se estrecha en pantallas medianas */
  display: flex;
  height: clamp(480px, 75vh, 760px);
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  background: var(--black);
  overflow: hidden;
  overflow: clip;   /* como hidden, pero el navegador no puede desplazarla al dar foco a un panel */
}

.mode {
  position: relative;
  flex: 0 0 var(--strip);
  transition: flex-grow 0.5s ease, flex-basis 0.5s ease;
  border-left: 1px solid var(--gold);
  background: var(--gray-900);
}
.mode:first-child { border-left: none; }
.mode.is-active { flex-grow: 1; }

.mode-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  transition: opacity 0.5s ease;
}
.mode.is-active .mode-video { opacity: 1; }

/* Oscurece la parte baja para que el texto se lea sobre el vídeo */
.mode::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(0deg,
    rgba(10, 10, 10, 0.92) 0%,
    rgba(10, 10, 10, 0.4) 45%,
    rgba(10, 10, 10, 0) 75%);
}

/* Franja colapsada: toda ella es clicable */
.mode-toggle {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
}
.mode.is-active .mode-toggle { display: none; }
.mode-toggle:hover,
.mode-toggle:focus-visible { color: var(--gold-light); }
.mode-toggle:focus-visible { outline: 2px solid var(--gold-light); outline-offset: -4px; }

.mode-strip-title {
  position: absolute;
  left: 50%;
  top: 32px;              /* arriba: abajo a la derecha está el botón de volver arriba */
  transform: translateX(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Flecha circular sobre la línea divisoria, apuntando hacia el panel abierto */
.mode-arrow {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 40px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--black);
  display: grid;
  place-items: center;
}
.mode-arrow::before {
  content: "";
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}
.mode.is-after .mode-arrow  { left: 0;  transform: translate(-50%, -50%); }
.mode.is-before .mode-arrow { right: 0; transform: translate(50%, -50%); }
.mode.is-after .mode-arrow::before  { transform: translateX(2px) rotate(-135deg); }  /* < */
.mode.is-before .mode-arrow::before { transform: translateX(-2px) rotate(45deg); }   /* > */

/* Contenido del panel abierto */
.mode-content {
  position: absolute;
  left: clamp(24px, 4vw, 56px);
  bottom: clamp(24px, 5vh, 56px);
  z-index: 2;
  width: min(640px, calc(100vw - 3 * var(--strip) - 96px)); /* 3 franjas cerradas */ /* ancho fijo: no se reacomoda al animar */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s 0.2s;
}
.mode.is-active .mode-content {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease 0.3s, visibility 0s 0s;
}

.mode-title {
  margin: 0 0 0.3em;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--gray-100);
}

.mode-text {
  margin: 0 0 1.5em;
  max-width: 62ch;   /* textos de ~130-150 caracteres: 3 líneas */
  color: var(--gray-300);
}

.btn-gold {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 4px;
  background: var(--gold);
  color: var(--gray-800);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s ease;
}
.btn-gold:hover,
.btn-gold:focus-visible { background: var(--gold-light); color: var(--black); }
.btn-gold:focus-visible { outline: 2px solid var(--gray-100); outline-offset: 2px; }

/* En pantallas estrechas los paneles se apilan en vertical */
@media (max-width: 768px) {
  .modes { flex-direction: column; height: auto; --strip: 64px; }
  .mode { flex: 0 0 var(--strip); border-left: none; border-top: 1px solid var(--gold); }
  .mode:first-child { border-top: none; }
  .mode.is-active { flex-basis: 520px; }

  .mode-strip-title {
    writing-mode: horizontal-tb;
    left: var(--gutter);
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }

  .mode.is-after .mode-arrow,
  .mode.is-before .mode-arrow { left: 50%; right: auto; }
  .mode.is-after .mode-arrow  { top: 0;    bottom: auto; transform: translate(-50%, -50%); }
  .mode.is-before .mode-arrow { top: auto; bottom: 0;    transform: translate(-50%, 50%); }
  .mode.is-after .mode-arrow::before  { transform: translateY(2px) rotate(-45deg); }   /* ^ */
  .mode.is-before .mode-arrow::before { transform: translateY(-2px) rotate(135deg); }  /* v */

  .mode-content { left: var(--gutter); width: calc(100vw - 2 * var(--gutter)); }
}

/* ===== Index: historial de operaciones ===== */
.ops {
  position: relative;
  isolation: isolate;
  padding-bottom: clamp(56px, 10vh, 104px);
}
.ops > *:not(.space-bg) { position: relative; z-index: 1; }
/* Copia temporal del fondo que se desvanece al cambiar de sistema */
.space-bg--fade { transition: opacity 0.7s ease; }

/* Fondo espacial de toda la sección; se funde con el negro de la página arriba y abajo */
.space-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 160px, #000 calc(100% - 120px), transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 160px, #000 calc(100% - 120px), transparent 100%);
}

.ops-body {
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Selector de sistema */
.system-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.system-tab {
  padding: 10px 24px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: transparent;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.system-tab:hover { background: rgba(201, 162, 39, 0.12); color: var(--gold-light); }
.system-tab[aria-selected="true"] { background: var(--gold); color: var(--gray-800); }
.system-tab[aria-selected="true"]:hover { background: var(--gold-light); color: var(--black); }
.system-tab:focus-visible { outline: 2px solid var(--gray-100); outline-offset: 2px; }

/* Resumen de operaciones bajo los botones */
.ops-summary {
  max-width: 900px;
  margin: 0 auto 8px;
  padding: 16px 0 0;
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 0;
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--gold) 15%, var(--gold) 85%, transparent) 1;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ops-summary li { white-space: nowrap; }
.ops-summary li + li::before {
  content: "·";
  margin: 0 14px;
  color: var(--gray-500);
}
.ops-summary-label { color: var(--gray-300); font-weight: 500; }
.ops-summary-note { margin: 6px 0 0; text-align: center; color: var(--gray-500); font-size: 0.8rem; letter-spacing: 0.04em; }
/* Icono de cada tipo (el mismo que en el mapa): el resumen hace de leyenda */
.ops-summary-ico { width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; }
.ops-summary-ico circle { fill: var(--gold); }
.ops-summary-ico .sm-op-icon { stroke: #141414; }
.ops-summary-num { color: var(--gold); font-weight: 700; }

/* Mapa */
/* Sin caja: el sistema flota sobre el fondo de la sección.
   Todo el ancho disponible, con el límite de que el mapa quepa entero en pantalla bajo el header */
.system-map {
  position: relative;
  aspect-ratio: 16 / 9;
  /* alto disponible = pantalla - header - cabecera de la sección - botones de sistema */
  width: min(100%, calc((100vh - var(--header-h) - clamp(56px, 10vh, 104px) - clamp(32px, 5vh, 48px) - 228px) * 16 / 9));
  margin: 0 auto;
}
.system-map[hidden] { display: none; }
.system-map img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.system-map img[hidden] { display: none; }  /* la regla global img{display:block} anularía el hidden */
/* Se ve mientras carga el mapa o si la imagen aún no existe */
.map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--gray-500);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Mapas dibujados en SVG */
.system-map.has-svg .map-fallback { display: none; }
.system-map svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}
.sm-orbits ellipse { fill: none; stroke: rgba(201, 162, 39, 0.22); stroke-width: 1.5; }
.sm-label {
  fill: var(--gray-300);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-anchor: middle;
}
.sm-label--star { fill: var(--gold); }
.sm-sub {
  fill: var(--gray-500);
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-anchor: middle;
}
.sm-planet-body { stroke: var(--gray-700); stroke-width: 1; }

/* Cinturones de asteroides */
.sm-belt circle { fill: var(--gray-300); }
.sm-belt-label {
  fill: var(--gray-500);
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-anchor: middle;
}

/* Lunas */
.sm-moon-orbits circle { fill: none; stroke: rgba(255, 255, 255, 0.09); stroke-width: 1; stroke-dasharray: 2 4; }
.sm-moon { cursor: pointer; outline: none; }
.sm-moon-hit { fill: transparent; stroke: transparent; stroke-width: 1.5; }
.sm-moon:hover .sm-moon-hit,
.sm-moon:focus-visible .sm-moon-hit { stroke: var(--gold); }

/* Operaciones finalizadas en un astro: aro discontinuo y una insignia por tipo (drawOpMark en system-map.js) */
.sm-opmark { cursor: pointer; outline: none; }
.sm-opmark-ring { fill: none; stroke: var(--gold); transition: stroke 0.15s ease; }   /* grosor y trazo: según el tamaño en pantalla (system-map.js) */
.sm-opmark-badge > circle:first-child { fill: var(--gold); stroke: var(--black); transition: fill 0.15s ease; }
.sm-op-icon { fill: none; stroke: #141414; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sm-opmark-count { fill: #141414; stroke: var(--gold); stroke-width: 1.3; }
.sm-opmark-num { fill: var(--gold-light); font-family: var(--font-display); font-weight: 700; text-anchor: middle; }
.sm-opmark-total { fill: #141414; font-family: var(--font-display); font-weight: 700; text-anchor: middle; }   /* móvil: el total, sin iconos */
.sm-opmark:hover .sm-opmark-ring, .sm-moon:hover + .sm-opmark .sm-opmark-ring { stroke: var(--gold-light); }
.sm-opmark:hover .sm-opmark-badge > circle:first-child { fill: var(--gold-light); }
.sm-opmark:focus-visible .sm-opmark-ring { stroke: var(--gray-100); }

/* Etiqueta del mapa */
.map-badge {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 2;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-500);
}

/* Ficha de la misión al pasar o tocar */
.map-tip {
  position: absolute;
  z-index: 3;
  width: max-content;
  max-width: 260px;
  padding: 10px 14px;
  background: var(--gray-900);
  border: 1px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0s 0.15s;
}
.map-tip.is-visible { opacity: 1; visibility: visible; transition: opacity 0.15s ease, visibility 0s 0s; }
.map-tip p { margin: 0; }
.map-tip-type {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}
.map-tip-name { margin: 2px 0 4px !important; color: var(--gray-100); font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.map-tip-meta { color: var(--gray-300); font-size: 0.8rem; }
/* Mapa de recursos: grupos (rocas, asteroides, gemas…) con una fila por recurso */
.map-tip:has(.map-tip-group) { max-width: 290px; min-width: 240px; }
.map-tip-group { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--gray-700); }
.map-tip-gtitle { margin: 0 0 6px !important; color: var(--gray-500); font-family: var(--font-display); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.map-tip-gtitle span { font-family: var(--font); font-weight: 400; letter-spacing: 0; text-transform: none; }
/* Las filas comparten columnas (li = display: contents): nombre · barra · valor, alineados */
.map-tip-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) 54px max-content; align-items: center; gap: 5px 10px; font-size: 0.82rem; font-variant-numeric: tabular-nums; color: var(--gray-300); }
.map-tip-rows li { display: contents; }
.map-tip-res { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-tip-track { height: 4px; border-radius: 2px; background: var(--gray-700); overflow: hidden; }
.map-tip-bar { display: block; height: 100%; background: rgba(201, 162, 39, 0.65); }
.map-tip-val { text-align: right; color: var(--gray-100); white-space: nowrap; }
.map-tip-rows li.is-hl .map-tip-res { color: var(--gold-light); font-weight: 600; }
.map-tip-rows li.is-hl .map-tip-bar { background: var(--gold-light); }
.map-tip-rows li.is-hl .map-tip-val { color: var(--gold-light); font-weight: 600; }
.map-tip-more { margin: 4px 0 0 !important; color: var(--gray-500); font-size: 0.75rem; }
.map-tip-list { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--gray-700); display: grid; gap: 2px; color: var(--gray-100); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  .system-tabs { gap: 8px; }
  .system-tab { flex: 1; padding: 10px 8px; font-size: 0.9rem; }
  /* En móvil solo se ve el nombre; "Sistema" sigue ahí para lectores de pantalla */
  .tab-prefix {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .system-map { aspect-ratio: 4 / 3; }
  .system-map.has-svg { aspect-ratio: 9 / 13; }
  /* Resumen en dos columnas */
  .ops-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 0.85rem; }
  .ops-summary li + li::before { content: none; }  /* composición vertical del mapa dibujado */
  /* Cabeceras de sección largas: que quepan en una línea */
  .eyebrow { font-size: 0.8rem; letter-spacing: 0.15em; gap: 10px; }
  .eyebrow::before, .eyebrow::after { width: 20px; }
}

/* ===== Botón volver arriba (común a todas las páginas) ===== */
.back-to-top {
  position: fixed;
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 90;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--gray-900);
  color: var(--gold);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0.25s;
}
.back-to-top::before {
  content: "";
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: translateY(2px) rotate(45deg);
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0s;
}
.back-to-top:hover,
.back-to-top:focus-visible { background: var(--gold); color: var(--gray-800); }
.back-to-top:focus-visible { outline: 2px solid var(--gray-100); outline-offset: 2px; }

/* ===== Footer ===== */
.site-footer {
  /* a la derecha deja hueco para el botón de volver arriba */
  padding: 40px calc(var(--gutter) + 44px + 16px) 24px var(--gutter);
  background: var(--gray-900);
  border-top: 1px solid var(--gray-700);
  color: var(--gray-300);
  font-size: 0.95rem;
}
.footer-main { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-about p { margin: 12px 0 0; line-height: 1.55; max-width: 460px; }
.footer-logo { width: 200px; height: auto; display: block; }
.footer-title { margin: 0 0 12px; color: var(--gold); font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a { color: var(--gray-300); text-decoration: none; }
.footer-col a:hover, .footer-col a:focus-visible { color: var(--gold-light); text-decoration: underline; }
/* Aviso de fan site (CIG): visible, no en letra pequeña */
.footer-cig { max-width: 1200px; margin: 32px auto 0; padding-top: 24px; border-top: 1px solid var(--gray-800); display: flex; align-items: center; gap: 24px; }
.footer-badge { height: 72px; width: auto; flex-shrink: 0; }
.footer-disclaimer { flex: 1; margin: 0; color: var(--gray-300); font-size: 0.95rem; line-height: 1.6; }
.footer-disclaimer a { display: inline-block; margin-top: 4px; color: var(--gold-light); }
.footer-copy { max-width: 1200px; margin: 20px auto 0; color: var(--gray-500); font-size: 0.85rem; }
.site-pending { background: rgba(224, 122, 95, 0.18); color: #f0a08a; padding: 0 4px; border-radius: 3px; }

@media (max-width: 900px) {
  .footer-main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .site-footer { padding: 32px var(--gutter) 88px; }  /* abajo, hueco para el botón */
  .footer-cig { flex-direction: column; text-align: center; gap: 16px; }
  .footer-badge { height: 60px; }
  .footer-copy { text-align: center; }
}
@media (max-width: 480px) {
  .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}

/* ===== Móvil ===== */
@media (max-width: 600px) {
  :root { --header-h: 64px; --gutter: 16px; }
  .logo img { height: 40px; }
  /* En móvil la versión pasa a dos líneas para no chocar con el logo */
  /* Móvil: una línea por dato, alineadas a la derecha */
  .header-version { font-size: 0.68rem; line-height: 1.25; letter-spacing: 0.02em; padding-left: 10px; }
  .header-version > a, .header-version > span:not(.sep) { display: block; }
  .header-version .sep { display: none; }
  /* Móvil: en columna, sin separadores */
  .submenu ul { flex-direction: column; align-items: flex-start; gap: 12px; }
  .submenu li + li::before { content: none; }
  .submenu-user { padding-bottom: 10px; border-bottom: 1px solid rgba(0, 0, 0, 0.2); width: 100%; }
  /* Cápsulas en móvil: ancho completo, la cuenta atrás a la derecha */
  .refinery-list { grid-template-columns: 1fr; }
  .refinery-pill { flex-wrap: wrap; row-gap: 4px; border-radius: 22px; padding: 10px 10px 10px 16px; }
  .pill-main { flex: 1; }
  .pill-minerals { order: 3; flex-basis: 100%; white-space: normal; font-size: 0.8rem; }
}

/* Móviles muy estrechos (≤360px): logo algo más pequeño para que quepan reporte y versión */
@media (max-width: 360px) {
  .logo img { height: 32px; }
}

/* Elegir nombre (primera vez con Google/Discord) */
.name-dialog .login-text { margin-bottom: 8px; }
.name-rules { font-size: 0.8rem; color: var(--gray-500); }
.name-dialog .login-error { margin: 0; }
.name-dialog input[aria-invalid="true"] { border-color: #e07a5f; }
.name-later {
  padding: 10px 16px;
  border: 1px solid var(--gray-700);
  border-radius: 4px;
  background: none;
  color: var(--gray-300);
  font: inherit;
  cursor: pointer;
}
.name-later:hover { border-color: var(--gray-500); color: var(--gray-100); }
.name-later:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.login-dialog.name-dialog { width: min(520px, calc(100vw - 32px)); }
.login-error-detail { display: block; margin-top: 6px; font-size: 0.78rem; color: var(--gray-300); word-break: break-word; }

/* Formas de entrar (Ajustes del panel) */
.settings-links { display: grid; gap: 10px; align-content: start; }
.settings-links .links-title { margin: 0; }
.links-help { margin: 0; color: var(--gray-300); font-size: 0.92rem; }
.links-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.links-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--gray-700);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
}
.links-row.is-linked { border-color: rgba(201, 162, 39, 0.45); }
.links-info { display: grid; gap: 2px; min-width: 0; }
.links-name { font-family: var(--font-display); font-weight: 700; color: var(--gray-100); }
.links-state { font-size: 0.85rem; color: var(--gray-500); }
.links-row.is-linked .links-state { color: var(--gold); }
.links-why { font-size: 0.8rem; color: var(--gray-500); }
.links-btn {
  padding: 8px 14px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: none;
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.links-btn:hover:not(:disabled) { background: var(--gold); color: var(--black); }
.links-btn:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.links-btn--off { border-color: var(--gray-700); color: var(--gray-300); }
.links-btn--off:hover:not(:disabled) { background: var(--gray-700); color: var(--gray-100); }
.links-btn.is-armed { border-color: #e07a5f; color: #f0b8a8; }
.links-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.links-status { margin: 0; min-height: 1.2em; font-size: 0.88rem; color: var(--gray-300); }

/* Ventana de aviso (vincular / unir cuentas) */
.login-dialog.notice-dialog { width: min(560px, calc(100vw - 32px)); }
.notice-items { margin: 0 0 14px; padding-left: 20px; color: var(--gray-300); display: grid; gap: 6px; }
.notice-detail:empty { display: none; }

/* Recordatorio de vincular la otra cuenta (panel, bajo el perfil) */
.link-reminder {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  background: rgba(201, 162, 39, 0.06);
  display: grid;
  gap: 10px;
}
.link-reminder[hidden] { display: none; }
.link-reminder-text { margin: 0; color: var(--gray-300); font-size: 0.92rem; }
.link-reminder-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.link-reminder .name-later { padding: 8px 14px; }

/* Verificación de RSI */
.verify-status.is-error { color: #f0b8a8; }
.org-check { color: var(--gold); font-weight: 700; }

/* Amigos: imagen en la inicial, avisos de las acciones */
.crew-initial { overflow: hidden; }
.crew-initial .friend-avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.friends-status { margin: 0 0 12px; font-size: 0.9rem; color: var(--gray-300); }
.friends-status.is-error, .friend-error { color: #f0b8a8; }
.friends-status[hidden] { display: none; }
.friend-error { flex-basis: 100%; margin: 6px 0 0; font-size: 0.85rem; }

/* Mensajes: aviso cuando no se le puede escribir */
.reply-blocked { margin: 12px 0 0; padding: 10px 12px; border: 1px dashed var(--gray-700); border-radius: 4px; }
.reply-error { margin: 8px 0 0; }
.map-tip-group.is-wide .map-tip-rows { grid-template-columns: minmax(0, 1fr) 40px max-content; }

/* ---------- Insignia Legacy (legacyMark en layout.js): junto al tick de verificado ---------- */
.legacy-mark { display: inline-block; flex: none; width: auto; vertical-align: middle;
  filter: drop-shadow(0 0 6px rgba(201, 162, 39, 0.35)); }   /* como el brillo azul del tick, en dorado */

/* ===== Próxima operación programada en el submenú (menos de 2 h) y su reloj en la solapa ===== */
.next-op { background: var(--gold); padding: 0 var(--gutter) 18px; }
.next-op::before { content: ""; display: block; max-width: 1300px; margin: 0 auto 12px; border-top: 1px solid var(--gray-700); }
.next-op[hidden] { display: none; }
.submenu .next-op-pill {
  display: flex; align-items: center; gap: 14px;
  max-width: 720px; margin: 0 auto; padding: 8px 8px 8px 18px;
  border-radius: 999px; background: var(--gray-900); color: var(--gray-300);
  font-size: 0.85rem; text-decoration: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.submenu .next-op-pill:hover, .submenu .next-op-pill:focus-visible { background: var(--black); color: var(--gray-100); }
.submenu .next-op-pill:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
.tab-next-op { display: inline-flex; width: 18px; height: 18px; }
.tab-next-op svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (max-width: 640px) {
  .submenu .next-op-pill { flex-wrap: wrap; row-gap: 4px; border-radius: 22px; padding: 10px 10px 10px 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .tab-next-op svg { animation: tab-next-op-pulse 2s ease-in-out infinite; }
  @keyframes tab-next-op-pulse { 50% { opacity: 0.45; } }
}

/* Buscador encima de un desplegable largo (selectFilter, en layout.js) */
.select-filter { position: relative; margin-bottom: 6px; }
.select-filter input { width: 100%; padding: 10px 70px 10px 12px; background: var(--black); border: 1px solid var(--gray-700); border-radius: 4px; color: var(--gray-100); font: inherit; }
.select-filter input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25); }
.select-filter input::placeholder { color: var(--gray-500); }
.select-filter-count { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-500); font-size: 0.8rem; font-variant-numeric: tabular-nums; pointer-events: none; }
