.post-body .game-shot > a[data-game-viewer] {
  cursor: zoom-in;
}

.post-body .game-shot > a[data-game-viewer]:focus-visible {
  outline: 3px solid #F18D0C;
  outline-offset: 5px;
}

dialog.report-image-viewer {
  position: fixed;
  inset: 0;
  width: fit-content;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 3px solid #111;
  border-radius: 0;
  background: #F4EFE3;
  color: #111;
  font-family: var(--ko, sans-serif);
  box-shadow: 5px 5px 0 #111;
}

dialog.report-image-viewer::backdrop {
  background: rgb(17 17 17 / 78%);
}

dialog.report-image-viewer[open] {
  animation: report-viewer-open 160ms ease-out;
}

.report-image-viewer__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

dialog.report-image-viewer .report-image-viewer__title {
  margin: 0;
  color: #111;
  font-family: var(--ko, sans-serif);
  font-size: 18px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: anywhere;
}

.report-image-viewer__title .name-reading {
  color: #666;
  font-size: .8em;
  font-weight: 400;
}

dialog.report-image-viewer .report-image-viewer__button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid #111;
  border-radius: 0;
  background: #F4EFE3;
  color: #111;
  font-family: sans-serif;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 2px 2px 0 #111;
  transition: transform 120ms;
}

dialog.report-image-viewer .report-image-viewer__close {
  background: #F5C03A;
}

dialog.report-image-viewer .report-image-viewer__button:hover {
  background: #F5C03A;
  transform: translate(-1px, -1px);
}

.report-image-viewer__button:focus-visible,
.report-image-viewer__source a:focus-visible {
  outline: 3px solid #F18D0C;
  outline-offset: 4px;
}

.report-image-viewer__stage {
  display: grid;
  grid-template-columns: 44px minmax(0, max-content) 44px;
  gap: 12px;
  align-items: center;
}

.report-image-viewer__previous {
  grid-column: 1;
  grid-row: 1;
}

.report-image-viewer__next {
  grid-column: 3;
  grid-row: 1;
}

dialog.report-image-viewer .report-image-viewer__image {
  display: block;
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: auto;
  height: auto;
  max-width: min(760px, calc(100vw - 192px));
  max-height: calc(100vh - 220px);
  max-height: calc(100dvh - 220px);
  margin: 0;
  border: 2px solid #111;
  object-fit: contain;
  opacity: 1;
  transition: opacity 120ms;
}

.report-image-viewer.is-loading .report-image-viewer__image {
  opacity: 0;
}

.report-image-viewer__count {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  font-family: var(--mono, monospace);
  font-size: 12px;
  line-height: 1.5;
}

.report-image-viewer__source {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  margin-top: 12px;
  color: #666;
  font-size: 11px;
  line-height: 1.6;
}

.report-image-viewer__source a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report-image-viewer__error {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  dialog.report-image-viewer {
    padding: 12px;
  }

  dialog.report-image-viewer .report-image-viewer__title {
    font-size: 15px;
  }

  .report-image-viewer__stage {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 12px 8px;
  }

  dialog.report-image-viewer .report-image-viewer__image {
    grid-column: 1 / -1;
    max-width: calc(100vw - 64px);
    max-height: calc(100vh - 256px);
    max-height: calc(100dvh - 256px);
  }

  .report-image-viewer__previous,
  .report-image-viewer__next {
    grid-row: 2;
  }
}

@keyframes report-viewer-open {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  dialog.report-image-viewer[open] { animation: none; }
  .report-image-viewer .report-image-viewer__button,
  .report-image-viewer .report-image-viewer__image { transition: none; }
}
