* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

li {
  list-style: none;
}

body {
  background-color: lightgray;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

main {
  display: grid;
  grid-template-columns: 40px 600px;
  column-gap: 10px;
}

button {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  font-size: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}

.control-btn {
  font-size: 12px;
  width: 60px;
  height: 36px;
}

canvas {
  background-color: white;
  border-radius: 8px;
}

button.red {
  background-color: red;
}

button.green {
  background-color: green;
}

button.blue {
  background-color: blue;
}

button.black {
  background-color: black;
}

button.selected {
  border: 2px solid white;
}

.gallery-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 36px;
  border-radius: 6px;
  background: #2f2f2f;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
}

body.gallery {
  flex-direction: column;
  align-items: stretch;
  padding: 40px 20px;
  gap: 24px;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.gallery-header h1 {
  font-size: 24px;
}

.gallery-main {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.gallery-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.gallery-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.gallery-card p {
  margin-top: 8px;
  font-size: 12px;
  color: #444;
  word-break: break-all;
}

.gallery-empty {
  margin-top: 20px;
  text-align: center;
  color: #666;
}
