/*
 * Custom CSS
 */

:root {
  --bs-body-bg: linear-gradient(to bottom, var(--darkpink), var(--navy));
  --darkpink: #cd3681;
  --navy: #008fc5;
  --purple: #52247f;
  --white: #ffffff;
  --lightpink: #f3d5e5;
  --ruby: #ed1d6b;
  --orange: #f9a01b;

  --font-main: "Noto Sans", sans-serif;
  user-select: none; /* Standard */
  -webkit-user-select: none; /* Chrome, Safari, Opera */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
}

.hud,
.toolbar {
  display: none !important;
}

#toggleControlBtn {
  position: absolute;
  left: 185%;

  width: 200px;
  overflow-wrap: anywhere; /* break super-long tokens if needed */

  font-size: 26px;
}

body {
  font-family: var(--font-main);
  font-weight: bold;

  background: var(--bs-body-bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  overflow: hidden;
  touch-action: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../img/small-square-layer.png") no-repeat center top;
  background-size: cover;
  opacity: 0.2;
  z-index: -1;
}

.curve_one {
  width: 1.25rem;
  height: 1.25rem;
  content: "";
  position: absolute;

  background: transparent;
  top: 0;
  left: -1.25rem;
  border-top-right-radius: 1rem;
  box-shadow: 0.375rem -0.375rem white;
}

.curve_two {
  width: 1.25rem;
  height: 1.25rem;
  content: "";
  position: absolute;

  background: transparent;
  top: 0;
  right: -1.25rem;
  border-top-left-radius: 1rem;
  box-shadow: -0.375rem -0.375rem white;
}

.logo-wrapper {
  position: relative;
  text-align: center;
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  background-color: white;
  width: 20%;
  border-radius: 0 0 10% 10%;
}

.language-text p {
  font-size: 30px;
  color: var(--purple);
  margin: 0px;
}

.beginMission {
  margin-top: 50px;
}

.btn-primary {
  padding: 35px 0;
  width: 520px;

  color: var(--purple);
  font-size: 30px;
  font-weight: bold;

  border: none;
  border-radius: 60px;

  background: linear-gradient(to bottom, var(--white), var(--lightpink));
  transition: all 0.15s ease;
}

.btn-secondary {
  width: 185px;
  padding: 7.5px 0;

  color: var(--purple);
  font-size: 30px;
  font-weight: bold;

  border: none;
  border-radius: 50px;

  background: linear-gradient(to bottom, var(--white), var(--lightpink));
  transition: all 0.15s ease;

  z-index: 1;
}

.btn-primary:hover,
.btn-secondary:hover {
  color: white;
  cursor: pointer;
  background: linear-gradient(to bottom, var(--ruby), var(--purple));
}

.btn-primary:active,
.btn-secondary:active {
  transform: translateY(3px);
  box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.2);
  background: linear-gradient(to bottom, var(--purple), var(--ruby));
}

.left:hover img {
  content: url("../img/next-arrow-left.png");
}

.right:hover img {
  content: url("../img/next-arrow-right.png");
}

.language-btn {
  white-space: nowrap;
  width: 100%;
  max-width: 225px;
  padding: 35px 225px;

  color: var(--purple);
  font-size: 30px;
  font-weight: bold;

  border: none;
  border-radius: 50px;

  background: linear-gradient(to bottom, var(--white), var(--lightpink));
}

.emotion-text {
  font-size: 34px !important;
  font-weight: 800;
  color: var(--purple);
  line-height: 30px;
}

.intro-text {
  font-size: 32px;
  color: var(--purple);

  line-height: 40px;
  max-width: 75%;
}

.intro-text2 {
  font-size: 28px;
  color: var(--purple);
}

.custom-line-height {
  margin-top: -10px;
  line-height: 36px;
}

.frame-text {
  font-size: 28px;
  color: var(--purple);

  line-height: 36px;
}

.cat-frame {
  background: url("../img/cat_frame.png") no-repeat center top;
  background-size: center; /* scale proportionally */
  width: 100%;
  height: 100vh;
}

.cat-frame2 {
  width: 100%;
  height: 1957px;
  background-image: url("../img/cat_frame2.png");
  background-size: cover; /* scale proportionally */
  background-repeat: no-repeat;
}

.cat-frame3 {
  width: 100%;
  height: 1857px;
  background-image: url("../img/cat_frame2.png");
  background-size: cover; /* scale proportionally */
  background-repeat: no-repeat;
}

.cat-frame4 {
  width: 100%;
  height: 1857px;
  background-image: url("../img/cat_frame2.png");
  background-size: cover; /* scale proportionally */
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}

.cat-frame5 {
  width: 894px;
  height: calc(1622px - 1px);
  background-image: url("../img/cat_frame3.png");
  background-size: cover; /* scale proportionally */
  background-repeat: no-repeat;
  position: relative;
}

.cat-frame6 {
  margin-top: 150px;
  background: url("../img/cat_frame4.png") no-repeat center top;
  width: 100%;
  height: 100vh;
}

.online-mission {
  margin-top: 400px;
}

.home-btn {
  position: absolute;
  top: 97%;
  width: 475px;
}

.hud-timer {
  position: absolute;
  top: 150px;
  left: 10px;
  text-align: center;
}

.hud-timer img {
  position: relative;
  z-index: 3;
}

.hud-score {
  position: absolute;
  top: 150px;
  right: 10px;
  text-align: center;
}

.hud-score img {
  position: relative;
  z-index: 3;
}

.hud-value {
  display: block;
  font-size: 70px !important;
}

.hud-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.hud-bubble {
  position: absolute;
  top: 120%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 100px;
  width: 350px;
  height: 126px;
  padding-top: 1rem;
  background-color: white;
  z-index: 1;
}

.gamePage .cat-frame {
  position: relative;
}

/* Canvas above arrows */
#gameCanvas {
  position: relative;
  z-index: 2;
  display: block;
}

.hud-arrow {
  position: absolute; /* relative to .gameWrap (nearest positioned ancestor) */
  left: 50%;
  bottom: 32%; /* tweak for your layout */
  transform: translateX(-50%);
  z-index: 1; /* below the canvas */
  display: flex;
  align-items: center;
  gap: 53rem;
}

.gameplay-left {
  opacity: 0.7;
}

.gameplay-right {
  opacity: 0.5;
}

.rectangle-frame {
  max-width: 745px; /* match your PNG */
  margin: 0 auto;
  height: 800px;
  background: url(../img/rectangle_frame.png) center / 100% 100% no-repeat;
  padding: 1.5rem 2rem; /* ensures rows sit inside the border */
  box-sizing: border-box;
  position: relative;
}

.red-bubble {
  position: relative; /* parent is positioning context */
  display: inline-block; /* shrink-wrap to the bubble */
  top: -13%;
}

.page2 .english-container {
  margin-top: -6rem !important;
}

.page3 .english-container {
  margin-top: -5rem !important;
}

.star-scoring {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hero-wrapper {
  position: relative; /* allows child absolute positioning */
  display: inline-block; /* shrink-wrap to cat image */
}

.speech-bubble {
  position: absolute;
  top: -5%; /* adjust vertical placement */
  right: -50%; /* adjust horizontal placement */
}

.speech-bubble2 {
  position: absolute;
  top: -25%; /* adjust vertical placement */
  right: -70%; /* adjust horizontal placement */
}

.frame-content {
  flex: 1; /* take remaining height inside frame */
  display: flex;
  align-items: center; /* vertical center if you want */
  justify-content: center; /* horizontal center */
  width: 100%;
}

.frame-content2 {
  width: 100%;
  height: 100%;
  padding: 1.5rem 2rem; /* space from rectangle border */
  display: block; /* let Bootstrap rows behave normally */
  box-sizing: border-box; /* padding doesn’t break width */
}

[data-language="digital-hero"],
[data-language="cyber-explorer"],
[data-language="aspiring-learner"] {
  font-weight: 900;
}

[data-language="digital-hero"],
[data-language="tip-scoring"],
[data-language="cyber-explorer"],
[data-language="aspiring-learner"] {
  font-size: 32px;
  color: var(--purple);
  line-height: 40px;
}

/* When viewport height is less than 1920px */
@media (min-height: 1919px) {
  .cat-frame3 {
    background-position: center;
    height: 100vh;
  }

  .cat-frame4 {
    background-position: center;
    height: 100vh;
  }
}

.mission-text {
  color: var(--purple);
  font-size: 32px;
  max-width: 45%;
}

.greetings {
  font-size: 68px;
  font-weight: 900;

  color: white;

  text-shadow:
    -2px -2px 10px #52247f,
    2px -2px 10px #52247f,
    -2px 2px 10px #52247f,
    2px 2px 10px #52247f,
    0 -2px 10px #52247f,
    0 2px 10px #52247f,
    -2px 0 10px #52247f,
    -2px -2px 10px #52247f,
    2px -2px 10px #52247f,
    -2px 2px 10px #52247f,
    2px 2px 10px #52247f,
    0 -2px 10px #52247f,
    0 2px 10px #52247f,
    -2px 0 10px #52247f,
    2px 0 10px #52247f;
}

#score-svg {
  display: block; /* so margin works properly */
  margin-right: -90px;
  max-width: 400px; /* keep it responsive */
  height: auto;
}

.cat-icon {
  display: block;
  margin: 0 auto;
}

.stage {
  width: 800px;
}

.start-50 {
  left: 50%;
  transform: translateX(-50%);
}

.basket {
  margin-top: -200px;
  opacity: 0;
  animation: slidePhase 4s ease-in-out infinite;
}

@keyframes slidePhase {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateX(0);
  }
  40% {
    opacity: 1;
    transform: translateX(-50%) translateX(var(--dx));
  }
  50% {
    opacity: 0;
    transform: translateX(-50%) translateX(var(--dx));
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateX(var(--dx));
  }
}

/* Directions & delays */
.basket-left {
  --dx: -20px;
  animation-delay: 0s;
}
.basket-right {
  --dx: 20px;
  animation-delay: 2s;
}

/* Arrow row uses Bootstrap flex; we just size & space it */
.arrow-container {
  height: 850px;
  width: 75%;
  margin-top: 295px; /* push below stage midpoint */
  padding: 0 8px;
  gap: 100px;
}

/* arrows default look */
.arrow {
  width: 100px;
  height: auto;
}

/* Left arrow runs for the first 4s */
.arrow-left {
  animation: leftArrowPhase 4s infinite; /* whole cycle is 8s */
}

/* Right arrow takes its turn in the second 4s */
.arrow-right {
  animation: rightArrowPhase 4s infinite;
}

/* Left hand visible during first 4s */
.hand-left {
  animation:
    handTap 4s infinite ease-in-out,
    handShowLeft 4s infinite linear;
}

/* Right hand visible during next 4s */
.hand-right {
  animation:
    handTap 4s infinite ease-in-out 2s,
    handShowRight 4s infinite linear;
}

@keyframes handTap {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  10% {
    transform: translateY(8px) scale(0.95); /* tap down */
  }
  40% {
    transform: translateY(0) scale(1);
  }
}

/* Visibility keyframes */
@keyframes handShowLeft {
  0%,
  49.9% {
    opacity: 1;
  } /* visible */
  50%,
  100% {
    opacity: 0;
  } /* hidden */
}

@keyframes handShowRight {
  0%,
  49.9% {
    opacity: 0;
  } /* hidden */
  50%,
  100% {
    opacity: 1;
  } /* visible */
}

.arrow-rectangle {
  position: absolute;
  left: -55%;
  width: 100%;
  height: 900px;
  background-image: url(../img/arrow_rectangle.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  margin-top: -280px;
}

.arrow-rectangle2 {
  position: absolute;
  right: -55%;
  width: 100%;
  height: 900px;
  background-image: url(../img/arrow_rectangle2.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  margin-top: -280px;
}

@keyframes leftArrowPhase {
  /* First 4s: active image */
  0%,
  49.9% {
    content: url("../img/left-arrow-active.png");
  }
  /* Next 4s: back to normal */
  50%,
  100% {
    content: url("../img/left-arrow.png");
  }
}

@keyframes rightArrowPhase {
  /* First 4s: normal */
  0%,
  49.9% {
    content: url("../img/right-arrow.png");
  }
  /* Next 4s: active image */
  50%,
  100% {
    content: url("../img/right-arrow-active.png");
  }
}

@media (min-height: 768px) {
  .mt-h-md-5 {
    margin-top: 3rem !important;
  }
  .mt-h-md-6 {
    margin-top: 5rem !important;
  }
  .mt-h-md-7 {
    margin-top: 7rem !important;
  }
  .mt-h-md-8 {
    margin-top: 9rem !important;
  }
  .mt-h-md-9 {
    margin-top: 12rem !important;
  }
  .mt-h-md-10 {
    margin-top: 15rem !important;
  }
}

@media (min-height: 1920px) {
  .mt-h-lg-5 {
    margin-top: 3rem !important;
  }
  .mt-h-lg-6 {
    margin-top: 5rem !important;
  }
  .mt-h-lg-7 {
    margin-top: 7rem !important;
  }
  .mt-h-lg-8 {
    margin-top: 9rem !important;
  }
  .mt-h-lg-9 {
    margin-top: 11rem !important;
  }
  .mt-h-lg-10 {
    margin-top: 15rem !important;
  }
}

.gap-6 {
  gap: 5rem !important;
}
.gap-7 {
  gap: 10rem !important;
}
.p-6 {
  padding: 5rem !important;
}
.p-7 {
  padding: 7rem !important;
}
.p-8 {
  padding: 9rem !important;
}
.p-9 {
  padding: 12rem !important;
}
.px-6 {
  padding-right: 5rem !important;
  padding-left: 5rem !important;
}
.px-7 {
  padding-right: 7rem !important;
  padding-left: 7rem !important;
}
.px-8 {
  padding-right: 9rem !important;
  padding-left: 9rem !important;
}
.px-9 {
  padding-right: 12rem !important;
  padding-left: 12rem !important;
}
.px-10 {
  padding-right: 15rem !important;
  padding-left: 15rem !important;
}
.px-11 {
  padding-right: 18rem !important;
  padding-left: 18rem !important;
}
.px-12 {
  padding-right: 21rem !important;
  padding-left: 21rem !important;
}
.w-10 {
  width: 10% !important;
}
.w-15 {
  width: 15% !important;
}

.w-30 {
  width: 28% !important;
}

.w-35 {
  width: 35% !important;
}

.w-40 {
  width: 40% !important;
}

.w-45 {
  width: 45% !important;
}

.w-60 {
  width: 60% !important;
}
.mt-6 {
  margin-top: 5rem !important;
}
.mt-7 {
  margin-top: 7rem !important;
}
.mt-8 {
  margin-top: 9rem !important;
}
.mt-9 {
  margin-top: 12rem !important;
}
.mt-10 {
  margin-top: 15rem !important;
}
.mt-11 {
  margin-top: 18rem !important;
}
.mb-6 {
  margin-bottom: 5rem !important;
}
.mb-7 {
  margin-bottom: 7rem !important;
}
.mb-8 {
  margin-bottom: 9rem !important;
}
.mb-9 {
  margin-bottom: 12rem !important;
}
.mb-10 {
  margin-bottom: 15rem !important;
}
.mb-11 {
  margin-bottom: 18rem !important;
}
.mt-n1 {
  margin-top: -0.25rem !important;
}
.mt-n2 {
  margin-top: -0.5rem !important;
}
.mt-n3 {
  margin-top: -1rem !important;
}
.mt-n4 {
  margin-top: -1.5rem !important;
}
.mt-n5 {
  margin-top: -3rem !important;
}
.mt-n6 {
  margin-top: -5rem !important;
}
.mt-n7 {
  margin-top: -7rem !important;
}
.mt-n8 {
  margin-top: -9rem !important;
}
.mt-n9 {
  margin-top: -12rem !important;
}
.mt-n10 {
  margin-top: -15rem !important;
}
.mt-n11 {
  margin-top: -18rem !important;
}
.mt-n12 {
  margin-top: -21rem !important;
}
.mt-n13 {
  margin-top: -24rem !important;
}
.mt-n14 {
  margin-top: -27rem !important;
}
.mt-n15 {
  margin-top: -30rem !important;
}
.mt-n16 {
  margin-top: -33rem !important;
}
.mx-6 {
  margin-left: 5rem !important;
  margin-right: 5rem !important;
}
.mx-7 {
  margin-left: 7rem !important;
  margin-right: 7rem !important;
}
.mx-8 {
  margin-left: 9rem !important;
  margin-right: 9rem !important;
}
.mx-9 {
  margin-left: 12rem !important;
  margin-right: 12rem !important;
}
.mx-10 {
  margin-left: 15rem !important;
  margin-right: 15rem !important;
}
.me-6 {
  margin-right: 5rem !important;
}
.me-7 {
  margin-right: 7rem !important;
}
.me-8 {
  margin-right: 9rem !important;
}
.me-9 {
  margin-right: 12rem !important;
}
.me-10 {
  margin-right: 15rem !important;
}

.row.gx-tight {
  --bs-gutter-x: -30rem; /* or any px/rem value */
}

html[lang="cn"] {
  [data-language="actively"],
  [data-language="discovering"] {
    margin-bottom: 50px;
  }

  .page2 .rectangle-frame {
    height: 750px;
  }

  .chinese-container {
    margin-top: -5rem !important;
  }
}

/* Malay (ml) */
html[lang="ml"] {
  .btn-secondary {
    width: 300px;
  }

  [data-language="actively"],
  [data-language="discovering"] {
    max-width: 75%;
    margin: 0 auto;
  }

  .malay-gap {
    gap: 0 !important;
  }

  .page2 .malay-container {
    margin-top: -5rem !important;
  }

  .page3 .malay-container {
    margin-top: -6rem !important;
  }

  [data-language="praise-message"] {
    font-size: 66px;
  }

  .page3 .frame-text {
    font-size: 28px;
    line-height: 30px;
  }
}

/* Tamil (tm) */
html[lang="tm"] {
  .bitty-cat {
    width: 30% !important;
  }

  .col-tm {
    flex: 0 0 auto;
    width: 50%;
  }

  .mission-text {
    max-width: 75%;
  }

  .btn-secondary {
    width: 300px;
  }

  .intro-text {
    font-size: 30px;
  }

  .intro-text2 {
    font-size: 26px;
  }

  .intro-text.mt-6 {
    margin-top: 3rem !important;
  }

  .emotion-text {
    font-size: 30px !important;
  }

  .btn[data-language="start"] {
    margin-top: 0rem !important;
  }

  .speech-bubble2 {
    top: -20%;
  }

  .tamil-container2 {
    margin-right: 1.5rem !important;
  }

  .text-height {
    height: 175px;
  }

  .tamil-container3 {
    margin-right: 50px !important;
  }

  .tamil-gap {
    gap: 0 !important;
  }

  .tamil-rookie-netizen {
    margin-right: 8rem !important;
  }

  .home-btn {
    width: 575px;
  }

  .tm-frame-text {
    line-height: 26px;
    font-size: 26px;
  }

  .col-tm2 {
    padding-left: 45px;
  }

  .page2 .rectangle-frame {
    height: 850px;
  }

  .page3 .tamil-container {
    margin-top: -6rem !important;
  }

  .page3 .rectangle-frame {
    height: 825px;
  }
}
