/* Prototipo aislado de la esfera geodésica fractal. Estilos propios: no comparte
   nada con app.css para que se pueda comparar sin tocar la aplicación. */
/* Estos estilos los comparten la página suelta del prototipo y la habilidad
   dentro de la aplicación, así que nada de aquí puede tocar al body: lo que
   viste de la página va colgado de .fs-root, que solo existe allí. */
.fs-root {
  position: relative;
  height: 100vh;
  box-sizing: border-box;
  background: #04060f;
  color: #e8f1ff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}
.fs-root *, .fs-shell * { box-sizing: border-box; }

.fs-loading {
  display: grid;
  place-content: center;
  gap: 10px;
  height: 100%;
  padding: 32px;
  text-align: center;
}
.fs-loading strong { font-size: 17px; font-weight: 600; }
.fs-loading p { max-width: 42ch; margin: 0 auto; color: #9db2d2; font-size: 13.5px; line-height: 1.5; }
.fs-orb { font-size: 30px; color: #ffd08a; }
.fs-error strong { color: #ffb4a2; }
.fs-link {
  display: inline-block;
  margin-top: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  background: #ffc857;
  color: #1a1204;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}
code { padding: 1px 5px; border-radius: 5px; background: #101a2e; font-size: .92em; }

/* Selector de estado: fuera del componente, para que cambiar de estado sea
   recargar la página y no un caso especial dentro de la vista. */
.fs-states {
  position: fixed;
  top: 118px; left: 24px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fs-states a {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid rgb(120 160 220 / 20%);
  border-radius: 999px;
  background: rgb(9 15 30 / 72%);
  color: #c2d4ec;
  font-size: 11.5px;
  text-decoration: none;
  transition: border-color .18s ease, color .18s ease;
}
.fs-states a:hover { border-color: rgb(150 190 250 / 45%); color: #eaf2ff; }
.fs-states a[aria-current] { border-color: #c98500; color: #f0d59a; }
.fs-states span { color: #7c93b4; font-size: 10px; }

.fs-shell { position: relative; height: 100vh; overflow: hidden; }
.fs-canvas { display: block; width: 100%; height: 100vh; cursor: grab; touch-action: none; }
/* Dentro de la aplicación la esfera comparte sitio con el chat, así que toma el
   alto de su hueco en vez de el de la ventana. */
.fs-shell.fs-embedded, .fs-shell.fs-embedded .fs-canvas { height: 100%; min-height: 520px; }
.fs-shell.fs-embedded .fs-top { padding: 16px 18px; }
.fs-shell.fs-embedded .fs-legend { bottom: 10px; }
.fs-shell.fs-embedded .fs-bottom { bottom: 62px; }

.fs-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 20px 24px;
  pointer-events: none;
}
.fs-top > * { pointer-events: auto; }
.fs-kicker {
  display: block;
  color: #8fb4e6;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.fs-title h2 { margin: 3px 0 2px; font-size: 25px; font-weight: 600; letter-spacing: -.01em; }
.fs-sub { margin: 0; max-width: 46ch; color: #9db2d2; font-size: 12.5px; }

.fs-counters { display: flex; gap: 8px; margin-left: auto; }
.fs-counters div {
  min-width: 84px;
  padding: 9px 13px;
  border: 1px solid rgb(120 160 220 / 18%);
  border-radius: 12px;
  background: rgb(9 15 30 / 72%);
  text-align: left;
}
.fs-counters strong { display: block; font-size: 16px; font-weight: 600; }
.fs-counters span { color: #8ba4c8; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.fs-actions { display: flex; flex-direction: column; gap: 6px; }
.fs-actions button, .fs-legend button {
  border: 1px solid rgb(120 160 220 / 22%);
  border-radius: 999px;
  background: rgb(9 15 30 / 78%);
  color: #dce8fa;
  font: inherit;
  font-size: 12px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.fs-actions button:hover, .fs-legend button:hover { border-color: rgb(150 190 250 / 45%); background: rgb(18 28 50 / 88%); }
.fs-actions button[aria-pressed="true"] { border-color: #ffc857; color: #ffd98a; }

.fs-panel {
  position: absolute;
  top: 118px; right: 24px;
  width: 288px;
  padding: 18px 18px 16px;
  border: 1px solid rgb(120 160 220 / 20%);
  border-radius: 16px;
  background: rgb(7 12 25 / 92%);
  box-shadow: 0 24px 60px rgb(2 4 12 / 55%);
}
.fs-close {
  position: absolute;
  top: 10px; right: 10px;
  border: 0;
  background: none;
  color: #7f96b8;
  font-size: 13px;
  cursor: pointer;
}
.fs-panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tone, #9db2d2);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.fs-panel h3 { margin: 7px 0 12px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.fs-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; font-size: 12.5px; }
.fs-panel dt { color: #8ba4c8; }
.fs-panel dd { margin: 0; text-align: right; }
.fs-panel-address {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 0;
  padding-top: 11px;
  border-top: 1px solid rgb(120 160 220 / 16%);
  color: #8ba4c8;
  font-size: 11px;
}
.fs-panel-address code { color: #ffd98a; font-size: 12px; letter-spacing: .04em; }

.fs-bottom {
  position: absolute;
  bottom: 74px; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 24px;
  color: #93a9c8;
  font-size: 11.5px;
  pointer-events: none;
}
.fs-address { color: #dce8fa; }
.fs-address code { color: #ffd98a; letter-spacing: .05em; }
.fs-meter { color: #6f87a8; font-variant-numeric: tabular-nums; }

.fs-legend {
  position: absolute;
  bottom: 16px; left: 0; right: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  padding: 0 20px;
}
.fs-legend button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-size: 10.5px;
}
.fs-legend i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 8px var(--tone);
}
.fs-legend em { color: #7e95b6; font-style: normal; font-size: 10px; }
.fs-legend b { color: var(--tone); font-weight: 600; font-size: 10.5px; }

@media (max-width: 900px) {
  .fs-counters { display: none; }
  .fs-panel { top: auto; bottom: 96px; right: 12px; left: 12px; width: auto; }
  .fs-bottom { flex-direction: column; gap: 4px; bottom: 74px; }
}
