/* Reset & Container */
#wab-game-container {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  text-align: center;
  padding: 20px;
  background: linear-gradient(to bottom, #fef3f3, #fde2ff);
  height: auto;
  box-sizing: border-box;
  overflow: hidden;
  padding-bottom: 50px;
}

#wab-game-container.no-bg {
  background: transparent !important;
}

/* HOST SCREEN */
#wab-host-screen {
  animation: fadeIn 1s ease-in-out;
}

.wab-gender-options {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.wab-gender-btn {
  padding: 14px 30px;
  font-size: 1.2rem;
  border: none;
  border-radius: 12px;
  background: #ffd2e1;
  color: #444;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.wab-gender-btn:hover {
  background: #ffaccb;
  transform: scale(1.05);
}

/* Instructions Above Gender Buttons */
.wab-instructions {
  margin: 15px auto;
  padding: 10px 15px;
  font-size: 1rem;
  line-height: 1.5;
  max-width: 520px;
  background: #f8f9fa;
  border-radius: 10px;
  color: #333;
  text-align: left;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.wab-gender-btn img {
  width: 60px;
  height: auto;
  margin-bottom: 8px;
}

/* GAME SCREEN */
#wab-game-screen {
  animation: fadeIn 0.8s ease-in-out;
}
#wab-scoreboard {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  font-size: 1.1rem;
  background: #fff3f8;
  border-radius: 10px;
  margin-bottom: 10px;
}

#wab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 100%;
  margin: 0 auto;
  padding: 10px;
}

.wab-hole {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1; /* Maintain rectangular shape */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin: 5px;
  background: none !important;
  pointer-events: none;
}

.mud-pit-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}

.wab-mole {
  font-size: 3rem;
  position: absolute;
  bottom: -100%;
  transition: bottom 0.3s ease-out;
  pointer-events: all;
  cursor: pointer;
  z-index: 2;
}

/* END SCREEN */
#wab-end-screen {
  animation: popIn 1s ease;
  background: linear-gradient(to top, #ffdde4, #fff);
  border-radius: 18px;
  padding: 30px 20px;
  z-index: 1;
  position: relative;
}

.wab-reveal-msg {
  font-size: 2.8rem;
  font-weight: bold;
  margin-top: 10px;
  color: #ff3c8d !important;
}

#wab-final-score {
  font-size: 2.2rem;
  color: #2a6e2a;
  margin: 10px 0;
}

#wab-end-screen p:nth-of-type(2) {
  font-size: 1.8rem;
  font-weight: bold;
}

#wab-play-again {
  padding: 12px 24px;
  font-size: 1.2rem;
  background: #ffc9de;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 15px;
  transition: transform 0.2s ease;
}
#wab-play-again:hover {
  transform: scale(1.1);
}

/* SOCIAL SHARE */
#wab-social-share {
  margin-top: 20px;
}
#wab-social-share a {
  font-size: 1.6rem;
  margin: 0 10px;
  color: #777;
  transition: color 0.3s ease;
}
#wab-social-share a:hover {
  color: #ff3c8d;
}

/* Score bubble */
@keyframes scorePop {
  0%   { transform: scale(0.8) rotate(0deg); opacity: 1; }
  30%  { transform: scale(1.4) rotate(var(--rot)) ; opacity: 1; }
  100% { transform: translateY(-30px) scale(1) rotate(var(--rot)); opacity: 0; }
}
.score-bubble {
  position: absolute !important;
  top: -10px;
  font-size: 1rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px #fff;
  animation: scorePop 0.8s ease-out forwards;
}

/* Score in Green or Red */
#score-display.score-up {
  color: #2a972a;
  animation: popColorUp 0.5s ease;
}

#score-display.score-down {
  color: #d12828;
  animation: popColorDown 0.5s ease;
}

@keyframes popColorUp {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes popColorDown {
  0% { transform: scale(1); }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Explosion effect */
#wab-grid.explosion {
  animation: shake 0.3s ease;
  background: rgba(255, 0, 0, 0.05);
}

@keyframes shake {
  0% { transform: translate(1px, 1px); }
  20% { transform: translate(-2px, -1px); }
  40% { transform: translate(2px, 2px); }
  60% { transform: translate(-1px, -2px); }
  80% { transform: translate(1px, 1px); }
  100% { transform: translate(0, 0); }
}

/* Glow effect */
.freeze-glow {
  animation: icy-glow 1s infinite alternate ease-in-out;
  color: #66e0ff !important;
  text-shadow: 0 0 8px #aeefff, 0 0 15px #bdfcff;
}

@keyframes icy-glow {
  0% {
    box-shadow: 0 0 5px #66e0ff, 0 0 10px #aeefff;
  }
  100% {
    box-shadow: 0 0 15px #bdfcff, 0 0 25px #66e0ff;
  }
}

/* Frostflake icon animation */
#wab-freeze-icon {
  font-size: 1.2rem;
  margin-left: 6px;
  transition: opacity 0.3s ease-in-out;
}

#wab-freeze-icon.show {
  display: inline;
  animation: flake-fade 1.5s ease-in-out;
}

#wab-freeze-icon.hidden {
  display: none;
}

@keyframes flake-fade {
  0% { transform: translateY(-3px); opacity: 0; }
  30% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(3px); opacity: 0; }
}

/* Double effect */
#double-bar {
  margin-left: 10px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(45deg, #ff9aff, #7fcbff);
  padding: 4px 10px;
  border-radius: 6px;
  animation: pulse 1s infinite;
  transition: opacity 0.5s ease;
}
#double-bar.fade-out {
  opacity: 0;
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.wab-center-msg {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  color: #222;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: bold;
  z-index: 100;
  animation: fadeCenterMsg 2s ease forwards;
}

@keyframes fadeCenterMsg {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  10% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 10px); }
}

/* Sparkle Canvas */
#wab-sparkle-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1002;
}

/* Curtain Effect */
#wab-curtain-container {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  justify-content: space-between;
}

#wab-curtain-left,
#wab-curtain-right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  pointer-events: none;
  transition: transform 2.2s ease-in-out;
  background:
    repeating-linear-gradient(
      90deg,
      #7b001c,
      #7b001c 6px,
      #9b0030 6px,
      #9b0030 12px
    ),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05), transparent 60%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.2), transparent 70%);
  background-blend-mode: overlay, overlay, normal;
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.4),
    inset 10px 0 20px rgba(0, 0, 0, 0.5);
}

#wab-curtain-left {
  left: 0;
}

#wab-curtain-right {
  right: 0;
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.4),
    inset -10px 0 20px rgba(0, 0, 0, 0.5);
}

/* Curtain open animation */
.curtain-open-left {
  transform: translateX(-100%) !important;
}

.curtain-open-right {
  transform: translateX(100%) !important;
}

/* HIDDEN CLASS */
.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

@media (max-width: 480px) {
  #wab-grid { gap: 6px; }
  .wab-hole { margin: 4px; aspect-ratio: 2 / 1.4 !important; }
  .wab-mole { font-size: 2rem; }
}

@media (min-width: 768px) {
  .wab-hole {
    max-width: 200px;
    margin: 8px auto;
  }