:root {
  --bg: #eef7f6;
  --accent: #8fd3c8;
  --accent2: #a0c4ff;
  --text: #334;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: linear-gradient(135deg, var(--bg), #ffffff);
  color: var(--text);
  display: flex;
  justify-content: center;
}

.main {
  max-width: 1100px;
  padding: 20px;
  width: 100%;
  text-align: center;
}

#thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.thumb {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

/* モーダル */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#modalContent {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modalImg {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  transition: transform 0.25s ease, opacity 0.25s ease;
  touch-action: pan-y;
  z-index: 1;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: white;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  line-height: 52px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  z-index: 5;
}

.nav.prev { left: 12px; }
.nav.next { right: 12px; }
