/*
 * Shared, crop-safe image component.
 * Every game should set only the frame's dimensions. The image itself is
 * always contained, centered, and never clipped by this component.
 */
.media-display {
  --media-bg: #f8fafc;
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: var(--media-bg);
}

.media-display__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.media-display__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  color: #334155;
  text-align: center;
  background: linear-gradient(135deg, #e0f2fe, #fef3c7);
}

.media-display__placeholder strong { font-size: 1.25rem; }
.media-display__placeholder small { font-size: .72rem; opacity: .75; }
.media-display--missing::after { content: attr(data-error); color: #b91c1c; font-weight: 700; }
.media-display--missing .media-display__image { display: none; }
