/* #region - FONT - */
@font-face {
  font-family: "ARHei Medium";
  src: url("../fonts/Arheib5-m.OTF") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "ARHei Bold";
  src: url("../fonts/Arheib5-b.OTF") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "ARHei Extra Bold";
  src: url("../fonts/Arheib5-eb.OTF") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "ARHei Heavy";
  src: url("../fonts/Arheib5-h.OTF") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Helvetica Regular";
  src: url("../fonts/Helvetica-r.TTF") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Helvetica Bold";
  src: url("../fonts/Helvetica-b.TTF") format("truetype");
  font-display: swap;
}
/* #endregion */
:root {

  --color-primary: #007367;
  --color-gray: #9fa0a0;
  --color-theme-a: #5dc427;
  --color-theme-b: #1c4ba0;
  --color-theme-c: #1f9d9f;

  --shadow-white: 0.52cqw 0.52cqw 0.52cqw rgba(255, 255, 255, 0.75);

  --button-gradient: linear-gradient(0deg, #F77A00 0%, #ffe32b 100%);
  --button-shadow: 0.52cqw 0.52cqw 0.26cqw rgba(78, 96, 81, 0.75);

  --box-shadow: 0.26cqw 0.26cqw 0.26cqw rgb(17 124 106 / 75%);
  --box-radius: 1.54cqw;

  --radius-round: 100cqw;

  --font-arhei-medium: "ARHei Medium", sans-serif;
  --font-arhei-bold: "ARHei Bold", sans-serif;
  --font-arhei-extra-bold: "ARHei Extra Bold", sans-serif;
  --font-arhei-heavy: "ARHei Heavy", sans-serif;
  --font-helvetica-regular: "Helvetica Regular", sans-serif;
  --font-helvetica-bold: "Helvetica Bold", sans-serif;
}
img {
  padding: 0;
  margin: 0;
  width: auto;
  height: auto;
}
.page-content {
  aspect-ratio: 390/683;
  z-index: auto;
  padding-top: 22.22cqw;
  gap: 7cqw;
}
/* #region - BACKGROUND - */
.bg-layer {
  background: url(/resources/bg.webp) center bottom/cover;
  &::before {
    content: "";
    position: absolute;
    top: 6.1cqw;
    left: 50%;
    width: 29.49cqw;
    aspect-ratio: 345/129;
    transform: translateX(-50%);
    background: url(/resources/logo.webp) center/100%100%;
  }
}
/* #endregion */

/* #region - EVENT TITLE - */
.event-title {
  width: 80cqw;
  aspect-ratio: 936/506;
  position: relative;
  left: 0.9cqw;
  &>img {
    display: block;
    width: 100%;
    height: auto;
  }
  &::before {
    content: "";
    position: absolute;
    top: 8%;
    left: -6%;
    width: 60%;
    aspect-ratio: 559/297;
    mix-blend-mode: screen;
    background: url(/resources/home-title-light.webp) center/100%100%;
  }
}
/* #endregion */

/* #region - PANEL - */
.panel {
  position: relative;
  width: 81.8cqw;
  aspect-ratio: 957/1501;
  --glass-body: url(/resources/panel.webp);
  --glass-shadow: url(/resources/panel-shadow.webp);
  &::before, &::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
}
.panel::before {
  z-index: 0;
  background: var(--glass-shadow) center/100% 100% no-repeat;
  mix-blend-mode: screen;
}
.panel::after {
  z-index: 1;
  background: var(--glass-body) center / 100% 100% no-repeat;
  mix-blend-mode: multiply;
}
.panel .content {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}
/* #endregion */

/* #region - INFO BOX - */
.info-box {
  position: relative;
  color: #ffff;
  text-shadow: var(--box-shadow);
}
.info-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url(/resources/texture.webp) center top / 100% auto;
  border-radius: var(--box-radius);
  opacity: 0.7;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: -1;
}
.info-box__corner {
  position: absolute;
  width: 3.59cqw;
  height: 2.91cqw;
  background: url(/resources/corner.webp) center / 100% 100% no-repeat;
  pointer-events: none;
}
.info-box__corner--tl {
  top: 0;
  left: 0;
}
.info-box__corner--tr {
  top: 0;
  right: 0;
  transform: scaleX(-1);
}
.info-box__corner--bl {
  bottom: 0;
  left: 0;
  transform: scaleY(-1);
}
.info-box__corner--br {
  bottom: 0;
  right: 0;
  transform: scale(-1);
}
/* #endregion */

/* #region - FLOWER TITLE - */
.flower-title {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: 0.35cqw;
  &::before,
  &::after {
    content: "";
    width: var(--flower-width);
    aspect-ratio: 53/60;
    background: url(/resources/flower.webp) center / contain no-repeat;
  }
}
.flower-title--sm {
  gap: 1.54cqw;
  font-size: 4.1cqw;
  --flower-width: 3.59cqw;
}
.flower-title--lg {
  gap: 4.6cqw;
  font-size: 6.15cqw;
  --flower-width: 5.64cqw;
}
/* #endregion */

/* #region - SUBTITLE - */
.subtitle {
  background: url(/resources/subtitle.webp) center/cover no-repeat;
  aspect-ratio: 677/98;
  display: block;
  color: var(--color-primary);
  text-align: center;
  align-content: center;
}
.subtitle--sm {
  width: 43.6cqw;
  min-height: 6cqw;
  font-size: 3.34cqw;
}
.subtitle--lg {
  width: 57.7cqw;
  font-size: 4.10cqw;
}
/* #endregion */

/* #region - BUTTON - */
.btn {
  background: var(--button-gradient);
  border-radius: var(--radius-round);
  width: 50.26cqw;
  height: 9.75cqw;
  display: grid;
  place-items: center;
  .content {
    color: #ffff;
    font-family: var(--font-arhei-heavy);
    font-size: 5.13cqw;
    letter-spacing: 0.5rem;
    text-indent: 0.5rem;
    text-shadow: var(--button-shadow);
    text-align: center;
  }
}
.btn-back {
  background: url(/resources/btn-back.webp) center/cover no-repeat;
  width: 6.67cqw;
  height: auto;
  aspect-ratio: 78/98;
  border-radius: 0;
  align-self: flex-start;
}
/* #endregion */

/* #region - TEXT - */
.text--heavy {
  font-family: var(--font-arhei-heavy);
  line-height: 1.2;
  .en {
    font-family: var(--font-helvetica-bold);
  }
}
.text--extra-bold {
  font-family: var(--font-arhei-extra-bold);
  .en {
    font-family: var(--font-helvetica-bold);
  }
}
.text--bold {
  font-family: var(--font-arhei-bold);
  .en {
    font-family: var(--font-helvetica-bold);
  }
}
.text--body {
  font-size: 3.08cqw;
  letter-spacing: 0.05rem;
  font-family: var(--font-arhei-medium);
  .en {
    font-family: var(--font-helvetica-regular);
  }
}
/* #endregion */

/* #region - SPLASH - */
.splash .bg-layer {
  &::before {
    display: none;
  }
}
.splash .event-title {
  width: 55cqw;
  margin-bottom: 3cqw;
}
.sp__bar-bg {
  width: 80%;
  height: 1cqw;
  background: #ffff;
  border-radius: var(--radius-round);
  box-shadow: var(--shadow-white);
}
.sp__bar-fill {
  height: 1cqw;
  width: 0%;
  background: var(--color-primary);
  transition: width 0.08s linear;
  border-radius: var(--radius-round);
}
.sp__pct {
  font-family: var(--font-helvetica-bold);
  letter-spacing: 0.1rem;
  color: var(--color-primary);
  text-shadow: var(--shadow-white);
}
/* #endregion */

/* #region - P00_HOME - */
.home .bg-layer {
  background-image: url(/resources/home-bg.webp);
}
.home .page-content {
  aspect-ratio: 390/751;
  padding-top: 15cqw;
  gap: 0;
  z-index: auto;
}

.home-planets {
  width: 66.07cqw;
  margin-top: -4.1cqw;
  transform: translateX(2cqw);
}
.home .panel {
  margin-top: 14cqw;
  width: 87.09cqw;
  aspect-ratio: 1019/619;
  --glass-body: url(/resources/home-panel.webp);
  --glass-shadow: url(/resources/home-panel-shadow.webp);
  .content {
    padding: 4cqw 4cqw;
    &::before {
      content: "";
      position: absolute;
      inset: 0;
      background: rgba(255, 255, 255, 0.5);
      filter: blur(6.15cqw);
      border-radius: 2.6cqw;
      z-index: 0;
      pointer-events: none;
    }
  }
}
.home .text--extra-bold,
.home .text--body {
  position: relative;
  z-index: 1;
  color: var(--color-primary);
  text-align: center;
  text-shadow: 0.52cqw 0.52cqw 0.52cqw rgba(255, 255, 255, 0.75);
}
.home .text--extra-bold {
  margin: 0 0 1.6cqw;
  font-size: 4.87cqw;
  letter-spacing: 0.1rem;
  line-height: 1.2;
}
.home .text--body {
  margin: 1.7cqw 0 0;
  line-height: 1.42;
}
.home .btn {
  margin-top: 8cqw;
}
/* #endregion */

/* #region - P01_INTRO - */
.intro .panel>.content {
  padding: 5cqw 4cqw;
}
.intro .info-box {
  padding: 5.5cqw 2.5cqw;
  .text--extra-bold {
    font-size: 4.36cqw;
    line-height: 1;
    letter-spacing: 0.1rem;
    text-indent: 0.1rem;
  }
  .text--body {
    line-height: 1.3;
    margin-top: 2cqw;
  }
}
.intro .flower-title {
  margin: 3cqw 0 0;
}
.intro-steps {
  list-style: none;
  color: var(--color-primary);
  margin-top: 2cqw;
  .subtitle {
    margin: 0 auto 1cqw;
    letter-spacing: 0.1rem;
  }
  .text--body {
    line-height: 1.25;
  }
}
.intro-steps>li+li {
  margin-top: 1cqw;
}
/* #endregion */

/* #region - P02_POINT_CARD - */
.point-card__actions {
  display: flex;
  justify-content: center;
  width: 87.1cqw;
  max-width: 100%;
  gap: 3cqw;
}
.point-card__actions>.btn {
  flex: 1 1 0;
  min-width: 0;
  max-width: 50.26cqw;
  box-sizing: border-box;
}
.point-card__actions>.btn[hidden] {
  display: none;
}
.point-card .panel>.content {
  padding: 12cqw 4cqw;
  color: var(--color-primary);
}
.point-card__stamps {
  display: block;
  position: relative;
  grid-column: none;
  width: 70.68cqw;
  aspect-ratio: 827/466;
  background: url(/resources/map.webp) center/cover no-repeat;
  margin-top: 5.5cqw;
}
.stamp {
  position: absolute;
  width: auto;
  aspect-ratio: auto;
  padding: 0.77cqw 1.8cqw;
  border: none;
  border-radius: var(--radius-round);
  background: var(--color-gray);
  color: #ffff;
  font-size: 2.05cqw;
  letter-spacing: 0.03rem;
}
.stamp.is-collected {
  border: none;
  background: var(--stamp-active-color);
  color: #ffff;
}

.stamp.is-collecting {
  animation: jello-horizontal 1s both;
  transition:
    opacity 0.2s ease-out,
    background-color 0.2s ease-out;
  border: none;
  background: var(--stamp-active-color);
  color: #ffff;
}
.point-card .subtitle {
  margin-top: 8cqw;
  letter-spacing: 0.1rem;
}
.point-card .text--extra-bold {
  margin-top: 2cqw;
  line-height: 1.4;
  font-size: 3.33cqw;
  .note {
    font-size: 2.56cqw;
  }
}

/* #endregion */

/* #region - P02_STAMP - */
.s01 {
  top: 3.8cqw;
  left: 6.3cqw;
}
.s02 {
  top: 13.1cqw;
  left: 10.8cqw;
}
.s03 {
  bottom: 11.9cqw;
  left: 10.8cqw;
}
.s01, .s02, .s03 {
  --stamp-active-color: var(--color-theme-a);
}
.s04 {
  bottom: 6.7cqw;
  left: 6.3cqw;
}
.s05 {
  top: 3.8cqw;
  left: 26.5cqw;
}
.s06 {
  bottom: 6.7cqw;
  left: 21.4cqw;
}
.s04, .s05, .s06 {
  --stamp-active-color: var(--color-theme-b);
}
.s07 {
  bottom: 2.6cqw;
  left: 28.7cqw;
}
.s08 {
  bottom: 11.3cqw;
  right: 16.3cqw;
}
.s09 {
  bottom: 11.3cqw;
  right: 4.0cqw;
}
.s07, .s08, .s09 {
  --stamp-active-color: var(--color-theme-c);
}
/* #endregion */

/* #region - P03_REDEMPTION - */
.redemption .panel>.content {
  padding: 5.8cqw 5.2cqw;
}
.redemption .flower-title {
  margin-top: 7.3cqw;
  letter-spacing: 0.3rem;
  gap: 1cqw;
  --flower-shadow: 0 0 0.39cqw rgba(255, 255, 255, 0.75);
  text-shadow: var(--flower-shadow);
  --flower-width: 4.43cqw;
  &::before, &::after {
    filter: drop-shadow(var(--flower-shadow));
  }
}
.redemption-gift {
  width: 55.38cqw;
  margin-top: 5.8cqw;
}
.redemption .info-box {
  margin-top: 7cqw;
  width: 95%;
  aspect-ratio: 263/101;
  display: grid;
  place-items: center;
  font-size: 3.33cqw;
  line-height: 1.5;
  letter-spacing: 0.05rem;
  .heading {
    font-size: 5.9cqw;
    letter-spacing: 0.1rem;
    line-height: 1.3;
  }
  .note {
    font-size: 2.56cqw;
    line-height: 1.5;
  }
}
.btn-redemption {
  position: relative;
  &::after {
    content: "";
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0) rotateZ(-20deg);
    width: 30cqw;
    aspect-ratio: 246/95;
    background: url(/resources/redeemed.webp) center /contain;
  }
}
.btn-redemption.is-redeemed {
  filter: grayscale(1);
  pointer-events: none;
  &::after {
    display: block;
  }
}
/* #endregion */

/* #region - REDEMPTION ANIMATION - */
.redemption .page-content {
  --redemption-opacity: 1;
}
.redemption .page-content.is-redemption-faded {
  --redemption-opacity: 0;
}
/* 個別淡出繪製圖層，避免外層 opacity 隔離面板與背景的混色 */
.redemption .panel::before,
.redemption .panel::after,
.redemption .panel>.content> :not(.info-box),
.redemption .info-box>*,
.redemption .page-content>.btn {
  opacity: var(--redemption-opacity);
  transition: opacity 200ms ease;
}
.redemption .info-box::before {
  opacity: calc(0.7 * var(--redemption-opacity));
  transition: opacity 200ms ease;
}
.redemption .btn {
  transition: all 100ms ease, opacity 200ms ease;
}
.redemption .page-content.is-redemption-transitioning {
  pointer-events: none;
}
.btn-redemption.is-redemption-pending::after {
  visibility: hidden;
}
.btn-redemption.is-redeeming::after {
  animation: redemption-stamp 450ms ease-out both;
}
@keyframes redemption-stamp {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) rotateZ(-20deg) scale(1.6);
  }
  70% {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0) rotateZ(-20deg) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0) rotateZ(-20deg) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .redemption .panel::before,
  .redemption .panel::after,
  .redemption .panel>.content> :not(.info-box),
  .redemption .info-box::before,
  .redemption .info-box>*,
  .redemption .page-content>.btn {
    transition: none;
  }
  .btn-redemption.is-redeeming::after {
    animation: none;
  }
}
/* #endregion */

/* #region - P04_SCANNER - */
.scanner .panel {
  --glass-body: url(/resources/panel--fade.webp);
  .content {
    padding: 5.8cqw 5.2cqw;
    color: #ffff;
    gap: 7cqw;
    .text--heavy {
      letter-spacing: 0.05rem;
    }
    .text--body {
      color: #ffff;
    }
  }
}
.scanner .btn-back {
  background-image: url(/resources/btn-back--white.webp);
}
.scanner .info-box {
  width: 59cqw;
  aspect-ratio: 230/258;
  padding: 2.5cqw;
  background: transparent;
  &::before {
    inset: unset;
    background: url(/resources/camera.webp) center top / contain no-repeat;
    border-radius: 0;
    opacity: 1;
    mix-blend-mode: normal;
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);
    width: 16.15cqw;
    aspect-ratio: 63/48;
  }
  .scanner__video {
    border-radius: var(--box-radius);
  }
}
/* #endregion */