:root {
  --bg: #0f0f12;
  --panel: #16171b;
  --muted: #2b3449;
  --text: #f1f3f5;
  --sub: #a1a6ae;
  --brand: #248eff;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    "Hiragino Kaku Gothic ProN", Meiryo, "Noto Sans JP", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a {
  color: var(--brand);
}


.logo {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  padding: 24px 24px 0;
  justify-content: center;
}
.logo img {
  width: 40vw;
  max-width: 240px;
  fill: #efdfd8;
}
.logo svg {
  fill: #efdfd8;
}

.wrap {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 980px;
  margin: 0 auto;
}
.panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  height: 45svh;
}
.previewimage .previewbox {
  height: calc(100% - 34px - 58px);
}
.previewimage .previewbox #preview {
  height: 100%;
  display: contents;
}
.previewimage .previewbox #preview svg {
  height: 100%;
  aspect-ratio: 1/1;
  display: block;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
button,
select,
input[type="text"],
.sharelink {
  background: var(--muted);
  color: var(--text);
  border: 1px solid #000;
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 14px;
}
button {
  cursor: pointer;
}
button:hover {
  filter: brightness(1.1);
}
.previewbox {
  aspect-ratio: 1/1;
  width: 100%;
  margin: 12px auto;
  background: #0b0c0f;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #000;
}
.share {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.share .row {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: center;
}
.share .row button {
  height: 40px;
}
.controls {
  height: 50svh;
  overflow-y: scroll;
  overflow-x: hidden;
}
.controls h2 {
  font-size: 16px;
  margin: 0 0 12px;
}
.controls .none {
  opacity: 1 !important;
}
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.card {
  background: #1d1f24;
  border: 1px solid #000;
  border-radius: 12px;
  padding: 12px;
  overflow: hidden;
}
.card .row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.card label {
  font-size: 13px;
  color: var(--sub);
}
input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #000;
  background: #000;
}
.sharelink {
  width: 100%;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mutetxt {
  color: var(--sub);
  font-size: 12px;
}
/* スライダーサムネイルが範囲を超えたら省略される */
.strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  /* 横スクロールを有効化 */
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  /* iOS/Macでスワイプ慣性 */
  scrollbar-width: none;
  /* Firefoxでスクロールバー非表示 */
  height: 72px;
}
.strip::-webkit-scrollbar {
  display: none;
  /* Chrome/Safariでスクロールバー非表示 */
}
.thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border: 1px solid #000;
  border-radius: 10px;
  background: #acacac;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.thumb.selected {
  border: 2px solid var(--brand);
}
.thumb svg {
  position: absolute;
  border-radius: 10px;
}
#preview svg {
  width: 100%;
  height: auto;
  display: block;
}
.rail {
  display: flex;
}
.head {
  padding-bottom: 12px;
}
input[type="text"] {
  background-color: #000;
}
@media (min-width: 980px) {
  .wrap {
    grid-template-columns: 40% 60%;
  }
  .panel {
    height: fit-content;
  }
  .controls {
    height: 90svh;
    overflow-y: scroll;
    overflow-x: hidden;
  }
}
/* 12色スウォッチの基本とハイライト */
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #000;
  cursor: pointer;
  position: relative;
  padding: 0;
}
.swatch[aria-selected="true"] {
  border: 2px solid var(--brand);
}

.ad {
  max-width: 980px;
  margin: 40px auto 0;
}

.copyright {
  text-align: center;
  font-size: 13px;
  color: #747474;
  padding: 24px 8px;
}
.link {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 12px;
  justify-content: center;
}
.link a {
  text-decoration: none;
  color: #747474;
  font-size: 15px;
}

.faq.wrap {
  max-width: 720px;
  margin: auto;
  width: 90vw;
  display: block;
}
.faq.wrap details {
  margin: 10px auto;
  width: 100%;
  background-color: var(--panel);
  padding: 12px 8px;
}
.faq.wrap details[open] summary {
  border-bottom: 1px solid var(--sub);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.terms {
  max-width: 720px;
  margin: auto;
  width: 90vw;
  display: block;
}
.terms * {
  color: #a4a4a4;
}
.terms h1 {
  font-size: 20px;
}
.terms h2 {
  font-size: 18px;
  margin-top: 32px;
}
.terms h3 {
  font-size: 17px;
}
.terms p {
  font-size: 15px;
  line-height: 1.6em;
}

.dl-preview {
  max-width: 980px;
  height: fit-content;
  margin: 0 auto;
}
.dl-preview p {
  font-size: 15px;
}
.dl-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;

  background: #1d1f24;
  border: 1px solid #000;
  border-radius: 12px;
  padding: 12px;
  overflow: hidden;
}
.dl-item h3 {
  font-size: 18px;
  margin: 0px auto 6px;
}
.dl-item #dlNormal img {
  max-width: 200px;
  width: 100%;
  height: auto;
  border: 1px solid #000;
  border-radius: 8px;
  aspect-ratio: 1/1;
}
.dl-item #dlPolaroid {
  max-width: 200px;
  width: 100%;
  aspect-ratio: 4/5;
  display: block;
}
.dl-item #dlPolaroid img {
  max-width: 200px;
  width: 100%;
  height: auto;
  border: 1px solid #000;
  border-radius: 8px;
}
.dl-item svg {
  max-width: 200px;
  width: 100%;
  height: auto;
  border: 1px solid #000;
  border-radius: 8px;
  aspect-ratio: 1/1;
}
.dl-item svg * {
  font-family: "Zalando Sans Expanded", sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
}
.dl-item p {
  text-align: center;
  font-size: 14px;
}
.dl-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.dl-swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #000;
  cursor: pointer;
}
.dl-swatch[aria-selected="true"] {
  border: 2px solid var(--brand);
}

#strip-eyes svg {
  zoom: 1.6
}
#strip-mouth svg {
  zoom: 3
}
#strip-mouth button:first-of-type svg {
  zoom: 1
}

#btn-dl {
  display: flex;
  gap: 6px;
  align-items: center;
  background: var(--muted);
  color: var(--text);
  border: 1px solid #000;
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 14px;
  text-decoration: none;
  height: 40px;
}
#btn-random {
  display: flex;
  gap: 6px;
  align-items: center;
}

.profile {
  max-width: 460px;
  width: 80vw;
  margin: 32px auto;
  text-align: center;
}
.profile img {
  border-radius: 50%;
  border: 1px solid #fff;
}
.profile p {
  margin: 12px 0 32px;
}
.link {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.link img {
  width: 32px;
  height: auto;
  border-radius: 0;
  border: none;
}
.bnr {
  max-width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 auto 24px;
}
.bnr a {
  border: 2px solid var(--brand);
  border-radius: 4px;
  overflow: hidden;
}
.bnr img {
  max-width: 300px;
  height: auto;
  display: block;
  border-radius: 0;
  border: none;
}
.dl-preview .share {
  margin-top: 24px;
  text-align: center;
}
.dl-preview .share p {
  margin-bottom: 0;
}
.dl-preview .share .wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 0px;
  padding: 0;
  margin-bottom: 24px;
}
.dl-preview .share #btn-share {
  height: 100%;
  display: block;
}