body {
  overflow-x: hidden;
}

.photos-stage {
  display: grid;
  width: min(100% - 28px, 1080px);
  min-height: 100vh;
  margin-inline: auto;
  padding: clamp(36px, 7vh, 80px) 0 70px;
  align-content: center;
  justify-items: center;
  gap: 26px;
}

.gallery-shell {
  position: relative;
  width: 100%;
}

.gallery-window {
  width: 100%;
}

.y2k-frame-decor {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
}

.y2k-frame-decor__sprite {
  position: absolute;
  display: block;
  image-rendering: pixelated;
  filter: drop-shadow(1px 2px 1px #27496666);
}

.y2k-frame-decor__sprite--songcat {
  bottom: -24px;
  left: -17px;
  transform: scale(1.06);
}

.y2k-frame-decor__sprite--handheld {
  bottom: 34px;
  left: 68%;
  transform: rotate(7deg) scale(0.94);
}

.y2k-frame-decor__sprite--bear {
  top: 119px;
  right: -13px;
  transform: rotate(11deg) scale(1.08);
}

.y2k-frame-decor__sprite--dreaming {
  right: -22px;
  bottom: -17px;
  transform: rotate(-8deg);
}

.y2k-frame-decor__sprite--blast {
  top: -25px;
  left: 43%;
  transform: translateX(-50%);
}

.gallery-window__icon {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px #ffffffcc);
}

.y2k-title-mascot {
  display: block;
  width: 21px;
  height: 21px;
  margin-left: 3px;
  object-fit: contain;
  image-rendering: pixelated;
  transform: translateY(2px) rotate(9deg);
}

.gallery-window__toolbar {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 12px;
  margin: 0 6px;
  padding: 0 14px;
  border: 1px solid #9aabb9;
  border-bottom-color: #899ba9;
  color: #263e50;
  background: linear-gradient(#fff, #e7edf2 48%, #d8e0e7 52%, #f5f7f9);
  box-shadow: inset 0 1px #fff;
  font-size: 12px;
}

.gallery-window__toolbar-separator {
  width: 1px;
  height: 18px;
  background: #aab6bf;
  box-shadow: 1px 0 #fff;
}

.y2k-toolbar-logo {
  display: block;
  width: 88px;
  height: 31px;
  margin-left: auto;
  object-fit: contain;
  image-rendering: pixelated;
  transform: translate(-7px, 2px) rotate(-2deg);
}

.gallery-window__body {
  min-height: 530px;
  margin-top: 0;
  border-top: 0;
  padding: 14px 13px 28px;
  background: #edf3fa;
}

.device-gallery {
  position: relative;
  padding: 14px 14px 20px;
  border: 1px solid #9eb4c8;
  border-radius: 4px;
  background: linear-gradient(135deg, #fafdff, #e8f1f9);
  box-shadow: inset 0 0 0 1px #fff, 0 2px 5px #58728a30;
}

.device-gallery + .device-gallery {
  margin-top: 22px;
}

.device-gallery__header {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: -14px -14px 17px;
  padding: 9px 15px 8px;
  border-bottom: 1px solid #9db4ca;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(#fff, #e9f3fc);
  box-shadow: inset 0 -1px #fff;
}

.device-gallery__eyebrow {
  display: block;
  color: #6b7e8e;
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.device-gallery__header h2 {
  margin: 3px 0 0;
  color: #244e79;
  font-size: 18px;
  font-weight: 400;
}

.device-gallery__logo {
  display: block;
  width: 72px;
  height: auto;
  opacity: 0.82;
}

.device-gallery__logo--nintendo {
  width: 82px;
  opacity: 0.9;
}

.device-gallery__logo--cyber-shot {
  width: 118px;
  opacity: 0.9;
}

.device-gallery--empty {
  padding-bottom: 14px;
}

.device-gallery__empty-message {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 20px 0 23px;
  color: #71808c;
  font-size: 13px;
  text-align: center;
}

.device-gallery__empty-message img {
  display: block;
  width: 29px;
  height: 39px;
  image-rendering: pixelated;
  transform: translate(4px, -6px) rotate(-8deg);
}

.gallery-group + .gallery-group {
  margin-top: 24px;
}

.gallery-group h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 17px;
  color: #7a8793;
  font-size: 13px;
  font-weight: 400;
}

.gallery-group h3::after {
  height: 1px;
  flex: 1;
  content: "";
  background: #b9c4cd;
  box-shadow: 0 1px #fff;
}

.gallery-group h3::before {
  order: 3;
  width: 0;
  height: 0;
  content: "";
  border-right: 4px solid transparent;
  border-bottom: 5px solid #6f7c86;
  border-left: 4px solid transparent;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 34px 22px;
  align-items: center;
  padding: 0 10px 2px;
}

.gallery-item {
  position: relative;
  display: grid;
  min-width: 0;
  height: 98px;
  margin: 0;
  place-items: center;
}

.gallery-item:hover,
.gallery-item:focus-within {
  outline: 1px dotted #4c5962;
  outline-offset: 3px;
  background: rgba(197, 220, 240, 0.28);
}

.gallery-item__media {
  position: relative;
  display: block;
  width: 124px;
  height: 94px;
  background: #fff;
  box-shadow: 0 2px 3px #23364378;
  cursor: pointer;
}

.gallery-item__media:focus-visible {
  outline: none;
}

.gallery-item__media img,
.gallery-item__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item__media video {
  pointer-events: none;
}

.gallery-item--photo .gallery-item__media {
  padding: 3px;
  border: 1px solid #bcc5cb;
  box-shadow: inset 0 0 0 1px #fff, 0 2px 3px #23364378;
}

.gallery-item--wide .gallery-item__media {
  width: 138px;
  height: 88px;
}

.gallery-item--portrait .gallery-item__media {
  width: 68px;
  height: 98px;
}

.gallery-item--video .gallery-item__media {
  width: 124px;
  height: 82px;
  margin-inline: 7px;
  border-block: 3px solid #292e30;
  box-shadow: 0 2px 3px #23364378;
}

.gallery-item--video.gallery-item--portrait .gallery-item__media {
  width: 64px;
  height: 92px;
  margin-inline: 18px;
}

.gallery-item--video.gallery-item--wide .gallery-item__media {
  width: 138px;
  height: 74px;
  margin-inline: 0;
}

.gallery-item--video .gallery-item__media::before,
.gallery-item--video .gallery-item__media::after {
  position: absolute;
  z-index: 2;
  top: -3px;
  bottom: -3px;
  width: 11px;
  content: "";
  border-inline: 1px solid #131719;
  background:
    repeating-linear-gradient(
      to bottom,
      #4a5052 0 4px,
      #d7dcdd 4px 10px,
      #202527 10px 13px
    );
  box-shadow: inset 0 0 0 1px #697173;
}

.gallery-item--video .gallery-item__media::before {
  left: -11px;
}

.gallery-item--video .gallery-item__media::after {
  right: -11px;
}

.gallery-tooltip {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .gallery-item:hover,
  .gallery-item:focus-within {
    z-index: 5;
  }

  .gallery-tooltip {
    position: absolute;
    z-index: 10;
    top: calc(100% + 9px);
    left: 50%;
    display: none;
    width: max-content;
    max-width: 240px;
    padding: 8px 10px 9px;
    border: 1px solid #767676;
    border-radius: 2px;
    color: #1e1e1e;
    background: linear-gradient(135deg, #fffef2, #fffbd6);
    box-shadow: 2px 3px 7px #20374666;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .gallery-tooltip::before {
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 9px;
    height: 9px;
    content: "";
    border-top: 1px solid #767676;
    border-left: 1px solid #767676;
    background: #fffef2;
    transform: translate(-50%, 5px) rotate(45deg);
  }

  .gallery-tooltip strong,
  .gallery-tooltip span {
    display: block;
  }

  .gallery-tooltip strong {
    margin-bottom: 3px;
    color: #194f78;
    font-size: 12px;
  }

  .gallery-tooltip b {
    font-weight: 600;
  }

  .gallery-item:hover .gallery-tooltip,
  .gallery-item:focus-within .gallery-tooltip {
    display: block;
  }
}

@media (max-width: 620px) {
  .photos-stage {
    padding-block: 26px;
  }

  .gallery-window__body {
    min-height: 0;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap-inline: 8px;
    padding-inline: 0;
  }

  .device-gallery {
    padding-inline: 9px;
  }

  .device-gallery__header {
    margin-inline: -9px;
  }

  .device-gallery__header h2 {
    font-size: 16px;
  }

  .device-gallery__logo {
    width: 58px;
  }

  .device-gallery__logo--cyber-shot {
    width: 92px;
  }

  .y2k-title-mascot {
    width: 18px;
    height: 18px;
  }

  .y2k-toolbar-logo {
    width: 70px;
    height: auto;
  }

  .gallery-item--video.gallery-item--wide .gallery-item__media {
    width: 124px;
  }

}

@media (max-width: 760px) {
  .y2k-frame-decor {
    display: none;
  }
}

@media (max-width: 360px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
