.absolute {
  position: absolute;
}
.relative {
  position: relative;
}
.object-scale-down {
  object-fit: scale-down;
}

.event-block {
  /* background: linear-gradient(to bottom, #4c50e0 0%, #248fc1 50%, #f1be87 70%); */
}

.event-block-top::after {
  content: "";
  display: block;
  position: absolute;
  background: url(../images/2025quiz/far-island-bg.png) no-repeat center
    bottom / 100%;
  position: absolute;
  width: 15%;
  left: 0;
  bottom: 0;
  aspect-ratio: 37/6;
}

.event-block-top {
  aspect-ratio: 30/9;
  overflow: hidden;
  align-items: end;
  background: url(../images/2025quiz/sky-bg.png) repeat-x center top;
  background-size: contain;
}
.event-block > div > section {
  max-width: 1140px;
  width: 95%;
  margin: 0 auto;
}

.quiz-visual {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
}

.quiz-visual > div {
  width: 45%;
  height: auto;
  position: relative;
  transition: transform 0.3s ease;
}
.main-girl {
  z-index: 1;
  transform: translate(25%, 1.5%);
  aspect-ratio: 50 / 49;
}
.main-title {
  z-index: 2;
  transform: translateX(-25%);
  text-align: center;
  animation: title 2s ease-in;
}

.quiz-btn {
  width: 50%;
  border: 4px solid #000;
  padding: 5px 15px;
  font-size: 1.5rem;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
  background: #fa0;
  color: #fff;
  box-shadow: 0 5px 0px rgba(0, 0, 0, 1);
}

/* 答題區 */
.quiz-block {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 2rem 5rem;
}

.quiz-block::before {
  content: "";
  display: block;
  width: 100%;
  background: url(../images/2025quiz/question-bg-top.png) no-repeat center
    bottom / contain;
  aspect-ratio: 1120 / 43;
}

.quiz-block::after {
  content: "";
  display: block;
  width: 100%;
  background: url(../images/2025quiz/question-bg-bottom.png) no-repeat center
    top / contain;
  aspect-ratio: 1120 / 43;
}

.quiz-list {
  height: 95%;
  padding: 0.5rem 9rem 1rem;
  background-color: #addefc;
  background: url(../images/2025quiz/question-bg-mid.png) repeat-y center top /
    100%;
}

.quiz-list::after {
  content: "";
  display: block;
  background-color: #addefc;
  background: url(../images/2025quiz/coconuttree.png) no-repeat center top /
    100%;
  position: absolute;
  width: 3rem;
  right: 6rem;
  bottom: 4rem;
  aspect-ratio: 55/64;
}

.quiz-topic {
  font-size: 1.3rem;
  font-weight: bold;
  color: #000;
  margin-bottom: 1rem;
  text-shadow: 0px 1px 0 #ffffff;
  text-indent: 1.8em;
  background: url(../images/2025quiz/q.png) no-repeat left top / 1.5em;
}
.quiz-ul > li {
  background-color: #ffffff;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  border: 2px solid #000;
}
.quiz-ul > li.selected,
.quiz-ul > li:hover {
  background-color: #c7f076;
  text-shadow: 0px 1px 0 #ffffff;
}

.send-ans {
  width: 100%;
  background-color: #000;
  color: #fff;
  padding: 0.5rem 0;
  border-radius: 0.5rem;
  font-size: 1.2rem;
  font-weight: bold;
  margin-top: 1rem;
  cursor: pointer;
}
.quiz-tab {
  background: #f1be87 url(../images/2025quiz/sand-bg.png) no-repeat left top;
  background-size: 150%;
  position: relative;
}

.quiz-tab::before {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  background: url(../images/2025quiz/bg-pattern.png) no-repeat center top /
    contain;
  aspect-ratio: 28 / 15;
}
.quiz-tab-box {
  background: #dfdede url(../images/2025quiz/gray-pattern.png) repeat top
    right/ 2%;
  /* min-height: 500px; */
  border: 4px solid #000;
  box-shadow: 0 5px 0px rgba(0, 0, 0, 1), inset 0 -5px 0px rgb(235, 162, 78);
}

.quiz-tab-list {
  display: flex;
  /* align-items: center; */
  justify-content: space-evenly;
}

.quiz-tab-item {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 1.2rem;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  transition: background-color 0.3s ease;
  background-color: #33b284;
  cursor: pointer;
  border-color: #000;
  border-width: 0 0 3px 0;
  border-style: solid;
  align-content: center;
}

.quiz-tab-item + .quiz-tab-item {
  border-left-width: 3px;
}

.quiz-tab-item.active {
  background: linear-gradient(
    -45deg,
    #000 0%,
    #000 5%,
    #fa0 5%,
    #fa0 95%,
    #000 95%,
    #000 100%
  );
}

.quiz-tab-text {
  position: relative;
  display: inline-block;
  font-size: 1.2rem;
  line-height: 1rem;
  vertical-align: middle;
}

.quiz-tab-item.active > .quiz-tab-text {
  color: #fff;
  position: relative;
  text-shadow: 0px 0px 5px #ff6600;
}

.quiz-tab-item-content {
  width: 80%;
  margin: 50px auto;
}
.histoty-quiz-list {
  height: 400px;
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: #9e9e9e transparent;
  scrollbar-gutter: stable;
}

.histot-quiz-item {
  background-color: #f3d9ce;
  border-radius: 0.5rem;
  color: #175279;
  padding: 1rem;
  font-weight: bold;
  box-shadow: 0 3px 0px rgb(219, 202, 202);
  margin-bottom: 1rem;
}

.quiz-rule-list {
  background-color: #f3d9ce;
  padding: 1rem;
  border-radius: 1rem;
  color: #175279;
  line-height: 1rem;
  list-style: disc;
}

.quiz-rule-list li {
  font-weight: 500;
  margin-left: 1.5rem;
}
.quiz-rule-list li + li {
  margin-top: 1.5rem;
}

.frist-day-only {
  position: absolute;
  top: 50%;
  right: 50%;
  transform: translate(50%, 0%);
  font-size: 1.5rem;
  color: #175279;
}

.quiz-bottom {
  background: url(../images/2025quiz/bg-bottom.png) no-repeat center top /
    cover;
  height: 80px;
  width: 100%;
}

/* 裝飾及動態處理 */
.quiz-deco {
  position: absolute;
  width: 100%;
  top: 0;
  height: auto;
  aspect-ratio: 30/9;
}
.quiz-deco-left {
  position: absolute;
  left: 5%;
  bottom: 15%;
  width: 15%;
}

.quiz-deco-right {
  position: absolute;
  right: -5%;
  bottom: 0%;
  width: 50%;
  animation: updown 3s infinite;
}

.quiz-island-left {
  width: 10%;
  position: absolute;
  right: 5%;
  top: 12vh;
}

.quiz-island-right {
  width: 25%;
  position: absolute;
  left: -5%;
  top: 15vh;
  animation: updown 2s infinite;
}

.quiz-quiz-mark-left {
  width: 2%;
  position: absolute;
  left: 20%;
  bottom: 15%;
  animation: quiz-a 2s infinite;
}
.quiz-quiz-mark-right {
  width: 2%;
  position: absolute;
  right: 9%;
  top: 5vh;
  animation: quiz-a 2s infinite;
}

.blink-red {
  animation: redBlink 1s ease-in-out infinite;
}

@keyframes quiz-a {
  0% {
    transform: rotateY(90deg);
  }
  50% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(-90deg);
  }
}

@keyframes updown {
  0% {
    transform: translateY(0);
  }

  70% {
    transform: translateX(10px);
  }
  100% {
    transform: translateX(0px);
  }
}

@keyframes title {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}

@keyframes redBlink {
  0% {
    background-color: #ff4d4d;
  } /* 紅色 */
  50% {
    background-color: #000;
  } /* 或原本背景色 */
  100% {
    background-color: #ff4d4d;
  }
}

/* 確認彈窗 */
.quiz-content-block {
  width: 90%;
  max-width: 700px;
  background-color: rgb(255, 255, 255);
  transform: translate(-50%, -50%);
  position: absolute;
  top: 50%;
  left: 50%;
  background: url(../images/2025quiz/question-modal-bg.png) no-repeat center
    top / cover;
  aspect-ratio: 820 / 446;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.quiz-pop-content {
  gap: 1rem;
  align-items: center;
  font-size: 1.2rem;
  text-align: left;
  padding: 1rem;
}

.quiz-conrirm {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}

.quiz-conrirm-btn {
  max-width: 50%;
  flex: 1;
  background-color: rgb(0, 0, 0);
  padding: 0.5rem;
  color: #fff;
  border-radius: 0.5rem;
}

/* ipad尺寸 */
@media (max-width: 1600px) {
  .event-block-top {
    aspect-ratio: 28/12;
  }
  .quiz-deco {
    aspect-ratio: 28/12;
  }
}

/* ipad尺寸 */
@media (max-width: 1100px) {
  .event-block-top {
    aspect-ratio: 27/16;
  }
  .quiz-deco {
    aspect-ratio: 27/16;
  }
  .quiz-quiz-mark-left,
  .quiz-quiz-mark-right {
    width: 4%;
  }
  .quiz-quiz-mark-left {
    bottom: 30%;
    left: 10%;
  }
  .quiz-island-right {
    width: 35%;
    left: -15%;
    top: 8vh;
  }
  .quiz-visual > div {
    width: 50%;
  }
  .main-girl {
    transform: translate(15%, 1.5%);
  }
  .main-title {
    transform: translateX(-15%);
  }
  .quiz-list {
    padding: 0.5rem 4rem 1rem;
  }
  .quiz-tab::before {
    display: none;
  }
}

@media screen and (max-width: 820px) {
  .quiz-list::after {
    width: 2.5rem;
    right: 4rem;
    bottom: 3.5rem;
  }

  .quiz-block {
    padding: 2rem 3rem;
  }
  .quiz-topic {
    font-size: 1.1rem;
  }
  .quiz-ul > li {
    padding: 0.3rem;
    font-size: 1.1rem;
  }
}

@media screen and (max-width: 768px) {
  .send-ans {
    font-size: 1rem;
    margin-top: 0.3rem;
  }
}

@media screen and (max-width: 540px) {
  .event-block-top {
    aspect-ratio: 25/19;
  }
  .quiz-btn {
    font-size: 1.2rem;
  }
  .quiz-block {
    padding: 2rem 0rem;
  }
  .quiz-topic {
    font-size: 0.9rem;
  }
  .quiz-ul > li {
    padding: 0.2rem 0.5rem;
    font-size: 0.9rem;
  }
  .quiz-visual {
    flex-direction: column;
  }
  .main-girl {
    transform: translate(-40%, 73%);
  }
  .main-title {
    transform: translate(40%, -15%);
  }

  .quiz-tab-item {
    padding: 3px 0;
  }

  .quiz-tab-text {
    font-size: 0.9rem;
    word-wrap: break-word;
  }
  .quiz-list::after {
    width: 2rem;
    right: 1rem;
  }
}

@media screen and (max-width: 450px) {
  .event-block-top,
  .quiz-deco {
    aspect-ratio: 25/31;
  }
  .event-block-top::after {
    width: 30%;
  }
  .quiz-visual > div {
    width: 65%;
  }
  .main-girl {
    transform: translate(-10%, 32%);
  }
  .main-title {
    transform: translate(-0%, -5%);
  }
  .quiz-visual > div.main-title {
    width: 80%;
  }

  .quiz-island-right {
    width: 55%;
    left: -25%;
  }
  .quiz-island-left {
    width: 25%;
    top: 20vh;
  }
  .quiz-quiz-mark-left,
  .quiz-quiz-mark-right {
    width: 8%;
  }

  .quiz-quiz-mark-right {
    top: 12vh;
    right: 13%;
  }
  .quiz-quiz-mark-left {
    bottom: 0%;
    left: 10%;
  }

  .quiz-list {
    padding: 1rem;
  }

  .quiz-tab-item-content {
    width: 90%;
    margin: 15px auto;
  }

  .quiz-list::after {
    bottom: 2.5rem;
  }
  .quiz-pop-content {
    font-size: 0.9rem;
  }
}
