html:has(#disclaimerModal.active) {
  overflow: hidden;
}
#generator {
  overflow: scroll;
  scrollbar-gutter: auto;
}
#disclaimerModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(24,26,29,0.9);
  z-index: 9999;
  display: none;
}
#disclaimerModal.active {
  display: block;
}
.modal-overlay {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
}
.modal-content {
  background-color: rgba(255,255,255,0.95);
  color: #333;
  width: min(90%, 650px);
  height: fit-content;
  max-height: 90%;
  padding: 1.5em;
  border: 3px solid #af1918;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: left;
  overflow: auto;
}
.modal-title {
  width: 100%;
  color: #d71a18;
  padding: 0 0 0.3em;
  margin: 0 0 3%;
  font-size: 160%;
  text-align: center;
  font-weight: bold;
  border-bottom: 1px solid #d71a18;
}
.modal-body ul {
  margin-bottom: 1em;
}
.stred2 {
  color: #d71a18;
}
.agreement-area {
  padding: 15px;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  &:has(:disabled) {
    cursor: not-allowed;
  }
}
.agreement-area input[type="checkbox"] {
  width: 25px;
  height: 25px;
  margin-right: 10px;
  cursor: pointer;
  &:disabled {
    filter: grayscale(1);
    opacity: .2;
    & + label {
      cursor: not-allowed;
      opacity: .2;
    }
  }
}
.agreement-area label {
  margin: 0;
  user-select: none;
  cursor: pointer;
  font-size: 16px;
}
#startBtn {
  display: block;
  background-color: #ccc;
  cursor: not-allowed;
  width: 75%;
  pointer-events: none;
}
#disclaimerModal:has(input[type="checkbox"]:checked) #startBtn {
  background-color: #d71a18;
  cursor: pointer;
  pointer-events: auto;
}
#disclaimerModal:has(input[type="checkbox"]:checked) #startBtn:hover {
  background-color: #ff1a1a;
}
#generator #container {
  background-color: rgba(45,45,45,0.7);
  background-image: linear-gradient(to top, rgba(24,26,29,0.5) 20%, rgba(33,36,38,0.5) 60%, rgba(33,36,38,0.5) 100%);
}
#generator h1 {
  color: #af1918;
  text-align: center;
  font-size: 260%;
  padding: .8em 0 .5em;
}
#generator main {
  width: min(90%, 650px);
  margin: 0 auto;
}
.update-area {
  margin-bottom: 20px;
  .updates {
    padding: 8px;
    background-color: #181515;
  }
  .post {
    display: grid;
    grid-template: auto / auto 1fr;
    align-items: flex-start;
    grid-gap: .5rem;
    font-size: 95%;
    line-height: 1.2;
    color: #fff;
    & + .post {
      margin-top: 1em;
    }
  }
  .icon {
    display: block;
    background-color: #af1918;
    padding: 0 .4em;
  }
}
/* 作画例 */
.canvas-sample {
  position: relative;
  margin-bottom: 20px;
  .sample {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    background-color: #333;
    background-image: url('./img/sample.jpg');
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
  }
}
.canvas-area {
  position: relative;
  margin-bottom: 20px;
  display: none;
  &.active {
    display: block;
  }
  &.active:not(.loading) {
    #previewCanvas {
      display: block;
    }
    &::before {
      display: none;
    }
  }
  #previewCanvas {
    display: none;
  }
  &::before {
    content: '写真を選択してください';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    background-color: #2b2b2c;
    border: 1px solid #414141;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    color: #999;
  }
}
.canvas-area.loading #previewCanvas {
  opacity: 0.2;
}
.canvas-area.loading::after {
  content: '';
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width:  50px;
  height: 50px;
  background-image: url("./img/lazyloading_wht.png");
  background-size: 600px 50px;
  background-repeat: no-repeat;
  transform: translate(-50%, -50%);
  animation: lazy 1s steps(12) infinite;
}
@keyframes lazy {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -600px 0;
  }
}
#previewCanvas {
  display: block;
  border: 1px solid #555;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  margin: auto;
  &.horizontal {
    max-width: 100%;
  }
  &.vertical {
    max-height: 70vh;
    max-width: 100%;
  }
}
.canvas-sample + p,
.canvas-area + p {
  text-align: center;
  line-height: 160%;
  font-size: 140%;
  margin: 0.5em 0 1em;
}
p.closed{
  line-height: 150%;
  font-size: 95%;
  padding:1.5em 0 2.5em;
}
a.bn_viewer{
  display: block;
  border: 1px solid #555;
  background: url(./img/bn_viewer.png) no-repeat center bottom;
  background-size:cover;
  aspect-ratio: 100 / 23;
  width:85%;
  margin:0 auto .5em;
}
a.bn_viewer + p{
  font-weight:400;
  font-size:80%;
  text-align:center;
  color:#fff;
}

#generator main .notice {
  border: 1px solid rgba(175,25,24,0.6);
  background-color: rgba(55,55,55,0.8);
  padding: 1em;
  margin: 0 0 1em;
}
.modal-body ul li,
#generator main .notice ul li {
  list-style-type: none;
  position: relative;
  padding-left: 0.8em;
  font-size: 95%;
  margin: 0.5em 0;
  line-height: 150%;
}
.modal-body ul li:before,
#generator main .notice ul li:before {
  border-radius: 50%;
  width: 4px;
  height: 4px;
  display: block;
  position: absolute;
  left: 0;
  top: 0.6em;
  content: "";
  background: #333;
}
#generator main .notice ul li:before {
  background: #fff;
}
#generator main .agreement-area {
  background-color: #373737;
  &:has(:disabled) {
    background-color: #2b2b2c;
  }
}
#generator main aside p {
  padding: 1em 0 0.5em;
  line-height: 170%;
}
#generator main aside span.f85 {
  line-height: normal !important;
  display: inline-block;
}
#generator a.btn_info {
  width: 72%;
  margin: 2em auto;
  font-size: 160%;
}
.input-group {
  margin: 0 0 1em;
}
.input-group label {
  display: block;
  margin-bottom: 0.5em;
  font-weight: bold;
}
.input-group input[type="text"],
.input-group input[type="file"] {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 5px;
  border: none;
  outline: none;
}
.input-group input[type="text"] {
  font-size: 16px;
  background-color: #373737;
  color: #fff;
  &:disabled {
    background-color: #2b2b2c;
    cursor: not-allowed;
    &::placeholder {
      opacity: .8;
    }
  }
}
.input-group input[type="file"] {
  cursor: pointer;
  background-color: #373737;
}
/* ロゴ位置選択、濃度スライダー */
.input-group:has(input[type="radio"]) {
  .inputs {
    display: grid;
    grid-template: auto / 1fr 1fr;
    align-items: center;
    justify-content: center;
    grid-gap: 10px;
  }
  label:has(input[type="radio"]) {
    display: flex;
    align-items: center;
    grid-gap: .5em;
    padding: 10px;
    background-color: #2b2b2c;
    border-radius: 5px;
    outline: none;
  }
  label:has(input[type="radio"]:checked) {
    background-color: #373737;
  }
  label:has(input[type="radio"]:disabled) {
    filter: grayscale(1);
    color: #666;
    background-color: #2b2b2c;
    cursor: not-allowed;
    input {
      opacity: .2;
      pointer-events: none;
    }
  }
}
.input-group:has(input[type="range"]) {
  label:has(input[type="range"]) {
    padding: 10px;
    background-color: #373737;
    border-radius: 5px;
  }
  label:has(input[type="range"]:disabled) {
    background-color: #2b2b2c;
    cursor: not-allowed;
  }
  input[type="range"] {
    display: block;
    width: 100%;
    outline: none;
    &:disabled {
      filter: grayscale(1);
      opacity: .2;
      pointer-events: none;
    }
  }
}

.error-area {
  display: none;
  margin-top: 1em;
  padding: 1em;
  background-color: rgba(175,25,24,0.6);
}
.error-area:has(.on) {
  display: block;
  animation: error 0.1s linear 5 alternate;
}
.error-area:has(.on) + .input-group {
  margin-top: 1em;
}
.error-area p {
  display: none;
  text-indent: -1em;
  padding-left: 1em;
  line-height: 1.5;
}
.error-area p.on {
  display: block;
}
.error-area p.on + p.on {
  margin-top: 0.5em;
}
@-moz-keyframes error {
  0% {
    transform: translateX(-1px);
  }
  100% {
    transform: translateX(1px);
  }
}
@-webkit-keyframes error {
  0% {
    transform: translateX(-1px);
  }
  100% {
    transform: translateX(1px);
  }
}
@-o-keyframes error {
  0% {
    transform: translateX(-1px);
  }
  100% {
    transform: translateX(1px);
  }
}
@keyframes error {
  0% {
    transform: translateX(-1px);
  }
  100% {
    transform: translateX(1px);
  }
}
.btn {
  display: block;
  background-color: #444;
  color: #fff;
  padding: 15px 30px;
  border-radius: 100vh;
  margin: 1em auto;
  cursor: pointer;
  border: none;
  font-size: 120%;
  width: 70%;
  font-weight: 700;
  box-sizing: border-box;
  font-family: a-otf-midashi-go-mb31-pr6n, sans-serif;
  font-weight: 600;
  font-style: normal;
  transition: 0.2s linear;
}
.btn:hover {
  background-color: #d91317;
}
#shareBtn.btn {
  background-color: #000;
}
#DlBtn {
  color: #555;
  background-color: #2b2b2c;
  cursor: not-allowed;
  pointer-events: none;
}
#generator .controls:has(input[type="checkbox"]:checked) #DlBtn {
  color: #fff;
  background-color: #d71a18;
  cursor: pointer;
  pointer-events: auto;
  outline: none;
}
#generator .controls:has(input[type="checkbox"]:checked) #DlBtn:hover {
  background-color: #ff1a1a;
}
.note {
  font-size: 12px;
  color: #aaa;
  margin-top: 20px;
}
footer {
  padding: 0;
}
footer p.copy {
  padding: 2.5em 0;
}
@media all and (max-width: 767px) {
  #generator h1 {
    font-size: 6.5vw;
  }
  .canvas-sample + p,
  .canvas-area + p {
    font-size: 3.6vw;
    margin: 0.5em 0 5%;
  }
p.closed{
    font-size: 90% !important;
  padding:5% 0 5%;
}
a.bn_viewer{
  width:90%;
  margin:0 auto 1%;
}
  #generator a.btn_info {
    font-size: 4vw;
    letter-spacing: -0.025em !important;
    margin: 5vw auto;
  }
  footer p.copy {
    padding: 0 0 5%;
  }
  footer {
    padding: 8% 5% 0;
  }
}
