/* Host Screen */
#nrm-host-screen {
  background: linear-gradient(to right, #fdf2f8, #e0f2fe);
  border: 4px solid #f472b6;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 0 30px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
  max-width: 600px;
  margin: 2rem auto;
  animation: fadeIn 1s ease;
}

.nrm-host-heading {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #444;
}

.nrm-host-intro {
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: #555;
}

.nrm-note {
  font-size: 0.9rem;
  margin-bottom: 2rem;
  color: #555;
  text-align: center;
}

.nrm-gender-select {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.nrm-gender-radio {
  border: 2px solid #ccc;
  padding: 1rem 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  background: white;
  transition: 0.3s ease;
  font-weight: bold;
}

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

.nrm-gender-radio.selected.boy {
  background: #a5f3fc;
  border-color: #38bdf8;
}

.nrm-gender-radio.selected.girl {
  background: #fbcfe8;
  border-color: #f472b6;
}

.nrm-gender-radio.selected.twins {
  background: #d1fae5; /* soft green */
  border-color: #10b981; /* emerald green */
}

.nrm-generated-link-box {
  text-align: center;
  margin-top: 1rem;
}

#nrm-secret-link {
  width: 100%;
  max-width: 480px;
  padding: 0.5rem;
  font-size: 1rem;
  border: 2px solid #ccc;
  border-radius: 12px;
  margin: 0.5rem auto;
  display: block;
  background: #f9f9f9;
}

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

.nrm-link-buttons button {
  background: #f472b6;
  color: white;
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.nrm-link-buttons button:hover {
  background: #ec4899;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Base */
body, html {
  margin: 0;
  padding: 0;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background: linear-gradient(to bottom right, #ffe4e6, #dbeafe);
}

/* Container for all screens */
.nrm-screen-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Bright colorful start box */
.nrm-start-box {
  background: linear-gradient(135deg, #fceabb, #f8b500, #f78ca0, #fbc2eb);
  background-size: 400% 400%;
  animation: gradientFlow 10s ease infinite;
  border: 4px solid #fff;
  padding: 2rem;
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

/* Animated background flow */
@keyframes gradientFlow {
  0% {background-position: 0% 50%;}
  50% {background-position: 100% 50%;}
  100% {background-position: 0% 50%;}
}

/* Wrapper */
#nrm-game-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center; 
}

/* Title */
.nrm-title {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 2.5rem !important;
  color: #fff;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

/* Container Borders */
#nrm-start-screen,
#nrm-scoreboard,
#nrm-game-board {
  background: #fff;
  width: 100%;
  max-width: 768px;
  margin-bottom: 1.5rem;
}

#nrm-game-board {
	position: relative;
}

/* Radio Buttons */
/* Radio Group Layout */
.nrm-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

/* Label Wrapper */
.nrm-radio {
  display: inline-block;
  cursor: pointer;
  border-radius: 25px;
  padding: 0.6rem 1.2rem;
}

/* Hide native radio */
.nrm-radio input[type="radio"] {
  display: none;
}

/* Visual Button */
.nrm-radio span {
  display: inline-block;
  width: 180px;
  height: 60px;
  line-height: 55px;
  text-align: center;
  font-weight: bold;
  border-radius: 25px;
  background-color: #fff;
  border: 2px solid #ccc;
  color: #333;
  transition: none;
}

/* Active state */
.nrm-radio input[type="radio"]:checked + span {
  background-color: #f472b6;
  border-color: #f472b6;
  color: #fff;
}

/* Optional: Hover effect */
.nrm-radio span:hover {
  border-color: #f472b6;
}

/* Buttons */
#nrm-start-btn,
#nrm-end-screen button,
button.nrm-share-icon,
button#nrm-play-again {
  display: block;
  margin: 0 auto !important;
  background: #f472b6;
  color: white;
  border: none;
  border-radius: 25px;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease;
  margin-top: 25px !important;
}

#nrm-start-btn:hover,
#nrm-end-screen button:hover,
button.nrm-share-icon:hover,
button#nrm-play-again:hover {
  background: #ec4899;
}

/* Game Board */
#nrm-game-board {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

#nrm-scoreboard,
#nrm-game-board {
  border: 3px solid #f472b6;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  padding: 1rem;
}

.nrm-card {
  position: relative;
  height: 100px;
  perspective: 1000px;
}

.nrm-card-inner {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.nrm-card.flipped .nrm-card-inner {
  transform: rotateY(180deg);
}

.nrm-card-front,
.nrm-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid #ccc;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  font-size: 0.9rem;
  padding: 10px;
  text-align: center;
  box-sizing: border-box;
}

/* Improved design of unflipped tile */
.nrm-card-front {
  background: #fef3c7;
  color: #444;
  font-weight: bold;
}

.nrm-card-back {
  background: #ffe6f0;
  transform: rotateY(180deg);
  font-weight: bold;
  color: #333;
  border-color: #ff80aa;
}

/* Scoreboard */
#nrm-scoreboard {
  text-align: center;
  font-size: 1.1rem;
  font-weight: bold;
  color: #444;
}

/* Score styling */
.nrm-score {
  font-size: 1.3rem;
  font-weight: bold;
  margin-left: 1rem;
  background: linear-gradient(to right, #f472b6, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulseScore 2s infinite ease-in-out;
  transition: transform 0.2s ease;
}

/* Score pulse animation */
@keyframes pulseScore {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Glowing effect on score number specifically */
#nrm-score {
  text-shadow: 0 0 5px #f472b6, 0 0 10px #60a5fa;
  font-size: 1.4rem;
  font-weight: bold;
}

/* Flash score when it updates */
.score-flash {
  animation: flashGlow 0.5s ease;
}

@keyframes flashGlow {
  0% { text-shadow: 0 0 5px #ff0, 0 0 15px #f0f; transform: scale(1.2); }
  100% { text-shadow: 0 0 5px #f472b6, 0 0 10px #60a5fa; transform: scale(1); }
}

.nrm-score-metrics {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.nrm-metrics-row {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.nrm-score-row {
  text-align: center;
}

/* End Screen */
#nrm-end-screen {
  background: linear-gradient(135deg, #fbc2eb, #a18cd1);
  border: 0px solid transparent;
  border-radius: 20px;
  padding: 2rem;
  animation: glowPulse 3s ease-in-out infinite;
  position: relative;
  box-shadow: 0 0 30px rgba(248, 191, 248, 0.5);
  --glow-color: #f472b6;
  max-width: 600px;
  margin: 1rem auto;
  width: 100%;
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 10px var(--glow-color, #f472b6); }
  50% { box-shadow: 0 0 30px var(--glow-color, #f472b6); }
  100% { box-shadow: 0 0 10px var(--glow-color, #f472b6); }
}

.nrm-end-content {
  padding: 3rem;
  border-radius: 20px;
  max-width: 500px;
  margin: auto;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: 100%;
}

.nrm-end-content h3 {
  text-align: center;
  font-size: 2.5rem;
  color: #fff;
  font-weight: bold;
  white-space: nowrap;
  text-shadow: 0 0 10px #f472b6, 0 0 20px #60a5fa;
  margin-bottom: 1rem;
  animation: popFade 1.2s ease-out;
  margin-top: -10px;
  margin-bottom: 45px;
}

@keyframes popFade {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

.nrm-inline-metric {
  white-space: nowrap;
  font-size: 1.1rem;
  font-weight: bold;
  color: #fff;
  text-align: center;
}

.nrm-gender-reveal {
  font-size: 2rem;
  text-align: center;
  white-space: nowrap;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 8px #f472b6, 0 0 12px #60a5fa;
  margin-bottom: 1rem;
}

.nrm-share-heading {
  margin-bottom: 0px !important;
  text-shadow: 0 0 4px #60a5fa;
}

.nrm-end-content p {
  font-size: 1.2rem;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  margin: 0.5rem auto;
  width: fit-content;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  text-align: center;
}

/* End Screen Rhymes Showing CSS */
.nrm-memory-scroll {
  max-height: 360px;
  overflow-y: auto;
  background: linear-gradient(135deg, #fff1f5, #ffeaf1);
  padding: 1.2em;
  margin-top: 1.5em;
  border-radius: 16px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  border: 2px solid #f9c2d1;
  position: relative;
  margin-bottom: 30px;
}

.nrm-memory-scroll h4 {
  margin-top: 0;
  font-size: 1.25rem;
  color: #b83280;
  text-align: center;
  font-weight: bold;
  margin-bottom: 0.75em;
}

.nrm-scroll-list .nrm-memory-pair {
  background: #ffffff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
}

.nrm-scroll-list .nrm-memory-pair:hover {
  transform: scale(1.01);
  background-color: #fff7fa;
}

.nrm-scroll-list .line {
  font-size: 15px;
  color: #333;
  line-height: 1.4;
  padding-left: 12px;
  position: relative;
}

.nrm-scroll-list .line::before {
  content: "♪";
  position: absolute;
  left: 0;
  color: #f472b6;
  font-weight: bold;
}

/* Video Box */
.nrm-user-video {
  position: absolute;
  bottom: 10px;
  right: 10px;
  top: auto;
  left: auto;
  width: 120px;
  height: 160px;
  border-radius: 10px;
  z-index: 1000;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  cursor: grab;
}

.nrm-user-video.enlarged {
  width: 100%;
  height: auto;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#nrm-download-wrapper {
  text-align: center;
}

#nrm-download-link {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: bold;
  background-color: #4f46e5;
  color: white;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  cursor: pointer;
}
#nrm-download-link:hover {
  background-color: #4338ca;
}

#nrm-sparkles {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.nrm-share-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.nrm-share-icon {
  background: #f472b6;
  color: white;
  font-size: 1rem;
  padding: 0.5rem 1.2rem;
  border-radius: 30px;
  flex: 1 1 calc(50% - 10px);
  max-width: 140px;
  text-align: center;
}

#nrm-gender-text {
  font-size: 3.5rem;
  font-weight: bold;
  display: inline-block;
  margin: 0 0.3rem;
  background: linear-gradient(
    90deg,
    #f472b6,
    #facc15,
    #60a5fa,
    #f472b6
  );
  background-size: 400% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 5s linear infinite, genderPop 1s ease-out;
  text-shadow: 
    0 0 5px rgba(255, 255, 255, 0.7),
    0 0 15px #f472b6,
    0 0 25px #60a5fa;
}

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

@keyframes genderPop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

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

/* Responsive Grid Layout */
@media (max-width: 480px) {
  .nrm-share-icon {
    flex: 1 1 100%;
    max-width: 200px;
  }
  .nrm-end-content {
    padding: 1.5rem;
	max-width: 100%;
  }
  #nrm-end-screen {
    padding: 1rem;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
  }
  #nrm-gender-text {
    font-size: 2.2rem;
  }
}

@media (max-width: 640px) {
  #nrm-game-board {
    grid-template-columns: repeat(2, 1fr);
  }
  .nrm-card {
    height: 80px;
    font-size: 0.75rem;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  #nrm-game-board {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .nrm-share-icons {
    flex-wrap: nowrap;
    gap: 1rem;
  }
  .nrm-share-icon {
    flex: 0 0 auto;
    max-width: none;
  }
}

@media (min-width: 1025px) {
  #nrm-game-board {
    grid-template-columns: repeat(4, 1fr);
  }
}