/* General resets and container */
body, html {
  margin: 0;
  padding: 0;
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(to bottom, #fff5fb, #fefefe);
  overflow-x: hidden;
}

.ggg-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  margin: auto;
}

.ggg-boxed-content {
  border: 1px solid #ffe4f1;
  background: linear-gradient(to bottom, #fff7fa, #fff);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(255, 105, 180, 0.15);
  width: 100%;
  margin: auto;
}

/* HOST Screen */
.ggg-host-screen {
  width: 100%;
  max-width: 600px;
  margin: auto;
  padding: 2rem;
  text-align: center;
}

.ggg-host-box {
  border: 3px solid #ffcce0;
  border-radius: 1.5rem;
  animation: pulse-border 3s infinite;
  padding: 2rem;
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 105, 180, 0.3); }
  50% { box-shadow: 0 0 20px rgba(255, 105, 180, 0.6); }
}

.ggg-gender-options {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.ggg-radio {
  font-size: 1.1rem;
  background: #ffe0f5;
  padding: 0.7rem 1.5rem;
  border-radius: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  border: 2px solid transparent;
}

.ggg-radio input {
  display: none;
}

.ggg-radio.boy.selected {
  background: #d0eaff;
  border-color: #66ccff;
}

.ggg-radio.girl.selected {
  background: #ffe0f5;
  border-color: #ff66cc;
}

.ggg-radio.twins.selected {
  background: #e0f0ff;
  border-color: #cc99ff;
}

.ggg-radio:hover {
  transform: scale(1.05);
}

.ggg-link-label {
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: #444;
}

#ggg-generated-link {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 1rem;
  font-size: 0.9rem;
  text-align: center;
}

.ggg-link-buttons {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.ggg-copy-btn, .ggg-open-btn {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 1.5rem;
  background: #ffb3da;
  color: #333;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.ggg-copy-btn:hover, .ggg-open-btn:hover {
  background: #ff85c1;
}

/* Start Screen */
.ggg-start-screen {
  text-align: center;
  padding: 2rem;
  position: relative;
}

.ggg-ear-icon {
  font-size: 3rem;
  animation: ear-pulse 2s infinite;
  margin-bottom: 1rem;
  color: #ff69b4;
}

@keyframes ear-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.ggg-sound-waves {
  display: flex;
  justify-content: center;
  margin: 1rem auto;
  gap: 4px;
  height: 20px;
}

.ggg-sound-waves div {
  width: 6px;
  background: #ff85c1;
  border-radius: 4px;
  animation: wave 1.2s infinite ease-in-out;
}

.ggg-sound-waves div:nth-child(1) { animation-delay: 0s; }
.ggg-sound-waves div:nth-child(2) { animation-delay: 0.2s; }
.ggg-sound-waves div:nth-child(3) { animation-delay: 0.4s; }
.ggg-sound-waves div:nth-child(4) { animation-delay: 0.6s; }
.ggg-sound-waves div:nth-child(5) { animation-delay: 0.8s; }

@keyframes wave {
  0%, 100% { height: 10px; }
  50% { height: 25px; }
}

.ggg-progress-bar-container {
  width: 100%;
  background: #f0f0f0;
  height: 12px;
  border-radius: 6px;
  margin-bottom: 30px;
  overflow: hidden;
}

.ggg-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #ff69b4, #ffc1e5);
  transition: width 0.3s ease;
}

.ggg-game-header {
  text-align: center;
  margin-bottom: 1rem;
}

.ggg-game-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  font-weight: 600;
  color: #ff69b4;
  margin-bottom: 0.5rem;
}

@keyframes ggg-icon-vibrate {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.ggg-icon.vibrating {
  animation: ggg-icon-vibrate 0.3s linear infinite;
}

.ggg-audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.ggg-icon {
  font-size: 1.6rem;
  color: #ff69b4;
}

.ggg-replay-icon {
  font-size: 1rem;
  cursor: pointer;
  color: #555;
  transition: transform 0.2s ease, color 0.2s ease;
}

.ggg-replay-icon:hover {
  transform: scale(1.1);
  color: #ff69b4;
}

.ggg-progress-numbers {
  font-size: 1rem;
  color: #666;
  position: relative;
}

.ggg-sound-icon {
  font-size: 1.4rem;
  margin-left: 0.5rem;
  animation: pulse-vibrate 2s infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes pulse-vibrate {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3) rotate(5deg); }
}

/* Emoji click feedback animation */
.ggg-emoji-options button:active {
  transform: scale(1.1);
  background-color: #ffecf5;
  animation: pulse-emoji 0.4s ease;
  box-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
}

@keyframes pulse-emoji {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.ggg-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #ff69b4;
}

.ggg-desc {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: #555;
}

.ggg-start-btn {
  background: #ffb3da;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  border-radius: 2rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.ggg-start-btn:hover {
  background: #ff85c1;
}

/* Game Screen */
.ggg-game-screen {
  text-align: center;
  width: 100%;
  max-width: 500px;
}

.ggg-progress-numbers {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.ggg-emoji-options {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.ggg-emoji-options button {
  font-size: 2rem;
  background: #ffe0f5;
  border: none;
  border-radius: 1rem;
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
}

.ggg-emoji-options button:hover {
  background: #ffc1e5;
  transform: scale(1.1);
}

.ggg-emoji-tracker {
  text-align: center;
  font-size: 16px;
  margin: 10px 0;
  padding: 8px 14px;
  background: #f8f8f8;
  border-radius: 12px;
  color: #333;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: inline-block;
  animation: fadeIn 0.6s ease;
}

.ggg-giggle-fact {
  text-align: center;
  font-style: italic;
  margin: 16px auto;
  font-size: 16px;
  color: #333;
  background: #fff8ec;
  border-left: 4px solid #ffb347;
  padding: 10px 18px;
  max-width: 90%;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
}

.ggg-giggle-fact.hidden {
  opacity: 0;
  visibility: hidden;
}

.hidden:not(.ggg-giggle-fact) {
  display: none !important;
}

.ggg-reaction-poll {
  margin-top: 20px;
  text-align: center;
}
.ggg-reaction-poll button {
  margin: 5px;
  padding: 6px 12px;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s;
}
.ggg-reaction-poll button:hover {
  transform: scale(1.1);
}
.ggg-reaction-poll button.dimmed {
  opacity: 0.5;
  pointer-events: none;
}

/* End Screen */
.ggg-end-screen {
  text-align: center;
  padding: 4rem 2rem 2rem; /* Increased top padding from 2rem to 4rem */
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  min-height: 90vh; /* Increase to give more vertical room */
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* So top padding actually pushes content down */
}

.ggg-share-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  color: #ff69b4;
}

.ggg-play-again-btn {
  margin-top: 0.5rem;
  background: #ffb3da;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  border-radius: 2rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.ggg-play-again-btn:hover {
  background: #ff85c1;
}

.ggg-replay-msg {
  margin-top: 30px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.ggg-emoji-summary {
  margin: 20px 0;
  text-align: center;
  background: #fff8f8;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ggg-summary-title {
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 16px;
  color: #444;
}

#ggg-end-emoji-tracker {
  font-size: 18px;
  font-weight: 500;
  color: #222;
}

/* Contain surprise box better */
.ggg-surprise-box {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 2rem;
  animation: pop-box 2.2s ease-in-out;
  overflow: visible;
  transition: opacity 0.5s ease;
}

.ggg-lid {
  position: absolute;
  top: 0;
  width: 100%;
  height: 40px;
  background: #ff85c1;
  border-radius: 12px 12px 0 0;
  z-index: 2;
}

.ggg-lid.open {
  animation: box-lid 1.5s ease forwards;
}

.ggg-surprise-box.fade-out {
  opacity: 0;
}

.ggg-box-body {
  position: absolute;
  top: 40px;
  width: 100%;
  height: 110px;
  background: #ffb3da;
  border-radius: 0 0 12px 12px;
  z-index: 1;
}

.ggg-final-gender-message {
  font-size: 2.4rem;
  font-weight: bold;
  color: #ff69b4;
  text-align: center;
  margin-bottom: 1rem;
  padding-top: 1rem;
  display: block;
  opacity: 1;
}

@keyframes genderPopReveal {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-5deg);
    filter: brightness(1.2);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(5deg);
    filter: brightness(1.4);
  }
  100% {
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }
}

.ggg-final-gender-message.show {
  animation: genderPopReveal 1.5s ease-out forwards;
}

.ggg-reveal-message {
  font-size: 2.4rem;
  font-weight: bold;
  margin: 2rem 0 2.5rem;
  color: #ff69b4;
  opacity: 0;
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  z-index: 3;
  pointer-events: none;
}

.ggg-reveal-message.animate {
  animation: reveal-pop 2.5s ease-out forwards;
}

@keyframes reveal-pop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0px) scale(0.5) rotate(-5deg);
  }
  30% {
    opacity: 1;
    transform: translateX(-50%) translateY(-90px) scale(1.25) rotate(5deg);
  }
  70% {
    transform: translateX(-50%) translateY(-120px) scale(1) rotate(0deg);
  }
  100% {
    transform: translateX(-50%) translateY(20px) scale(1) rotate(0deg);
  }
}

.ggg-analysis-message {
  font-size: 1.2rem;
  color: #666;
  margin-top: 1.5rem;
}

.ggg-share-icons {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.ggg-share {
  text-decoration: none;
  background: #ffe0f5;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

.ggg-share:hover {
  background: #ffc1e5;
}

canvas#ggg-celebration-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

@keyframes pop-box {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes box-lid {
  0% { top: 0; }
  100% { top: -80px; }
}

@media (min-width: 768px) {
  .ggg-emoji-options {
    flex-wrap: nowrap;
    flex-direction: row;
  }
}

@media (max-width: 767px) {
  .ggg-host-screen {
    max-width: 100% !important;
    padding: 1rem !important;
  }

  .ggg-boxed-content.ggg-host-box {
    padding: 1rem;
    border-width: 2px;
  }

  .ggg-gender-options {
    flex-direction: column;
    align-items: center;
  }

  .ggg-radio {
    width: 80%;
    text-align: center;
    margin: 0.5rem 0;
  }

  #ggg-generated-link {
    font-size: 0.85rem;
  }
  .ggg-start-screen,
  .ggg-game-screen,
  .ggg-end-screen {
    max-width: 100% !important;
    width: 100% !important;
    padding: 1rem !important;
  }

  .ggg-boxed-content {
    padding: 1rem !important;
    border-width: 1px;
  }
  .ggg-share-icons {
    flex-direction: column;
	align-items: center;
    gap: 0.8rem;
  }
  .ggg-share {
    width: 80%;
    text-align: center;
  }
}