.thgdb-host {
  width: 100%;
  min-width: 0;
}

.thgdb-shell {
  --thgdb-purple: #32146f;
  --thgdb-green: #caffb8;
  --thgdb-ink: #15111f;
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(50, 20, 111, 0.14);
  border-radius: 22px;
  background: #0d0818;
  box-shadow: 0 18px 50px rgba(30, 13, 66, 0.16);
  font-family: Arial, Helvetica, sans-serif;
}

.thgdb-toolbar {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px 7px 16px;
  background: #fff;
}

.thgdb-status {
  overflow: hidden;
  color: #625b6f;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thgdb-status[data-state="success"] { color: #16733b; }
.thgdb-status[data-state="error"] { color: #a6202c; }
.thgdb-status[data-state="warning"] { color: #8a5c00; }
.thgdb-status[data-state="playing"] { color: var(--thgdb-purple); }

.thgdb-fullscreen,
.thgdb-back {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--thgdb-purple);
  color: #fff;
  cursor: pointer;
  font: 800 12px/1 Arial, Helvetica, sans-serif;
  text-decoration: none;
}

.thgdb-fullscreen { padding: 8px 14px; }
.thgdb-back { margin-top: 18px; padding: 13px 22px; background: var(--thgdb-green); color: var(--thgdb-purple); }

.thgdb-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  background: #000;
}

.thgdb-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.thgdb-loading,
.thgdb-rotate,
.thgdb-result {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: rgba(17, 8, 37, 0.96);
  color: #fff;
  text-align: center;
}

.thgdb-loading[hidden],
.thgdb-result[hidden] { display: none; }

.thgdb-loading strong,
.thgdb-rotate strong,
.thgdb-result > strong:not(.thgdb-result-score) { font-size: clamp(22px, 4vw, 34px); }
.thgdb-loading span,
.thgdb-rotate span,
.thgdb-result p { margin: 0; color: rgba(255, 255, 255, 0.78); font-size: 15px; }

.thgdb-rotate { display: none; z-index: 8; }
.thgdb-rotate.is-visible { display: flex; }

.thgdb-result-label {
  color: var(--thgdb-green);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.thgdb-result-score {
  color: #fff;
  font-size: clamp(58px, 11vw, 110px);
  line-height: 0.95;
}

.thgdb-result-unit { color: rgba(255, 255, 255, 0.74); font-weight: 700; }

.thgdb-shell:fullscreen,
.thgdb-shell:-webkit-full-screen {
  width: 100vw;
  max-width: none;
  height: 100vh;
  border: 0;
  border-radius: 0;
}

.thgdb-shell:fullscreen .thgdb-stage,
.thgdb-shell:-webkit-full-screen .thgdb-stage {
  height: calc(100vh - 46px);
  min-height: 0;
  aspect-ratio: auto;
}

@media (max-width: 820px) {
  .thgdb-shell { border-radius: 14px; }
  .thgdb-toolbar { min-height: 42px; padding: 5px 7px 5px 11px; }
  .thgdb-stage { min-height: 210px; }
  .thgdb-fullscreen { min-height: 32px; padding: 7px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .thgdb-shell *,
  .thgdb-shell *::before,
  .thgdb-shell *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

