html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

input:focus,
textarea:focus,
select:focus,
button:focus {
  outline: none;
}

::-webkit-scrollbar {
  width: 0.3em;
}

::-webkit-scrollbar-track {
  width: 0.3em;
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
  background-color: rgb(112, 112, 112);
}

.content {
  background-color: #161616;
  width: 100%;
  min-height: 50em;
  display: flex;
  flex-direction: column;
}

.main {
  background-color: #222222;
  width: 90%;
  height: 70vh;
  border-radius: 1em;
  margin: 1em auto auto auto;
  display: flex;
  flex-direction: column;
}

.main-container {
  display: flex;
  align-items: flex-start;
  width: 90%;
  background-color: #222222;
  margin-left: auto;
  margin-right: auto;
  flex-direction: row;
  align-items: flex-start;
  flex-grow: 1;
  flex-shrink: 1;
  overflow-y: auto;
}

.topic {
  background-color: #222222;
  width: 90%;
  color: #9c67b5;
  margin: auto;
  margin-top: 0em;
  margin-bottom: 0.2em;
  text-align: center;
  font-size: 2em;
}


.text-container {
  margin: auto;
  line-height: 150%;
  color: white;
  width: 60%;
  height: auto;
  max-height: 100%;
  white-space: pre-line;
  box-sizing: border-box;
  display: initial;
  flex-direction: column;
  overflow-y: auto;
  word-break: break-all;
  overflow-wrap: break-word;
}

.img-container {
  width: 40%;
  /* max-height: 50%; */
  display: flex;
  justify-self: center;
  align-items: flex-start;
  top: -5%;
  position: relative;
  margin: auto;
  overflow: hidden;
}

.img-container img {
  margin: auto;
  max-width: 500px;
  max-height: 500px;
  min-width: 2;
  object-fit: contain;
}

@media screen and (max-width: 768px) {
  .main {
    height: 75vh;
    margin-bottom: 0;
  }

  .main-container {
    flex-direction: column;
    overflow-y: auto;
  }

  .text-container,
  .img-container {
    width: 100%;
    margin: 0 0 0 0;
    order: 2;
  }

  .text-container {
    height: auto;
    max-height: 60%;
    overflow-y: scroll; 
  }

  .no-dream .text-container {
    max-height: 100%;
  }

  .img-container {
    top: 0;
    order: 1;
  }
}

.img-wrapper {
  width: 100%;
  max-width: 80vw;
  height: 100%;
  max-height: 80vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

.prompt {
  font-size: 0.75em;
  color: white;
  width: 90%;
  margin: auto;
}

.hintPrompt {
  border: 0px;
  border-radius: 10px;
  padding: 5px;
  color: white;
  left: 0;
}

.hintPrompt:hover {
  background-color: #666666;
}

.hintText {
  display: none;
}

#hintText2 {
  text-align: center;
  margin: auto;
}

#end-link,
#end-link a {
  text-align: center;
  color: white;
  width: 100%;
}

.button-area {
  width: 40%;
  left: 0;
  right: 0;
  margin: auto;
}

.button-area .large-button,
.medium-button,
.small-button {
  border: 2px solid #9c67b5;
  background-color: #222222;
  margin: 5%;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  height: 3em;
  border-radius: 10px;
  font-size: 1em;
  touch-action: manipulation;
}

.go-button {
  color: #9c67b5;
  border-color: #9c67b5;
  margin-left: 5px;
  border-width: 3px;
}

.button-area .large-button {
  width: 90%;
  color: white;
}

.button-area .medium-button {
  width: 40%;
  color: white;
}

.button-area .small-button {
  width: 3em;
  color: white;
  font-size: 1em;
  font-style: bold;
}

.button-area .input-box {
  margin: 10px;
  color: white;
  background-color: transparent;
  border: 3px solid #9c67b5;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  height: 3em;
  border-radius: 10px;
  font-size: 1em;
  width: calc(80% - 3em);
  text-transform: uppercase;
}

.calculater-container {
  margin-left: calc(2em + 25px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-1,
.cal-2 {
  flex: 1;
  border: 3px solid #9c67b5;
  background-color: transparent;
  color: white;
  height: 3em;
  border-radius: 10px;
  font-size: 1em;
  width: calc((100% - 3em) / 2);
  text-transform: uppercase;
}

.equal,
.plus {
  width: 1em;
  text-align: center;
}

@media screen and (max-width: 768px) {
  .calculater-container {
    margin-left: 0;
  }

  .equal {
    width: 2em;
    font-size: 1em;
    margin: 5%;
    margin-left: 15px;
    border: 3px;
  }
}

.plus,
.equal {
  font-size: 1.5em;
  color: #9c67b5;
}

.button-area .calculater-container {
  display: none;
}

.input-and-calc-container {
  display: flex;
  align-items: center;
}

.button-area .calculater {
  width: 1.5em;
  display: flex;
  border: 3px solid #9c67b5;
  border-radius: 10px;
  padding: 0.6em;
}

.button-area .calculater:hover,
.button-area .cal-1:hover,
.button-area .cal-2:hover {
  cursor: pointer;
  border-width: 4px;
  padding: 0.55em;
}

.button-area .calculater-container.display {
  display: flex;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-10px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(10px);
  }
}

.error-shake {
  animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes color-change {
  from {
    color: red;
  }

  to {
    color: #9c67b5;
  }
}

.error-color {
  animation: color-change 2s ease;
}

.button-area .large-button:hover,
.medium-button:hover,
.small-button:hover {
  cursor: pointer;
  /* border: 3px solid; */
  border-width: 3px;
}


.button-area .input-box:hover {
  cursor: pointer;
  border-width: 4px;
}

.no-dream .input-box:hover,
.no-dream .cal-1:hover,
.no-dream .cal-2:hover,
.no-dream .calculater:hover {
  border-width: 3px;
}

.no-dream .small-button:hover {
  border-width: 2px;
}

.hidden-element {
  opacity: 0;
}

.hidden-element:hover {
  cursor: default !important;
}

.continue {
  box-sizing: border-box;
}

.card-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  margin: auto;
  height: 25vh;
  top: 0;
}

.card-container {
  display: flex;
  justify-content: center;
  flex-grow: 1;
  height: 100%;
  gap: 20px;
}

@media screen and (max-width: 768px) {
  .card-container {
    gap: 10px;
  }
}

.card {
  background-color: #222222;
  color: #222222;
  border: 2px solid #ff9d95;
  display: flex;
  border-radius: 10px;
  text-align: center;
  margin-top: 20px;
  position: relative;
  flex-direction: column;
  max-width: 6em;
  max-height: calc(6em * 4 /3);
  width: 15vw;
  height: calc(15vw * 4 / 3);
  min-width: 1.6em;
  min-height: calc(1.6em * 4 / 3);
}

.card-title {
  margin-left: auto;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.5em;
  text-align: center;
  color: #ff9d95;
  width: 100%;
  top: 10%;
}

.card-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  margin: auto;
  display: block;
}

@media screen and (max-width: 768px) {
  .card-wrapper {
    height: 15vh;
    margin-top: 0;
  }

  .card {
    border: 1px solid #ff9d95;
  }
}

.card:hover,
.hintPrompt:hover {
  cursor: pointer;
  border-width: 3px;
}

.card:hover::before {
  content: '';
  z-index: 1;
  border-radius: inherit;
  position: absolute;
  left: 0;
  height: 100%;
  top: 0px;
  width: 100%;
}

.card-drag {
  position: absolute;
  z-index: 100;
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0.1);
}

.no-dream .main {
  border-radius: 0;
  background-color: #161616;
  border: 1px solid white;
}

.no-dream .main-container,
.no-dream .topic {
  background-color: #161616;
}

.no-dream .card,
.no-dream .modal-content,
.no-dream .large-button,
.no-dream .medium-button,
.no-dream .small-button,
.no-dream .input-box,
.no-dream .cal-1,
.no-dream .cal-2,
.no-dream .calculater {
  border-radius: 0;
}

.no-dream .calculater:hover {
  background-color: transparent;
}

.no-dream .card-description-text {
  overflow-y: scroll;
}

.no-dream .card:hover,
.no-dream .hintPrompt:hover,
.no-dream .large-button:hover,
.no-dream .medium-button:hover {
  border-width: 2px;
}

.no-dream .hintPrompt:hover {
  background-color: transparent;
  text-decoration: underline;
}

.dev-area {
  background-color: darkolivegreen;
}

@media screen and (max-width: 1023px) {
  .button-area {
    width: 90%;
  }
}

@media screen and (max-width: 768px) {
  .card-wrapper {
    width: 90%;
  }
}

.nav-button {
  background-color: transparent;
  margin: 5%;
  min-height: 60px;
  height: 5vw;
  min-width: 60px;
  width: 5vw;
  text-align: center;
  border: none;
  touch-action: manipulation;
}

.nav-button img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.nav-button:hover {
  cursor: pointer;
}

@media screen and (max-width: 768px) {
  .nav-button {
    width: 15vw;
    height: 15vw;
    margin: 0;
  }
}

/* 蒙版 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.75);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #161616;
  margin: 0;
  padding: 20px;
  border: 1px solid #ff9d95;
  border-radius: 10px;
  width: 30vw;
  max-width: 30em;
  /* 模态宽度 */
  height: 50vw;
  max-height: 50em;
  /* 模态高度 */
  position: relative;
  display: none;
  flex-direction: column;
  align-items: center;
}

.close {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 28px;
  font-weight: bold;
  margin-top: 1em;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.card-description-img {
  width: 80%;
}

.card-description-id {
  color: #ff9d95;
  font-size: 2em;
  text-align: center;
  margin-bottom: 15px;
}

.card-description-name {
  color: #ffffff;
  font-size: 1.5em;
  margin-top: 15px;
  margin-bottom: 15px;
}

.no-dream .card-description-name {
  margin: auto 0;
  font-size: 1em;  
}

.card-description-text {
  color: #ffffff;
  margin-top: 15px;
  overflow-y: auto;
  white-space: pre-line;
}

.divider {
  height: 2px;
  width: 80%;
  background-color: #ff9d95;
  margin-bottom: 15px;
}

@media screen and (max-width: 768px) {
  .modal-content {
    width: 80vw;
    height: 120vw;
  }

  .card-title {
    display: none;
  }

  .card-description-img {
    height: 50%;
    width: auto;
    overflow: hidden;
  }

  .card-description-id {
    font-size: 1.5em;
  }

  .card-description-name {
    font-size: 0.75em;
    margin: auto 0;
  }

  .card-description-text {
    font-size: 0.8em;
  }
}

div.RAISA {
  border: 1px solid #000;
  background-color: #fff9e6;
  text-align: center;
  margin: auto;
  width: 80vw;
  padding: 10px;
  padding-top: 20px;
  padding-bottom: 20px;
  display: none;
}

div.RAISA-title {
  font-size: 1em;
  font-weight: bold;
  color: black;
  margin-bottom: 10px;
}

div.RAISA-description {
  font-size: 1em;
  color: black;
  white-space: pre-line;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.fade-in {
  animation: fadeIn 1s forwards;
}

.fade-out {
  animation: fadeOut 1s forwards;
}

.prompt,
.button-area {
  flex-shrink: 0;
  flex-grow: 0;
  min-height: 50px;
}