/* Tipografía: Adobe Fonts — https://use.typekit.net/gzc7pai.css
   Familias separadas para evitar que el navegador aplique Heavy (900) a los nombres. */
@font-face {
  font-family: "korolev-compressed-light";
  src: url("https://use.typekit.net/af/59704a/00000000000000007735e8b5/31/l?subset_id=2&fvd=n3&v=3") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 300;
}

@font-face {
  font-family: "korolev-compressed-heavy";
  src: url("https://use.typekit.net/af/748d6d/00000000000000007735e8b4/31/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n9&v=3") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 900;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange: #ee8501;
  --banner-border: rgba(0, 0, 0, 0.5);
  --ink: #212121;
  --line: 1.25px;
  --banner-h: 68px;
  --digit-h: var(--banner-h);
  --digit-w: 50px;
  --text-size: 2.75rem;
  --category-size: 16px;
  --font-digits: "korolev-compressed-heavy", "korolev-compressed", sans-serif;
  --font-name: "korolev-compressed-light", "korolev-compressed", sans-serif;
  --font-category: "Outfit", sans-serif;
  --gap: 12px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: #111;
  font-family: var(--font-digits);
  color: #ccc;
  padding: 24px;
}

/* ── Bloque visual: barra + termómetro ── */
.display {
  width: min(960px, 96vw);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

/* ── Banner principal ── */
.banner {
  display: flex;
  align-items: stretch;
  background: var(--orange);
  border: var(--line) solid var(--banner-border);
  border-radius: 3px;
  height: calc(var(--banner-h) + 2 * var(--line));
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.digits {
  display: flex;
  flex-shrink: 0;
}

.digit-box {
  width: var(--digit-w);
  height: var(--digit-h);
  border-right: var(--line) solid var(--banner-border);
  overflow: hidden;
  position: relative;
}

.digit-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.digit-strip span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--digit-h);
  font-family: var(--font-digits);
  font-size: var(--text-size);
  font-weight: 900;
  font-synthesis: none;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}

/* ── Nombre del barrio ── */
.name-area {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 8px;
  overflow: hidden;
  min-width: 0;
  font-weight: 300;
}

.name-text {
  font-family: var(--font-name);
  font-weight: 300;
  font-style: normal;
  font-synthesis: none;
  font-size: var(--text-size);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
  text-transform: uppercase;
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
}

/* ── Contenedor inferior: categorías + termómetro ── */
.indicator-panel {
  display: flex;
  align-items: stretch;
  gap: 50px;
  width: 100%;
  padding: 40px 0 0;
  background: var(--orange);
  border: none;
  border-radius: 0;
  overflow: hidden;
}

.category-area {
  flex: 1;
  min-width: 0;
}

.category-line {
  border: none;
  border-top: var(--line) solid var(--banner-border);
  margin: 0;
}

.category-row {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 18px 0;
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
  min-width: 0;
}

.category-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}

.category-text {
  display: block;
  font-family: var(--font-category);
  font-weight: 400;
  font-style: normal;
  font-synthesis: none;
  font-size: var(--category-size);
  line-height: 1.1;
  letter-spacing: 0.05em;
  color: var(--ink);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0;
  flex: 1;
  min-width: 0;
}

/* ── Termómetro de estrés térmico ── */
.indicator {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: var(--gap);
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.stress-track {
  width: 16px;
  height: 100%;
  border: var(--line) solid var(--ink);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.stress-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--ink);
  border-radius: 4px 4px 7px 7px;
  will-change: height;
}

.stress-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.stress-row {
  display: flex;
  gap: var(--gap);
  align-items: center;
}

.stress-row span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.18;
  transition: opacity 0.25s ease;
}

.stress-row.active span {
  opacity: 1;
}

/* ── Panel de control / sync AE ── */
.panel {
  width: min(960px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.85rem;
}

.panel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel button {
  font-family: var(--font-digits);
  font-size: 0.8rem;
  font-weight: 900;
  padding: 7px 16px;
  background: var(--orange);
  border: var(--line) solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel button:hover { filter: brightness(1.1); }
.panel button.active { background: var(--ink); color: var(--orange); }

.timecode {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  color: var(--orange);
  min-width: 140px;
}

.info {
  flex: 1;
  min-width: 200px;
  line-height: 1.4;
}

.info strong { color: #fff; }

.scrubber {
  width: 100%;
  accent-color: var(--orange);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 16px;
}

.config-grid label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-grid input[type="range"] {
  accent-color: var(--orange);
  width: 100%;
}

.config-grid output {
  color: var(--orange);
  font-family: monospace;
}

.status {
  font-size: 0.75rem;
  color: #666;
}

/* ── Desktop: demo más grande (no aplica al embed) ── */
@media (min-width: 961px) {
  body:not(.embed) {
    --banner-h: 82px;
    --digit-w: 60px;
    --text-size: 3.1rem;
    --category-size: 18px;
  }

  body:not(.embed) .display {
    width: min(1100px, 96vw);
  }
}
