:root {
  --base-font-size: 12px;
  font-size: var(--base-font-size) !important;
  --webkit-scrollbar-display: block;
  --colour1: #3e4bde;
  --colour2: #626ef1;
  --speed: 20s;
  --patternRepeatWidth: 975;
  --stripeWidth: calc(var(--patternRepeatWidth) * 0.035px);
  --fundamentalBase: calc(1px * sqrt(2 * pow(var(--patternRepeatWidth), 2)));
}

@font-face {
  font-family: 'Luckiest Guy';
/*  src: url(./luckiestGuy.ttf);*/
  src: url(./luckiestGuy.woff2) format('woff2'),
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  color: #fff;
  /* transition: all 0.15s ease; */
}

.game_shell {
  display: flex;
  height: 100%;
  width: 100%;
  position: relative;
  align-items: center;
  justify-content: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}

.landing-page {
  height: 100%;
  width: 100%;
  background-color: black;
}

#logo-container {
  position: relative;
  height: auto;
  width: 70%;
  align-items: center;
  border-radius: 0.1em;
  overflow: hidden;
  padding-bottom: 2em;
}

#landing-container {
  /* background-color: black; */
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  margin: auto;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  /* background-color: blue; */
}

#logo-img {
  height: 15em;
  width: 100%;
  position: relative;
  background-image: url('logo.webp');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  display: flex;
  margin-bottom: 2em;
}

#unity-loading-bar {
  position: absolute;
  height: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#bar-empty {
  background-color: #252323;
  width: 33em;
  height: 0.4em;
  border-radius: 0.2em;
}

#bar-full {
  background-color: #ec8e21;
  width: 50%;
  height: 0.4em;
  position: relative;
  -webkit-box-shadow: 0 0 20px #ec8e21;
  -moz-box-shadow: 0 0 20px #ec8e21;
  box-shadow: 0 0 10px #ec8e21;
  border-radius: 0.2em;
}

#prompt-holder {
  background-color: rgba(0, 0, 0, 0.8);
  position: absolute;
  z-index: 12;
  width: 100%;
  height: 100%;
}

#prompt-container {
  position: relative;
  z-index: 16;
  box-shadow: none;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#content-box {
  border-radius: 8%;
  background-color: rgb(35 33 46 / 70%);
}

#content-holder {
  padding: 20px;
 /* Adds space inside the content-holder */
  margin: 0 10px;
 /* Optional: adds space outside content-holder, adjust as needed */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#content-img {
  position: absolute;
  align-content: center;
  height: 35%;
  top: 33%;
  left: 30%;
  width: 100%;
  transform: translateX(-31%);
}

.screen_compat {
  position: relative;
  font-size: 12px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  /* background-image: url('./phase2.png'); */
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  filter: drop-shadow(0.02em 0.02em 0.1em rgba(0, 0, 0, 0.5));
  z-index: 1;
  /* background-image: url(mask.png); */
}

.screen_safe_area {
  /* background-color: blue; */
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0px;
  width: 0px;
  margin: auto;
}

#prompt-title {
  font-family: msgboxTitleFont;
  justify-content: center;
  display: flex;
  position: sticky;
  color: #ffffff;
  font-size: calc(2.6vw + 2.6vh);
  margin-top: 3%;
  text-shadow: 2px 2px 2px #000000;
  text-align: center;
}

#prompt-msg {
  font-family: msgboxMsgFont;
  justify-content: center;
  position: sticky;
  display: flex;
  color: #ffffff;
  font-size: calc(1.50vw + 1.50vh);
  margin-top: 11%;
  margin-bottom: 5%;
  text-shadow: 2px 2px 2px #000000;
  text-align: center;
  width: 20em;
  white-space: pre-wrap;
}

#prompt-code {
  font-family: msgboxMsgFont;
  justify-content: center;
  display: flex;
  position: sticky;
  color: #ffffff;
  font-size: calc(1.10vw + 1.10vh);
  margin-top: 3%;
  text-shadow: 2px 2px 2px #000000;
  text-align: center;
}

#error-btn {
  width: 30%;
  height: 4em;
  background-color: #FFC824;
  margin-left: auto;
  margin-right: auto;
  border-color: #ffffff;
  border-radius: 1.1em;
  align-items: center;
  text-align: center;
/* display: flex; */
  overflow: hidden;
  margin: 1em
}

.game-canvas {
  position: fixed;
  height: 100%;
  width: 100%;
  background-image: url(mask.webp);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

#unity-canvas {
  display: flex;
  height: 100%;
  width: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  position: absolute;
}

.fade-out {
  opacity: 1;
  transition: opacity 1s ease-in-out;
}

@font-face {
  font-family: defaultFont;
/*  src: url(LiberationSans.ttf);*/
font-display: swap;
}

@font-face {
  font-family: msgboxTitleFont;
/*  src: url(Font/font_title_msgbox.ttf);*/
  src: url(Font/font_title_msgbox.woff2) format('woff2'),
  url('Font/font_title_msgbox.woff') format('woff'),
url('Font/font_title_msgbox.ttf') format('truetype'); 

  font-display: swap;
}

@font-face {
  font-family: msgboxMsgFont;
/*  src: url(Font/font_msg_msgbox.ttf);*/
  src: url(Font/font_msg_msgbox.woff2) format('woff2'),
  url('Font/font_msg_msgbox.woff') format('woff'),
  url('Font/font_msg_msgbox.ttf') format('truetype'); 
  font-display: swap;
}

.check-landscape {
  background-color: black;
  z-index: 100;
  height: 100%;
  width: 100%;
  position: absolute;
  display: none;
  top: 0;
  opacity: 0.95;
}

.active-landscape {
  /* background-color: black; */
  background-image: url(mask.webp);
  background-size: cover;
  color: #000;
  z-index: 100;
  height: 100%;
  width: 100%;
  position: absolute;
  opacity: 1;
}

.rotate-img {
  display: block;
  width: 20em;
  height: 20em;
  transform: translate(0%, 0%);
}

.rotate-items {
  display: flex;
  height: 100vh;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.rotate-text {
  color: white;
  text-align: center;
  font-size: 2em;
  padding-left: 15%;
  padding-right: 15%;
  margin-top: 5%;
  z-index: 1;
}

@media screen and (orientation: portrait) {
  .active-landscape {
    display: block;
  }
}

@media screen and (orientation: landscape) {
  .active-landscape {
    display: block;
  }
}

/*INTRO PANEL*/

#intro-panel {
  width: 100%;
  height: 100%;
  display: flex;
  background-color: black;
  position: absolute;
  z-index: 100;
}

.connecting-view {
  width: 100%;
  height: 10em;
  /*    background-color: #104270;*/
  position: absolute;
  top: 5em;
}

#text {
  font-size: 2em;
  display: flex;
  position: relative;
  left: 4%;
}

#hr-intro {
  width: 95%;
  margin: auto;
  top: 0.5em;
  display: flex;
  position: relative;
}

#version-container {
  height: auto;
  width: auto;
  position: fixed;
  bottom: 0;
  right: 0;
  padding-right: 0.5em;
  padding-bottom: 0.5em;
  z-index: 100;
  font-size: 1vw;
}

#version-container span {
  align-items: center;
  display: flex;
  text-align: center;
  font-family: defaultFont;
  color: #fff;
}

/* New Loading screen implementation */

body {
  background: rgb(32, 32, 32);
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  overflow: hidden;
  /* .game_shell {
    background: none;
    display: flex;
    height: 100%;
    width: 100%;
    position: fixed;
    align-items: center;
    justify-content: center;
    background-image: url('mask1.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
  } */
}

.wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  z-index: 10;
}

#pinLoader {
  position: absolute;
  right: -10px;
  z-index: 10;
  top: -8px;
  height: 1.2rem;
  width: 0.6rem;
}

@keyframes slide {
  from {
    background-position-x: 0;
  }

  to {
    background-position-x: var(--fundamentalBase);
  }
}

.bubble {
  position: absolute;
  left: 0;
  top: -2.6rem;
  width: 100px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
}

.bubble img {
  width: 35px;
  position: absolute;
}

.bubble .percentage {
  color: rgb(103, 48, 213);
  position: relative;
  transform: translateY(-10%);
  font-family: msgboxTitleFont;
  font-size: 1.1rem;
}

.loadingWrapper {
  width: 100%;
  height: 1.1rem;
  background: linear-gradient(180deg, rgb(249, 195, 13), rgb(246, 136, 10));
  border-radius: 50rem;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.loadingWrapper .loadingBg {
  background: linear-gradient(180deg, rgb(30, 15, 59), rgb(45, 17, 81));
  position: relative;
  width: calc(100% - 4px);
  height: calc(100% - 2px);
  border-radius: 50rem;
  overflow: hidden;
}

.loadingWrapper .loadingBg .container {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loadingWrapper .loadingBg .container .bar {
  min-height: 100%;
  border-radius: 10px;
  width: 100%;
  box-shadow: 0px 10px 13px -6px rgba(44, 62, 80, 1);
  background-color: var(--colour2);
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.5),
      rgba(255, 255, 255, 0)
    ),
    repeating-linear-gradient(
      135deg,
      transparent,
      transparent calc(var(--stripeWidth) / 4),
      var(--colour1) calc(var(--stripeWidth) / 4),
      var(--colour1) calc(var(--stripeWidth) / 2)
    );
  background-image: -webkit-linear-gradient(
      rgba(255, 255, 255, 0.5),
      rgba(255, 255, 255, 0)
    ),
    -webkit-repeating-linear-gradient(135deg, transparent, transparent
          calc(var(--stripeWidth) / 4), var(--colour1)
          calc(var(--stripeWidth) / 4), var(--colour1)
          calc(var(--stripeWidth) / 2));
}

.footer {
  position: absolute;
  left: 50%;
  /* width: 100%; */
  width: 58%;
  transform: translateX(-50%);
  bottom: 5vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
}

#startOrDownloading {
  margin-top: 1rem;
  width: 22rem;
  display: none;
  /* 下载完成按钮*/
}

#downloadingText {
  width: 100%;
  font-size: medium;
  font-family: msgboxMsgFont;
  color: #ffffff;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: left;
}

#downloadProgress {
  position: relative;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: left;
}

#downloadProgress #downloadedValue {
  text-align: right;
  white-space: nowrap;
}

#downloadProgress #downloadTotal {
  white-space: nowrap;
}

.startGameBtn {
  margin-bottom: 10px;
  width: 12rem !important;
}

.loadingScreen {
  display: grid;
  place-content: center;
  width: 100%;
  height: 100%;
  padding-block: 5rem;
  position: relative;
  justify-items: center;
  background-color: #202020;
}

.reelRiches {
  width: 20.2rem;
  height: 10.2rem;
  margin-bottom: 3rem;
}

@media screen and (orientation: portrait) {
  #loadingScreen {
    transform: rotate(90deg);
    transform-origin: top right;
    position: absolute;
    top: 100%;
    right: 0;
    height: 100vw;
    width: 100vh;
    height: 100dvw;
    width: 100dvh;
  }

  .reelRiches {
    margin-bottom: 5rem;
  }

  .startGameBtn {
    margin-bottom: 3px !important;
  }

  .screen_compat {
    transform: rotate(90deg);
  }
}

#overlay {
  width: 100%;
  height: 100%;
  display: block;
  background-color: #202020;
  position: absolute;
  z-index: 100;
  top: 0;
  left: 0;
}
  /* Loading animation styles */
       
#loading-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
 /* Dark background to contrast */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
 /* Ensure it is at the top layer */
  color: white;
  font-size: 24px;
  font-family: Arial, sans-serif;
  opacity: 1;
  visibility: visible;
  transition: opacity 1s ease-out, visibility 1s ease-out;
 /* Apply transition for opacity and visibility */
}
        /* Hide the loading screen */
.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
}
        /* Simple animation (a spinner) */
.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #ffffff;
 /* White color for visibility */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
   /* Keep existing styles and add sway animation */
        
@keyframes sway {
  0% {
    transform: rotate(0deg);
 /* Start at the default position */
  }

  25% {
    transform: rotate(-30deg);
 /* Move left with a bigger angle */
  }

  50% {
    transform: rotate(0deg);
 /* Return to default */
  }

  75% {
    transform: rotate(30deg);
 /* Move right with a bigger angle */
  }

  100% {
    transform: rotate(0deg);
 /* Return to default */
  }
}

/* Apply sway animation to #pinLoader with faster speed */
#pinLoader {
  animation: sway 0.5s ease-in-out infinite;
 /* Apply the sway animation with faster speed */
  transform-origin: bottom center;
 /* Set the bottom center as the rotation origin */
}
/* 初始缩放动画 */
@keyframes scaleAnim {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1.0);
  }
}

/* 呼吸动画，使用更加平滑的动画，并增加更长的持续时间 */
@keyframes breatheAnim {
  0% {
    transform: scale(0.95);
  }
  25% {
    transform: scale(1.05);
  }
  50% {
    transform: scale(1.0);
  }
  75% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(0.95);
  }
}

.scaleAnimation {
  animation: scaleAnim 0.6s ease-in-out;
}

.breatheAnimation {
  animation: breatheAnim 3s ease-in-out infinite; /* 更长的时间，使用平滑的ease-in-out */
  will-change: transform; /* 提示浏览器优化transform属性 */
}


/* NOT SUPPORTED UI */
#not-supported{
  background-color: white;
  display: block;
  height: 100%;
  width: 100%;
  position: absolute;
  z-index: 30;
  align-items: center;
  justify-content: center;
  display: flex;
  opacity: 1;
}

@media (orientation: landscape) {
  #not-supported {
    rotate: -90deg;
    height: 100vw;
    width: 100vh;
  }
}

/* #top-logo{
  width: 30%;
  display: block;
  margin: auto;
  position: absolute;
  top: 2vh;
  left: 2vh;

}
#top-text{
  display: block;
  margin: auto;
  position: absolute;
  top: 6vh;
  right: 2vh;
  color: black;
  font-size: small;
} */

#top-side{
  height: 20%;
  width: 100%;
  
}

#top-bar {
  position: absolute;
  top: 2vh;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2vh;
  pointer-events: none; /* Optional: prevents interaction if overlaying canvas */
  height: auto;
}

#top-logo {
  width: clamp(40%, 12vw, 150px);
  height: auto;
}

#top-text {
  color: black;
  font-size: small;
  margin: 0;
}

#center-panel{
  /* background-color: red; */
  /* margin-top: 2vh; */
  text-align: center;
  pointer-events: auto; /* Allow interaction if needed */
  /* padding-top: 5%; */
  height: auto;
}

#message-center {
  width: 80%;
  margin: 5vh auto;
  color: black;
  font-size: large;
}

.greeting {
  text-align: left;
 width: 100%;
 display: flex;
 color: black;
}

.body-text {
  text-align: left;
   width: 100%;
 display: flex;
 color: black;
}

#bottom-text{
  /* background-color: green; */
  height: 20%;
  width: 80%;
  font-size: small;
  display: flex;
  margin:auto;
  
}
