/* ==========================================================================
   Mesa de Rol — Estación La Terminal (Diseño editorial y arquitectónico)
   Estética ferroviaria espacial hogareña: lino cálido, madera de nogal,
   latón sobrio, verde botánico La Terminal y tablero Solari real.
   Cero clip-art caricaturesco ni plantillas SaaS genéricas.
   ========================================================================== */

:root {
  --header-offset: 74px;

  /* Materiales arquitectónicos: lino, madera de nogal y latón */
  --paper-bg: #f3ede0;
  --paper-surface: #fcf9f2;
  --paper-tinted: #e9e0ce;
  --wood-ebony: #1a120c;
  --wood-walnut: #271b13;
  --wood-cedar: #432d1f;
  --wood-honey: #6a472e;
  --brass: #b88c4a;
  --brass-bright: #e4be7a;
  --brass-ink: #6f4e1d;

  /* Tinta y bordes con alto contraste (WCAG AA + 1.4.11 >= 3:1) */
  --ink: #191410;
  --ink-soft: #43372d;
  --ink-muted: #5a4c40;
  --border-warm: #cbbba1;
  --border-strong: #876f56;
  --border-input: #77604a;

  /* Verde La Terminal (contraste >= 6.4:1 con texto blanco) */
  --emerald-deep: #094a1a;
  --emerald: #0c5a21;
  --emerald-hover: #0a4b1b;
  --emerald-soft: #e3f2e7;
  --emerald-border: #76ba87;

  /* Estados */
  --discord: #414cb9;
  --discord-hover: #353f9f;
  --danger: #a42626;
  --danger-bg: #fcebeb;
  --warning-bg: #fbf2da;
  --warning-ink: #664200;

  /* Tipografía */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  /* Geometría sobria de estación e imprenta */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-card: 0 2px 0 rgba(39, 27, 19, 0.08), 0 8px 20px rgba(39, 27, 19, 0.06);
  --shadow-card-hover: 0 4px 0 rgba(12, 90, 33, 0.16), 0 14px 28px rgba(39, 27, 19, 0.12);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper-bg);
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2.5px solid var(--emerald-deep);
  outline-offset: 2px;
}

.site-header :focus-visible,
.departure-console :focus-visible,
.marquee-band :focus-visible,
.site-footer :focus-visible,
.detail-panel-bar :focus-visible {
  outline-color: #9bf7aa;
}

body:not(.kb-nav) :focus:not(:focus-visible),
body:not(.kb-nav) [tabindex="-1"]:focus {
  outline: none;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 2000;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--emerald);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   FRISO SUPERIOR DE MADERA DE NOGAL Y LATÓN
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 800;
  background: var(--wood-walnut);
  border-bottom: 2px solid rgba(184, 140, 74, 0.45);
  color: #faf5ea;
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 9px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: #102a16;
  border: 1px solid rgba(136, 245, 150, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark-sm { width: 32px; height: 32px; }

.brand-copy { display: flex; flex-direction: column; line-height: 1.12; }
.brand-copy strong {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  color: #fcf8ef;
  letter-spacing: -0.01em;
}
.brand-copy small {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brass-bright);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }

.main-nav a {
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 600;
  color: #e6dac5;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
}
.main-nav a:hover { background: rgba(228, 190, 122, 0.14); color: #ffffff; }

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}

.dice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 11px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(228, 190, 122, 0.4);
  background: rgba(255, 248, 235, 0.06);
  color: #f6ead4;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.dice-btn:hover { background: rgba(228, 190, 122, 0.16); border-color: var(--brass-bright); }
.dice-btn.rolling { animation: dice-jolt 260ms ease; }
@keyframes dice-jolt {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.dice-result {
  padding: 1px 6px;
  border-radius: 3px;
  background: #140e0a;
  color: var(--brass-bright);
  font-size: 0.72rem;
}

.dice-btn.crit { background: #0d5420; border-color: #88fa9b; color: #fff; }
.dice-btn.crit .dice-result { background: #073814; color: #b5ffc2; }
.dice-btn.fumble { background: #6c1d1d; border-color: #f49b9b; color: #fff; }
.dice-btn.fumble .dice-result { background: #471111; color: #ffd4d4; }

.session-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }

.logout-error-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffd3d3;
  background: #7f1d1d;
  padding: 3px 7px;
  border-radius: var(--radius-xs);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px 3px 4px;
  border-radius: var(--radius-xs);
  background: rgba(255, 248, 235, 0.08);
  border: 1px solid rgba(228, 190, 122, 0.3);
  color: #fffaf0;
  font-size: 0.82rem;
  font-weight: 600;
}

.user-avatar-initial {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  background: var(--emerald);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(228, 190, 122, 0.36);
  background: rgba(255, 248, 235, 0.06);
  color: #faf4e8;
  cursor: pointer;
}

.mobile-nav-drawer {
  border-top: 1px solid rgba(184, 140, 74, 0.25);
  background: #1e140e;
  padding: 12px 18px 16px;
}

.mobile-nav-links { display: flex; flex-direction: column; gap: 2px; }
.mobile-nav-links a {
  padding: 9px 10px;
  border-radius: var(--radius-xs);
  text-decoration: none;
  font-weight: 600;
  color: #f3e8d4;
}
.mobile-nav-links a:hover { background: rgba(228, 190, 122, 0.12); }
.mobile-drawer-tools { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(184, 140, 74, 0.2); }

/* ==========================================================================
   BOTONES ARQUITECTÓNICOS SOBRIOS (WCAG AA >= 6.4:1)
   ========================================================================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: 0.58; cursor: not-allowed; }
.button-lg { min-height: 46px; padding: 11px 20px; font-size: 0.95rem; }
.button-small, .button-sm-pill { min-height: 36px; padding: 6px 13px; font-size: 0.83rem; }
.button-full { width: 100%; }

.button-primary {
  background: var(--emerald);
  color: #ffffff;
  border-color: var(--emerald-deep);
}
.button-primary:hover:not(:disabled) {
  background: var(--emerald-hover);
  box-shadow: 0 4px 12px rgba(9, 74, 26, 0.24);
}

.button-timber-outline {
  background: var(--paper-surface);
  color: var(--wood-walnut);
  border-color: var(--wood-cedar);
}
.button-timber-outline:hover:not(:disabled) {
  background: var(--paper-tinted);
}

.button-secondary {
  background: var(--paper-surface);
  color: var(--ink);
  border-color: var(--border-input);
}
.button-secondary:hover:not(:disabled) {
  background: var(--paper-tinted);
  border-color: var(--wood-walnut);
}

.button-wood-light {
  background: rgba(255, 248, 235, 0.1);
  color: #fcf7ec;
  border-color: rgba(228, 190, 122, 0.45);
}
.button-wood-light:hover:not(:disabled) { background: rgba(255, 248, 235, 0.2); }

.button-discord { background: var(--discord); color: #ffffff; }
.button-discord:hover:not(:disabled) { background: var(--discord-hover); }

.button-danger { background: var(--danger); color: #ffffff; }
.button-danger:hover:not(:disabled) { background: #891e1e; }

.text-button {
  background: none;
  border: 0;
  color: var(--emerald-deep);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:hover { color: var(--wood-walnut); }

.arrow-slide { display: inline-block; transition: transform 180ms ease; }
.button:hover .arrow-slide { transform: translateY(2px); }

/* ==========================================================================
   HALL DE ESTACIÓN LA TERMINAL (LINO CÁLIDO + NOGAL + VENTANAL ORBITAL + SOLARI)
   ========================================================================== */
.station-concourse {
  background: var(--paper-bg);
  border-bottom: 1.5px solid var(--border-warm);
  --px: 0px;
  --py: 0px;
}

.concourse-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px 36px;
}

/* Cabecera ferroviaria impresa */
.station-fascia {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-warm);
}

.station-sign-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--wood-cedar);
  white-space: nowrap;
  min-width: 0;
}

.station-t-inline { display: inline-flex; align-items: center; flex-shrink: 0; }
.beacon-short { display: none; }

.station-console-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.station-clock {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink);
  padding: 4px 8px;
  background: var(--paper-tinted);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-xs);
}

.ambient-toggle-btn {
  padding: 4px 10px;
  min-height: 29px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-input);
  background: var(--paper-surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.ambient-toggle-btn:hover { background: var(--paper-tinted); }
.ambient-toggle-btn[data-paused="true"] {
  background: var(--emerald);
  border-color: var(--emerald-deep);
  color: #ffffff;
}

/* Grilla principal: izquierda editorial, derecha mirador + tablero mecánico */
.concourse-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 36px;
  align-items: start;
}

.concourse-copy {
  padding-top: 8px;
}

.concourse-copy h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.hero-lead {
  margin: 0 0 24px;
  font-size: 1.03rem;
  line-height: 1.62;
  color: var(--ink-soft);
  max-width: 48ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

/* Notas sobrias estilo horario impreso (sin bullets con estrellitas) */
.station-ledger-notes {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--border-warm);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.station-ledger-notes dt {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--emerald-deep);
  margin-bottom: 3px;
}

.station-ledger-notes dd {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.35;
}

/* Columna derecha: Mirador espacial en carpintería de nogal + Tablero Solari montado debajo */
.station-terminal-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.observatory-frame {
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--wood-walnut);
  border: 2px solid var(--wood-cedar);
  box-shadow: 0 12px 30px rgba(26, 18, 12, 0.2), inset 0 1px 0 rgba(244, 214, 158, 0.22);
}

.observatory-glass {
  position: relative;
  container-type: inline-size;
  height: 162px;
  background: #07090e;
  overflow: hidden;
  border: 5px solid #2f1f14;
  border-bottom: 0;
  box-shadow:
    inset 0 12px 24px rgba(10, 6, 4, 0.72),
    inset 0 -18px 28px rgba(34, 20, 10, 0.78),
    inset 0 0 0 1px rgba(228, 190, 122, 0.22);
}

.cosmos-photo {
  position: absolute;
  inset: -6% -3%;
  width: 106%;
  height: 112%;
  object-fit: cover;
  object-position: 50% 30%;
  opacity: 0.94;
  transform: translate3d(calc(var(--px) * -0.32), calc(var(--py) * -0.22), 0);
  transition: transform 260ms ease-out;
}

.cosmos-grade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 44% at 50% 100%, rgba(245, 186, 102, 0.16) 0%, transparent 72%),
    linear-gradient(
      180deg,
      rgba(22, 14, 9, 0.44) 0%,
      rgba(8, 11, 18, 0.02) 40%,
      rgba(20, 14, 9, 0.36) 72%,
      rgba(22, 14, 9, 0.88) 100%
    );
}

.starfield-layer {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.1px 1.1px at 14% 24%, rgba(255, 248, 232, 0.84) 50%, transparent 100%),
    radial-gradient(1px 1px at 34% 36%, rgba(220, 248, 228, 0.65) 50%, transparent 100%),
    radial-gradient(1.2px 1.2px at 78% 24%, rgba(255, 236, 198, 0.86) 50%, transparent 100%),
    radial-gradient(1px 1px at 88% 40%, rgba(255, 255, 255, 0.72) 50%, transparent 100%);
  background-size: 380px 158px;
  animation: stars-twinkle 7s ease-in-out infinite alternate;
}

@keyframes stars-twinkle {
  0% { opacity: 0.36; }
  100% { opacity: 0.88; }
}

/* Viaducto ferroviario elevado y tren expreso orbital con separación nítida de figura y fondo */
.orbital-viaduct {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  height: 46px;
  z-index: 2;
  pointer-events: none;
}

.orbital-train-wrap {
  position: absolute;
  left: 0;
  bottom: 9px;
  display: inline-flex;
  align-items: flex-end;
  animation: convoy-pass 24s linear infinite;
  animation-delay: -11.5s;
  will-change: transform;
}

.orbital-train-svg {
  display: block;
  width: 312px;
  height: 33px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.75));
}

.orbital-rail-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  height: 1.5px;
  background: linear-gradient(
    90deg,
    rgba(228, 204, 166, 0.14) 0%,
    rgba(238, 214, 174, 0.55) 30%,
    rgba(244, 232, 206, 0.68) 50%,
    rgba(238, 214, 174, 0.55) 70%,
    rgba(228, 204, 166, 0.14) 100%
  );
}

.viaduct-deck {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(16, 11, 8, 0.94) 0 4px,
      rgba(214, 184, 138, 0.22) 4px 5px,
      rgba(18, 12, 8, 0.78) 5px 34px
    ),
    linear-gradient(180deg, #1b130d 0 3px, #120c08 3px 100%);
  border-top: 1px solid rgba(226, 198, 152, 0.34);
}

.window-glass-sheen {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(255, 236, 198, 0.09) 0%, transparent 30%, transparent 72%, rgba(255, 218, 158, 0.07) 100%);
}

/* Alféizar interior de madera tibia iluminada por lámpara del salón */
.window-warm-sill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(180deg, #6b492e 0%, #422b1b 42%, #291a10 100%);
  border-top: 1px solid rgba(255, 224, 168, 0.45);
  box-shadow: 0 -4px 12px rgba(255, 196, 112, 0.16);
}

@keyframes convoy-pass {
  0% { transform: translate3d(-108%, 0, 0); }
  100% { transform: translate3d(calc(100cqw + 24px), 0, 0); }
}

.glass-mullions {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  pointer-events: none;
  z-index: 4;
}

.glass-mullions span { position: relative; }
.glass-mullions span::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 7px;
  background: linear-gradient(90deg, #1b120b, #3e281b 50%, #1b120b);
  border-left: 1px solid rgba(228, 190, 122, 0.28);
  border-right: 1px solid rgba(228, 190, 122, 0.18);
  opacity: 0.78;
}
.glass-mullions span:first-child::after { left: 32%; }
.glass-mullions span:last-child::after { right: 32%; }

.observatory-plate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: var(--wood-walnut);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brass-bright);
}

/* ==========================================================================
   TABLERO SOLARI MECÁNICO CONTINUO
   ========================================================================== */
.departure-console {
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--wood-walnut);
  border: 2px solid var(--wood-cedar);
  box-shadow: 0 14px 32px rgba(26, 18, 12, 0.22);
  color: #fcf7ec;
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 9px;
}

.console-title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brass-bright);
  white-space: nowrap;
}

.console-live-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #b4fcc1;
  background: #0f3d1a;
  border: 1px solid rgba(130, 242, 152, 0.35);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.solari-matrix {
  background: #14110f;
  border: 1px solid rgba(184, 140, 74, 0.35);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.flap-head-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 136px;
  gap: 12px;
  padding: 6px 12px;
  background: #1d1814;
  border-bottom: 1px solid rgba(184, 140, 74, 0.28);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #cab393;
}

.flap-col-time { text-align: right; }
.flap-board-rows { display: flex; flex-direction: column; }

.flap-row {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 136px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(184, 140, 74, 0.18);
  color: #fcf7ec;
  transition: background 150ms ease;
}

.flap-row:last-child { border-bottom: 0; }
.flap-row:not(.flap-row-skeleton):hover { background: rgba(130, 242, 152, 0.09); }
.flap-row-skeleton { cursor: default; }

.flap-row-trigger {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  display: block;
  width: 100%;
}
.flap-row-trigger::after { content: ""; position: absolute; inset: 0; }
.flap-row-trigger:focus-visible { outline: none; }

.flap-row:has(.flap-row-trigger:focus-visible) {
  outline: 2.5px solid #9bf7aa;
  outline-offset: -3px;
  background: rgba(130, 242, 152, 0.12);
}

.flap-platform {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border-radius: 3px;
  background: linear-gradient(180deg, #173d1e 0%, #102d16 49%, #0b2210 51%, #14361b 100%);
  border: 1px solid rgba(130, 242, 152, 0.42);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: #bbfcc6;
}

.flap-platform::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, 0.52);
}

.flap-platform.flap-tick { animation: flap-badge-flip 320ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes flap-badge-flip {
  0% { transform: rotateX(-55deg); }
  100% { transform: rotateX(0deg); }
}

.flap-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.flap-main strong { font-size: 0.89rem; font-weight: 700; line-height: 1.24; color: #fffbf2; }
.flap-main small { font-size: 0.73rem; color: #d7c7af; line-height: 1.3; }
.flap-sys { color: #8ef5a0; font-weight: 700; }

.flap-time {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--brass-bright);
  text-align: right;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.flap-row-arrow {
  display: inline-block;
  margin-left: 5px;
  color: #8ef5a0;
  font-weight: 800;
  transition: transform 160ms ease;
}
.flap-row:hover .flap-row-arrow { transform: translateX(3px); }

.flap-zone-hint { display: block; font-size: 0.61rem; font-weight: 500; color: #d5bf9e; margin-top: 1px; }

.console-footer {
  margin-top: 9px;
  padding: 8px 2px 0;
  border-top: 1px solid rgba(184, 140, 74, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.console-shelf-note { font-size: 0.74rem; color: #cbb89d; }
.console-mobile-all-link {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--brass-bright);
  text-decoration: none;
  white-space: nowrap;
}
.console-mobile-all-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.console-cta-link {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: #a6fbb4;
  text-decoration: none;
  white-space: nowrap;
}
.console-cta-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   CINTA TIPOGRÁFICA DE RUTAS DE ROL
   ========================================================================== */
.marquee-band {
  background: var(--wood-walnut);
  color: #efe3ce;
  border-bottom: 2px solid rgba(184, 140, 74, 0.35);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
}

.marquee-station-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--brass-bright);
  padding-right: 12px;
  border-right: 1px solid rgba(184, 140, 74, 0.35);
  white-space: nowrap;
}

.marquee-viewport {
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 34s linear infinite;
}

.marquee-group {
  list-style: none;
  margin: 0;
  padding: 0 20px 0 0;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.77rem;
  font-weight: 500;
  white-space: nowrap;
}

.marquee-group li { display: inline-flex; align-items: center; gap: 16px; }
.marquee-group li::after { content: "/"; color: rgba(228, 190, 122, 0.6); }

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee-band.is-paused .marquee-viewport {
  mask-image: none;
  -webkit-mask-image: none;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(228, 190, 122, 0.55) rgba(255, 248, 235, 0.08);
}
.marquee-band.is-paused .marquee-viewport::-webkit-scrollbar { height: 5px; }
.marquee-band.is-paused .marquee-viewport::-webkit-scrollbar-track {
  background: rgba(255, 248, 235, 0.08);
  border-radius: 999px;
}
.marquee-band.is-paused .marquee-viewport::-webkit-scrollbar-thumb {
  background: rgba(228, 190, 122, 0.58);
  border-radius: 999px;
}
.marquee-band.is-paused .marquee-track { animation-play-state: paused; }

.marquee-toggle {
  padding: 4px 10px;
  min-height: 29px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(228, 190, 122, 0.42);
  background: rgba(255, 248, 235, 0.07);
  color: #fbf3e4;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.marquee-toggle:hover { background: rgba(255, 248, 235, 0.16); }
.marquee-toggle[data-paused="true"] { background: var(--emerald); border-color: #8ef5a0; color: #ffffff; }

/* Pausa de la escena superior únicamente */
body.ambient-paused .orbital-train-wrap,
body.ambient-paused .starfield-layer {
  animation-play-state: paused !important;
}

/* ==========================================================================
   SALÓN DE ANDENES Y BOLETOS IMPRESOS
   ========================================================================== */
.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--emerald-deep);
}

.muted { color: var(--ink-muted); }
.small-note { font-size: 0.84rem; }

.notice {
  margin-bottom: 20px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-input);
  background: var(--paper-surface);
  font-weight: 600;
}
.notice[data-kind="success"] { background: var(--emerald-soft); border-color: var(--emerald-border); color: var(--emerald-deep); }
.notice[data-kind="error"] { background: var(--danger-bg); border-color: #d99595; color: #7c1717; }
.notice[data-kind="warning"] { background: var(--warning-bg); border-color: #d8b86d; color: var(--warning-ink); }

.catalog-section { scroll-margin-top: var(--header-offset); }

.catalog-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.catalog-title-group h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.5vw, 2.05rem);
  line-height: 1.14;
  color: var(--ink);
}

.catalog-header-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.catalog-status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.count-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--radius-xs);
  background: var(--wood-walnut);
  color: #fcf7ec;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
}
.count-pill.flap-update { animation: count-flip 280ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes count-flip { 0% { transform: rotateX(-55deg); } 100% { transform: rotateX(0deg); } }

.completeness-note { font-size: 0.78rem; color: var(--ink-soft); }
.completeness-note a { color: var(--emerald-deep); font-weight: 700; text-underline-offset: 2px; white-space: nowrap; }

.refresh-header-btn.spinning .refresh-ico { display: inline-block; animation: spin 720ms linear 6; }
@keyframes spin { to { transform: rotate(360deg); } }

.explorer-bar {
  background: var(--paper-surface);
  border: 1.5px solid var(--border-warm);
  box-shadow: inset 0 3px 0 var(--wood-walnut), var(--shadow-card);
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  margin-bottom: 22px;
  overflow: hidden;
}

.search-row { margin-bottom: 12px; }
.search-input-wrap { position: relative; display: flex; align-items: center; }
.search-ico { position: absolute; left: 13px; color: var(--ink-muted); pointer-events: none; }

#game-search {
  width: 100%;
  min-height: 44px;
  padding: 9px 14px 9px 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-input);
  background: #ffffff;
  color: var(--ink);
  font-size: 0.95rem;
}

.search-input-wrap.has-value #game-search { padding-right: 40px; }
#game-search:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(12, 90, 33, 0.14); }

.search-inline-clear {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
}
.search-inline-clear:hover { background: var(--paper-tinted); }

.source-and-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.source-segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--paper-tinted);
  border: 1px solid var(--border-warm);
  gap: 2px;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 6px 13px;
  min-height: 32px;
  border-radius: var(--radius-xs);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
}
.seg-btn.active { background: var(--wood-walnut); color: #fcf7ec; }

.mobile-filter-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters-toggle-btn { display: none; }

.filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 3px;
  background: var(--emerald);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 700;
}

.explorer-filters-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 11px;
  border-top: 1px solid var(--border-warm);
}

.filter-group-block { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }

.filter-group-label {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.system-chips, .mini-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.sys-chip, .mini-chip {
  min-height: 32px;
  padding: 5px 11px;
  border-radius: var(--radius-xs);
  border: 1.2px solid var(--border-input);
  background: var(--paper-surface);
  color: var(--ink-soft);
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
}
.sys-chip:hover, .mini-chip:hover { border-color: var(--emerald); color: var(--emerald-deep); }
.sys-chip.active, .mini-chip.active { background: var(--emerald-deep); border-color: var(--emerald-deep); color: #ffffff; }

.composable-filters-grid { display: flex; flex-wrap: wrap; gap: 8px 22px; }

.resolve-banner, .info-banner {
  margin-bottom: 16px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-input);
  background: var(--paper-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

/* ==========================================================================
   GRILLA DE BOLETOS DE EMBARQUE IMPRESOS
   ========================================================================== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  scroll-margin-top: var(--header-offset);
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper-surface);
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--wood-honey);
}

.game-card:focus-within {
  border-color: var(--emerald-deep);
  box-shadow: 0 0 0 3px rgba(9, 74, 26, 0.2), var(--shadow-card-hover);
}

.game-card.card-enter {
  animation: ticket-enter 320ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--i, 0) * 40ms);
}
@keyframes ticket-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.card-cover {
  position: relative;
  height: 152px;
  background: var(--wood-walnut);
  overflow: hidden;
  border-bottom: 1.5px solid var(--border-warm);
}

.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 380ms ease; }
.game-card:hover .card-cover img { transform: scale(1.04); }

.art-fantasy { object-position: center 42%; }
.art-mystery { object-position: center 36%; }
.art-scifi { object-position: center 48%; }
.art-table { object-position: center 50%; }

.card-cover-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 13, 8, 0.56) 0%, rgba(20, 13, 8, 0.04) 55%, rgba(20, 13, 8, 0.36) 100%);
}

.cover-top-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.system-pill {
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  background: rgba(24, 16, 11, 0.9);
  border: 1px solid rgba(228, 190, 122, 0.45);
  color: #fcf7ec;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  max-width: 62%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-web { background: var(--emerald-deep); color: #eefef1; }
.badge-discord { background: var(--discord); color: #ffffff; }
.badge-admin { background: #6f2d14; color: #ffe8c8; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #84f597; }

.card-body { padding: 15px 16px 13px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.card-platform-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.card-platform-code { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; color: var(--brass-ink); }
.marker-tag { font-family: var(--font-mono); font-size: 0.69rem; font-weight: 700; padding: 2px 6px; border-radius: 3px; background: var(--paper-tinted); color: var(--ink-soft); }

.card-title-heading { margin: 0; font-family: var(--font-display); font-size: 1.18rem; line-height: 1.22; color: var(--ink); overflow-wrap: anywhere; }

.card-primary-trigger {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.card-primary-trigger::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.card-primary-trigger:focus-visible { outline: none; }

.card-facts-box {
  display: grid;
  gap: 5px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: #f6f0e4;
  border: 1px solid #dbd0bc;
  min-width: 0;
}

.fact-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 0.81rem; min-width: 0; }
.fact-label { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); flex-shrink: 0; }
.fact-value { font-weight: 600; color: var(--ink); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.fact-value.highlight { color: var(--emerald-deep); font-weight: 700; }

.rpg-tags { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.rpg-tag { font-size: 0.73rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-xs); background: var(--paper-tinted); border: 1px solid var(--border-warm); color: var(--ink-soft); max-width: 100%; overflow-wrap: anywhere; }
.rpg-tag.schedule { background: var(--emerald-soft); border-color: var(--emerald-border); color: var(--emerald-deep); }
.rpg-tag.experience-required { background: var(--warning-bg); border-color: #d8b86d; color: var(--warning-ink); }

.gm-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gm-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 0.81rem; font-weight: 700; color: var(--ink-soft); min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.gm-initial {
  width: 21px;
  height: 21px;
  border-radius: 3px;
  background: var(--wood-walnut);
  color: #fcf7ec;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.game-card-body { margin: 0; font-size: 0.87rem; line-height: 1.52; color: var(--ink-soft); overflow-wrap: anywhere; }

.card-footer {
  position: relative;
  padding: 11px 16px;
  border-top: 1.5px dashed var(--border-strong);
  background: #f8f3e8;
}
.card-footer::before, .card-footer::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper-bg);
  border: 1.5px solid var(--border-warm);
}
.card-footer::before { left: -7px; }
.card-footer::after { right: -7px; }

.card-action-visual { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; font-weight: 800; color: var(--emerald-deep); }
.source-discord .card-action-visual { color: var(--discord); }
.card-action-arrow { transition: transform 160ms ease; }
.game-card:hover .card-action-arrow { transform: translateX(4px); }

.skeleton-card { border-radius: var(--radius-md); background: var(--paper-surface); border: 1.5px solid var(--border-warm); overflow: hidden; min-height: 350px; }
.skeleton-media { height: 152px; background: linear-gradient(90deg, #e7dcc8 25%, #f3ead9 50%, #e7dcc8 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out 3; }
.skeleton-lines { padding: 16px; display: grid; gap: 11px; }
.skeleton-line { height: 13px; border-radius: 3px; background: #e8decb; }
.skeleton-line.tall { height: 20px; width: 76%; }
.skeleton-line.short { width: 50%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.empty-state { padding: 18px; border-radius: var(--radius-sm); background: var(--paper-surface); border: 1.5px dashed var(--border-input); color: var(--ink-soft); }
.empty-state-card { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 4px; }
.empty-state p { margin: 0; }

/* ==========================================================================
   GUÍA EDITORIAL IMPRESA DE LA ESTACIÓN (PAPEL CÁLIDO + FILETE DE LATÓN)
   ========================================================================== */
.how-section { margin-top: 52px; scroll-margin-top: var(--header-offset); }

.how-editorial-band {
  border-radius: var(--radius-md);
  padding: 28px 28px 30px 32px;
  background: var(--paper-tinted);
  border: 1.5px solid var(--border-warm);
  box-shadow: inset 5px 0 0 var(--wood-walnut);
  overflow: hidden;
}

.how-header h2 {
  margin: 0 0 22px;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.3vw, 1.88rem);
  color: var(--ink);
}

.journey-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.journey-step { display: flex; flex-direction: column; gap: 10px; }
.step-marker { display: flex; align-items: center; gap: 10px; }

.step-num {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  background: var(--wood-walnut);
  border: 1px solid var(--brass);
  color: var(--brass-bright);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.track-line {
  flex: 1;
  height: 2px;
  background: var(--border-strong);
  transform-origin: left center;
}
.how-editorial-band.is-visible .track-line { animation: rail-draw 650ms cubic-bezier(0.22, 1, 0.36, 1) backwards; }
@keyframes rail-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.track-line.track-end { background: linear-gradient(90deg, var(--border-strong), transparent); }

.step-body h3 { margin: 0 0 5px; font-size: 1rem; color: var(--ink); }
.step-body p { margin: 0; font-size: 0.89rem; line-height: 1.56; color: var(--ink-soft); }

/* ==========================================================================
   MODAL NATIVO <dialog>
   ========================================================================== */
dialog.detail-modal-sheet {
  padding: 0;
  margin: auto;
  width: min(840px, calc(100vw - 32px));
  max-width: 840px;
  max-height: calc(100dvh - 36px);
  background: var(--paper-surface);
  color: var(--ink);
  border: 2px solid var(--wood-walnut);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.52);
  overflow: hidden;
}

dialog.detail-modal-sheet[open] {
  display: flex;
  flex-direction: column;
  animation: modal-pop 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

dialog.detail-modal-sheet::backdrop {
  background: rgba(16, 12, 9, 0.74);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

@keyframes modal-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.detail-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--wood-walnut);
  color: #fcf7ec;
  border-bottom: 1.5px solid rgba(184, 140, 74, 0.45);
  flex-shrink: 0;
}

.detail-kicker-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.05em; color: var(--brass-bright); min-width: 0; }
.detail-kicker-brand svg { flex-shrink: 0; }
.detail-inline-error { padding: 10px 18px; background: var(--danger-bg); border-bottom: 1px solid #d99595; color: #7c1717; font-size: 0.87rem; font-weight: 700; flex-shrink: 0; }
.detail-modal-body { padding: 20px 22px 24px; overflow-y: auto; background: var(--paper-surface); }
.detail-top-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.85fr); gap: 20px; align-items: start; }
.detail-heading-block { min-width: 0; }
.detail-heading-block .eyebrow { overflow-wrap: anywhere; }
.detail-title-main { margin: 4px 0 12px; font-family: var(--font-display); font-size: clamp(1.45rem, 2.3vw, 1.9rem); line-height: 1.16; color: var(--ink); overflow-wrap: anywhere; }
.detail-primary-cta { margin: 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.detail-primary-cta .button { white-space: normal; text-align: center; max-width: 100%; }
.detail-description { margin: 0 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.62; color: var(--ink-soft); }
.detail-side-art { border-radius: var(--radius-sm); overflow: hidden; border: 1.5px solid var(--border-warm); aspect-ratio: 4 / 3; background: var(--wood-walnut); }
.detail-side-art img { width: 100%; height: 100%; object-fit: cover; }
.publication-status { margin: 0; font-size: 0.82rem; font-weight: 600; color: var(--ink-muted); }
.members-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.member-pill { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 5px 10px; border-radius: var(--radius-xs); background: var(--paper-tinted); border: 1px solid var(--border-warm); font-size: 0.83rem; max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
.member-pill strong { min-width: 0; overflow-wrap: anywhere; }

/* ==========================================================================
   ZONA AUTENTICADA
   ========================================================================== */
.wood-divider { margin: 44px 0 22px; display: flex; align-items: center; gap: 14px; font-family: var(--font-mono); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--wood-honey); }
.wood-divider::before, .wood-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-warm); }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.sheet-panel { background: var(--paper-surface); border: 1.5px solid var(--border-warm); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-card); margin-bottom: 20px; scroll-margin-top: var(--header-offset); }
.dashboard-grid .sheet-panel { margin-bottom: 0; }
.sheet-panel h2 { margin: 2px 0 8px; font-family: var(--font-display); font-size: 1.42rem; }
.panel-lead { margin: 0 0 15px; color: var(--ink-soft); font-size: 0.91rem; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 0.83rem; font-weight: 700; color: var(--ink); }
.field-row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-checkbox { justify-content: flex-end; }
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.checkbox-label input { width: 17px; height: 17px; accent-color: var(--emerald); }
.field input, .field textarea, .field select { width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-input); background: #ffffff; color: var(--ink); font: inherit; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--emerald); }
.field textarea[aria-invalid="true"], .field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--danger); background: #fff9f9; }
.field-meta-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.field-char-counter { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700; color: var(--ink-muted); margin-left: auto; }
.field-char-counter.is-over { color: var(--danger); }
.field-inline-error { margin: 2px 0 0; padding: 7px 10px; border-radius: var(--radius-xs); background: var(--danger-bg); border: 1px solid #d99595; color: #7c1717; font-size: 0.82rem; font-weight: 700; }
.section-error-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--danger-bg); border: 1px solid #d99595; color: #7c1717; font-size: 0.86rem; }
.button-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.application-list, .compact-list { display: flex; flex-direction: column; gap: 10px; }
.application-card, .compact-card { padding: 13px; border-radius: var(--radius-sm); background: #f8f3e8; border: 1px solid var(--border-warm); min-width: 0; overflow-wrap: anywhere; }
.compact-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compact-card > div, .application-card-top > div { min-width: 0; overflow-wrap: anywhere; }
.application-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.application-card h3 { margin: 2px 0 4px; font-size: 0.98rem; }
.status { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--radius-xs); font-size: 0.73rem; font-weight: 700; }
.status-pending { background: var(--warning-bg); color: var(--warning-ink); }
.status-accepted { background: var(--emerald-soft); color: var(--emerald-deep); }
.status-rejected, .status-withdrawn, .status-cancelled { background: var(--danger-bg); color: var(--danger); }
.warning-banner { margin: 10px 0; padding: 10px 13px; border-radius: var(--radius-sm); background: var(--warning-bg); border: 1px solid #d8b86d; color: var(--warning-ink); font-size: 0.86rem; overflow-wrap: anywhere; }
.chat-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; }
.chat-main { min-width: 0; }
.chat-sidebar { display: flex; flex-direction: column; gap: 14px; padding: 13px; border-radius: var(--radius-sm); background: #f6f0e4; border: 1px solid var(--border-warm); min-width: 0; }
.chat-sidebar-section h3 { margin: 0 0 7px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
.chat-thread-list, .chat-teammates-list { display: flex; flex-direction: column; gap: 6px; }
.chat-thread-item { width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-xs); border: 1px solid var(--border-warm); background: var(--paper-surface); cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-thread-item.active { background: var(--emerald-soft); border-color: var(--emerald); }
.chat-thread-title { font-size: 0.85rem; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.chat-thread-preview { font-size: 0.77rem; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.teammate-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; border-radius: var(--radius-xs); background: var(--paper-surface); border: 1px solid var(--border-warm); min-width: 0; }
.teammate-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.chat-active-box { border: 1px solid var(--border-warm); border-radius: var(--radius-sm); padding: 15px; background: #fbf8f1; min-width: 0; }
.chat-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid var(--border-warm); }
.chat-header > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.chat-header h3 { margin: 0 0 3px; overflow-wrap: anywhere; }
.chat-header p { margin: 0; font-size: 0.83rem; overflow-wrap: anywhere; }
.message-list { list-style: none; margin: 13px 0; padding: 0; max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; }
.message { padding: 9px 12px; border-radius: var(--radius-sm); background: var(--paper-surface); border: 1px solid var(--border-warm); max-width: 85%; min-width: 0; overflow-wrap: anywhere; }
.message.mine { align-self: flex-end; background: var(--emerald-soft); border-color: var(--emerald-border); }
.message-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.75rem; margin-bottom: 4px; }
.message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.safety-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.edit-form { margin-top: 18px; padding-top: 16px; border-top: 1.5px dashed var(--border-warm); }

/* ==========================================================================
   PIE DE PÁGINA
   ========================================================================== */
.site-footer { background: var(--wood-walnut); color: #e8dcc8; border-top: 2px solid rgba(184, 140, 74, 0.45); }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 30px 24px 40px; display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.footer-brand { flex: 1 1 560px; max-width: 780px; }
.footer-brand-lockup { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-credits { padding-top: 12px; border-top: 1px solid rgba(184, 140, 74, 0.22); }
.credits-title { margin: 0 0 7px; font-size: 0.81rem; font-weight: 700; color: var(--brass-bright); }
.credits-list { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 0.79rem; color: #d6c6ae; }
.credits-list code { font-family: var(--font-mono); font-size: 0.74rem; color: #a9f9b7; background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 3px; }
.credits-list a { color: #f3e4ca; text-underline-offset: 3px; }
.credits-list a:hover { color: #98fa9f; }
.svg-credits-note { margin: 10px 0 0; font-size: 0.76rem; line-height: 1.5; color: #c7b59b; }
.footer-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.footer-links { display: flex; gap: 16px; font-size: 0.85rem; font-weight: 600; }
.footer-links a { color: #e4d4bc; text-decoration: none; }
.footer-links a:hover { color: #98fa9f; text-decoration: underline; }

/* ==========================================================================
   RESPONSIVE: TABLET, 390px Y 320px
   ========================================================================== */
@media (max-width: 1020px) {
  .concourse-grid { grid-template-columns: 1fr; gap: 22px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey-steps, .dashboard-grid, .safety-grid, .chat-layout { grid-template-columns: 1fr; }
  .track-line { display: none; }
}

@media (max-width: 860px) {
  .main-nav, .header-right .dice-control { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .header-inner { padding: 8px 14px; }
  .login-label-extra { display: none; }

  .filters-toggle-btn { display: inline-flex; }
  .explorer-filters-panel { display: none; }
  .explorer-filters-panel.is-open { display: flex; }

  .detail-top-grid { grid-template-columns: 1fr; }
  .detail-side-art { display: none; }
}

@media (max-width: 640px) {
  .concourse-shell { padding: 9px 14px 12px; }
  .station-fascia { margin-bottom: 8px; padding-bottom: 6px; gap: 8px; }
  .beacon-full { display: none; }
  .beacon-short { display: inline; }
  .station-sign-code { font-size: 0.64rem; }
  .station-clock { display: none; }
  .ambient-toggle-btn { font-size: 0.65rem; padding: 2px 8px; min-height: 25px; }

  .concourse-grid { gap: 10px; }
  .concourse-copy { padding-top: 0; }
  .concourse-copy h1 { font-size: 1.54rem; margin-bottom: 6px; }
  .hero-lead { font-size: 0.84rem; line-height: 1.4; margin-bottom: 10px; }
  .hero-actions { gap: 7px; margin-bottom: 0; }
  .hero-actions .button-lg { flex: 1 1 124px; min-height: 36px; padding: 6px 10px; font-size: 0.82rem; }

  .station-ledger-notes { display: none; }
  .station-terminal-stack { gap: 0; }

  /* En móvil: mirador con alféizar hogareño y tren nítido + búsqueda y primer título en el primer pliegue */
  .observatory-glass { height: 78px; border-width: 4px; }
  .orbital-viaduct { bottom: 6px; height: 34px; }
  .orbital-train-wrap { bottom: 6px; }
  .orbital-train-svg { width: 224px; height: 24px; }
  .orbital-rail-line { bottom: 9px; }
  .viaduct-deck { height: 9px; }
  .window-warm-sill { height: 6px; }
  .observatory-plate { font-size: 0.56rem; padding: 3px 10px; }

  .departure-console,
  .marquee-band { display: none; }

  .user-name, .site-header .badge-admin { display: none; }
  .user-chip { padding: 3px; }
  .field-row-2 { grid-template-columns: 1fr; }

  /* Explorador móvil compacto visible junto al primer título en el primer pliegue (390px y 320px) */
  .page-shell { padding: 11px 14px 42px; }
  .catalog-header { margin-bottom: 6px; gap: 4px; }
  .catalog-title-group .eyebrow { display: none; }
  .catalog-title-group h2 { font-size: 1.24rem; }
  .catalog-header-meta { align-items: flex-start; width: 100%; gap: 2px; }
  .catalog-status-row { width: 100%; justify-content: space-between; flex-wrap: nowrap; gap: 8px; }
  .count-pill { font-size: 0.7rem; padding: 4px 8px; white-space: nowrap; }
  .refresh-header-btn { min-height: 29px; padding: 4px 9px; font-size: 0.76rem; }

  .explorer-bar { padding: 9px 10px; margin-bottom: 10px; }
  .search-row { margin-bottom: 6px; }
  #game-search { min-height: 37px; font-size: 0.9rem; }
  .source-and-toggle-row { margin-bottom: 0; gap: 6px; }
  .explorer-filters-panel { gap: 7px; padding-top: 8px; margin-top: 6px; }
  .sys-chip, .mini-chip { min-height: 29px; padding: 4px 9px; font-size: 0.75rem; }

  .game-grid { grid-template-columns: 1fr; gap: 14px; }
  .card-body { order: -1; padding: 12px 13px 10px; gap: 7px; }
  .card-cover { height: 112px; border-top: 1.5px solid var(--border-warm); border-bottom: 0; }
  .how-editorial-band { padding: 20px 16px; }

  dialog.detail-modal-sheet { width: calc(100vw - 18px); max-height: calc(100dvh - 18px); }
  .detail-brand-suffix { display: none; }
  .detail-panel-bar { padding: 8px 12px; gap: 8px; }
  .detail-kicker-brand { font-size: 0.72rem; white-space: nowrap; }
  .detail-modal-body { padding: 13px 14px 18px; }
  .detail-title-main { font-size: 1.32rem; margin: 2px 0 9px; }
  .detail-primary-cta { margin: 11px 0; }

  .footer-inner { padding: 22px 16px 34px; }
  .footer-actions { align-items: flex-start; }
}

@media (max-width: 360px) {
  .header-inner { padding: 8px 10px; gap: 6px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-copy strong { font-size: 0.94rem; }
  .brand-copy small { font-size: 0.6rem; }

  .concourse-shell { padding: 6px 10px 8px; }
  .station-fascia { margin-bottom: 5px; padding-bottom: 4px; }
  .concourse-grid { gap: 7px; }
  .concourse-copy h1 { font-size: 1.3rem; margin-bottom: 4px; }
  .hero-lead { font-size: 0.78rem; line-height: 1.32; margin-bottom: 6px; }
  .hero-actions .button-lg { min-height: 33px; padding: 4px 8px; font-size: 0.76rem; }
  .observatory-glass { height: 64px; border-width: 3px; }
  .orbital-viaduct { bottom: 5px; height: 28px; }
  .orbital-train-wrap { bottom: 5px; }
  .orbital-train-svg { width: 204px; height: 22px; }
  .orbital-rail-line { bottom: 7px; }
  .viaduct-deck { height: 7px; }
  .window-warm-sill { height: 5px; }
  .observatory-plate { font-size: 0.52rem; letter-spacing: 0.04em; padding: 2px 8px; white-space: nowrap; }
  .page-shell { padding: 8px 10px 36px; }
  .catalog-header { margin-bottom: 5px; }
  .catalog-title-group h2 { font-size: 1.12rem; }
  .completeness-note { font-size: 0.72rem; }
  .explorer-bar { padding: 8px 9px; margin-bottom: 8px; }
  .search-row { margin-bottom: 5px; }
  #game-search { min-height: 35px; padding: 6px 10px 6px 34px; font-size: 0.86rem; }
  .search-ico { left: 10px; width: 15px; height: 15px; }
  .source-and-toggle-row { gap: 5px; }
  .source-segmented { padding: 2px; gap: 1px; }
  .seg-btn { padding: 4px 7px; font-size: 0.71rem; min-height: 28px; }
  .filters-toggle-btn { min-height: 30px; padding: 4px 8px; font-size: 0.71rem; }
  .card-body { padding: 10px 11px 9px; gap: 6px; }
  .card-title-heading { font-size: 1.08rem; }
}

/* ==========================================================================
   PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .orbital-train-wrap { transform: translate3d(calc(50cqw - 50%), 0, 0) !important; }
  .ambient-toggle-btn, .marquee-toggle { display: none !important; }

  .marquee-band { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .marquee-viewport { mask-image: none; -webkit-mask-image: none; overflow: visible; }
  .marquee-track { animation: none !important; width: 100%; }
  .marquee-duplicate { display: none; }
  .marquee-group { flex-wrap: wrap; white-space: normal; gap: 5px 12px; padding-right: 0; }
  .marquee-group li:last-child::after { display: none; }
}

@media (prefers-reduced-motion: reduce) and (max-width: 360px) {
  .marquee-band { grid-template-columns: minmax(0, 1fr); }
}
