body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  
  background-image: url("assets/backgrounds/bg1.png");
  background-size: cover; 
  background-position: center;
  background-repeat: no-repeat;

  min-height: 100vh;
}

body {
  cursor: default;
}


#gameContent {
  visibility: hidden;
}

.start-screen{
  display: none;
}

.video-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #ff8fc7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-intro video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.skip-intro-btn {
  position: absolute;
  right: 18px;
  bottom: 24px;
  padding: 10px 18px;
  border: 3px solid white;
  border-radius: 18px;
  background: #ff4fa3;
  color: white;
  font-family: "Comfortaa", sans-serif;
  font-weight: bold;
  cursor: pointer;
}

.start-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("assets/backgrounds/bg1.png");
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.start-card {
  background: #ff8fc7f2;
  border: 5px solid white;
  border-radius: 40px;
  padding: 40px 50px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.start-title {
  font-family: "Pacifico", cursive;
  font-size: 48px;
  color: white;
  margin: 0 0 10px 0;
  text-shadow: 2px 2px #ff2f93;
}

.start-subtitle {
  font-family: "Comfortaa", sans-serif;
  font-size: 18px;
  color: white;
  margin-bottom: 25px;
}

.play-btn {
  font-family: "Comfortaa", sans-serif;
  font-size: 22px;
  font-weight: 700;
  background: #ff4fa3;
  color: white;
  border: 4px solid white;
  border-radius: 20px;
  padding: 12px 28px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(255, 255, 255, 0.3);
}

.play-btn:hover {
  transform: scale(1.05);
}

.background-sparkles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-sparkle {
  position: absolute;
  color: rgba(255, 255, 255, 0.85);
  font-size: 24px;
  animation: floatSparkle 6s ease-in-out infinite;
}

/* individual sparkle positions */
.s1 {
  top: 8%;
  left: 10%;
  font-size: 24px;
  animation-delay: 0s;
}

.s2 {
  top: 18%;
  right: 12%;
  font-size: 18px;
  animation-delay: 1s;
}

.s3 {
  top: 40%;
  left: 6%;
  font-size: 20px;
  animation-delay: 2s;
}

.s4 {
  top: 55%;
  right: 8%;
  font-size: 26px;
  animation-delay: 3s;
}

.s5 {
  bottom: 18%;
  left: 18%;
  font-size: 22px;
  animation-delay: 1.5s;
}

.s6 {
  bottom: 10%;
  right: 20%;
  font-size: 18px;
  animation-delay: 2.5s;
}

@keyframes floatSparkle {
  0% {
    transform: translateY(0px) scale(1);
    opacity: 0.7;
  }
  25% {
    transform: translateY(-8px) scale(1.1);
    opacity: 1;
  }
  50% {
    transform: translateY(-16px) scale(0.95);
    opacity: 0.8;
  }
  75% {
    transform: translateY(-8px) scale(1.08);
    opacity: 1;
  }
  100% {
    transform: translateY(0px) scale(1);
    opacity: 0.7;
  }
}

.bg-sparkle {
  position: absolute;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  font-size: 24px;
  animation: floatSparkle 6s ease-in-out infinite;
}

.game-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  box-sizing: border-box;
}

.main-game-area {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
  box-sizing: border-box;
}

.game-title {
  text-align: center;
  font-family: "Pacifico", cursive;
  font-size: 48px;
  color: white;

  background: #ff6db4;
  display: inline-block;
  padding: 10px 25px;

  border-radius: 30px;
  border: 4px solid white;

  margin: 20px auto 10px;
  display: block;

  text-shadow: 2px 2px #ff2f93;
}

.game-title {
  animation: glow 10s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 2px 2px #ff2f93, 0 0 10px #ffffff;
  }
  to {
    text-shadow: 2px 2px #ff2f93, 0 0 20px #ed137c;
  }
}

.title-container {
  position: relative;
  text-align: center;

  background: #ff6db4;
  border: 5px solid white;
  border-radius: 40px;

  width: fit-content;
  margin: 20px auto;

  padding: 15px 40px;

  box-shadow: 0 6px 0 rgba(255, 255, 255, 0.4);
}

.game-subtitle {
  font-family: "Comfortaa", sans-serif;
  font-size: 16px;
  color: white;

  margin-top: 5px;
  margin-bottom: 0;

  opacity: 0.9;
}

.help-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(255, 143, 199, 0.65);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.help-popup.show {
  display: flex;
}

.help-card {
  position: relative;
  width: min(90vw, 420px);
  background: #ffb7db;
  border: 5px solid white;
  border-radius: 32px;
  padding: 28px 24px;
  color: white;
  font-family: "Comfortaa", sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.help-card h2 {
  margin-top: 0;
  font-family: "Pacifico", cursive;
  font-size: 34px;
  text-align: center;
  text-shadow: 2px 2px #ff2f93;
}

.help-card p {
  font-size: 14px;
  line-height: 1.5;
}

.help-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 3px solid white;
  border-radius: 50%;
  background: #ff4fa3;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.help-btn {
  height: 52px;
  padding: 0 18px;
  border: 4px solid white;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb7db, #ff4fa3);
  color: white;
  font-family: "Comfortaa", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.menu button {
  width: 150px;
  padding: 14px 18px;
  font-family: "Comfortaa", sans-serif;
  font-size: 18px;
  font-weight: bold;
  color: white;
  background: #ff6db4;
  border: 3px solid white;
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}

.menu button:hover {
  background: #ff4fa3;
  transform: translateY(-2px);
}

.doll-panel {
  position: relative;
  width: 460px;
  height: 560px;

  background-image: url("assets/backgrounds/bg2.png");
  background-size: cover;
  background-position: center;

  border: 5px solid white;
  border-radius: 40px;

  display: flex;
  justify-content: center;
  align-items: center;

  overflow: hidden;

  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.15);
}

.doll {
  position: absolute;
  left: 50%;
  bottom: -25px;        
  width: 420px;
  height: 600px;
  transform: translateX(-50%) scale(1);
  transform-origin: center 32%;
  transition: transform 0.4s ease;
}

.doll.zoom-body {
  transform: translateX(-50%) scale(1);
}

.doll.zoom-face {
  transform: translateX(-50%) scale(2.0) translateY(85px);
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bottom-panel {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.item-bar-frame {
  background: #ffb7db;
  border: 5px solid white;
  border-radius: 30px;
  padding: 14px 18px;
  width: 620px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 90px;
}

.item-bar img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  cursor: pointer;
  background: #ff5aa9;
  border: 3px solid white;
  border-radius: 20px;
  padding: 6px;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.item-bar img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.arrow-btn {
  width: 62px;
  height: 62px;
  border: 4px solid white;
  border-radius: 50%;
  background: #ff4fa3;
  color: white;
  font-family: "Comfortaa", sans-serif;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.15s ease, background 0.15s ease;
}

.arrow-btn:hover {
  background: #ff2f93;
  transform: scale(1.05);
}

.makeup-submenu {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.makeup-submenu button {
  padding: 10px 16px;
  border: 3px solid white;
  border-radius: 16px;
  background: #ff6db4;
  color: white;
  font-family: "Comfortaa", sans-serif;
  font-weight: bold;
  cursor: pointer;
}

.accessories-submenu {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.accessories-submenu button {
  padding: 10px 16px;
  border: 3px solid white;
  border-radius: 16px;
  background: #ff6db4;
  color: white;
  font-family: "Comfortaa", sans-serif;
  font-weight: bold;
  cursor: pointer;
}

.remove-item {
  width: 85px;
  height: 85px;
  background: #ff5aa9ff;
  border: 3px solid #ffffff;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Nunito", sans-serif;
  font-size: 48px;
  font-weight: bold;
  color: #ffffff;
  cursor: pointer;
}

.remove-item:hover {
  background: #ffe6f3;
}

.selected-preview {
  border: 4px solid white !important;
  box-shadow: 0 0 16px #ffffff;
  transform: scale(1.06);
}

.utility-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.reset-btn {
  height: 52px;
  padding: 0 18px;

  border: 4px solid white;
  border-radius: 999px;

  background: linear-gradient(180deg, #ff9dcb, #ff4fa3);
  color: white;

  font-family: "Comfortaa", sans-serif;
  font-size: 15px;
  font-weight: 700;

  cursor: pointer;

  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.18),
    0 5px 0 rgba(255, 255, 255, 0.3);

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.reset-btn:hover {
  transform: translateY(-2px);
}

.reset-btn:active {
  transform: scale(0.96);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.3);
}

.layer[src=""] {
  display: none;
}

.layer-controls {
  width: 95px;
  padding: 12px 10px;
  border: 4px solid white;
  border-radius: 24px;
  background: rgba(236, 158, 201, 0.88);
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 0px;
}

.layer-controls-title {
  font-size: 16px;
  font-weight: 700;
  color: white;
  text-align: center;
}

.icon-toggle-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.icon-toggle {
  width: 72px;
  height: 60px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.22);
  color: white;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.icon-toggle:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.3);
}

.icon-toggle.active {
  background: #ff9dcb;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18) inset;
}

.icon-toggle:not(.active) {
  background: rgba(255, 255, 255, 0.14);
  opacity: 0.85;
}

.icon-pair {
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.music-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 4px solid white;
  background: #f56bb3;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.photo-top-bar {
  display: none;
}

body.photo-mode .photo-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  width: min(88vw, 760px);
  margin: 0 auto 14px;
}

.bg-cycle-btn,
.exit-photo-btn {
  padding: 10px 18px;
  border: 4px solid white;
  border-radius: 20px;
  background: #ff6db4;
  color: white;
  font-family: "Comfortaa", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.photo-btn {
  height: 52px;
  padding: 0 18px;
  border: 4px solid white;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb7db, #ff4fa3);
  color: white;
  font-family: "Comfortaa", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

/* PHOTO MODE */
body.photo-mode .menu,
body.photo-mode .layer-controls,
body.photo-mode .bottom-panel,
body.photo-mode .utility-buttons,
body.photo-mode .submenus,
body.photo-mode .music-btn,
body.photo-mode .reset-btn,
body.photo-mode .photo-btn {
  display: none !important;
}

body.photo-mode .exit-photo-btn {
  display: block;
}

body.photo-mode .main-game-area {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;

  padding: 40px 20px;
  box-sizing: border-box;
}

body.photo-mode .doll-panel {
  width: min(88vw, 760px);
  height: min(78vh, 720px);
  position: relative;
  overflow: hidden;
}

body.photo-mode .doll {
  position: absolute;
  left: 50%;
  bottom: 35px; /* raises the doll */
  width: 380px;
  height: 600px;
  transform: translateX(-50%) scale(1);
  transform-origin: center center;
}

.photo-caption-wrap {
  display: none;
}

body.photo-mode .photo-caption-wrap {
  display: block;
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
}

#photoCaptionInput {
  width: min(78vw, 320px);
  padding: 12px 18px;

  border: 4px solid white;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.88);
  color: #ff2f93;

  font-family: "Comfortaa", sans-serif;
  text-align: center;

  outline: none;
}

.photo-caption-display {
  display: none;
}

body.photo-mode .photo-caption-display {
  display: block;
  position: fixed;
  bottom: 95px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;

  color: white;
  font-family: "Pacifico", cursive;
  font-size: 28px;
  text-shadow: 2px 2px #ff2f93;
}

body.photo-mode .photo-caption-wrap {
  bottom: 28px;
}

html,
body {
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .title-container {
    width: 92vw;
    max-width: 380px;

    padding: 12px 18px;
    border-radius: 28px;

    margin-top: 18px;
    margin-bottom: 12px;

    box-sizing: border-box;
  }

  .game-title {
    font-size: 32px;
    padding: 8px 14px;

    border-radius: 20px;
  }

  .game-subtitle {
    font-size: 14px;
    margin-top: 8px;
  }

  .start-card {
    width: 88vw;
    max-width: 340px;

    padding: 28px 20px;

    border-radius: 28px;
  }

  .start-title {
    font-size: 34px;
    line-height: 1.1;
  }

  .start-subtitle {
    font-size: 14px;
  }

  .play-btn {
    height: 52px;
    font-size: 18px;
    padding: 0 24px;
  }

  .game-shell {
    align-items: center;
    width: 100%;
    padding: 0;
    overflow-x: hidden;
    padding-bottom: 150px;
  }

  .main-game-area {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    margin: 0 auto;
  }

  .menu {
    order: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;

    width: min(95vw, 430px);
    gap: 8px;
    padding: 0 6px 8px;
    margin: 0 auto;
    box-sizing: border-box;

    scrollbar-width: none;
  }

  .menu::-webkit-scrollbar {
    display: none;
  }

  .menu {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  }

  .menu button {
    flex: 0 0 auto;
    width: auto;
    min-width: 105px;
    height: 42px;
    padding: 8px 12px;
    font-size: 14px;
  }

  .help-btn {
    top: 10px;
    right: 12px;
    transform: scale(0.9);
  }

  .doll-panel {
    order: 2;
    width: min(94vw, 460px);
    height: 115vw;
    max-height: 600px;
    margin: 0 auto;
  }

  .doll {
    width: 82vw;
    max-width: 420px;
    height: calc(82vw * 1.58);
    max-height: 600px;

    bottom: -30px;
    transform-origin: center 30%;
  }

  .doll.zoom-body {
    transform: translateX(-50%) scale(0.92);
  }

  .doll.zoom-face {
    transform: translateX(-50%) scale(2.00) translateY(65px);
  }

  .layer-controls {
    order: 3;
    flex-direction: row;
    width: auto;
    margin: 0 auto;
  }

  .icon-toggle-row {
    flex-direction: row;
  }

  .bottom-panel {
    order: 4;
    bottom: 18px;
    width: 94%;
    max-width: 430px;
    border: 4px solid white;
    border-radius: 28px;
    padding: 14px 10px 18px;
    margin: 0 auto;
  }

  .bottom-panel {
  background: #ffb7db;
  border: 5px solid white;
  border-radius: 30px;

  width: 94vw;
  max-width: 430px;

  padding: 14px 12px;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.item-bar-frame {
  background: #ffc1df;
  border: none;
  width: 72vw;
  max-width: 320px;
  min-height: 88px;
  padding: 10px;
  box-sizing: border-box;
}

.arrow-btn {
  margin: 0 -4px; /* pulls arrows closer */
  z-index: 2;
}

  .makeup-submenu,
  .accessories-submenu {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;

    overflow-x: auto;
    overflow-y: hidden;

    width: 95vw;
    max-width: 430px;

    gap: 8px;
    padding: 6px 6px 10px;

    margin: 0 auto;

    scrollbar-width: none; /* Firefox */
  }

  .makeup-submenu::-webkit-scrollbar,
  .accessories-submenu::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .makeup-submenu button,
  .accessories-submenu button {
    flex: 0 0 auto;

    min-width: 100px;
    height: 40px;

    font-size: 13px;
    padding: 6px 10px;
  }

  .makeup-submenu,
  .accessories-submenu {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  }

  .item-bar-frame {
    width: 68vw;
    max-width: 340px;
    min-height: 86px;

    padding: 12px;
    border-radius: 26px;
    box-sizing: border-box;
  }

  .item-bar {
    justify-content: flex-start;
    overflow-x: auto;
    gap: 10px;
    padding: 2px 4px;
    scrollbar-width: none;
  }

  .item-bar::-webkit-scrollbar {
    display: none;
  }

  .item-bar img,
  .remove-item {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .arrow-btn {
    width: 48px;
    height: 48px;
    font-size: 22px;
    flex: 0 0 auto;
  }

  body.photo-mode .doll-panel {
    width: 88vw;
    height: 120vw;
    max-height: 620px;
  }

  body.photo-mode .doll {
    bottom: -45px;
  }
}

.utility-buttons {
  order: 4;
}

.reset-btn {
  height: 46px;
  font-size: 13px;
  padding: 0 14px;
}

#startScreen {
  display: flex;
}

#videoIntro {
  display: none;
}

#gameContent {
  visibility: hidden;
}

.skip-intro-btn {
  position: fixed;
  right: 18px;
  bottom: 24px;
  z-index: 10000;

  padding: 10px 18px;
  border: 3px solid white;
  border-radius: 999px;

  background: #ff4fa3;
  color: white;

  font-family: "Comfortaa", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

#hairBackLayer { z-index: 0; }


#baseLayer { z-index: 1; }

#eyebrowsLayer { z-index: 5; }
#eyeshadowLayer { z-index: 6; }
#lipstickLayer { z-index: 7; }
#blushLayer { z-index: 8; }
#highlightLayer { z-index: 9; }
#lashesLayer { z-index: 10; }

#socksLayer {z-index: 17}
#shoesLayer   { z-index: 18; }
#bottomLayer  { z-index: 19; }
#topLayer     { z-index: 20; }
#outfitsLayer { z-index: 21; }

#earringsLayer { z-index: 22; }
#glassesLayer { z-index: 23; }
#necklacesLayer { z-index: 24; }
#braceletsLayer { z-index: 25; }
#bodyLayer { z-index: 26; }

#hairFrontLayer { z-index: 30; }
#headLayer {z-index: 31}