/* Berço button layout: título + barra à esquerda, contador circular à direita */
.berco-btn {
  flex: 1;
  display: flex;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 12px 14px !important;
  gap: 10px;
  border-radius: 12px;
  background: linear-gradient(to bottom, #ffffff, #f1f3f5);
  border: 1px solid #ced4da;
  border-bottom: 5px solid #adb5bd;
  color: #495057;
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  font-family: inherit;
  font-weight: 700;
  position: relative;
  top: 0;
  height: 120px;
}

.berco-btn:hover {
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  border-color: #adb5bd;
  border-bottom-color: #8e959c;
  color: #212529;
}

.berco-btn:active:not(.active) {
  transform: translateY(2px);
  border-bottom-width: 3px;
}

/* Selecionado / clicado — gradiente escuro (igual index 01) */
.berco-btn.active {
  background: linear-gradient(to bottom, #2d3748, #1a202c);
  border-color: #4a5568;
  border-bottom: 3px solid #0f172a;
  color: #ffffff;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.35), 0 2px 3px rgba(0, 0, 0, 0.2);
  transform: translateY(4px);
  font-weight: 800;
  height: 120px;
}

.berco-btn.active:hover {
  transform: translateY(4px);
  background: linear-gradient(to bottom, #2d3748, #1a202c);
  color: #ffffff;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.35), 0 2px 3px rgba(0, 0, 0, 0.2);
}

.berco-btn-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.berco-status-bar {
  position: static !important;
  transform: none !important;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.berco-status-bar.status-green {
  background: #14eb2e;
  box-shadow: 0 0 7px rgba(20, 235, 46, 0.6);
}

.berco-status-bar.status-red {
  background: #ff0808;
  box-shadow: 0 0 7px rgba(255, 8, 8, 0.8);
}

.berco-count-badge {
  flex-shrink: 0;
  width: 48px;
  min-height: 74px;
  padding: 10px 8px 12px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #464f5c;
  border: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.berco-count-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 1;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
}

.berco-count-num {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  min-width: 0;
  text-align: center;
}

.berco-btn.active .berco-count-badge {
  background: #1e2430;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

/* Badge claro só no botão ativo (fundo escuro) */
.app-container.state-amber .berco-btn.active .berco-count-badge,
.app-container.state-red .berco-btn.active .berco-count-badge {
  background: #1e2430;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* Ícone guincho piscando durante vídeo início */
.guincho-move-hint {
  position: absolute;
  top: clamp(8px, 2.5vw, 22px);
  left: clamp(8px, 2.5vw, 22px);
  width: clamp(44px, 12vw, 72px);
  height: auto;
  z-index: 6;
  display: none;
  animation: guincho-hint-blink 1s ease-in-out infinite;
}

@keyframes guincho-hint-blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

.app-container.guincho-moving:not(.guincho-intro-done) .guincho-move-hint {
  display: block;
}

.app-container.state-idle .guincho-move-hint {
  display: none !important;
}

/* Oculta contador antigo dentro da área principal */
.berco-counters {
  display: none !important;
}

/* Nenhum berço selecionado — área desativada */
.app-container.state-idle .main-content {
  background-color: #8b929a !important;
}

.app-container.state-idle .icon-green,
.app-container.state-idle .icon-red {
  opacity: 0 !important;
  transform: scale(0.8);
  pointer-events: none;
}

.icon-idle {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  z-index: 4;
}

.app-container.state-idle .icon-idle {
  opacity: 1;
  transform: scale(1);
}

.idle-prompt-circle {
  width: min(78%, 260px);
  aspect-ratio: 1;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.idle-prompt-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.idle-prompt-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -18px;
  margin-bottom: 2px;
  animation: pulse-arrow-up 2s infinite;
}

.idle-prompt-arrow svg {
  width: 72px;
  height: 72px;
  fill: none;
  stroke: rgba(74, 85, 104, 0.55);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes pulse-arrow-up {
  0% {
    opacity: 0.3;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-14px);
  }

  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
}

.idle-prompt-circle p {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #4a5568;
  line-height: 1.35;
  letter-spacing: 0.2px;
}

/* Painel dual de sliders */
#slider-panel-dual {
  display: none;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.dual-slider-row {
  width: 100%;
}

.dual-track {
  height: 68px !important;
  border-radius: 34px !important;
}

.dual-track .slider-thumb {
  width: 58px !important;
  height: 58px !important;
  top: 5px !important;
}

.dual-track .slider-text {
  font-size: 15px !important;
  padding-right: 16px !important;
}

.dual-track.track-aproxime {
  background-color: var(--green-pill, #0e4c35) !important;
}

.dual-track.track-aproxime .slider-thumb {
  background-color: var(--green-thumb, #093826) !important;
}

.dual-track.track-aproxime .slider-thumb svg {
  fill: #14eb2e !important;
}

.dual-track.track-aproxime .slider-thumb.is-dragging {
  animation: shake-thumb 0.25s linear infinite, blink-color 0.4s ease-in-out infinite !important;
}

.dual-track.track-aproxime .slider-thumb.counting {
  animation: countdown-ring 1s ease-out infinite, blink-color 0.5s ease-in-out infinite !important;
}

/* Aproxime alerta ativo: slider dual verde → vermelho (sem trocar operação) */
.app-container.aproxime-alert-screen .dual-track.track-aproxime {
  background-color: var(--red-pill, #d10000) !important;
}

.app-container.aproxime-alert-screen .dual-track.track-aproxime .slider-thumb {
  background-color: var(--red-thumb, #960000) !important;
}

.app-container.aproxime-alert-screen .dual-track.track-aproxime .slider-thumb svg {
  fill: #ff0808 !important;
}

.app-container.aproxime-alert-screen .dual-track.track-aproxime .slider-thumb.is-dragging {
  animation: shake-thumb 0.25s linear infinite, blink-color-red 0.4s ease-in-out infinite !important;
}

.app-container.aproxime-alert-screen .dual-track.track-aproxime .slider-thumb.counting {
  animation: countdown-ring 1s ease-out infinite, blink-color-red 0.5s ease-in-out infinite !important;
}

.dual-track.track-afaste {
  background-color: var(--red-pill, #d10000) !important;
}

.dual-track.track-afaste .slider-thumb {
  background-color: var(--red-thumb, #960000) !important;
}

.dual-track.track-afaste .slider-thumb svg {
  fill: #ff0808 !important;
}

.dual-track.track-afaste .slider-thumb.is-dragging {
  animation: shake-thumb 0.25s linear infinite, blink-color-red 0.4s ease-in-out infinite !important;
}

.dual-track.track-afaste .slider-thumb.counting {
  animation: countdown-ring 1s ease-out infinite, blink-color-red 0.5s ease-in-out infinite !important;
}

/* Afaste alerta ativo: slider dual vermelho → verde (depois do base para vencer cascade) */
.app-container.afaste-alert-screen .dual-track.track-afaste,
.app-container.state-red.afaste-alert-screen .dual-track.track-afaste,
.app-container.state-amber.afaste-alert-screen .dual-track.track-afaste {
  background-color: var(--green-pill, #0e4c35) !important;
}

.app-container.afaste-alert-screen .dual-track.track-afaste .slider-thumb,
.app-container.state-red.afaste-alert-screen .dual-track.track-afaste .slider-thumb,
.app-container.state-amber.afaste-alert-screen .dual-track.track-afaste .slider-thumb {
  background-color: var(--green-thumb, #093826) !important;
}

.app-container.afaste-alert-screen .dual-track.track-afaste .slider-thumb svg,
.app-container.state-red.afaste-alert-screen .dual-track.track-afaste .slider-thumb svg,
.app-container.state-amber.afaste-alert-screen .dual-track.track-afaste .slider-thumb svg {
  fill: #14eb2e !important;
}

.app-container.afaste-alert-screen .dual-track.track-afaste .slider-thumb.is-dragging,
.app-container.state-red.afaste-alert-screen .dual-track.track-afaste .slider-thumb.is-dragging,
.app-container.state-amber.afaste-alert-screen .dual-track.track-afaste .slider-thumb.is-dragging {
  animation: shake-thumb 0.25s linear infinite, blink-color 0.4s ease-in-out infinite !important;
}

.app-container.afaste-alert-screen .dual-track.track-afaste .slider-thumb.counting,
.app-container.state-red.afaste-alert-screen .dual-track.track-afaste .slider-thumb.counting,
.app-container.state-amber.afaste-alert-screen .dual-track.track-afaste .slider-thumb.counting {
  animation: countdown-ring 1s ease-out infinite, blink-color 0.5s ease-in-out infinite !important;
}

.app-container.state-amber .dual-track.track-afaste {
  background-color: var(--amber-pill, #ff9500) !important;
}

.dual-track.disabled {
  background-color: #222 !important;
  pointer-events: none;
}
