[data-topic-player] {
  position: relative;
  background: #080b10;
  color: #f1f5f9;
}

[data-topic-player] [hidden] { display: none !important; }

[data-topic-player]:fullscreen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: auto;
  border: 0;
  border-radius: 0;
}

[data-topic-player]:fullscreen [data-video-stage] {
  width: min(100%, calc((100dvh - 115px) * 16 / 9));
  margin-inline: auto;
}

[data-video-stage].with-activity iframe {
  display: block;
  width: 100%;
  height: min(75dvh, 50rem);
  min-height: 19rem;
  border: 0;
  background: #080b10;
}

.topic-player-controls {
  padding: 4px 12px 8px;
  background: #121925;
}

.topic-player-timeline {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 1px 2px 4px;
  scrollbar-color: #64748b #121925;
}

.topic-player-timeline button {
  position: relative;
  flex: 1 0 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

[data-topic-player] [data-kind="video"] { --segment: #dc2626; --locked: #561a1a; }
[data-topic-player] [data-kind="test"] { --segment: #8b5cf6; --locked: #39265d; }
[data-topic-player] [data-kind="documento"] { --segment: #22c55e; --locked: #16452a; }
[data-topic-player] [data-kind="prueba"] { --segment: #fcd53f; --locked: #51451a; }
.topic-player-timeline [data-state="locked"] { --segment: var(--locked); }
.topic-player-timeline [data-state="past"], .topic-player-legend .legend-past { --segment: #646861; }
.topic-player-timeline button span:first-child {
  display: block;
  height: 7px;
  margin-top: -8px;
  background: var(--segment);
}
.topic-player-timeline button[aria-current="step"] span:first-child {
  background: linear-gradient(to right, var(--segment) var(--played, 0%), #1c2533 var(--played, 0%));
  box-shadow: inset 0 0 0 1px var(--segment);
}
.topic-player-timeline button:hover span:first-child { filter: brightness(1.25); }
.topic-player-timeline button span:last-child {
  position: absolute;
  inset: 27px 0 auto;
  color: #f1f5f9;
  font-size: 13px;
  line-height: 16px;
}

.topic-player-legend {
  display: flex;
  flex-wrap: wrap;
  column-gap: 14px;
  row-gap: 4px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  color: #cbd5e1;
  font-size: .875rem;
  line-height: 1.4;
}

.topic-player-legend li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.topic-player-legend span {
  display: inline-block;
  flex: 0 0 11px;
  min-width: 11px;
  height: 6px;
  background: var(--segment);
}

.topic-player-legend .legend-icon {
  height: auto;
  color: #f1f5f9;
  text-align: center;
}

.topic-player-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.topic-player-status { margin: 6px 0 0; font-size: 1rem; overflow-wrap: anywhere; }
.topic-player-status:empty { display: none; }
.topic-player-actions a,
.topic-player-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 5px 12px;
  border: 1px solid #636e7f;
  border-radius: 8px;
  background: #1c2533;
  color: #f1f5f9;
  font-size: 1rem;
  cursor: pointer;
}
.topic-player-actions button:disabled { opacity: .65; cursor: wait; }
.topic-player-actions a:hover,
.topic-player-actions button:hover { background: #334155; }
.topic-player-actions [data-topic-primary] { background: #c2410c; border-color: #c2410c; color: #fff; }
.topic-player-actions [data-topic-primary]:hover { background: #9a3412; }

[data-topic-player] :focus-visible {
  outline: 2px solid #fdba74;
  outline-offset: -2px;
}

.topic-player-preview {
  position: absolute;
  z-index: 2;
  transform: translateY(-100%);
  width: min(17rem, calc(100% - 16px));
  padding: 12px;
  border: 1px solid #64748b;
  border-radius: 8px;
  background: #121925;
  color: #f1f5f9;
  pointer-events: none;
}
.topic-player-preview > * { display: block; }
.topic-player-preview img { width: 100%; max-height: clamp(64px, 20vw, 110px); object-fit: contain; margin-bottom: 8px; }
.topic-player-preview span { color: #cbd5e1; font-size: .875rem; }

.topic-player-dialog {
  width: min(32rem, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 20px;
  border: 1px solid #fb923c;
  border-radius: 12px;
  background: #121925;
  color: #f1f5f9;
}
.topic-player-dialog::backdrop { background: rgb(8 11 16 / .75); }
.topic-player-dialog h2 { margin-bottom: 8px; font-size: 1.375rem; font-weight: 650; }
.topic-player-dialog p { margin-bottom: 16px; font-size: 1rem; }

[data-topic-select] {
  display: none;
  width: 100%;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid #636e7f;
  border-radius: 8px;
  background: #1c2533;
  color: #f1f5f9;
  font-size: 1rem;
}

.topic-player-many .topic-player-timeline {
  display: grid;
  grid-template-columns: var(--topic-columns);
  overflow-x: hidden;
}
.topic-player-many .topic-player-timeline button { min-width: 0; overflow: hidden; }
.topic-player-many [data-topic-select] { display: block; }

@media (max-width: 1150px) {
  .topic-player-timeline {
    display: grid;
    grid-template-columns: var(--topic-columns);
    overflow-x: hidden;
  }
  .topic-player-timeline button { min-width: 0; overflow: hidden; }
  [data-topic-select] { display: block; }
}

[data-topic-player] [data-video-stage] > div:has(> iframe) {
  position: relative;
  width: 100%;
}

[data-topic-player] [data-video-stage]:not(.with-activity) iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.topic-player-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 0 14px;
}

.topic-player-footer .topic-player-actions {
  flex: 1 1 16rem;
  min-width: 0;
}

.topic-player-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: end;
  gap: 0 12px;
  max-width: 100%;
  margin-inline-start: auto;
  color: #cbd5e1;
  font-size: .875rem;
}

[data-topic-overview-percent] {
  align-content: center;
  min-height: 48px;
}

.topic-player-overview summary {
  align-content: center;
  min-height: 48px;
  color: #fdba74;
  font-size: 1rem;
  cursor: pointer;
}

.topic-player-overview details[open] {
  flex-basis: 100%;
  max-width: 22rem;
}
.topic-player-overview dl { margin: 0; }
.topic-player-overview dl div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid #475569;
}
.topic-player-overview dt { overflow-wrap: anywhere; }
.topic-player-overview dd { margin: 0; font-weight: 650; }
