/* ==========================================================================
   ASTRO — CAPA INDUSTRIAL / CASSETTE-FUTURISM
   --------------------------------------------------------------------------
   Se carga DESPUÉS de style.css, astro_clock.css y audio_hud.css, así que
   sólo añade acabados: chasis metálico, biseles duros, tornillos, pantallas
   de fósforo con scanlines y rejilla milimetrada, controles con volumen
   físico (sliders estriados, botones tipo tecla mecánica, dial central).

   Reglas de la casa:
     - Verde fósforo  -> datos y emisión principal.
     - Ámbar táctico  -> selección, alertas, marcos críticos.
     - Azul radar     -> información secundaria, sin estridencia.
   Nada de degradados Web3 ni neones rosas: luz de pantalla y pintura usada.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TIPOGRAFÍA TÉCNICA (fuentes locales en vendor/fonts)
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Share Tech Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('vendor/fonts/ShareTechMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('vendor/fonts/VT323-Regular.woff2') format('woff2');
}

/* --------------------------------------------------------------------------
   2. CHASIS: metal fundido, plástico ABS y azul de vacío
   -------------------------------------------------------------------------- */

body {
  background-color: var(--bg-color);
  background-image:
    /* halo tenue de pantalla al fondo del habitáculo */
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(74, 246, 38, 0.05), transparent 65%),
    /* aluminio cepillado: micro-rayado horizontal */
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.014) 0 1px,
      rgba(0, 0, 0, 0.014) 1px 2px,
      transparent 2px 4px
    ),
    linear-gradient(180deg, #0e151b 0%, #080d12 55%, #05080b 100%);
  background-attachment: fixed;
  letter-spacing: 0.012em;
  /* Los iconos son glifos grabados, no pegatinas: presentación de texto, así
     heredan el color del rótulo en vez de venir en su emoji a todo color. */
  font-variant-emoji: text;
}

/* Retícula CRT global: textura FIJA sobre toda la interfaz.
   NO lleva animación. Una capa fija a pantalla completa a la que se le mueve
   la opacidad es una fluctuación de luz de TODA LA PÁGINA, y eso aquí no se
   hace: el parpadeo es cosa del tubo de cada gráfica, nunca del documento. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.16) 0 1px,
      transparent 1px 3px
    );
  opacity: 0.35;
}

/* Viñeta de lente: oscurece las esquinas del "monitor". */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 8999;
  pointer-events: none;
  background: radial-gradient(ellipse 95% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* --------------------------------------------------------------------------
   3. MÓDULOS ATORNILLADOS (paneles, tarjetas, ventanas)
   El tornillo se dibuja en la propia pila de fondos: cero elementos extra.
   -------------------------------------------------------------------------- */

.app-header,
.card,
.controls-panel,
.results-panel,
.saved-charts-panel,
.wheel-panel,
.nx-panel,
.nx-card,
.stats-subpanel,
.transit-subpanel,
.historical-matches-panel,
.historical-mass-forces-panel,
.timeline-chart-wrapper,
.transit-timeline-section,
.clock-table-panel,
.clock-season-panel,
.modal-container,
.potentials-card,
.values-card,
.house-detail-panel,
.timeline-life-events-panel {
  position: relative;
  border: 1px solid var(--border-color);
  border-top-color: #3a4348;
  border-radius: 3px;
  background-color: var(--card-bg);
  background-image:
    /* cuatro tornillos de cabeza hexagonal en las esquinas */
    radial-gradient(circle at 8px 8px, #5a6569 0 1.5px, #0b0f11 1.6px 2.6px, transparent 2.7px),
    radial-gradient(circle at calc(100% - 8px) 8px, #5a6569 0 1.5px, #0b0f11 1.6px 2.6px, transparent 2.7px),
    radial-gradient(circle at 8px calc(100% - 8px), #5a6569 0 1.5px, #0b0f11 1.6px 2.6px, transparent 2.7px),
    radial-gradient(circle at calc(100% - 8px) calc(100% - 8px), #5a6569 0 1.5px, #0b0f11 1.6px 2.6px, transparent 2.7px),
    /* luz cenital sobre el panel */
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #1b2226 0%, #141a1e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -2px 3px rgba(0, 0, 0, 0.6),
    0 2px 0 #05080a,
    0 8px 18px rgba(0, 0, 0, 0.55);
}

/* La cabecera es la carcasa principal: bisel más grueso y remaches dobles. */
.app-header {
  position: relative;
  border-radius: 4px;
  background-image:
    /* etiqueta de código de barras pegada al borde inferior */
    repeating-linear-gradient(
      90deg,
      rgba(230, 243, 232, 0.16) 0 2px,
      transparent 2px 5px,
      rgba(230, 243, 232, 0.16) 5px 6px,
      transparent 6px 11px,
      rgba(230, 243, 232, 0.16) 11px 14px,
      transparent 14px 17px
    ),
    radial-gradient(circle at 10px 50%, #5a6569 0 1.7px, #0b0f11 1.8px 3px, transparent 3.1px),
    radial-gradient(circle at calc(100% - 10px) 50%, #5a6569 0 1.7px, #0b0f11 1.8px 3px, transparent 3.1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 50%),
    linear-gradient(180deg, #1e262a 0%, #141a1e 100%);
  background-size: 100% 4px, auto, auto, auto, auto;
  background-position: 0 100%, 0 0, 0 0, 0 0, 0 0;
  background-repeat: repeat-x, no-repeat, no-repeat, no-repeat, no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -3px 5px rgba(0, 0, 0, 0.7),
    0 3px 0 #05080a,
    0 10px 22px rgba(0, 0, 0, 0.6);
}

/* Rótulo de advertencia grabado en la carcasa (dentro de la cabecera, sin
   invadir ningún control: no recibe clics). */
.app-header::after {
  content: 'MOD. 77-A · INPUT_FREQ: 400Hz · SYSTEM STATUS: ACTIVE · DO NOT OVERRIDE';
  position: absolute;
  right: 14px;
  bottom: 1px;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  color: rgba(255, 176, 0, 0.45);
  text-shadow: 0 0 6px rgba(255, 176, 0, 0.25);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

@media (max-width: 1400px) {
  .app-header::after { display: none; }
}

/* --------------------------------------------------------------------------
   4. ETIQUETAS DE INGENIERÍA (marca, badges, píldoras)
   -------------------------------------------------------------------------- */

.brand-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--phosphor);
  text-shadow: var(--glow-phosphor);
}

.brand-badge,
.badge,
.table-badge,
.historical-summary-badge,
.timeline-range-badge,
.tl-preset-aspects,
.celeb-total-count-badge {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 2px;
  background-color: #10171c;
  border: 1px solid var(--border-strong);
  color: var(--text-bright);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 0 rgba(0, 0, 0, 0.6);
}

.brand-badge {
  color: var(--amber);
  border-color: var(--amber-dim);
  background-color: var(--amber-deep);
  text-shadow: 0 0 6px rgba(255, 176, 0, 0.5);
}

/* --------------------------------------------------------------------------
   5. NAVEGACIÓN: teclas de consola
   -------------------------------------------------------------------------- */

.main-nav-tabs {
  background: #0b1014;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 3px;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.75),
    0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-tab {
  font-family: var(--font-tech);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.74rem;
  border-radius: 2px;
  border: 1px solid transparent;
  color: var(--text-dim);
  transition: color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.nav-tab:hover {
  color: var(--phosphor);
  background: #131b20;
  border-color: #26302f;
  text-shadow: 0 0 8px rgba(74, 246, 38, 0.35);
}

/* Pestaña activa: la bombilla ámbar encendida bajo la tecla. */
.nav-tab.active {
  color: var(--amber);
  background: linear-gradient(180deg, #2a2008 0%, #1a1405 100%);
  border-color: var(--amber-dim);
  box-shadow:
    inset 0 1px 0 rgba(255, 200, 90, 0.18),
    inset 0 -6px 12px rgba(255, 176, 0, 0.16),
    0 0 10px rgba(255, 176, 0, 0.22);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.55);
}

/* --------------------------------------------------------------------------
   6. BOTONERA TÁCTICA: teclas mecánicas con recorrido
   -------------------------------------------------------------------------- */

.btn-action,
.btn-accent,
.btn-save,
.btn-success,
.btn-chip,
.btn-view-mode,
.btn-play,
.btn-toggle-map,
.btn-clear-search,
.btn-close-modal,
.btn-file-label,
.btn-open-modal,
.increment-btn,
.tl-preset-btn,
.stats-subtab,
.transit-subtab,
.center-toggle-group .center-btn {
  font-family: var(--font-tech);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 2px;
  border: 1px solid #3a4348;
  border-bottom-color: #0a0e10;
  background-color: #242c30;
  background-image: linear-gradient(180deg, #2f383d 0%, #1d2528 100%);
  color: var(--text-bright);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -3px 6px rgba(0, 0, 0, 0.45),
    0 2px 0 #070b0d,
    0 3px 7px rgba(0, 0, 0, 0.5);
  transition: all 0.1s ease;
}

.btn-action:hover,
.btn-chip:hover,
.btn-view-mode:hover,
.btn-play:hover,
.btn-toggle-map:hover,
.btn-clear-search:hover,
.btn-close-modal:hover,
.btn-file-label:hover,
.increment-btn:hover,
.tl-preset-btn:hover,
.stats-subtab:hover,
.transit-subtab:hover,
.center-toggle-group .center-btn:hover {
  color: var(--phosphor);
  border-color: var(--phosphor-dim);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -8px 14px rgba(74, 246, 38, 0.12),
    0 2px 0 #070b0d,
    0 0 12px rgba(74, 246, 38, 0.22);
  text-shadow: 0 0 8px rgba(74, 246, 38, 0.45);
}

/* Pulsación real: la tecla baja 2 px y el bisel se comprime. */
.btn-action:active,
.btn-accent:active,
.btn-save:active,
.btn-success:active,
.btn-chip:active,
.btn-view-mode:active,
.btn-play:active,
.btn-toggle-map:active,
.btn-close-modal:active,
.increment-btn:active,
.tl-preset-btn:active,
.stats-subtab:active,
.transit-subtab:active,
.center-toggle-group .center-btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.7),
    0 0 0 #070b0d;
}

/* Acción principal: emisión ámbar desde dentro de la tecla. */
.btn-accent,
.btn-view-mode.active,
.tl-preset-btn.active,
.center-toggle-group .center-btn.active,
.stats-subtab.active,
.transit-subtab.active {
  color: var(--amber);
  background-color: #2a2008;
  background-image: linear-gradient(180deg, #3a2c0a 0%, #1f1806 100%);
  border-color: var(--amber-dim);
  text-shadow: 0 0 9px rgba(255, 176, 0, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 210, 120, 0.2),
    inset 0 -8px 16px rgba(255, 176, 0, 0.14),
    0 2px 0 #070b0d,
    0 0 14px rgba(255, 176, 0, 0.28);
}

/* Guardar / confirmar: emisión verde fósforo. */
.btn-save,
.btn-success {
  color: var(--phosphor);
  background-color: #12240f;
  background-image: linear-gradient(180deg, #1b3a17 0%, #0f1f0c 100%);
  border-color: var(--phosphor-dim);
  text-shadow: 0 0 9px rgba(74, 246, 38, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(150, 255, 120, 0.16),
    inset 0 -8px 16px rgba(74, 246, 38, 0.12),
    0 2px 0 #070b0d,
    0 0 14px rgba(74, 246, 38, 0.24);
}

/* --------------------------------------------------------------------------
   7. CHRONO-ADJUSTER: ranuras mecánicas y tiradores estriados
   -------------------------------------------------------------------------- */

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: ew-resize;
}

/* Ranura excavada + regla de medición a los lados. */
input[type='range']::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 2px;
  border: 1px solid #0a0e10;
  border-top-color: #05080a;
  background-color: #0d1317;
  background-image:
    /* marcas de regla cada 8 px */
    repeating-linear-gradient(
      90deg,
      rgba(230, 243, 232, 0.22) 0 1px,
      transparent 1px 8px
    ),
    /* marca larga cada 40 px */
    repeating-linear-gradient(
      90deg,
      rgba(255, 176, 0, 0.35) 0 1px,
      transparent 1px 40px
    ),
    linear-gradient(180deg, #05080a 0%, #161d21 100%);
  background-size: 100% 4px, 100% 7px, 100% 100%;
  background-position: 0 top, 0 top, 0 0;
  background-repeat: repeat-x, repeat-x, no-repeat;
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.85),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

/* Tirador: bloque rectangular de metal estriado. */
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 22px;
  margin-top: -6px;
  border-radius: 2px;
  border: 1px solid #05080a;
  background-color: #4a5459;
  background-image:
    /* estrías de agarre */
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.55) 0 1px,
      rgba(255, 255, 255, 0.12) 1px 3px
    ),
    linear-gradient(90deg, #2b3336 0%, #6c7a80 45%, #394246 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.7),
    0 0 10px rgba(74, 246, 38, 0.25);
  transition: box-shadow 0.12s ease;
}

input[type='range']:hover::-webkit-slider-thumb {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 2px 4px rgba(0, 0, 0, 0.7),
    0 0 14px rgba(74, 246, 38, 0.5);
}

input[type='range']:active::-webkit-slider-thumb {
  background-image:
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.6) 0 1px,
      rgba(255, 255, 255, 0.1) 1px 3px
    ),
    linear-gradient(90deg, #2b3336 0%, #8a979d 45%, #48524f 100%);
}

/* Firefox */
input[type='range']::-moz-range-track {
  height: 12px;
  border-radius: 2px;
  border: 1px solid #0a0e10;
  background-color: #0d1317;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.85);
}

input[type='range']::-moz-range-thumb {
  width: 13px;
  height: 22px;
  border-radius: 2px;
  border: 1px solid #05080a;
  background-color: #4a5459;
  background-image: linear-gradient(90deg, #2b3336 0%, #6c7a80 45%, #394246 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

input[type='range']:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--phosphor);
  outline-offset: 1px;
}

/* --------------------------------------------------------------------------
   8. PANTALLAS DE FÓSFORO: cristal, scanlines y rejilla milimetrada
   -------------------------------------------------------------------------- */

.wheel-wrapper,
.wheel-stage,
.wheel-center,
.timeline-chart-wrapper,
.transit-timeline-section,
.clock-svg-wrap,
.saved-wheel-view-wrapper,
.compare-wheels-grid,
.clock-map,
#map,
#reloc-map {
  position: relative;
  border: 2px solid #05080a;
  border-radius: 3px;
  background-color: #060d09;
  background-image:
    /* rejilla milimetrada de ingeniero */
    repeating-linear-gradient(0deg, rgba(74, 246, 38, 0.07) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(74, 246, 38, 0.07) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(0deg, rgba(74, 246, 38, 0.032) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(90deg, rgba(74, 246, 38, 0.032) 0 1px, transparent 1px 6px),
    /* fondo de fósforo con caída hacia los bordes */
    radial-gradient(ellipse 75% 70% at 50% 45%, #0c1a10 0%, #060d09 70%, #040806 100%);
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.8),
    inset 0 0 0 1px #1b2420,
    0 3px 0 #05080a,
    0 10px 24px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  /* el contenido interior respira para que se vea el cristal */
  padding: 10px;
}

/* Scanlines + reflejo de cristal + aberración cromática en los bordes. */
.wheel-wrapper::after,
.wheel-stage::after,
.wheel-center::after,
.timeline-chart-wrapper::after,
.transit-timeline-section::after,
.clock-svg-wrap::after,
.saved-wheel-view-wrapper::after,
.compare-wheels-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    /* aberración cromática ligera: franja roja a un lado, cian al otro */
    linear-gradient(90deg, rgba(255, 60, 60, 0.10) 0, transparent 3px),
    linear-gradient(270deg, rgba(60, 220, 255, 0.09) 0, transparent 3px),
    /* reflejo diagonal del cristal */
    linear-gradient(122deg, rgba(255, 255, 255, 0.055) 0%, transparent 30%),
    /* scanlines */
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.20) 0 1px, transparent 1px 3px);
  mix-blend-mode: normal;
}

/* Los gráficos SVG no llevan fondo propio: dejan ver la retícula. */
#astro-wheel-svg,
#ephemeris-wheel-svg,
#transits-wheel-svg,
#eph-timeline-svg,
#transit-timeline-svg,
#clock-svg,
.saved-wheel-svg,
.timeline-chart-wrapper svg {
  background: transparent;
  filter: drop-shadow(0 0 3px rgba(74, 246, 38, 0.18));
}

/* Glifos del zodíaco y de los planetas: SIEMPRE presentación de TEXTO.
   Sin esto, Chrome en Windows los pinta como emoji a color: ignoran el `fill`
   y el aro del zodíaco se llena de sellos violetas en vez de símbolos que
   obedecen a la paleta (el reloj astral ya lo resolvía con U+FE0E). */
#astro-wheel-svg text,
#ephemeris-wheel-svg text,
#transits-wheel-svg text,
#eph-timeline-svg text,
#transit-timeline-svg text,
#clock-svg text,
.saved-wheel-svg text,
.timeline-chart-wrapper svg text,
.compare-wheels-grid svg text {
  font-family: 'Segoe UI Symbol', 'Cambria Math', 'DejaVu Sans', 'Segoe UI', sans-serif;
  font-variant-emoji: text;
}

/* Títulos de pantalla: rótulo grabado en el bisel. */
.wheel-header,
.wheel-date-display,
.eph-wheel-title,
.chart-title-text,
.clock-title {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--phosphor);
  text-shadow: var(--glow-phosphor);
}

/* --------------------------------------------------------------------------
   9. CAMPOS Y SELECTORES: ranura hundida en el panel
   -------------------------------------------------------------------------- */

.search-input,
.form-select,
.filter-select,
.saved-select,
.saved-sort-box select,
.timeline-date-picker,
.life-event-input,
.nx-search,
.nx-select,
select,
input[type='text'],
input[type='number'],
input[type='date'],
input[type='time'],
input[type='search'],
textarea {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--phosphor);
  background-color: #080d10;
  border: 1px solid #0a0e10;
  border-top-color: #05080a;
  border-radius: 2px;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.8),
    0 1px 0 rgba(255, 255, 255, 0.04);
  text-shadow: 0 0 6px rgba(74, 246, 38, 0.25);
  color-scheme: dark;
}

.search-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: #4d5a53;
  text-shadow: none;
}

.search-input:focus,
.form-select:focus,
.filter-select:focus,
.timeline-date-picker:focus,
.life-event-input:focus,
select:focus,
input[type='text']:focus,
input[type='number']:focus,
textarea:focus {
  outline: none;
  border-color: var(--phosphor-dim);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(74, 246, 38, 0.35),
    0 0 12px rgba(74, 246, 38, 0.22);
}

/* --------------------------------------------------------------------------
   10. DIAL CENTRAL / ROTADOR DE ZODÍACO: aro metálico y dientes de engranaje
   -------------------------------------------------------------------------- */

.center-toggle-group {
  position: relative;
  background-color: #171d21;
  background-image:
    /* dientes de engranaje alrededor del aro */
    repeating-conic-gradient(
      from 0deg,
      rgba(255, 255, 255, 0.07) 0deg 2deg,
      transparent 2deg 6deg
    ),
    radial-gradient(circle at 50% 50%, #20272b 0 62%, #0e1316 63% 100%);
  border: 2px solid #05080a;
  border-radius: 50%;
  padding: 8px;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.75),
    inset 0 -2px 4px rgba(255, 255, 255, 0.05),
    0 4px 0 #05080a,
    0 10px 22px rgba(0, 0, 0, 0.6);
}

.center-toggle-group .center-btn {
  border-radius: 2px;
  font-size: 0.68rem;
}

/* --------------------------------------------------------------------------
   11. TABLAS DE DATOS: listado de instrumento
   -------------------------------------------------------------------------- */

.astro-table,
table {
  border-collapse: collapse;
}

.astro-table th,
.astro-table td,
table th,
table td {
  border-color: #232a2e;
}

.astro-table th,
thead th {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.68rem;
  color: var(--amber);
  background-color: #131a1e;
  border-bottom: 1px solid var(--border-strong);
  text-shadow: 0 0 6px rgba(255, 176, 0, 0.3);
}

.astro-table tr:hover,
tbody tr:hover {
  background-color: rgba(74, 246, 38, 0.05);
}

.astro-table td {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-main);
}

.astro-table td strong {
  color: var(--text-bright);
}

/* --------------------------------------------------------------------------
   12. SECCIONES Y RÓTULOS
   -------------------------------------------------------------------------- */

.view-header-title h2,
.results-header h2,
.saved-header h2,
.modal-header h2,
.historical-title-group h2,
.section-title,
h2 {
  font-family: var(--font-tech);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-bright);
}

h3,
h4,
.controls-section h4,
.tl-group-label,
.stats-subhead,
.aspects-split h3 {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--amber-dim);
  font-weight: 400;
}

/* Texto de ingeniería diminuto alrededor de los controles. */
.hint,
.tl-group-label,
.date-display-label,
.time-display-label,
.coords-display,
.subtitle,
.view-hint {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

/* Línea de datos técnicos bajo la cabecera de cada bloque de controles. */
.tl-group {
  background-color: #141a1e;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 60%);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 1px 0 rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   13. VENTANAS (modales): puertas de consola
   -------------------------------------------------------------------------- */

/* Sin `backdrop-filter`: el brief pide evitar los desenfoques tipo iOS y,
   además, desenfocar el fondo de una ventana con contenido animado dentro
   obliga a recomponer cada fotograma (medido: ~15 fps menos al abrir). Se
   sustituye por un velo más denso, que es lo que hacía un monitor de fósforo
   al bajar la luz de la sala. */
.modal-overlay {
  background: rgba(3, 6, 8, 0.9);
}

.modal-container {
  border-radius: 4px;
  border: 1px solid #3a4348;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 4px 0 #05080a,
    0 24px 60px rgba(0, 0, 0, 0.75);
}

.modal-header {
  background-color: #171e22;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 6px);
  border-bottom: 1px solid #0a0e10;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modal-tabs {
  background: #0b1014;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.7);
}

.modal-tab {
  font-family: var(--font-tech);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 2px;
  color: var(--text-dim);
}

.modal-tab:hover {
  color: var(--phosphor);
  background: #131b20;
}

.modal-tab.active {
  color: var(--amber);
  background: linear-gradient(180deg, #2a2008, #1a1405);
  border-color: var(--amber-dim);
  box-shadow:
    inset 0 -6px 12px rgba(255, 176, 0, 0.16),
    0 0 10px rgba(255, 176, 0, 0.2);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.5);
}

/* --------------------------------------------------------------------------
   14. BARRA DE DESPLAZAMIENTO: riel metálico estriado
   -------------------------------------------------------------------------- */

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: #0a0f12;
  border-left: 1px solid #05080a;
  box-shadow: inset 2px 0 4px rgba(0, 0, 0, 0.6);
}

::-webkit-scrollbar-thumb {
  border-radius: 0;
  border: 1px solid #05080a;
  background-color: #3d474b;
  background-image:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0 1px, rgba(255, 255, 255, 0.09) 1px 3px),
    linear-gradient(90deg, #2b3336, #5c676c 50%, #2b3336);
}

::-webkit-scrollbar-thumb:hover {
  background-color: #4d585c;
  background-image:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0 1px, rgba(255, 255, 255, 0.11) 1px 3px),
    linear-gradient(90deg, #333c40, #6c787d 50%, #333c40);
}

/* --------------------------------------------------------------------------
   15. ENFOQUE POR TECLADO: visible y dentro de la paleta
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--phosphor) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 3px rgba(74, 246, 38, 0.28) !important;
}

/* --------------------------------------------------------------------------
   16. HUD DE AUDIO: mezclador de la máquina
   -------------------------------------------------------------------------- */

.audio-hud,
.audio-mixer {
  font-family: var(--font-mono);
}

.audio-hud-text,
.audio-mixer-label,
.audio-mixer-val,
.audio-mixer-scene {
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.audio-mixer-label {
  color: var(--amber-dim);
  font-size: 0.64rem;
}

.audio-mixer-val {
  color: var(--phosphor);
  text-shadow: 0 0 6px rgba(74, 246, 38, 0.4);
}

.audio-mixer-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 3px;
}

.audio-mixer-head,
.audio-mixer-scene {
  color: var(--amber);
  text-shadow: 0 0 7px rgba(255, 176, 0, 0.4);
}

/* --------------------------------------------------------------------------
   12. FICHA DE CASA: el módulo, con su bisel y su junta
   --------------------------------------------------------------------------
   El panel de casas es un módulo atornillado más (sección 3), pero el
   contenido no tenía margen y se metía debajo de los tornillos de las
   esquinas. Aquí se le da la junta interior y el aire que le falta, y la
   banda de cabecera se convierte en el rótulo grabado del aparato.
   -------------------------------------------------------------------------- */

.house-detail-panel {
  /* La junta que separa el cristal del chasis: el contenido ya no toca el
     tornillo de la esquina. */
  padding: 0;
  overflow: hidden;
  border-color: #0a0e10;
}

/* Rótulo grabado en el bisel: la casa y a qué huele. */
.house-ficha-head {
  border-bottom: 1px solid #05080a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -8px 14px rgba(0, 0, 0, 0.35);
}

.house-ficha-title {
  font-family: var(--font-tech);
  letter-spacing: 0.1em;
}

/* La caja del glifo: ranura hundida, como los campos de la casa. */
.house-ficha-bezel {
  font-variant-emoji: text;
  border-color: #05080a;
  border-bottom-color: var(--house-rank);
  background-image: linear-gradient(180deg, #0b1114, #070c0f);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.75),
    0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 10px -2px var(--house-rank);
}

/* El raíl de la casa: 2px de color jerárquico con su brillo. */
.house-ruler,
.house-ficha-note {
  box-shadow: inset 3px 0 0 -1px rgba(255, 255, 255, 0.05);
}

/* Cada planeta, una placa hija del módulo. El raíl dice su veredicto de un
   vistazo: se escanea la columna y se ve dónde hay fricción. */
.house-planet-card {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0) 55%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.house-planet-card[data-verdict="muy-fuerte"] { border-left-color: #4af626; }
.house-planet-card[data-verdict="fuerte"]     { border-left-color: #8cff6b; }
.house-planet-card[data-verdict="neutro"]     { border-left-color: #6e7c74; }
.house-planet-card[data-verdict="friccion"]   { border-left-color: #ffb000; }
.house-planet-card[data-verdict="bloqueado"]  { border-left-color: #ff8a72; }

.house-planet-glyph {
  font-variant-emoji: text;
  text-shadow: 0 0 9px rgba(74, 246, 38, 0.22);
}

.house-planet-name {
  font-family: var(--font-tech);
  letter-spacing: 0.04em;
}

/* La tira de estado es una banda del panel, no un campo: sin marco lateral, y
   la etiqueta y la frase comparten línea (si la frase es larga, cae debajo). */
.house-planet-state-head { flex: 0 0 auto; }
.house-planet-state-what { flex: 1 1 12ch; min-width: 0; }
