body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
}

header {
  padding: 1em;
  background: #f0f0f0;
}

#tag-list {
  margin-top: 0.5em;
}

#tag-list button {
  margin: 0.2em;
  padding: 0.4em 0.8em;
  border: 1px solid #333;
  background: #fff;
  cursor: pointer;
}

#tag-list button.active {
  background: #333;
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1em;
  padding: 1em;
}

.card {
  border: 1px solid #ccc;
  padding: 0.5em;
  text-align: center;
  cursor: pointer;
  background: #fff;
}

.card img {
  max-width: 100%;
  height: auto;
}

.tags {
  margin-top: 0.5em;
  font-size: 0.8em;
  color: #666;
}

#search-box {
  padding: 0.5em;
  margin: 0.5em 0;
  width: 200px;
}

#clear-tags {
  margin-left: 1em;
  padding: 0.4em 0.8em;
  cursor: pointer;
}


/* モーダル */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #fff;
  padding: 2em;
  max-width: 400px;
  border-radius: 8px;
  position: relative;
}

#modal-close {
  position: absolute;
  top: 0.5em;
  right: 0.8em;
  font-size: 1.5em;
  cursor: pointer;
}
