/* Host Container */
.gmr-host-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.gmr-host-box {
  background: linear-gradient(145deg, #fff6fc, #f1f9ff);
  border: 4px solid #ffb3d1;
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 25px rgba(0,0,0,0.1);
  animation: popIn 0.6s ease;
}

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

.gmr-gender-options {
  display: flex;
  justify-content: space-around;
  margin: 20px 0;
}

.gmr-gender-option {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 18px;
  transition: all 0.3s ease;
  user-select: none;
  background: #f0f0f0;
}

.gmr-gender-option input {
  display: none;
}

.gmr-gender-option.boy.selected {
  background: #cce5ff;
  border-color: #3399ff;
  color: #0056b3;
}

.gmr-gender-option.girl.selected {
  background: #ffe0f0;
  border-color: #ff3399;
  color: #cc0066;
}

.gmr-gender-option.twins.selected {
  background: #e5ffe5;
  border-color: #00cc66;
  color: #006633;
}

#gmr-link-box {
  margin-top: 20px;
}

#gmr-token-link {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fdfdfd;
}

.gmr-link-buttons {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.gmr-link-buttons button {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#gmr-copy-link {
  background: #ffe066;
}

#gmr-copy-link.copied {
  background: #a3e635;
}

#gmr-open-link {
  background: #5eead4;
}

#gmr-wrapper {
  max-width: 700px;
  margin: 2rem auto;
  text-align: center;
  font-family: 'Comic Sans MS', cursive;
}

.gmr-title {
  font-size: 2rem;
  color: #4e342e;
}

#gmr-start-screen,
#gmr-game-screen,
#gmr-result-screen {
  border: 3px solid #ff80ab;
  border-radius: 15px;
  padding: 20px;
  background: linear-gradient(to right, #fce4ec, #e1f5fe);
  box-shadow: 0 0 12px rgba(0,0,0,0.1);
  margin: 2rem 0;
}

#gmr-result-screen {
  animation: fadeInUp 0.8s ease;
  text-align: center;
  background: linear-gradient(to right, #ffecd2, #fcb69f);
  border: 3px #ff80ab;
  position: relative;
  overflow: hidden;
}

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

/* Difficulty Level */
#gmr-difficulty-options {
  margin-top: 50px;
  margin-bottom: 50px;
  animation: fadeIn 0.5s ease;
}

.gmr-diff-btn {
  background: linear-gradient(to right, #4fc3f7, #81d4fa);
  border: none;
  padding: 10px 18px;
  font-size: 1rem;
  margin: 0.3rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  color: white;
  transition: background 0.3s ease;
}

.gmr-diff-btn:hover {
  background: linear-gradient(to right, #0288d1, #03a9f4);
}

/* User Entry, Start Screen, Multiplayer Mode Buttons */
#gmr-name-entry-multi {
  text-align: center;
  margin-bottom: 20px;
  margin-top: 50px;
}

#gmr-name-entry-multi input {
  padding: 10px;
  width: 80%;
  max-width: 300px;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 8px;
  outline: none;
  transition: 0.3s ease;
}

#gmr-name-entry-multi input:focus {
  border-color: #ff69b4;
  box-shadow: 0 0 5px #ff69b4;
}

.gmr-name-entry-box {
  text-align: center;
  margin-top: 20px;
}

.gmr-name-input {
  width: 80%;
  padding: 10px;
  font-size: 16px;
  margin: 8px 0;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.gmr-join-btn {
  margin-top: 10px;
  margin-bottom: 30px;
  padding: 10px 18px;
  font-size: 16px;
  border: none;
  background: #f48fb1;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.gmr-join-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  background-color: #ccc !important;
  color: #666 !important;
  border: 1px solid #999 !important;
  box-shadow: none !important;
}

#gmr-mode-select {
  text-align: center;
  margin-top: 50px;
  margin-bottom: 50px;
}

.gmr-mode-btn {
  padding: 12px 24px;
  margin: 10px;
  font-size: 18px;
  background: linear-gradient(135deg, #ffd700, #ffb347);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gmr-mode-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255, 183, 0, 0.6);
}

#gmr-join-room-btn, #gmr-replay-btn {
  background: linear-gradient(135deg, #ff9800, #ffc107);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 1rem;
  margin-bottom: 2rem;
  transition: transform 0.3s ease;
}

#gmr-join-room-btn:hover,
#gmr-replay-btn:hover {
  transform: scale(1.05);
}

#gmr-start-screen input#gmr-username {
	padding: 10px;
	font-size: 1.1em;
}

/* Room Creation Styles */
#gmr-room-create {
	text-align: center;
	margin-top: 50px;
	margin-bottom: 50px;
}

#gmr-room-create input#gmr-room-link {
	width: 90%;
	padding: 10px;
	font-size: 1.1em;
	border: 2px solid #ccc;
	border-radius: 8px;
	outline: none;
	text-align: center;
	margin-bottom: 15px;
	background-color: #fffbe6;
	color: #444;
	font-weight: bold;
}

#gmr-room-create button {
	padding: 12px 20px;
	margin: 8px 10px;
	font-size: 1em;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.3s ease, transform 0.2s ease;
	font-weight: bold;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#gmr-room-create button:hover {
	transform: scale(1.05);
}

/* Specific styles */
#gmr-room-create button:nth-child(3) {
	background: linear-gradient(to right, #ffde59, #ffc107);
	color: #000;
}

#gmr-room-create button#gmr-host-start-btn {
	background: linear-gradient(to right, #00c9ff, #92fe9d);
	color: #000;
}

#gmr-room-link {
	width: 90%;
	padding: 8px;
	margin: 10px 0;
	font-size: 1em;
}

/* Host and Guest Lobby */
#gmr-lobby-screen {
  text-align: center;
  margin: 20px auto;
  max-width: 480px;
  font-family: 'Comic Sans MS', cursive;
}

#gmr-lobby-screen h2 {
  font-size: 1.8em !important;
  margin-bottom: 25px;
  color: #e59e00;
}

#gmr-player-list {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}

#gmr-player-list li {
  background: #fff;
  border: 1px dashed #ffc107;
  padding: 8px 12px;
  margin: 6px auto;
  max-width: 300px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#gmr-player-list button {
  border: none;
  color: white;
  font-size: 0.9em;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
}

.gmr-kick-btn {
	margin-left: 10px;
	color: red;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 16px;
}

#gmr-host-actions {
  margin-top: 20px;
}

#gmr-host-launch-btn {
  padding: 12px 20px;
  font-size: 1.1em;
  background: linear-gradient(45deg, gold, orange);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s;
  margin-bottom: 25px;
}

#gmr-host-launch-btn:hover {
  transform: scale(1.05);
}

.gmr-dot-anim::after {
    content: '';
    animation: gmrDots 1.5s infinite steps(3);
}
@keyframes gmrDots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
    100% { content: ''; }
}

#gmr-golden-match {
  background: #fff3e0;
  border: 2px dashed gold;
  padding: 1.5rem;
  border-radius: 12px;
  margin: 2rem auto;
  max-width: 550px;
  animation: popIn 0.5s ease;
}

#gmr-golden-match h2 {
  color: #ff9800;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

#gmr-golden-match p {
  font-size: 1.2rem;
  color: #6d4c41;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Toast Container - Center Bottom */
#gmr-toast-container {
	position: fixed;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: center;
	pointer-events: none; /* Allow clicks to pass through */
}

/* Individual Toast Style */
.gmr-toast {
	background: #333;
	color: #fff;
	padding: 12px 16px;
	border-radius: 8px;
	margin-top: 10px;
	font-size: 14px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: auto; /* Needed for any interactive content */
}

/* Toast Show State */
.gmr-toast.show {
	opacity: 1;
}

#gmr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  margin-top: 1.5rem;
}

.gmr-card {
  background: #fff9c4;
  border-radius: 10px;
  height: 80px;
  cursor: pointer;
  font-size: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  perspective: 1000px;
  width: 100%;
  position: relative;
}

.gmr-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  border-radius: 10px;
}

.gmr-card.flipped .gmr-card-inner {
  background: #aed581;
  pointer-events: none;
  transform: rotateY(180deg);
}

.gmr-card-front, .gmr-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  user-select: none;
}

.gmr-card-front {
  background: #fff9c4;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.gmr-card-back {
  background: #aed581;
  transform: rotateY(180deg);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.gmr-hidden {
  display: none !important;
}

#gmr-score-box {
  font-weight: bold;
  font-size: 1.1rem;
  margin: 1rem 0;
}

#gmr-score-live {
  font-size: 1.1rem;
  color: #ff5722;
  margin-top: 0.5rem;
  font-weight: bold;
}

#gmr-meter-container {
  width: 100%;
  height: 20px;
  background: #eeeeee;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

#gmr-meter-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff8bd1, #ffdf8b);
  box-shadow: 0 0 12px 4px rgba(255, 200, 255, 0.7);
  transition: width 1s ease-in-out;
  animation: glowPulse 2s infinite ease-in-out;
  border-radius: 5px;
}

@keyframes glowPulse {
  0%   { box-shadow: 0 0 8px 3px rgba(255, 200, 255, 0.5); }
  50%  { box-shadow: 0 0 20px 8px rgba(255, 150, 255, 0.8); }
  100% { box-shadow: 0 0 8px 3px rgba(255, 200, 255, 0.5); }
}

/* Leaderboard CSS */
#gmr-leaderboard-box {
  max-width: 600px;
  margin: 0 auto;
  border-radius: 12px;
  padding: 20px;
}

#gmr-leaderboard-list {
  list-style: none;
  padding: 0;
}

.gmr-leaderboard-item {
  padding: 10px 14px;
  margin: 8px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
}

.gmr-leaderboard-item strong {
  color: #0984e3;
}

.gmr-leaderboard-item .gmr-time {
  font-size: 14px;
  color: #636e72;
  margin-left: 12px;
}

.gmr-highlight {
  background: #ffeaa7;
  border-left: 4px solid #fdcb6e;
  font-weight: bold;
}

button.gmr-join-btn:disabled,
button.gmr-disabled-btn {
  cursor: not-allowed !important;
}

.gmr-disabled-note {
	font-size: 14px;
	color: #777;
	margin-top: 5px;
	text-align: center;
}

/* Countdown Screen */
.gmr-countdown-screen {
	text-align: center;
	padding: 60px 20px;
	color: #2575fc;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.gmr-big-count {
	font-size: 200px !important;
	font-weight: bold;
	animation: gmr-pop-scale 0.3s ease-out;
}

.gmr-pop {
	animation: gmr-pop-scale 0.3s ease-out;
}

@keyframes gmr-pop-scale {
	0% { transform: scale(1); opacity: 0.7; }
	50% { transform: scale(1.5); opacity: 1; }
	100% { transform: scale(1); opacity: 1; }
}

/* Star overlay container */
.gmr-star-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

/* Individual star */
.gmr-star {
  position: absolute;
  color: #fff;
  font-size: 12px;
  animation: starBurst 1.2s linear forwards;
  opacity: 0.8;
}

@keyframes starBurst {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-30px) scale(0.5); opacity: 0; }
}

#gmr-final-message {
  font-size: 3rem;
  margin: 1.5rem 0;
  font-weight: bold;
  background: linear-gradient(to right, #ff80ab, #80d8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulseText 2s infinite;
}

@keyframes pulseText {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

#gmr-summary {
  font-size: 1rem;
  margin: 1rem 0;
  color: #555;
}

.gmr-share-buttons a {
  margin: 10px;
  padding: 10px 15px;
  background: #4caf50;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
}

.gmr-firework-container {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	pointer-events: none;
	overflow: visible !important;
	z-index: 999;
}

.gmr-firework-launch {
	position: absolute;
	bottom: 0;
	width: 2px;
	height: 150px;
	background: linear-gradient(to top, #fff, #ccc);
	animation: launch 1.5s ease-out forwards;
}

.gmr-particle-burst {
	position: absolute;
	width: 0;
	height: 0;
	z-index: 1000;
	pointer-events: none;
}

.gmr-particle {
	position: absolute;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	transform: rotate(var(--angle));
	animation: particle-move 2s ease-out forwards;
	opacity: 1;
}

.gmr-particle.gold {
	background-color: gold;
	box-shadow: 0 0 6px gold;
}

.gmr-particle.silver {
	background-color: silver;
	box-shadow: 0 0 6px silver;
}

@keyframes particle-move {
	0% {
		transform: rotate(var(--angle)) translateY(0px) scale(1);
		opacity: 1;
	}
	100% {
		transform: rotate(var(--angle)) translateY(var(--distance)) scale(0.8);
		opacity: 0;
	}
}

@keyframes launch {
	0% {
		transform: translateY(0);
		opacity: 1;
	}
	100% {
		transform: translateY(-300px);
		opacity: 0;
	}
}

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

@media (max-width: 768px) {
  .gmr-gender-options {
    flex-direction: column;
    align-items: stretch;
	gap: 20px;
  }
	.gmr-gender-option {
    width: 100%;
    text-align: center;
    padding: 14px 16px;
    font-size: 18px;
  }
	#gmr-wrapper { font-family: 'Comic Sans MS'; }
	.gmr-host-box { padding: 20px; }
}