* {
  font-family: dnp-shuei-mgothic-std, sans-serif !important;
  box-sizing: border-box;
}

body {
  font-size: 16px;
  padding: 16px;
  margin: 0;
  background-image: url(../img/bg.png);
  color: #2e1923;
}

.icon-maker {
  max-width: 1000px;
  padding: 16px;
  margin: 0 auto;
  border-radius: 12px;
  background: #ffd37b;
  text-align: center;
}

.logo {
  max-width: 240px;
  margin: 16px auto;
}

.logo img {
  display: block;
  width: 100%;
}

.preview img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 12px;
  border: 2px solid #eee;
}

.preview p {
  margin: 0;
}

.btn {
  display: block;
  padding: 4px 16px;
  margin: 16px auto 8px;
  border-radius: 10px;
  border: none;
  background: #2e1923;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.global-color {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;

}

.global-color::-webkit-scrollbar {
  display: none;
}

.global-color.disabled {
  pointer-events: none;
  opacity: 0;
}

.color-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 2px solid #eee;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.color-btn.null {
  background: repeating-linear-gradient(-45deg, #eee, #eee 8px, #fff 8px, #fff 16px);
}

.color-btn.active {
  border-color: #fc6572;
}

/* ── 横スクロールタブ ── */
.tab-bar {
  overflow: hidden;
  margin-bottom: 16px;
}

.tabs {
  display: flex;
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
}

.tabs::-webkit-scrollbar {
  display: none;
}

/* Chrome/Safari */
.tab-btn {
  width: calc(100% / 11);
  min-width: 80px;
  height: 40px;
  border: none;
  background: white;
  color: #2e1923;
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
  transition: all 0.2s;
  cursor: pointer;
}

.tab-btn.active {
  background: #73c5d8;
  color: white;
}

.parts-wrap {
  overflow: hidden;
  border-radius: 12px;
}

.parts-grid {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  align-content: start;
  height: 440px;
  padding: 16px 10px 16px 16px;
  background: #fff;
  scrollbar-gutter: stable;
}

.parts-grid::-webkit-scrollbar {
  width: 6px;
}

.parts-grid::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #73c5d8;
}

.part-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid #ccc;
  background: #eee;
  transition: 0.15s;
  cursor: pointer;
}

.part-thumb.selected {
  border-color: #fc6572;
}

.part-thumb.null {
  background: repeating-linear-gradient(-45deg, #eee, #eee 10px, #fff 8px, #fff 20px);
}

#open-modal {
  border: none;
  background: transparent;
  font-size: 16px;
  color: #2e1923;
  text-decoration: none;
  cursor: pointer;
}

#modal {
  width: calc(100% - 32px);
  max-width: 1000px;
  padding: 16px;
  margin: 16px auto;
  border-radius: 12px;
  border: none;
  background: #ffd37b;
  text-align: start;
}

#modal_inner {
  padding: 24px 48px;
}

h1 {
  font-size: 32px;
  margin: 0 0 40px;
  text-align: center;
}

h3 {
  font-size: 18px;
  margin: 0;
}

h4 {
  margin: 0;
}

.point {
  margin: 8px 0 24px;
  padding-left: 1.3rem;
}

#close-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 48px auto 0;
  border: none;
  background: none;
  color: var(--main-color);
  font-size: 40px;
  cursor: pointer;
}

@media screen and (max-width: 480px) {
  body {
    font-size: 14px;
  }
  .logo {
    max-width: 200px;
    margin: 0 auto 12px;
  }

  .preview img {
    width: 70%;
  }

  .global-color {
    justify-content: flex-start;
    gap: 6px;
    margin: 8px 0;
  }

  .color-btn {
    width: 32px;
    height: 32px;
  }

  .parts-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    height: 240px;
  }

  #modal {
    font-size: 14px;
  }

  #modal_inner {
    padding: 24px;
  }
}