:root {
  --background: rgb(236, 236, 236);
  --entry: rgb(245, 245, 245);
  --border: rgb(227, 227, 227);
  --accent: rgb(128, 194, 255);
  --radio: rgb(0, 116, 184);
  --text: rgb(22, 30, 39);
  --text-muted: rgb(102, 102, 102);
  --transition: background .2s ease, color .2s ease, border-color .2s ease, opacity 0.2s ease;
  --section-margin: 1.8rem 0 2rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: rgb(16, 23, 32);
    --entry: rgb(28, 40, 56);
    --border: rgb(30, 44, 61);
    --accent: rgb(0, 82, 158);
    --radio: rgb(77, 189, 255);
    --text: rgb(218, 218, 219);
    --text-muted: rgb(155, 156, 157);
  }
}

body {
  background: var(--background);
  color: var(--text);
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 0;
}

.container {
  position: relative;
  padding: 1rem 1rem 0 1rem;
  max-width: 43rem;
}

.samples,
.previews-group,
.upload-container,
.previews-group,
.options-group,
#preview-container,
.download-button,
.link {
  margin: var(--section-margin);
}

.lang-switch {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 2rem 0 0;
}

h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 2rem;
}

.marker {
  background: linear-gradient(
    transparent 60%,
    var(--accent) 60%
  );
}

.samples-list {
  display: flex;
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.samples-list img {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

hr {
  border: none;
  height: 3px;
  background: var(--border);
  margin: 1.5rem 0 2.5rem;
}

.upload-container>label,
button {
  background-color: var(--text);
  color: var(--entry);
  border: none;
  padding: .7rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
}

.upload-container>label:focus,
button:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.note,
.footer-meta,
.footer-meta a {
  color: var(--text-muted);
}

#timeline-preview {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: 1.3rem 1.3rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
  border-radius: 4px;
  background-color: var(--entry);
  max-width: 17rem;
}

#timeline-preview img {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  object-fit: cover;
}

.timeline-text {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  text-align: left;
  line-height: 1.2;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-name {
  color: var(--text);
  font-weight: 700;
}

.timeline-handle {
  color: var(--text-muted);
  font-size: 14px;
}

.timeline-post {
  color: var(--text);
  font-size: 14px;
}

.options-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.option p {
  margin: 0;
}

.option-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
}

.option-buttons input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-buttons span {
  display: inline-block;
  padding: .5rem .5rem;
  min-width: 1.4rem;
  border-radius: 999px;
  background: var(--entry);
  color: var(--primary-font);
  border: 1px solid var(--border);
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.option-buttons label:hover span {
  opacity: .8;
}

.option-buttons input:checked + span {
  background: var(--radio);
  color: var(--entry);
  border-color: var(--accent);
}

.option-buttons input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

#preview {
  max-width: 19rem;
  height: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
  border-radius: 50%;
}

#preview:not([src]),
#preview[src=""] {
  display: none;
}

canvas {
  display: none;
}

.download-button {
  display: flex;
  gap: 16px;
}

.footer-meta p,
.footer-meta ul {
  margin-block: 0.3rem;
}

.footer-meta ul {
  padding-left: 0;
  list-style: none;
}

.lang-switch a,
.credit a {
  color: var(--text);
}

.link a {
  color: var(--text-muted);
  font-weight: 700;
}

@media (max-width: 600px) {

  :root {
    --section-margin: 1.5rem 1.7rem;
  }

  .container {
    text-align: center;
  }

  h1 {
  font-size: 1.7rem;
  margin: 1.5rem 0 0;
  }

  h2 {
  font-size: 1.1rem;
  margin: 0 0 1.5rem;
  }

  #timeline-preview,
  #preview {
    margin: 0 auto;
  }

  .samples-list,
  .options-group,
  .option-buttons,
  .download-button {
    justify-content: center;
  }

  canvas,
  #preview {
    max-width: 240px;
  }
}
