@import "common-3d.css";

melon-3d.m3d {
  display: inline-block;
  position: relative;
  max-width: 100%;
  vertical-align: middle;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--m3d-metal);
  background-image: var(--m3d-metal-tex);
  background-size: cover;
  color: var(--m3d-dark);
  font-size: 12px;
  font-family: Verdana, Geneva, sans-serif;
  box-shadow:
    inset 0 0 8px rgba(40, 25, 8, 0.4),
    0 2px 5px rgba(40, 25, 8, 0.3);
  border: 1px outset #aeacad;
}

melon-3d.m3d .m3d-facade {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

melon-3d.m3d .m3d-thumb {
  position: absolute;
  inset: 35px 6px 6px 6px;
  border: 1px solid #848484;
  border-radius: 6px;
  background-color: var(--m3d-metal);
  background-image: var(--m3d-metal-tex-alt);
  background-blend-mode: soft-light;
  background-size: cover;
  box-shadow: inset 0 2px 16px rgba(0, 0, 0, 0.75);
}

melon-3d.m3d.m3d-has-thumb .m3d-thumb {
  filter: saturate(0.95);
}

melon-3d.m3d .m3d-centre {
  position: absolute;
  inset: 35px 6px 6px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.51);
}

melon-3d.m3d .m3d-cube {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

melon-3d.m3d .m3d-cube img {
  width: 100%;
  height: 100%;
  display: block;
}

melon-3d.m3d.m3d-has-thumb .m3d-cube {
  display: none;
}

melon-3d.m3d .m3d-play {
  border-radius: 8px;
  padding: 3px 12px;
}

melon-3d.m3d .m3d-facade:hover .m3d-play {
  background: var(--m3d-btn-hover);
}

melon-3d.m3d .m3d-bar {
  position: absolute;
  top: var(--m3d-pad);
  left: var(--m3d-pad);
  right: var(--m3d-pad);
  height: 24px;
  padding: 0 8px;
  gap: 8px;
}

melon-3d.m3d .m3d-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: bold;
}

melon-3d.m3d .m3d-corner {
  position: absolute;
  top: 39px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}

melon-3d.m3d .m3d-facade:hover .m3d-corner {
  opacity: 1;
}

melon-3d.m3d .m3d-corner a {
  display: flex;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 1px rgba(40, 25, 8, 0.25);
}

melon-3d.m3d iframe.m3d-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: var(--m3d-metal);
}

melon-3d.m3d.m3d-live .m3d-facade {
  pointer-events: none;
}

melon-3d.m3d .m3d-auto {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 10;
  pointer-events: auto;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 1px rgba(40, 25, 8, 0.25);
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
  text-decoration: none;
}

melon-3d.m3d:hover .m3d-auto {
  opacity: 1;
}
