/* HOST SCREEN */
.rmb-host-wrapper {
  max-width: 600px;
  margin: 40px auto;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffe0f0, #e0f7ff);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
  text-align: center;
  animation: fadeIn 1s ease;
  border: 5px solid #fff;
  position: relative;
  overflow: hidden;
}

.rmb-host-wrapper::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    #ff8fab,
    #b2e0ff,
    #ffc75f,
    #a3f7bf,
    #ff8fab
  );
  animation: rotateBorder 8s linear infinite;
  z-index: 0;
}

.rmb-host-wrapper > * {
  position: relative;
  z-index: 1;
}

@keyframes rotateBorder {
  to { transform: rotate(360deg); }
}

.rmb-host-instructions h2 {
  font-size: 1.8em;
  background: linear-gradient(90deg, #f43f5e, #8b5cf6, #10b981);
  -webkit-background-clip: text;
  color: transparent !important;
  animation: hueRotate 4s infinite linear;
  margin-bottom: 12px;
}

@keyframes hueRotate {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.rmb-gender-options {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 20px 0;
}

.rmb-gender-radio {
  padding: 14px 28px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
  position: relative;
}

.rmb-gender-radio input {
  display: none;
}

.rmb-boy {
  background: #cce4ff;
  color: #004085;
  border-color: #60a5fa !important;
}

.rmb-girl {
  background: #ffd6e8;
  color: #800040;
  border-color: #f472b6 !important;
}

.rmb-twins {
  background: #e5e5ff;
  color: #333399;
  border-color: #a78bfa !important;
}

.rmb-gender-radio.selected {
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
  border-color: #10b981;
}

.rmb-link-container {
  margin-top: 20px;
}

#rmb-shareable-link {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid #ccc;
  margin-bottom: 10px;
  background: #fffefc;
  text-align: center;
  font-family: monospace;
}

.rmb-link-buttons {
  display: flex !important;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px;
}

.rmb-link-container,
.rmb-link-buttons {
  display: none;
}

.rmb-animated-button {
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease, transform 0.3s ease;
  font-size: 1rem;
  min-width: 100px;
}

#rmb-copy-link {
  background-color: #3b82f6;
  color: white;
}

#rmb-open-link {
  background-color: #10b981;
  color: white;
}

.rmb-animated-button:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* Baby Math Riddle – CSS */
.rmb-container {
  max-width: 640px;
  margin: 30px auto;
  padding: 20px;
  font-family: 'Poppins', sans-serif;
  border-radius: 1.2rem;
  background: linear-gradient(135deg, #fceaff, #e0f7ff);
  background-size: 200% 200%;
  animation: containerGradientMove 10s ease infinite;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transform: scale(0.98);
  animation: containerPop 0.8s ease-out forwards, containerGradientMove 15s ease infinite;
}

@keyframes containerPop {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes containerGradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

#rmb-progress-bar-wrapper {
  position: relative;
  background: #eee;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
  margin-top: 0.5rem;
  height: 17px;
}

#rmb-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f472b6, #60a5fa);
  animation: progress-animate 0.6s ease;
}

#rmb-progress-label {
  position: relative;
  right: 0;
  font-size: 1.3rem;
  color: #8AD;
  text-align: center;
  margin-top: 25px;
}

/* End screen styles */
.rmb-bob-shadow {
  font-size: 1.4rem;
  color: #333;
  margin: 10px 0;
  text-shadow: 1px 1px 0 #ffc107, 2px 2px 0 #f59e0b;
  animation: bobbing 2s infinite ease-in-out;
}

@keyframes bobbing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

#rmb-scoreboard {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 15px;
    margin-bottom: 1rem;
    font-size: 18px;
    color: #333;
}

#rmb-riddle-box {
  text-align: center;
  animation: fadeIn 1s ease;
}

#rmb-riddle-text {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: #111;
}

#rmb-answer-box {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 10px;
}

.rmb-letter-input {
  width: 45px;
  height: 45px;
  margin: 4px;
  font-size: 1.4rem;
  text-align: center;
  border-radius: 8px;
  border: 2px solid #ccc;
  transition: border-color 0.3s;
  text-transform: uppercase;
}

.rmb-letter-input:focus {
  border-color: #93c5fd;
  outline: none;
}

.rmb-letter-input:disabled {
    background: #e2f4ff;
    font-weight: bold;
    border-color: #66cfff;
}

.rmb-word-line {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
	flex-wrap: wrap;
    max-width: 100%;
}

#rmb-hint-btn {
  background: #facc15;
  border: none;
  padding: 10px 25px;
  border-radius: 30px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-bottom: 20px;
}

#rmb-hint-btn:hover {
  background: #fbbf24;
}

#rmb-hint-btn.disabled {
  background: #ccc;
  cursor: not-allowed;
}

.rmb-hint-text {
  margin-top: 10px;
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: #444;
  font-style: italic;
  display: block;
  transition: opacity 0.4s ease-in;
}
.rmb-hint-text.show-hint {
  opacity: 1;
}

#rmb-correct-animation {
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 0;
  transform: scale(1);
  position: absolute;
  z-index: 999;
  font-size: 2rem;
  padding: 12px 20px;
  color: #2c7a2c;
  font-weight: bold;
  pointer-events: none;
}

#rmb-correct-animation.show {
  opacity: 1;
  transform: scale(1.1);
}

/* Score Animation */
.rmb-animated-score {
    transition: transform 0.3s ease, color 0.3s ease;
    will-change: transform, color;
}

.rmb-animated-score.flash-up {
    transform: scale(1.3);
    color: #4caf50; /* green */
}

.rmb-animated-score.flash-down {
    transform: scale(1.3);
    color: #f44336; /* red */
}

#rmb-end-screen {
  text-align: center;
  margin-top: 2rem;
  position: relative;
}

#rmb-reveal-text {
  font-size: 4.7rem !important;
  font-weight: bold;
  background: linear-gradient(90deg, #f43f5e, #8b5cf6, #10b981, #f43f5e);
  background-size: 200% auto;
  -webkit-background-clip: text;
  color: transparent;
  white-space: nowrap;
  overflow: hidden;
  border-right: 3px solid #10b981;
  display: inline-block;
}

@keyframes rainbowFlow {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Social Share Buttons */
.rmb-share-heading {
  margin-top: 30px;
  font-weight: bold;
  font-size: 1.2rem;
  color: #4b5563;
}

.rmb-social-share {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}

.rmb-share-icon {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: bold;
  color: white;
  text-decoration: none;
  font-size: 16px;
  transition: transform 0.2s ease, opacity 0.3s ease;
}

/* Platform-specific colors */
#rmb-share-x {
  background-color: #000; /* X (Twitter) black */
}

#rmb-share-facebook {
  background-color: #1877F2; /* Facebook blue */
}

#rmb-share-whatsapp {
  background-color: #25D366; /* WhatsApp green */
}

/* Hover animation */
.rmb-share-icon:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

#rmb-play-again-btn {
  background: linear-gradient(90deg, #8b5cf6, #3b82f6);
  color: #fff;
  padding: 14px 30px;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin: 20px;
}
#rmb-play-again-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(139, 92, 246, 0.6);
}

/* Riddle Drops */
#rmb-riddle-drops {
  position: fixed;
  pointer-events: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  overflow: hidden;
}

.riddle-drop {
  position: absolute;
  top: -50px;
  font-size: 2rem;
  animation: dropFall linear forwards;
  opacity: 0.9;
}

@keyframes dropFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(360deg);
    opacity: 0;
  }
}

/* Curtain Effect */
.curtain {
  position: fixed;
  top: 0;
  width: 50%;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    #d63384 0%,
    #c22577 10%,
    #d63384 20%
  ); /* Folded pink fabric look */
  z-index: 9999;
  transition: transform 1.8s ease-in-out;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
  border-top-right-radius: 20px;
  border-bottom-right-radius: 20px;
  background-size: 40px 100%;
  background-position: center;
}

#curtain-left {
  left: 0;
  transform: translateX(0%);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

#curtain-right {
  right: 0;
  transform: translateX(0%);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

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

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

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.4s ease;
  border-color: #ef4444 !important;
}

/* Typewriter animation */
#rmb-reveal-text.typewriter {
  overflow: hidden !important;
  white-space: nowrap !important;
  animation: typing 3s steps(40, end), blink-caret .75s step-end infinite, rainbowFlow 5s linear infinite !important;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: #ccc }
}

/* Responsive & Portrait mode */
@media (max-width: 480px) {
  .rmb-container {
    padding: 12px;
  }

  .rmb-letter-input {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  #rmb-scoreboard {
    font-size: 0.9rem;
  }
  .rmb-share-icon {
	display: block;
    text-align: center;
    font-size: 15px;
	width: 65%;
    margin: 0 auto;
  }
	#rmb-reveal-text {
		font-size: 3.5rem !important;
	}
}