html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  /* prevent horizontal scroll */
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

@font-face {
  font-family: "ChivoBold";
  src: url("../assets/fonts/Chivo-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: "Playball";
  src: url("../assets/fonts/Playball-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Teberna";
  src: url("../assets/fonts/TabernaSans-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* --- base --- */
body,
.main-container {
  margin: 0;
  overflow: hidden;
  font-family: Arial, sans-serif;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
  position: relative;
}

.main-container {
  height: 100%;
  width: 100%;
  margin: 0;
  overflow: hidden;
  font-family: Arial, sans-serif;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Canvas covers screen */
#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  background-color: #000;
  z-index: 10;
}

/* generic screens */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 100;
  text-align: center;
  overflow: hidden;
}

.screen.hidden {
  display: none;
}

.screen h1 {
  font-size: 8vw;
  margin-bottom: 2vh;
}

.screen p {
  font-size: 4vw;
  /* margin-bottom: 3vh; */
  padding: 0 5vw;
}

.screen button {
  background-color: #4caf50;
  color: white;
  padding: 2.5vw 5vw;
  border: none;
  border-radius: 1.5vw;
  font-size: 5vw;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 3vh;
}

.screen button:hover {
  background-color: #45a049;
}

/* --- Loading Screen (inherits from custom-start-screen for styling) --- */
#loading-screen {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  /* Higher z-index to be on top */
  overflow: hidden;
  background: url("https://cdn.pulse.makear.ai/assets/Textures/landingPagesBg.png")
    center center / cover no-repeat;
  background-color: #cc5436;
}

#loading-screen .start-bg,
#loading-screen .clip,
.game-logo,
#loading-screen .game-title {
  /* Reuse styles from custom-start-screen */
  position: absolute;
  z-index: 1;
}

#loading-screen .start-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  z-index: -1;
}

#loading-screen .clip {
  width: 30dvw;
  max-width: 120px;
  height: auto;
}

#loading-screen .top-left-clip {
  top: 0;
  left: 0;
}

#loading-screen .top-right-clip {
  top: 0;
  right: 0;
}

#loading-screen .LandingPageLogo {
  position: absolute;
  width: 84dvw;
  top: 20dvh;
}

#loading-screen .game-title {
  position: absolute;
  /* Added position absolute */
  top: 37dvh;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  max-width: 400px;
  z-index: 2;
}

.loading-bar-container {
  position: absolute;
  bottom: 16vh;
  left: 50%;
  transform: translateX(-50%);
  width: 60vw;
  max-width: 300px;
  height: 30px;
  background-color: transparent;
  border: 1px solid white;
  border-radius: 8px;
  z-index: 2;
}

.loading-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background-color: #4caf50;
  border-radius: 8px;
  transition: width 0.1s linear;
  z-index: 1;
}

.loading-text-wrapper {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

#loading-text {
  color: white;
  font-size: 6vw;
  font-weight: bold;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

.tnc-text {
  z-index: 1000;
  position: absolute;
  bottom: 0.5dvh;
  left: 0.5dvh;
  font-size: 12px !important;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  padding: 2px;
  align-items: center;
  gap: 5px;
}

.tnc-text img {
  width: 4dvw;
}

#loading-screen img[alt="PulseCandy"] {
  width: 35vw;
  position: absolute;
  bottom: 2dvh;
}

img[alt="leftBasket"],
img[alt="rightBasket"] {
  position: absolute;
  width: 30%;
  max-width: 150px;
}

img[alt="leftBasket"] {
  bottom: -2dvh;
  left: 0;
}

img[alt="rightBasket"] {
  bottom: -2dvh;
  right: 0;
}

/* --- Custom Start Screen --- */
#custom-start-screen {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 110;
  overflow: hidden;
  background: url("https://cdn.pulse.makear.ai/assets/Textures/landingPagesBg.png")
    center center / cover no-repeat;
}

#custom-start-screen .start-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  z-index: -1;
}

#custom-start-screen .clip {
  position: absolute;
  width: 30dvw;
  max-width: 120px;
  height: auto;
  z-index: 1;
}

#custom-start-screen .top-left-clip {
  top: 0;
  left: 0;
}

#custom-start-screen .top-right-clip {
  top: 0;
  right: 0;
}

/* #custom-start-screen .game-logo {
  position: absolute;
  top: 25dvh;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  max-width: 150px;
} */

#custom-start-screen .LandingPageLogo {
  position: absolute;
  width: 84dvw;
  top: 20dvh;
}

.pulse-of-india-text {
  position: absolute;
  top: 35dvh;
  background: linear-gradient(
    90deg,
    rgba(51, 51, 51, 0) 0%,
    #60a015 19.59%,
    #60a015 81.11%,
    rgba(102, 102, 102, 0) 100%
  );
  width: 80dvw;
}

.pulse-of-india-text p {
  font-size: 1rem;
  font-weight: 600;
  margin: 0px !important;
  padding: 10px 0px;
  color: white;
}

#custom-start-screen .game-title {
  position: absolute;
  top: 37dvh;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  max-width: 400px;
  z-index: 2;
}

.start-screen-text-container {
  position: absolute;
  top: 50%;
  background: linear-gradient(
    90deg,
    rgba(51, 51, 51, 0) 0%,
    #60a015 19.59%,
    #60a015 81.11%,
    rgba(102, 102, 102, 0) 100%
  );
}

.start-screen-text {
  font-size: 17px !important;
  font-weight: 600;
}

#custom-start-screen .play-button {
  position: absolute;
  bottom: 16vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  background-color: transparent !important;
  border: 1px solid white;
  padding: 5px;
  width: 60dvw;
  border-radius: 15px;
  max-width: 400px;
}

.play-button p {
  background-color: #5ea418;
  margin: 0 !important;
  border-radius: 15px;
  padding: 10px !important;
  font-weight: 700;
  font-size: 1.2rem;
}

img[alt="dsLogo"] {
  width: 30px;
  position: absolute;
  top: 1dvh;
  right: 1dvh;
}

#custom-start-screen img[alt="PulseCandy"] {
  width: 35vw;
  position: absolute;
  bottom: 2dvh;
}

#custom-start-screen .play-button img {
  width: 50vw;
  max-width: 200px;
  cursor: pointer;
}

/* --- Instruction Screen --- */

#instruction-screen .start-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

#instruction-screen .clip {
  position: absolute;
  width: 30dvw;
  height: auto;
  z-index: 1;
}

#instruction-screen .top-left-clip {
  top: 0;
  left: 0;
}

#instruction-screen .top-right-clip {
  top: 0;
  right: 0;
}

#instruction-screen .instruction-box {
  background-color: #5ea418;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute;
  width: 85vw;
  max-width: 400px;
  z-index: 0;
  height: auto;
  min-height: 60vh;
  max-height: 90vh;
  border: 4px solid #000000;
  padding: 15px;
  box-sizing: border-box;

  justify-content: space-between;
}

#instruction-screen .game-logo {
  top: -5dvh !important;
}

.instruction-text-review {
  font-size: 14px !important;
  padding: 10px 0px 10px 0px !important;
}

.instruction-box h2 {
  margin: 0px !important;
  padding: 30px 0px 0px 0px;
}

#instruction-screen .how-to-play-list {
  text-align: left;
  font-size: 12px !important;
  width: 75dvw;
  max-width: 315px;
}

.htp-text {
  font-size: 12px !important;
  padding: 10px 0px 0px 0px !important;
}

.how-to-play-list ol {
  padding-left: 15px !important;
}

.how-to-play-list li {
  margin-top: 10px;
}

.instruction-box p {
  margin: 0 !important;
}

/* Content wrapper for better spacing control */
.instruction-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 10px;
}

.toggle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: auto;
  padding: 0px;
  flex-shrink: 0;
}

/* Row for checkbox + text */
#instruction-screen .toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 350px;
  margin-bottom: 15px;
}

#instruction-screen .toggle-checkbox {
  width: 22px;
  height: 22px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Label in column (two lines) */
#instruction-screen .toggle-label {
  display: flex;
  flex-direction: column;
  color: white;
  font-size: 3vw;
  line-height: 1.3;
  text-align: left;
  display: inline;
}

#instruction-screen .toggle-label .terms-link {
  color: #ffd700;
  text-decoration: none;
  font-weight: bold;
  margin-top: 0px;
  white-space: nowrap;
}

#instruction-screen .toggle-label .terms-link:hover {
  text-decoration: underline;
}

.button-column {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 300px;
  gap: 10px;
  align-items: center;
}

#instruction-screen .startgame-button {
  background-color: #ea731c !important;
  border: 1px solid #ffffff;
  margin-top: 0px !important;
  transition: opacity 0.3s ease;
  cursor: pointer;
  width: 90%;
  max-width: 300px;
  min-height: 45px;
  max-height: 60px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 5px;
}

#instruction-screen .startgame-button:disabled {
  opacity: 0.5;
  /* Visually indicate disabled state */
  cursor: not-allowed;
}

#instruction-screen .cancel-button {
  background-color: transparent !important;
  border: 1px solid #ffffff;
  margin-top: 0px !important;
  transition: opacity 0.3s ease;
  cursor: pointer;
  width: 90%;
  max-width: 300px;
  min-height: 45px;
  max-height: 60px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 5px;
}

/* --- Avatar Selection Screen --- */
#avatar-selection-screen {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 13;
  background: url("https://cdn.pulse.makear.ai/assets/Textures/bg.png") center
    center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* Blur overlay */
#avatar-selection-screen .blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Corner decorations */
#avatar-selection-screen .clip {
  position: absolute;
  width: 30dvw;
  min-width: 80px;
  max-width: 140px;
  height: auto;
  z-index: 2;
}

.top-left-clip {
  top: 0;
  left: 0;
}

.top-right-clip {
  top: 0;
  right: 0;
}

/* Main heading */
.select-avatar-text {
  position: absolute;
  top: 15dvh;
  width: 85dvw;
  height: auto;
}

/* Avatar container - centered layout */
.avatar-preview-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  margin-top: auto;
  margin-bottom: 26vh;
  width: 100%;
  max-width: 600px;
  padding: 0 20px;
  z-index: 3;
}

@media screen and (max-height: 730px) {
  .avatar-preview-container {
    margin-bottom: 18vh;
  }
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0vh;
}

/* Avatar images */
.avatar-image {
  width: 43vw;
  min-width: 140px;
  max-width: 220px;
  height: auto;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.avatar-image.male {
  width: 38vw !important;
}

/* Avatar selection buttons */
.avatar-button {
  background-color: #000000;
  color: #ffffff;
  border: none;
  margin-top: 0 !important;
  padding: 2.5vw 10vw !important;
  border-radius: 2.5vw !important;
  font-size: 4vw;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: capitalize;
  min-width: 25vw;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.avatar-button.female,
.avatar-button.male {
  background-color: #000000;
}

.avatar-button.selected.male,
.avatar-button.selected.female {
  background: linear-gradient(160deg, #87bf4c 50%, #000000 50%);
}

/* Let's Go button */
.lets-go-button {
  position: absolute;
  bottom: 8vh;
  left: 50%;
  transform: translateX(-50%);
  background: #5ea418;
  color: #ffffff;
  padding: 2.5vw 30vw !important;
  border-radius: 4.5vw !important;
  font-size: 4.5vw;
  font-weight: 700;
  cursor: pointer;
  text-transform: capitalize;
  z-index: 5;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.lets-go-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lets-go-button:hover {
  transform: translateX(-50%) translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #8bd85c 0%, #b5e870 100%);
}

.lets-go-button:active {
  transform: translateX(-50%) translateY(-1px);
}

/* --- Capture Screen --- */
#capture-screen {
  background: url("https://cdn.pulse.makear.ai/assets/Textures/FaceTrackBg.png")
    center center / cover no-repeat;
  z-index: 130;
}

/* Blur overlay */
#capture-screen .blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#capture-screen .capture-screen-content {
  position: absolute;
  bottom: 1dvh;
  right: 2dvw;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#capture-screen h2 {
  font-size: 5vw;
  margin-bottom: 2vh;
  padding: 0 2vw;
  color: #ffd24d;
}

#captureDisplay {
  width: 40vw;
  border-radius: 15px;
  max-width: 320px;
  height: 100%;
  max-height: 240px;
  border: 1px solid #ffffff;
  transform: scaleX(-1);
}

/* #face-marker {
  position: absolute;
  bottom: 11dvh;
  width: 40vw;
  max-width: 180px;
  height: 40vw;
  max-height: 180px;
  border-radius: 50%;
  border: 2px dashed #ff9b00;
  pointer-events: none;
  box-sizing: border-box;
} */

#capture-screen .instructions-text-div {
  position: absolute;
  top: 10dvh;
}

#capture-screen .instructions-text {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  text-shadow: 4px 4px 0 black, -4px 4px 0 black, 4px -4px 0 black,
    -4px -4px 0 black;
}

.instructions-message {
  font-size: 1.2rem !important;
  font-weight: normal;
}

.main-head-container {
  position: absolute;
  top: 75dvh;
  left: 50%;
  transform: translateX(-50%);
  width: 90dvw;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.head-container {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 6dvh;
  bottom: 10dvh;
  height: 20dvh;
  width: 100%;
  max-width: 300px;
}

.head-container img {
  width: 38dvh;
  max-width: 380px;
  height: auto;
  object-fit: contain;
}

#capture-screen .turn-text {
  font-size: 1rem;
}

@media screen and (max-height: 530px) {
  /* Loading Screen Adjustments */
  #loading-screen .LandingPageLogo,
  #custom-start-screen .LandingPageLogo {
    width: 65dvw;
    top: 8dvh;
  }

  #loading-screen .clip,
  #custom-start-screen .clip {
    width: 25dvw;
    max-width: 100px;
  }

  .loading-bar-container {
    bottom: 10vh;
    width: 55vw;
    height: 25px;
  }

  .loading-text-wrapper {
    top: -45px;
  }

  #loading-text {
    font-size: 5vw;
  }

  .pulse-of-india-text {
    top: 35dvh;
  }

  .pulse-of-india-text p {
    font-size: 1.2rem;
    padding: 8px 0px;
  }

  /* Custom Start Screen Adjustments */
  .start-screen-text-container {
    top: 45%;
    padding: 10px;
  }

  .start-screen-text {
    font-size: 16px !important;
    line-height: 1.4;
  }

  #custom-start-screen .play-button {
    bottom: 12vh;
  }

  #custom-start-screen .play-button img {
    width: 45vw;
    max-width: 180px;
  }

  /* Common Elements Adjustments */
  .tnc-text {
    z-index: 1000;
    bottom: 5px;
    font-size: 10px !important;
  }

  img[alt="leftBasket"],
  img[alt="rightBasket"] {
    width: 25%;
    max-width: 130px;
    bottom: -1dvh;
  }

  /* Instruction Screen Adjustments for small screens */
  #instruction-screen .instruction-box {
    min-height: 55vh;
    max-height: 85vh;
    padding: 10px;
  }

  .toggle-container {
    margin-top: auto;
    padding: 8px 0;
  }

  #instruction-screen .toggle-row {
    max-width: 300px;
    margin-bottom: 10px;
  }

  #instruction-screen .toggle-checkbox {
    width: 20px;
    height: 20px;
  }

  #instruction-screen .toggle-label {
    font-size: 2.5vw;
  }

  .button-column {
    max-width: 250px;
    gap: 8px;
  }

  #instruction-screen .startgame-button,
  #instruction-screen .cancel-button {
    padding: 2vw 4vw;
    font-size: 4vw;
    max-width: 300px;
    min-height: 40px;
    max-height: 55px;
  }

  /* Capture Screen Adjustments */
  #capture-screen .capture-screen-content {
    bottom: 0.5dvh;
  }

  #capture-screen h2 {
    font-size: 4vw;
    margin-bottom: 1vh;
  }

  #captureDisplay {
    width: 35vw;
    max-height: 200px;
  }

  #capture-screen .instructions-text-div {
    top: 8dvh;
  }

  #capture-screen .instructions-text {
    font-size: 1.5rem;
  }

  .main-head-container {
    top: 15dvh;
  }

  .head-container {
    gap: 8dvh;
    bottom: 8dvh;
    height: 18dvh;
  }

  .head-container img {
    width: 25dvh;
  }

  #capture-screen .turn-text {
    font-size: 1.2rem;
    margin-bottom: 0.8vh;
  }
}

/* Very short screens - ensure buttons are always visible */
@media screen and (max-height: 600px) {
  #instruction-screen .instruction-box {
    min-height: 50vh;
    max-height: 95vh;
    padding: 8px;
  }

  .instruction-content-wrapper {
    padding-bottom: 5px;
  }

  .toggle-container {
    padding: 5px 0;
  }

  #instruction-screen .how-to-play-list {
    font-size: 11px !important;
    max-width: 280px;
  }

  .htp-text {
    font-size: 11px !important;
    padding: 5px 0px 0px 0px !important;
  }

  .instruction-text-review {
    font-size: 12px !important;
    padding: 5px 0px;
  }

  #instruction-screen .toggle-row {
    max-width: 280px;
    margin-bottom: 8px;
  }

  #instruction-screen .toggle-checkbox {
    width: 18px;
    height: 18px;
  }

  #instruction-screen .toggle-label {
    font-size: 2.2vw;
    line-height: 1.1;
  }

  .button-column {
    max-width: 250px;
    gap: 6px;
  }

  #instruction-screen .startgame-button,
  #instruction-screen .cancel-button {
    padding: 2vw 4vw;
    font-size: 3.8vw;
    max-width: 220px;
    min-height: 35px;
    max-height: 50px;
  }
}

/* --- UI Overlay --- */
#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2vw;
  box-sizing: border-box;
  z-index: 20;
  pointer-events: none;
}

#top-ui {
  display: flex;
  flex-direction: column;
  /* Changed to column to stack timer box and bar */
  justify-content: center;
  /* Center horizontally */
  align-items: center;
  /* Center items for the column layout */
  font-size: 5vw;
  font-weight: bold;
  pointer-events: auto;
  position: relative;
  /* Needed for absolute positioning of left and right top-ui */
  padding-top: 1vw;
  /* Give some general padding from the top edge for the whole stacked unit */
}

/* Left UI (pause button) - Positioned absolutely */
#left-top-ui {
  position: absolute;
  /* Position independently */
  left: 2vw;
  /* Align to the left */
  top: 2vw;
  /* Align to the top */
  display: flex;
  align-items: center;
  gap: 10px;
}

/* New: The red timer box content container */
#timer-box {
  display: flex;
  /* To center timer-top content */
  justify-content: center;
  align-items: center;
  background-image: url("https://cdn.pulse.makear.ai/assets/Textures/red_timer_bg.png");
  /* <--- PATH TO YOUR RED TIMER BACKGROUND IMAGE */
  background-size: 100% 100%;
  /* Stretch image to cover the element */
  background-repeat: no-repeat;
  padding: 0.8vw 2.5vw;
  /* Padding inside the red box for its content */
  box-sizing: border-box;
  box-shadow: 0 0.5vw 1vw rgba(0, 0, 0, 0.3);
  /* Adjust width to control the size of the red box */
  width: fit-content;
  /* Or a fixed width like 40vw */
  min-width: 20vw;
  /* Ensure it's not too small */
}

/* Timer top row: icon + text - now inside #timer-box */
#timer-top {
  display: flex;
  align-items: center;
  gap: 1.5vw;
  margin: 0;
  /* Reset any default margins */
}

#timer-top img#pulseIcon {
  width: 6vw;
  /* Smaller icon */
  height: auto;
  filter: drop-shadow(0 0 0.5vw rgba(0, 0, 0, 0.5));
  /* Add some shadow to the icon */
}

#timer-text {
  font-size: 5vw;
  /* Larger font for time */
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}

/* Timer fill bar - now completely separate and positioned below #timer-box */
#timer-bar-container {
  width: 30vw;
  /* Shorter bar under time, adjust as needed */
  max-width: 150px;
  /* Max width */
  height: 1vw;
  /* Thicker bar */
  background: rgba(255, 255, 255, 0.3);
  /* Lighter background for the empty part */
  border-radius: 0.5vw;
  overflow: hidden;
  margin-top: 0.5vw;
  /* Gap between the red box and the fill bar */
  box-sizing: border-box;
  /* Use border-box for consistent sizing */
  /* No padding-top here as it's not inside the red box anymore */
}

#timer-fill {
  width: 0%;
  /* Will be controlled by JS for animation */
  height: 100%;
  background-color: #4caf50;
  /* Green fill color */
  border-radius: 0.5vw;
  transition: width 0.05s linear;
}

/* Right UI (score and items) - now on the right, blue box */
#right-top-ui {
  position: absolute;
  /* Position independently */
  right: 2vw;
  /* Align to the right */
  top: 2vw;
  /* Align to the top */
  display: flex;
  flex-direction: column;
  /* Stack score and items vertically */
  align-items: center;
  background-image: url("https://cdn.pulse.makear.ai/assets/Textures/blue_score_bg.png");
  /* <--- PATH TO YOUR BLUE SCORE BACKGROUND IMAGE */
  background-size: 100% 100%;
  /* Stretch image to cover the element */
  background-repeat: no-repeat;
  padding: 0.8vw 2.5vw;
  /* Keep base padding for the overall box */
  box-sizing: border-box;
  box-shadow: 0 0.5vw 1vw rgba(0, 0, 0, 0.3);
  border-radius: 0;
}

#score {
  font-size: 5vw;
  /* Font size for the score number */
  font-weight: bold;
  color: #fff;
  /* White color for the number */
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
  margin-bottom: 0;
  /* Ensure no external margin pushing down */
}

#right-top-ui::after {
  content: "Items";
  /* "Items" text below the score number */
  font-size: 3vw;
  /* Smaller font for "Items" */
  font-weight: normal;
  color: #e0e0e0;
  /* Slightly dimmer color for "Items" */
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  margin-top: 1vw;
  /* Gap between score number and "Items" text */
}

#mini-video-feed {
  display: none !important;
}

/* --- Webcam Feedback (Mirrored Preview) --- */
#webcam-feedback {
  position: absolute;
  bottom: 2dvh;
  right: 2dvw;

  /* ✅ Set rectangular ratio — width wider than height */
  width: 26vw;
  /* height: calc(40vw * 0.56); */
  height: calc(26vw * 1.35);
  /* 16:9 aspect ratio (landscape style) */
  max-width: 400px;
  max-height: 225px;

  /* ✅ Keep your beautiful border + glow */
  border-radius: 12px;
  border: 1px solid rgba(255, 210, 77, 0.6);
  background: radial-gradient(
    circle at center,
    rgba(30, 30, 30, 0.9) 0%,
    rgba(10, 10, 10, 0.85) 100%
  );

  /* ✅ Glass + glow effects */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 10px rgba(255, 210, 77, 0.3),
    inset 0 0 6px rgba(255, 210, 77, 0.15);

  /* ✅ Flip webcam (mirror view) */
  /* transform: scaleX(-1); */

  /* ✅ Clean layout behavior */
  display: none;
  /* Hidden by default */
  z-index: 5555;
  overflow: hidden;
  pointer-events: none;
  transition: all 0.3s ease-in-out;
}

/* Canvas inside the webcam feedback */
#webcamDisplayCanvas {
  width: 100%;
  height: 100%;
  display: block;
  transform: scaleX(-1);
  /* Mirror effect */
  object-fit: cover;
  border-radius: inherit;
  pointer-events: auto;
  filter: brightness(1.1) contrast(1.05);
  transition: filter 0.2s ease-in-out;
}

/* Hover/interaction effect */
#webcam-feedback:hover #webcamDisplayCanvas {
  filter: brightness(1.2) contrast(1.1);
}

/* Subtle animated glow when active */
@keyframes webcamBorderPulse {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 210, 77, 0.3),
      inset 0 0 6px rgba(255, 210, 77, 0.15);
  }

  50% {
    box-shadow: 0 0 15px rgba(255, 210, 77, 0.6),
      inset 0 0 10px rgba(255, 210, 77, 0.25);
  }
}

/* Add this class dynamically when webcam is active */
#webcam-feedback.active {
  display: block;
  animation: webcamBorderPulse 2s infinite ease-in-out;
}

/* Collectible UI */
#collectible-ui {
  position: absolute;
  left: 2vw;
  top: 0;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 150;
  pointer-events: none;
  bottom: 0;
  margin: auto;
  height: max-content;
}

.collectible-slot {
  width: 11vw;
  max-width: 56px;
  height: 11vw;
  max-height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(56, 54, 54, 0.9);
  /* lighter base */
  padding: 6%;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.9);
  /* more visible border */
  /* filter: grayscale(70%) contrast(1) opacity(0.95); */
  /* nearly opaque and clearer */
  transition: filter 300ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.collectible-slot.collected {
  filter: none;
  opacity: 1;
  /* fully visible when collected */
  background: rgba(253, 225, 65, 0.646);
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(255, 210, 77, 0.9);
  border-color: rgba(251, 135, 53, 0.9);
}

/* Game over */
#game-over-screen {
  z-index: 140;
}

#game-over-screen h1 {
  color: #ff5a5a;
}

#game-over-screen p {
  color: #ffd24d;
}

#game-over-screen .tnc-text {
  color: white !important;
}

/* Hidden original start-screen */
#start-screen {
  display: none;
}

/* Media queries */
@media (min-width: 768px) {
  .screen h1 {
    font-size: 3em;
  }

  .screen p {
    font-size: 1.2em;
    padding: 0;
  }

  .screen button {
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.5em;
    margin-top: 20px;
  }

  #loading-screen .clip,
  #custom-start-screen .clip,
  #instruction-screen .clip,
  #avatar-selection-screen .clip,
  #happy-chhath-screen .clip {
    width: 150px;
  }

  .game-logo,
  #custom-start-screen .game-logo {
    top: 10%;
    width: 150px;
  }

  #loading-screen .game-title,
  #custom-start-screen .game-title {
    top: 25%;
    width: 400px;
  }

  #custom-start-screen .player-character,
  #avatar-selection-screen .avatar-preview {
    bottom: 25%;
    width: 250px;
  }

  #custom-start-screen .play-button img,
  #instruction-screen .agree-button img,
  #avatar-selection-screen .lets-go-button img {
    width: 200px;
  }

  #instruction-screen .instruction-box {
    width: 500px;
  }

  #avatar-selection-screen .select-avatar-text {
    font-size: 2.5em;
  }

  .avatar-button {
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.2em;
    min-width: 100px;
  }

  #capture-screen h2 {
    font-size: 2em;
    margin-bottom: 20px;
    padding: 0;
  }

  #captureDisplay {
    width: 320px;
    height: 240px;
  }

  /* #face-marker {
    width: 180px;
    height: 180px;
  } */
  #ui-overlay {
    padding: 10px;
  }

  #top-ui {
    font-size: 1.2em;
  }

  #webcam-feedback {
    bottom: 10px;
    right: 10px;
    width: 100px;
    height: 75px;
  }

  #collectible-ui {
    left: 14px;
    top: 140px;
  }

  .collectible-slot {
    width: 56px;
    height: 56px;
  }

  .loading-bar-container {
    height: 20px;
    /* Thicker loading bar for larger screens */
  }

  #loading-text {
    font-size: 1.2em;
  }
}

/* ... (previous CSS remains the same) ... */

/* Game over screen specific styles */
#game-over-screen {
  z-index: 140;
  background: url("https://cdn.pulse.makear.ai/assets/Textures/FaceTrackBg.png")
    center center / cover no-repeat;
  display: none;
  /* Hidden by default */
}

#game-over-screen.active,
#happy-chhath-screen.active {
  display: flex;
  /* Show when active */
}

.game-over-content-wrapper,
.happy-chhath-content-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.game-over-logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100dvw;
  height: auto;
  z-index: 10;
}

/* .score-display {
  position: absolute;
  top: 4vh;
  right: 5vw;
  background: #ea731c;
  border: 2px solid #ffffff;
  color: white;
  padding: 1vw 4vw;
  border-top-left-radius: 4vw;
  border-bottom-left-radius: 4vw;
  font-size: 6vw;
  width: 50px;
  font-weight: 700;
  z-index: 10;
  white-space: nowrap;
} */

.items-text {
  font-size: 18px;
  font-weight: 700;
  position: absolute;
  top: 9vh;
  right: 5vw;
}

.game-over-box {
  border-radius: 10vw;
  padding: 8vw 4vw;
  width: 75vw;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 20dvh;
  overflow: hidden;
}

.game-over-title {
  font-size: 8vw;
  font-weight: 900;
  color: white;
  margin: 0;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.8vw;
  line-height: 1;
  padding-bottom: 2vh;
}

#finalTime {
  font-size: 10vw;
  font-weight: 900;
  color: white;
  margin: 0;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
  line-height: 1;
}

#game-over-screen .game-over-ok-button {
  background: #ea731c;
  border: 1px solid #ffffff;
  padding: 2.5vw 5vw;
  cursor: pointer;
  font-weight: 700;
  z-index: 2;
  /* Ensure button is clickable */
}

.ok-button-image {
  width: 30vw;
  max-width: 150px;
  height: auto;
}

/* Fireworks effect for game over box */
.fireworks {
  position: absolute;
  width: 15vw;
  max-width: 80px;
  height: auto;
  opacity: 0.8;
  z-index: 0;
}

.fireworks-top-left {
  top: -5%;
  left: -5%;
  transform: rotate(30deg);
}

.fireworks-top-right {
  top: -5%;
  right: -5%;
  transform: rotate(-30deg);
}

.fireworks-bottom-left {
  bottom: -5%;
  left: -5%;
  transform: rotate(-120deg);
}

.fireworks-bottom-right {
  bottom: -5%;
  right: -5%;
  transform: rotate(120deg);
}

/* Happy Chhath Screen Styles */
#happy-chhath-screen {
  z-index: 145;
  /* Slightly higher than game over to layer on top */
  background: url("https://cdn.pulse.makear.ai/assets/Textures/happyChhathBg.png")
    center center / cover no-repeat;
  display: none;
  background-color: #de8e48;
  /* Hidden by default */
}

/* Corner decorations for Happy Chhath screen */
#happy-chhath-screen .clip {
  position: absolute;
  width: 30dvw;
  max-width: 120px;
  height: auto;
  z-index: 1;
}

#happy-chhath-screen .top-left-clip {
  top: 0;
  left: 0;
}

#happy-chhath-screen .top-right-clip {
  top: 0;
  right: 0;
}

.happy-chhath-title {
  width: 80dvw;
  height: auto;
  position: absolute;
  top: 25dvh;
}

.chhath-message {
  font-size: 4.5vw;
  color: white;
  margin: 0;
  margin-bottom: 5vh;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

#happy-chhath-screen .happy-continue-button {
  position: absolute;
  bottom: 10dvh;
  left: 50%;
  transform: translateX(-50%);
  background-color: transparent !important;
  border: 1px solid white;
  padding: 5px;
  width: 95dvw;
  border-radius: 15px;
  max-width: 400px;
}

.happy-continue-button p {
  background-color: #5ea418;
  margin: 0 !important;
  border-radius: 15px;
  padding: 10px !important;
  font-weight: 700;
  font-size: 1.2rem;
}

/* .collection-summary {
  background-color: #3f6c00; Green background
  border-radius: 6vw;
  padding: 4vw 6vw;
  margin-top: 2vh;
  font-size: 4vw;
  color: white;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  width: 80vw;
  max-width: 450px;
} */

.collection-summary p {
  margin: 0;
  line-height: 1.3;
}

img[alt="happyChhathLeft"],
img[alt="happyChhathRight"] {
  position: absolute;
  width: 40%;
  max-width: 150px;
  bottom: 0;
}

img[alt="happyChhathLeft"] {
  left: 0;
}

img[alt="happyChhathRight"] {
  right: 0;
}

/*Form Page Styles*/
#form-screen {
  width: 100%;
  height: 100%;
  z-index: 110;
  overflow: hidden;
  background: url("https://cdn.pulse.makear.ai/assets/Textures/bg.png") center
    center / cover no-repeat;
}

.game-logo {
  position: absolute;
  top: 1dvh;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  max-width: 150px;
}

#form-screen .clip {
  position: absolute;
  width: 30dvw;
  height: auto;
  z-index: 0;
}

#form-screen .top-left-clip {
  top: 0;
  left: 0;
}

#form-screen .top-right-clip {
  top: 0;
  right: 0;
}

.form-container {
  background-color: #5ea418;
  border: 4px solid #000000;
  border-radius: 20px;
  max-width: 400px;
  width: 75dvw;
  padding: 20px 30px 0px 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.form-text-large {
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  margin-bottom: 8px;
  text-align: center;
  padding: 0px !important;
}

.form-text-small {
  font-size: 16px;
  margin-bottom: 20px;
  text-align: center;
}

#user-form {
  text-align: left;
}

.form-field-text {
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 8px;
  display: block;
}

.form-field-input {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid #ffffff;
  width: 92%;
  padding: 15px;
  border-radius: 5px;
  font-size: 16px;
  color: white;
  transition: all 0.3s ease;
}

.form-field-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.form-field-input:focus {
  outline: none;
  border-color: #fff;
  background-color: rgba(255, 255, 255, 0.15);
}

.form-field-container {
  margin-bottom: 20px;
}

.photo-upload-wrapper {
  position: relative;
}

.photo-input {
  display: none;
}

.photo-upload-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px;

  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
}

.photo-upload-label:hover {
  border-color: #6b9e3e;
}

.upload-text {
  background-color: white;
  color: black;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.file-name {
  color: #666;
  font-size: 14px;
  margin-left: 12px;
  flex: 1;
  text-align: left;
  padding-left: 12px;
}

.black-container {
  background-color: black;
  padding: 20px 30px;
  margin: 20px -30px -4px -30px;
  border-radius: 0 0 16px 16px;
}

.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 10px;
  align-items: center;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  left: -9999px;
}

.file-input-button {
  background-color: white;
  color: #5ea418;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
}

.file-input-button:hover {
  background-color: #f0f0f0;
}

.file-input-display {
  flex: 1;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid #ffffff;
  border-radius: 5px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.checkbox-container {
  margin: 0 0 20px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

#form-screen .toggle-checkbox {
  width: 20px;
  height: 20px;
  min-width: 20px;
  cursor: pointer;
  margin-top: 2px;
}

#form-screen .toggle-label {
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

#form-screen .terms-link {
  color: #ffd700;
  text-decoration: underline;
  font-weight: 600;
}

#form-screen .terms-link:hover {
  color: #fff;
}

#form-screen .submit-button {
  width: 100%;
  padding: 15px;
  background-color: #000000;
  color: white;
  border: 2px solid #ffffff;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0px;
  transition: all 0.3s ease;
}

#form-screen .submit-button:hover {
  background-color: #222;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#form-screen .submit-button:active {
  transform: translateY(0);
}

#form-screen .submit-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#photo-frame-screen {
  background: linear-gradient(180deg, rgba(28, 27, 27, 0) 7.79%, #090909 79.3%),
    #5d8b2f;
  background-blend-mode: overlay;
}

.photo-frame-container {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
}

/* Photo frame wrapper - centers the frame and positions text */
.photo-frame-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Image sizing moved from inline styles */
.PhotoFrame {
  width: 100%;
  height: auto;
  display: block;
}

.photo-frame-texts {
  position: absolute;
  top: 66%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  text-align: center;
}

.photo-frame-name {
  color: #432400;
  font-size: 1rem !important;
  font-family: "Teberna" !important;
  margin-bottom: 0px;
}

.user-uploaded-photo {
  position: absolute;
  top: 86%;
  left: 86%;
  transform: translate(-50%, -50%);
  width: 12vh;
  height: 12vh;
  border: 1px solid white;
  border-radius: 5px;
  object-fit: cover;
  object-position: top center;
}

#frameThree-img {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52dvw;
  height: 52dvw;
  border: 1px solid white;
  border-radius: 100%;
}

.frameLogo {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50vw;
  border-radius: 5px;
  z-index: 100;
}

.flowerOne {
  position: absolute;
  top: 25%;
  left: 70%;
  transform: translate(-50%, -50%);
  width: 13dvw;
  height: 13dvw;
  border-radius: 100%;
  z-index: 1;
}

.flowerBottom {
  position: absolute;
  bottom: -1%;
  right: -3%;
  transform: translate(-50%, -50%);
  width: 7vw;
  height: 7vw;
  border-radius: 100%;
  z-index: 1;
}

.photo-frame-message {
  color: #862620;
  font-size: 1.6rem !important;
  font-family: "Playball" !important;
  font-weight: bold;
  margin: 0;
}

/* @media screen and (max-width: 350px) {
  .photo-frame-name {
    font-size: 1.2rem !important;
  }

  .photo-frame-message {
    font-size: 1.2rem !important;
  }
} */

#photo-frame-screen .action-buttons {
  position: absolute;
  bottom: 5dvh;
  left: 5dvw;
  display: flex;
  width: 90dvw;
  flex-direction: column;
  gap: 15px;
}

@media screen and (max-height: 700px) {
  #photo-frame-screen .action-buttons {
    bottom: 2dvh;
    left: 2dvw;
    width: 96dvw;
    gap: 10px;
  }
}

@media screen and (max-height: 921px) and (min-height: 800px) {
  #photo-frame-screen .action-buttons {
    bottom: 10dvh;
  }
}

#photo-frame-screen .action-button-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#photo-frame-screen .play-again-button {
  background-color: transparent;
  border: 1px solid;
  border-radius: 10px;
  margin: 0;
  padding: 5px;
  flex: 1;
}

.play-again-button p {
  padding: 10px;
  background-color: white;
  margin: 0;
  color: black;
  border-radius: 10px;
}

#photo-frame-screen .share-button {
  background-color: transparent;
  border: 1px solid;
  margin: 0;
  border-radius: 10px;
  padding: 5px;
  flex: 1;
}

.share-button p {
  background-color: #5ea418;
  margin: 0;
  border: 10px;
  padding: 10px;
}

#photo-frame-screen .download-button {
  background-color: transparent;
  border: 1px solid;
  margin: 0;
  border-radius: 10px;
  padding: 5px;
  width: 100%;
}

.download-button p {
  background-color: #5ea418;
  margin: 0;
  border-radius: 10px;
  padding: 10px;
}

/* Additional responsive styles for instruction screen */
@media screen and (max-width: 480px) {
  #instruction-screen .instruction-box {
    width: 85vw;
    min-height: 60vh;
    max-height: 95vh;
    padding: 12px;
  }

  .toggle-container {
    margin-top: auto;
  }

  #instruction-screen .toggle-row {
    max-width: 320px;
    margin-bottom: 12px;
  }

  #instruction-screen .toggle-checkbox {
    width: 20px;
    height: 20px;
  }

  #instruction-screen .toggle-label {
    font-size: 2.8vw;
    line-height: 1.2;
  }

  .button-column {
    max-width: 280px;
    gap: 8px;
  }

  #instruction-screen .startgame-button,
  #instruction-screen .cancel-button {
    padding: 2.5vw 5vw;
    font-size: 4.5vw;
    width: 100%;
    max-width: 260px;
    min-height: 42px;
    max-height: 58px;
  }
}

/* Mobile Responsive Styles */
/* Extra Small Devices (350px - 380px) */
@media screen and (max-width: 380px) {
  .game-logo {
    width: 35%;
    max-width: 120px;
    top: 0.5dvh;
  }

  #form-screen .clip {
    width: 28vw;
  }

  .form-container {
    width: 80dvw;
    padding: 20px 20px 0px 20px;
    border-width: 3px;
    border-radius: 16px;
  }

  .form-text-large {
    font-size: 16px;
    margin-bottom: 6px;
  }

  .form-text-small {
    font-size: 13px;
    margin-bottom: 15px;
  }

  .form-field-text {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .form-field-input {
    padding: 12px;
    font-size: 14px;
    width: 90%;
  }

  .form-field-container {
    margin-bottom: 15px;
  }

  .black-container {
    padding: 8px 8px;
    margin: 15px -20px 0 -20px;
    border-radius: 0 0 13px 13px;
  }

  .file-input-button {
    padding: 8px 15px;
    font-size: 12px;
  }

  .file-input-display {
    padding: 8px;
    font-size: 12px;
  }

  .checkbox-container {
    margin: 0 0 15px 0;
    gap: 8px;
  }

  #form-screen .toggle-checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
  }

  #form-screen .toggle-label {
    font-size: 12px;
  }

  #form-screen .submit-button {
    padding: 12px;
    font-size: 16px;
  }

  /* Instruction screen button constraints for extra small devices */
  #instruction-screen .startgame-button,
  #instruction-screen .cancel-button {
    max-width: 200px;
    min-height: 32px;
    max-height: 45px;
    padding: 8px 16px;
    font-size: 14px;
  }
}

/* Small Devices (381px - 420px) */
@media screen and (min-width: 381px) and (max-width: 420px) {
  .game-logo {
    width: 32%;
    max-width: 130px;
    top: 0.8dvh;
  }

  #form-screen .clip {
    width: 26vw;
  }

  .form-container {
    width: 80dvw;
    padding: 20px 24px 0px 24px;
    border-width: 3px;
    border-radius: 18px;
  }

  .form-text-large {
    font-size: 18px;
    margin-bottom: 7px;
  }

  .form-text-small {
    font-size: 14px;
    margin-bottom: 18px;
  }

  .form-field-text {
    font-size: 15px;
    margin-bottom: 7px;
  }

  .form-field-input {
    padding: 13px;
    font-size: 15px;
    width: 90%;
  }

  .form-field-container {
    margin-bottom: 18px;
  }

  .black-container {
    padding: 10px 10px;
    margin: 18px -24px 0 -24px;
    border-radius: 0 0 15px 15px;
  }

  .file-input-button {
    padding: 9px 18px;
    font-size: 13px;
  }

  .file-input-display {
    padding: 9px;
    font-size: 13px;
  }

  .checkbox-container {
    margin: 0 0 18px 0;
    gap: 9px;
  }

  #form-screen .toggle-checkbox {
    width: 19px;
    height: 19px;
    min-width: 19px;
  }

  #form-screen .toggle-label {
    font-size: 13px;
  }

  #form-screen .submit-button {
    padding: 13px;
    font-size: 17px;
  }

  /* Instruction screen button constraints for small devices */
  #instruction-screen .startgame-button,
  #instruction-screen .cancel-button {
    max-width: 300px;
    min-height: 35px;
    max-height: 48px;
    padding: 10px 18px;
    font-size: 15px;
  }
}

/* Medium Devices (421px - 500px) */
@media screen and (min-width: 421px) and (max-width: 500px) {
  .game-logo {
    width: 30%;
    max-width: 140px;
  }

  #form-screen .clip {
    width: 25vw;
  }

  .form-container {
    width: 75dvw;
    padding: 20px 24px 0px 24px;
    border-radius: 20px;
  }

  .form-text-large {
    font-size: 19px;
  }

  .form-text-small {
    font-size: 15px;
  }

  .form-field-text {
    font-size: 15px;
  }

  .form-field-input {
    padding: 14px;
    font-size: 15px;
    width: 90%;
  }

  .form-field-container {
    margin-bottom: 19px;
  }

  .black-container {
    padding: 10px 10px;
    margin: 19px -28px 0 -28px;
    border-radius: 0 0 17px 17px;
  }

  .file-input-button {
    padding: 10px 19px;
    font-size: 14px;
  }

  .file-input-display {
    padding: 10px;
    font-size: 14px;
  }

  .checkbox-container {
    margin: 0 0 19px 0;
  }

  #form-screen .toggle-label {
    font-size: 14px;
  }

  #form-screen .submit-button {
    padding: 14px;
    font-size: 17px;
  }

  /* Instruction screen button constraints for medium devices */
  #instruction-screen .startgame-button,
  #instruction-screen .cancel-button {
    max-width: 300px;
    min-height: 38px;
    max-height: 52px;
    padding: 11px 20px;
    font-size: 16px;
  }
}

/* Height-specific adjustments for very short screens */
@media screen and (max-height: 700px) {
  .game-logo {
    top: 0.5dvh;
    width: 25%;
    max-width: 100px;
  }

  .form-container {
    padding-top: 20px;
  }

  .form-text-large {
    font-size: 17px;
    margin-bottom: 5px;
  }

  .form-text-small {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .form-field-container {
    margin-bottom: 12px;
  }

  .form-field-input {
    padding: 10px;
  }

  .checkbox-container {
    margin: 0 0 12px 0;
  }

  #form-screen .submit-button {
    padding: 10px;
  }
}

/* Height-specific adjustments for tall screens */
@media screen and (min-height: 850px) {
  .game-logo {
    top: 2dvh;
  }

  .form-container {
    padding-top: 20px;
  }

  .form-text-large {
    font-size: 22px;
    margin-bottom: 10px;
  }

  .form-text-small {
    font-size: 17px;
    margin-bottom: 25px;
  }

  .form-field-container {
    margin-bottom: 22px;
  }

  .form-field-input {
    padding: 16px;
  }

  .checkbox-container {
    margin: 0 0 22px 0;
  }

  #form-screen .submit-button {
    padding: 16px;
  }
}

/* Media queries for larger screens */
@media (min-width: 768px) {
  .game-over-logo {
    top: 20px;
    left: 20px;
    width: 100px;
  }

  .score-display {
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2em;
  }

  .game-over-box {
    border-radius: 50px;
    padding: 40px 20px;
    width: 400px;
  }

  .game-over-title {
    font-size: 3em;
    letter-spacing: 4px;
    padding-bottom: 10px;
  }

  #finalTime {
    font-size: 4em;
  }

  .game-over-ok-button {
    margin-top: 30px;
  }

  .ok-button-image {
    width: 150px;
  }

  .fireworks {
    width: 80px;
  }

  .happy-chhath-title {
    font-size: 3.5em;
  }

  .chhath-message {
    font-size: 1.5em;
    margin-bottom: 25px;
  }

  .collection-summary {
    border-radius: 30px;
    padding: 20px 30px;
    font-size: 1.4em;
    width: 450px;
  }
}

/* ... (rest of the CSS) ... */

@media (max-aspect-ratio: 4/3) {
  #gameCanvas {
    width: 100vh;
    height: 100vh;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
  }
}

.timesup-image {
  width: 80vw;
  height: auto;
  position: relative;
}

.game-container-box {
  position: absolute;
  bottom: 9vh;
}

#game-over-screen .pulseCandiesCount {
  color: white;
}

#collectedItemsCount {
  font-size: 10vw;
  font-weight: 900;
  color: white;
  margin: 0;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
  line-height: 1;
  padding: 5px;
  background-color: #fcab02;
  border: 3px solid white;
  border-radius: 20px;
  padding: 6px 20px;
  color: #ffffff !important;
}

/* PDF Modal Overlay - always on top */
#pdfContainer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999 !important;
  justify-content: center;
  align-items: center;
  overflow: auto;
  /* allow scrolling on small/tall screens */
  -webkit-overflow-scrolling: touch;
  /* smooth scrolling for iOS */
  padding: 2vh 2vw;
  box-sizing: border-box;
}

#pdfContainer iframe {
  width: 100%;
  max-width: 900px;
  height: calc(100vh - 80px);
  max-height: 90vh;
  display: block;
  border: none;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

#pdfContainer button {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 10px 16px;
  cursor: pointer;
  z-index: 10001;
}

body.pdf-modal-open {
  overflow: hidden !important;
}

.pc-view-container {
  display: none;
  background: #5ea418;
  width: 100vw;
  height: 100vh;
  position: relative;
  z-index: 999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* margin-right: 12%; */
}

.pc-view-container img {
  width: 32vw;
  max-width: 18rem;
}

.pulseQR {
  width: 22vw !important;
  margin-top: 5vh;
  max-width: 16rem;
}

.pc-view-container .pc-view-copy {
  color: #ffffff !important;
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
}

.pc-view-container .pc-view-copy h4 {
  color: #ffffff !important;
  font-size: 1.4rem;
}

@media only screen and (min-width: 768px) {
  .pc-view-container {
    display: flex;
  }

  .main-container {
    display: none;
  }
}
