html.emblem-viewer-open { overflow: hidden; }

#emblem-dialog {
  width: min(720px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: clamp(16px, 3vw, 28px);
  box-sizing: border-box;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #465776;
  border-radius: 20px;
  background: #101929;
  color: #eff5ff;
  box-shadow: 0 32px 100px #03081288;
  color-scheme: dark;
}

#emblem-dialog::backdrop { background: rgb(5 10 20 / 82%); }
.emblem-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
#emblem-dialog h2 { margin-block: 0; color: inherit; font-size: clamp(34px, 5vw, 58px); }
#emblem-dialog [data-close-emblem] { flex: none; font-size: 28px; line-height: 1; }
#emblem-dialog [data-close-emblem], #emblem-dialog .emblem-retry {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid #667d9f;
  border-radius: 12px;
  background: #1e2b43;
  color: #f5f8ff;
  cursor: pointer;
}
#emblem-dialog [data-close-emblem]:focus-visible,
#emblem-dialog .emblem-retry:focus-visible,
#emblem-stage:has(model-viewer:focus-within) {
  outline: 3px solid #8fbbff;
  outline-offset: 3px;
}
#emblem-stage {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  width: 100%;
  height: clamp(190px, 50dvh, 430px);
  margin-block: 16px;
  border: 1px solid #374b6d;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 48%, #233655, #101a2c 65%, #0c1422);
}
#emblem-stage model-viewer {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  touch-action: none;
  --poster-color: transparent;
  --progress-bar-color: #90b7ff;
  --progress-bar-height: 3px;
}
#emblem-stage .emblem-viewer-poster {
  display: block;
  width: min(148px, 38%);
  height: auto;
  object-fit: contain;
}
#emblem-stage model-viewer .emblem-viewer-poster {
  position: absolute;
  inset: 0;
  margin: auto;
}
#emblem-stage .emblem-retry { position: absolute; bottom: 12px; padding-inline: 16px; }
#emblem-status { margin: 0; color: #c0cede; font-size: 15px; line-height: 1.5; }
@media (max-height: 480px) {
  #emblem-stage { height: clamp(145px, 43dvh, 200px); margin-block: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #emblem-dialog[open] { animation: none; }
}
