.showbox {
  display: grid;
  min-width: 0;
  color: var(--showbox-color, inherit);
}

.showbox-stage {
  display: grid;
  isolation: isolate;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--showbox-radius, 6px);
  background: var(--showbox-background, transparent);
}

.showbox-layer {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.showbox-layer > :is(img, video) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.showbox-layer-text {
  box-sizing: border-box;
  padding: clamp(6px, 5%, 24px);
  color: var(--showbox-caption-color, white);
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 3px black, 0 0 6px black;
}

.showbox-stage-reading {
  position: relative;
}

.showbox-stage-reading > .showbox-layer {
  visibility: hidden;
}

.showbox-tip {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-sizing: border-box;
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--showbox-tip-color, #f3f6fb);
  background: var(--showbox-tip-background, #172235);
  overflow-wrap: anywhere;
}

.showbox-tip[hidden] {
  display: none;
}

.showbox-tip:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -3px;
}

.showbox-tip-demo:not(.showbox-tip-program) {
  gap: 0.375rem;
  padding: 12px;
}

.showbox-tip-visual {
  flex: none;
  align-self: center;
  width: min(100%, 6.5rem);
  aspect-ratio: 1;
}

.showbox-tip-visual[hidden] {
  display: none;
}

.showbox-tip-visual > canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.showbox-tip-program {
  justify-content: flex-end;
  padding: 0;
  overflow: hidden;
}

.showbox-tip-program > .showbox-tip-visual {
  position: absolute;
  inset: 0;
  width: 100%;
}

.showbox-tip-program > .showbox-tip-title {
  position: relative;
  display: -webkit-box;
  padding: 8px 12px;
  overflow: hidden;
  background: #111827;
  color: #f3f6fb;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.showbox-tip-title,
.showbox-tip-text {
  margin: 0;
  white-space: pre-wrap;
}

.showbox-tip-title {
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.2;
}

.showbox-tip-text {
  font-size: 0.875rem;
  line-height: 1.45;
}

.showbox-tip-progress {
  margin: auto 0 0;
  color: var(--showbox-tip-muted, #b8c5dc);
  font-size: 0.75rem;
  line-height: 1.4;
}

.showbox-tip-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.showbox-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}

.showbox-button {
  appearance: none;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.showbox-button:not(:disabled, [aria-disabled="true"]):hover,
.showbox-button:focus-visible {
  border-color: currentColor;
}

.showbox-button:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: -2px;
}

.showbox-button:disabled,
.showbox-button[aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
}

.showbox-icon {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 5px;
  height: 5px;
  background: currentColor;
}

.showbox-button[data-showbox-control="next"] .showbox-icon {
  clip-path: polygon(0 40%, 61% 40%, 31% 10%, 46% 0, 100% 50%, 46% 100%, 31% 90%, 61% 60%, 0 60%);
}

.showbox-button[data-showbox-control="previous"] .showbox-icon {
  clip-path: polygon(100% 40%, 39% 40%, 69% 10%, 54% 0, 0 50%, 54% 100%, 69% 90%, 39% 60%, 100% 60%);
}

.showbox-button[data-showbox-control="play"][data-active="false"] .showbox-icon {
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.showbox-button[data-showbox-control="sound"] .showbox-icon {
  clip-path: polygon(0 30%, 21% 30%, 55% 0, 55% 100%, 21% 70%, 0 70%, 0 30%, 65% 45%, 98% 0, 100% 23%, 76% 57%, 100% 89%, 85% 100%, 65% 71%, 65% 45%);
}

.showbox-button[data-showbox-control="sound"][data-active="true"] .showbox-icon {
  clip-path: polygon(0 30%, 21% 30%, 55% 0, 55% 100%, 21% 70%, 0 70%, 0 30%, 65% 18%, 79% 4%, 98% 33%, 98% 67%, 79% 96%, 65% 82%, 80% 60%, 80% 40%, 65% 18%);
}

.showbox-status {
  margin: 0;
  padding: 0 4px 4px;
  font-size: 0.75rem;
  line-height: 1.4;
}
