#bpw-wrapper {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  font-family: 'Comic Sans MS', cursive, sans-serif;
}

/* HOST Screen */
#host-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(145deg, #fef7f7, #ffe3f3);
  display: flex;
  align-items: flex-start;        /* stick to top instead of centering */
  justify-content: center;
  padding: 40px 0;                /* give some breathing room, but not too much */
  box-sizing: border-box;
  z-index: 9999;
  animation: fadeIn 0.6s ease-in-out;
}

/* reduce top/bottom pink any further if desired */
.host-box {
  background: #fff;
  padding: 30px 25px;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
  text-align: center;
  max-width: 500px;
  width: 90%;
  animation: popIn 0.5s ease;
}

/* Gender Buttons – Desktop: same row; Mobile: wrap but not stretch */
.options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
.options label {
  background: #f5f5f5;
  border: 2px solid #ccc;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  /* prevent stretching: let them size to content */
  flex: 0 1 auto;
  white-space: nowrap;
}
.options input[type="radio"] {
  display: none;
}
/* pressed effect: use :has() to style the label that contains a checked input */
.options label:has(input:checked) {
  background: #ffb3d9;
  border-color: #ff4d94;
  color: #fff;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.1);
  font-weight: bold;
}

.link-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.link-box input {
  width: 100%;
  padding: 10px;
  border: 2px solid #ccc;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  background-color: #fdfdfd;
  outline: none;
}

.link-box-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.link-box-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: #ff66a3;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
  white-space: nowrap;
  margin-top: 15px;
}

.link-box-buttons button:hover {
  background: #e05590;
}

#bpw-wrapper { visibility: hidden; }
#bpw-wrapper.visible { visibility: visible; animation: fadeIn 0.6s; }

/* Instructions Overlay */
#instructions-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;              /* full viewport height */
  padding: 20px;                  /* breathing room on mobile */
  background: #fff;               /* or any background */
  box-sizing: border-box;
  overflow-y: auto;               /* scroll if too tall */
  font-family: 'Comic Sans MS', cursive, sans-serif;
  z-index: 100;
}
.instructions-box {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  font-family: 'Comic Sans MS', cursive, sans-serif;
}
.instructions-box h2 {
  margin-bottom: 16px;
  color: #ff5470;
}
.instructions-box ol {
  text-align: left;
  margin-bottom: 20px;
}
.instructions-box li + li { margin-top: 8px; }
.instructions-box button {
  background: #ff8fab;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  width: 60%;
}
.instructions-box button:hover {
  background: #ff6b9b;
}

/* Power Up Message (Below Landed On) */
.powerup-msg {
  display: block;
  margin-top: 12px;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(90deg, #ff9a9e, #fad0c4);
  padding: 8px 16px;
  border-radius: 20px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
.powerup-msg.visible {
  opacity: 1 !important;
  transform: translateY(0);
}

#wheel-container, #poop-container {
  max-width: 500px;
  margin: 20px auto;
  position: relative;
}

/* 2) Poop canvas sits under its own container */
#poop-container {
  height: 500px;
  border: 1px solid #aaa;
  border-radius: 8px;
  margin-bottom: 140px;
}
#poop-container.end-hidden {
  border: none !important;
  background: transparent !important;
  pointer-events: none;
}

#poop-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2;
  pointer-events: auto;
}

#bpw-wheel {
  width: 100%;
  max-width: 500px;
  border-radius: 50%;
  border: 8px solid #ffcad4;
  box-shadow: 0 0 20px rgba(255, 100, 150, 0.5);
}

#bpw-spin-button {
  margin-top: 25px;
  padding: 12px 20px;
  font-size: 18px;
  background: #ff8fab;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#bpw-spin-button:active {
  transform: scale(0.95);
}

#bpw-spin-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

#bpw-arrow {
  position: absolute;
  top: 250px;
  left: 100%;
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-right: 20px solid #333;
  transform: translate(-50%, -50%);
  z-index: 9;
}

#bpw-selected-segment {
  margin-top: 10px;
  font-size: 18px;
  color: #333;
}

/* Poop Game */
#poop-wrapper {
  position: relative;
  width: 100%;
}

#pd-ui {
  position: absolute;
  top:100%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
  background: rgba(255,255,255,0.8);
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
.pd-line1 {
  display: flex;
  justify-content: center;
  gap: 50px;
  font-size: 18px;
  color: #333;
}
#pd-lives {
  font-size: 18px;
  color: #333;
}

#pd-lives, #pd-score, #pd-time {
  margin-bottom: 6px;
  font-weight: bold;
  margin-top: 5px;
}

.hidden {
  display: none !important;
}

/* Poop Overlay */
#poop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 500px;
  max-height: 500px;
  background: linear-gradient(145deg, rgba(0,0,0,0.8), rgba(50,50,50,0.8));
  color: #fff;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  border-radius: 5px;
  padding: 20px;
}

.overlay-content {
  background: rgba(0, 0, 0, 0.75);  /* Dark semi-transparent background */
  padding: 30px 20px;
  border-radius: 12px;
  text-align: center;
  color: #fff;
  font-size: 18px;
  line-height: 1.6;
  max-width: 80%;
  margin: auto;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  z-index: 20;
}

.overlay-content h2 {
  font-size: 26px;
  margin-bottom: 10px;
  color: white !important;
}

.overlay-content p {
  font-size: 18px;
  margin-bottom: 20px;
  color: white !important;
}

#start-poop-game {
  padding: 12px 24px;
  font-size: 20px;
  font-weight: bold;
  background-color: #ff8fab;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

#start-poop-game:hover {
  background-color: #ff6b9b;
  transform: scale(1.05);
}

/* Visual Effects of Power-ups */
#pd-ui.double-score {
  box-shadow: 0 0 12px gold;
}

#pd-ui.invincible {
  box-shadow: 0 0 12px cyan;
}

#poop-container.bomb-shake {
  animation: container-shake 0.3s ease-in-out;
}

@keyframes container-shake {
  0%, 100% { transform: translateX(0,0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.powerup-timer {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 18px;
  z-index: 999;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(1.1); opacity: 1; }
}

/* Colored Border when Power-up is active */
#poop-container.powerup-active {
  --clr: gold;
  border: 4px solid transparent;
  box-shadow:
    0 0 10px var(--clr),
    inset 0 0 20px var(--clr);
  position: relative;
}
#poop-container.powerup-active::before,
#poop-container.powerup-active::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  background: var(--clr);
}
#poop-container.powerup-active::before {
  top: 0; left: 0;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
#poop-container.powerup-active::after {
  bottom: 0; right: 0;
  clip-path: polygon(100% 100%, 0 100%, 100% 0);
}

#bpw-final-screen {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
  width: 95%;
  background: linear-gradient(135deg, #ff9a9e, #fad0c4);
  border: 4px solid #ff5470;
  color: #333;
  animation: fadeInUp 0.6s ease;
}

#bpw-final-screen, #try-again-screen, #gender-reveal-screen {
  background: linear-gradient(135deg, #ff9a9e, #fad0c4);
  border: 0px solid #ff5470;
  color: #333;
  margin-bottom: 20px;
  font-size: 26px;
}
#bpw-final-screen h2,
#try-again-screen h2,
#gender-reveal-screen h2 {
  font-size: 2rem !important;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}
#bpw-final-screen p,
#try-again-screen p,
#gender-reveal-screen p {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: #333;
}

#gender-reveal-screen {
  color: #8e44ad;
  font-weight: bold;
  text-shadow: 0 0 5px #ffd6ff;
}

#bpw-final-screen button {
  background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
  color: #fff;
  border: none;
  padding: 12px 25px;
  font-size: 1.1rem;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s;
  box-shadow: 0 5px 15px rgba(255,105,135,0.3);
  margin-bottom: 20px;
}

#bpw-final-screen button:hover {
  background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  transform: scale(1.05);
}

/* Fade-in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#bpw-wrapper.game-ended {
  position: relative;
  height: 100%;
}

@keyframes blink {
  0%,100% { opacity: 1; }
  50%    { opacity: 0.3; }
}
.blink {
  animation: blink 0.6s ease-in-out 4;
}

@media (max-width: 480px) {
  #bpw-arrow {
    top: 186px;
    left: 100%;
    transform: translate(-50%, -50%);
    border-right: 14px solid #333;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
  }
  .pd-line1 {
    flex-wrap: wrap;
    gap: 10px;
  }

@media (max-width: 600px) {
  .options label {
    width: 65%;
    margin: 5px auto;
  }
 
  .link-box {
    flex-direction: column;
    align-items: center;
	justify-content: center;
  }
  .link-box button {
    width: 75%;
  }
	#bpw-final-screen h2,
	#try-again-screen h2,
	#gender-reveal-screen h2 {
	  font-size: 1.8rem !important;
	}
}