@import url("https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;700&display=swap");

/* 全リセット */
body {
  margin: 0;
  padding: 0;

  background: black;

  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;

  font-family: "Zen Maru Gothic", serif;
}

.close {
  width: 100px;
  height: 50px;
  background-color: white;
  border: 3px solid rgb(35, 162, 226);
  border-radius: 10px;
  margin: 10px;
}

.main_container {
  /* 16:9の画面比率を保つ */
  aspect-ratio: 16 / 9;
  width: 100vw;

  /* 背景画像 */
  background-image: url("../img/background.webp");
  background-size: 25vh;
  background-repeat: repeat;

  /* 上下中央に配置 */
  position: relative;

  overflow: hidden;
}

/* 縦画面の場合は90度回転 */
@media (orientation: portrait) {
  .main_container {
    width: 100vh;
    transform: rotate(90deg);
  }
}

/* 横長で16:9が収まらない場合は高さを100vhにする */
@media (min-aspect-ratio: 16/9) {
  .main_container {
    height: 100vh;
    width: auto;
  }
}

.debug::after {
  /* 本体の要素に影響を及ぼさないように枠線を表示 */
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid red;
  box-sizing: border-box;
  pointer-events: none;
}

.school {
  /* サイズはできる限り大きく、左側に3%, 右側に8%のマージンを設ける */
  width: 89%;
  margin: 0 0 0 3%;

  /* 上下は中央に配置 */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.id_input,
.material_input {
  position: absolute;
  top: 2.5%;
  right: calc(-70% + 5vw);
  width: 70%;
  height: 80%;
  transition: right 0.5s ease;
  pointer-events: none;
}

.material_input {
  top: auto;
  bottom: 2.5%;
}

.id_input.open,
.material_input.open {
  right: 0;
}

.id_input > .id_input_bar,
.material_input > .material_input_bar {
  pointer-events: all;
  /* fixedで右側の上50%に配置 */
  /* 横幅5vw, 縦幅45% */
  width: 5vw;
  height: 45%;
  position: absolute;
  top: 2.5%;
  left: 0;
  background: #868686;
  border-radius: 10px 0 0 10px;
}

.material_input > .material_input_bar {
  top: auto;
  bottom: 2.5%;
  /* border-radius: 0 10px 10px 0; */
}

.id_input > .id_input_bar > .inner,
.material_input > .material_input_bar > .inner {
  /* margin 20pxで中央に配置 */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 10px;

  cursor: pointer;

  /* 最大サイズ */
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  margin: 10px;
  writing-mode: vertical-rl;
  font-size: 2vw;
  letter-spacing: 1vw;
}

.id_input > .id_input_main,
.material_input > .material_main {
  pointer-events: all;
  background: #868686;
  position: absolute;
  width: calc(100% - 5vw);
  height: 95%;
  margin-left: 5vw;
  top: 2.5%;
}

.id_input > .id_input_main > .inner,
.material_input > .material_main > .inner {
  /* margin 20pxで中央に配置 */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: url("../img/iron.webp");
  border-radius: 10px;

  /* 最大サイズ */
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  margin: 10px;
  font-size: 2vw;
  letter-spacing: 1vw;
}

.material_input > .material_main > .inner > h2 {
  color: white;
  font-size: 2vw;
}

.id_input > .id_input_main > .inner > img,
.material_input > .material_main > .inner > img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
}

.id_input > .id_input_main > .inner > .keypad {
  width: 100%;
  max-width: 500px;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  position: relative;
}

.id_input > .id_input_main > .inner > .keypad > .display {
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2vw;
  letter-spacing: 1vw;
  margin: 10px;
}

.id_input > .id_input_main > .inner > .keypad > .display > div {
  width: 40px;
  height: 50px;
  margin: 0 10px;
  background: white;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  transform: translateX(6px);
}

.id_input > .id_input_main > .inner > .keypad > .input {
  width: 100%;
  max-width: 300px;
  height: 100%;
  max-height: 400px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.id_input > .id_input_main > .inner > .keypad > .input > div {
  width: calc(33.3% - 20px);
  height: calc(25% - 20px);
  margin: 10px;
  background-color: white;
  border-radius: 50%;
  cursor: pointer;
}

.id_input > .id_input_main > .inner > .keypad > .input > div > span {
  font-size: 2vw;
  letter-spacing: 1vw;
  display: block;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateX(6px);
}

.over {
  height: 100%;
  width: 100%;
}

.over > .bomb,
.over > .info,
.over > .hint {
  position: absolute;
  cursor: pointer;
  display: block;
  width: 5vw;
  height: 5vw;

  display: none;
}

.over > .bomb.step1 {
  left: 43%;
  top: 8%;
}

.over > .bomb.step2 {
  left: 20%;
  top: 56%;
}

.over > .bomb.step3 {
  left: 51%;
  top: 60%;
}

.over > .bomb.step4 {
  left: 9%;
  top: 82%;
}

.over > .bomb.step5 {
  left: 88.5%;
  top: 34%;
}

.over > .bomb.step6 {
  left: 57%;
  top: 34%;
}

.over > .bomb.clear {
  filter: hue-rotate(60deg);
}

.over > .info.no1 {
  filter: hue-rotate(264deg);
  left: 85%;
  top: 73%;
}

.over > .hint {
  left: 2%;
  top: 2%;
  display: block;
  background: url(../img/hint.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.over > .hint::after {
  content: "HINT";
  position: absolute;
  bottom: -50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5vw;
  color: white;
}

.over > .bomb.show,
.over > .info.show {
  display: block;
}

.notice {
  position: fixed;
  display: block;
  font-weight: bold;
  color: white;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vw;
  max-width: 600px;
  height: 80vh;
  max-height: 200px;
  background-color: white;
  border: 3px solid rgb(35, 162, 226);
  border-radius: 10px;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
}

.materials {
  width: 400px;
  height: 100px;
  background-color: white;
  border: 3px solid rgb(35, 162, 226);
  display: flex;
  justify-content: baseline;
  align-items: center;
  flex-direction: column;
  bottom: 10px;
  right: calc(5vw + 10px);
  margin: 10px;
  margin-top: 20px;
}

.materials > h2 {
  font-size: 2vw;
  margin: 1px;
}

.materials > .inner {
  margin-top: 5px;
}

.materials > .inner > div {
  display: none;
  position: relative;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.materials > .inner > div.show {
  display: flex;
}

.materials > .inner > div > p {
  margin: 0;
  letter-spacing: 0;
  font-size: 1vw;
}
.materials > .inner > div > img {
  cursor: pointer;
}

.container,
.container {
  position: fixed;
  width: 80vw;
  height: 80vh;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  overflow: hidden;

  background: url("../img/brushed.webp");
  border-radius: 10px;

  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.container.show {
  display: flex;
}

.container > img {
  height: 80%;
  max-width: 90%;
}

.container > .input {
  display: flex;
  justify-content: center;
  align-items: center;
  width: calc(100% - 20px);
  margin: 10px;
}

.container > .input > input {
  width: 80%;
  max-width: 400px;
  height: 40px;
  border-radius: 10px;
}

.container > .input > button {
  width: 50px;
  height: 40px;
  border-radius: 10px;
}

.container.info_modal > h2 {
  height: calc(10% - 40px);
  font-size: 2vw;
  margin: 20px 0;
}

.container.info_modal > .inner {
  height: calc(90% - 40px);
  overflow: scroll;
  margin: 20px;
}

.container.info_modal > .inner > .item {
  display: flex;
  flex-direction: row;
  align-items: start;
}

.container.info_modal > .inner > .item > .left {
  width: 10%;
  max-width: 50px;
}

.container.info_modal > .inner > .item > .left > img {
  width: 100%;
  aspect-ratio: 1;
  background: white;
  border-radius: 50%;
}

.container.info_modal > .inner > .item > .right {
  width: 90%;
  max-width: calc(100% - 50px);
  margin-left: 10px;
}

.container.info_modal > .inner > .item > .right > .name {
  font-size: 1vw;
  margin: 0;
}

.container.info_modal > .inner > .item > .right > .contents {
  font-size: 1.5vw;
  margin: 5px;
  margin-bottom: 10px;
  margin-left: 0;

  background-color: rgb(255, 255, 255);
  border-radius: 0 10px 10px 10px;
  padding: 10px;
}

.container.hint_modal > .inner {
  height: calc(90% - 40px);
  overflow: scroll;
  margin: 20px;
}

.container.hint_modal > .inner > div {
  display: none;

  /* display: block; */
}

#tutorial_hint {
  display: block;
}

#tutorial_hint.hide {
  display: none;
}

.container.hint_modal > .inner {
  width: 90%;
  max-width: 500px;
}

.container.hint_modal > .inner > div > h2 {
  font-size: 2vw;
  margin: 20px 0;
}

.container.hint_modal > .inner > div > p {
  font-size: 1.5vw;
  margin: 5px;
  margin-bottom: 10px;
  margin-left: 0;

  background-color: rgb(255, 255, 255);
  border-radius: 0 10px 10px 10px;
  padding: 10px;

  display: none;
}

.container.hint_modal > .inner > div.show {
  display: block;
}

.container.hint_modal > .inner > div > .hint_item > h3 {
  cursor: pointer;
}

.container.hint_modal > .inner > div > .hint_item > h3::before {
  content: "▶︎";
}

.container.hint_modal > .inner > div > .hint_item.show > h3::before {
  content: "▼";
}

.container.hint_modal > .inner > div > .hint_item > p {
  display: none;
}

.container.hint_modal > .inner > div > .hint_item.show > p {
  display: block;
}
