/* Avata 360 no site: cores do visualizador local do Geraldo, com tudo arredondado (regra do site). */
:root {
  color-scheme: dark;
  --bg: #121211;
  --panel: #25231f;
  --panel-strong: #312e28;
  --line: #444036;
  --text: #f5f0e6;
  --muted: #bdb3a0;
  --accent: #1fa186;
  --accent-strong: #26b99a;
  --accent-text: #071a15;
  --shadow: rgba(0, 0, 0, 0.32);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  height: 100dvh;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  padding: 10px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 26px var(--shadow);
  z-index: 5;
}

.brand {
  display: grid;
  gap: 1px;
  margin-right: 4px;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-link {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
}

.brand-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.media-group {
  flex: 1 1 260px;
  min-width: 0;
}

.select,
.tool-button,
.icon-button,
.range-field {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--text);
}

.select {
  width: 100%;
  min-width: 0;
  padding: 0 34px 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.export-select {
  width: auto;
}

.tool-button,
.icon-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.tool-button:hover,
.icon-button:hover,
.select:hover {
  border-color: var(--muted);
}

.tool-button:active,
.icon-button:active {
  transform: translateY(1px);
}

.tool-button:focus-visible,
.icon-button:focus-visible,
.select:focus-visible,
.range-field:focus-within,
#viewer:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.tool-button svg,
.icon-button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 750;
}

.primary:hover {
  border-color: transparent;
  background: var(--accent-strong);
}

/* Perfil de cores ligado: botão na cor de destaque, com a metade do círculo preenchida */
.lut-button[aria-pressed="true"] {
  border-color: var(--accent-strong);
  color: var(--accent-strong);
}

.lut-button .lut-metade {
  fill: none;
}

.lut-button[aria-pressed="true"] .lut-metade {
  fill: currentColor;
}

.tool-button:disabled,
.icon-button:disabled,
.select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.range-field {
  display: grid;
  grid-template-columns: auto minmax(72px, 120px);
  gap: 9px;
  align-items: center;
  padding: 0 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.range-field input {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent-strong);
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #050505;
}

.stage.dragover {
  box-shadow: inset 0 0 0 3px var(--accent-strong);
}

#viewer {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: grab;
  touch-action: none;
}

#viewer.dragging {
  cursor: grabbing;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at center, #28231a 0%, #10100f 62%);
}

.empty-state h1 {
  margin: 0;
  font-size: clamp(36px, 8vh, 76px);
  line-height: 1;
}

.empty-state p {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.empty-state small {
  max-width: 460px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0.85;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}

.empty-actions .tool-button {
  height: 46px;
  padding: 0 20px;
}

.drop-hint {
  position: absolute;
  inset: 16px;
  display: grid;
  place-content: center;
  border: 2px dashed var(--accent-strong);
  border-radius: 18px;
  background: rgba(7, 26, 21, 0.72);
  color: var(--text);
  font-size: 22px;
  font-weight: 750;
  pointer-events: none;
}

.video-bar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  width: min(760px, calc(100% - 28px));
  padding: 8px 10px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(18, 18, 17, 0.82);
  backdrop-filter: blur(12px);
}

.video-bar .icon-button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
}

/* Estabilização do .OSV: botão com nome; ligado, na cor de destaque */
.video-bar .estab-button {
  width: auto;
  gap: 6px;
  padding: 0 13px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.video-bar .estab-button[aria-pressed="true"] {
  border-color: var(--accent-strong);
  color: var(--accent-strong);
}

.video-bar .icon-play {
  fill: currentColor;
  stroke-width: 1.4;
}

.video-bar .icon-pause,
.video-bar.playing .icon-play,
.video-bar .icon-sound,
.video-bar.sound .icon-muted {
  display: none;
}

.video-bar.playing .icon-pause,
.video-bar.sound .icon-sound {
  display: block;
}

.video-bar input[type="range"] {
  flex: 1 1 auto;
  min-width: 60px;
  accent-color: var(--accent-strong);
}

.time-label {
  min-width: 42px;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.loading,
.status {
  position: absolute;
  left: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(18, 18, 17, 0.82);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.loading {
  top: 14px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
}

.status {
  top: 14px;
  right: auto;
  max-width: calc(100% - 28px);
  min-height: 36px;
  padding: 9px 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status:empty,
.loading:not([hidden]) + .status {
  display: none;
}

.status[data-kind="ok"] {
  color: #9be0c8;
}

.status[data-kind="warn"] {
  color: #f2c16d;
}

.status[data-kind="error"] {
  color: #ffb1a6;
}

@media (max-width: 760px) {
  .toolbar {
    gap: 8px;
    padding: 8px 10px;
  }

  /* Três linhas: título e pasta; lista; vista e exportação */
  .brand {
    flex: 1 1 auto;
  }

  .media-group {
    flex-basis: 100%;
  }

  .view-group {
    flex: 1 1 0;
    min-width: 0;
  }

  .view-group .range-field {
    flex: 1 1 auto;
    min-width: 0;
    grid-template-columns: minmax(48px, 1fr);
  }

  .range-field span {
    display: none;
  }

  .tool-button span,
  .video-bar .estab-button span {
    display: none;
  }

  .video-bar .estab-button {
    width: 38px;
    padding: 0;
  }

  .tool-button {
    width: 42px;
    padding: 0;
  }

  .empty-actions .tool-button {
    width: auto;
    padding: 0 18px;
  }

  .empty-actions .tool-button span {
    display: inline;
  }

  .status {
    white-space: normal;
  }
}
