.tools-parent-container {
  /* Animated background elements */
}
.tools-parent-container body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at 20% 80%, rgba(255, 182, 193, 0.3) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(173, 216, 230, 0.3) 0%, transparent 50%), radial-gradient(circle at 40% 40%, rgba(255, 255, 224, 0.3) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}
.tools-parent-container {
  /* Header Section */
}
.tools-parent-container .header-section {
  position: static; /* Fixed position */
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000; /* High z-index */
  text-align: center;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 0 0 20px 20px;
  margin: 0;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-bottom: 3px solid #FFB6C1;
  backdrop-filter: blur(10px);
}
.tools-parent-container .main-title {
  font-family: "Fredoka One", cursive;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: #FF6B9D;
  margin: 0 0 10px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  animation: bounce 2s infinite;
}
.tools-parent-container .description {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: #4A90E2;
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}
.tools-parent-container {
  /* Game Info */
}
.tools-parent-container .game-info {
  position: static; /* Fixed position */
  top: 90px; /* Below header */
  left: 0;
  right: 0;
  z-index: 1900; /* High z-index */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0 0 15px 15px;
  margin: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  transform: translateX(0) !important;
  margin: 16px auto;
}
.tools-parent-container .timer-display {
  font-family: "Fredoka One", cursive;
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: #FF6B9D;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tools-parent-container .timer-icon {
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}
.tools-parent-container .stars-display {
  display: flex;
  gap: 5px;
}
.tools-parent-container .star {
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  filter: grayscale(100%);
  transition: all 0.3s ease;
}
.tools-parent-container .star.earned {
  filter: grayscale(0%);
  animation: starEarn 0.5s ease;
}
@keyframes starEarn {
  0% {
    transform: scale(0) rotate(0deg);
  }
  50% {
    transform: scale(1.3) rotate(180deg);
  }
  100% {
    transform: scale(1) rotate(360deg);
  }
}
.tools-parent-container .puzzle-container {
 position: relative;
}
.tools-parent-container #menu {
  position: absolute; /* Fixed position */
  top: 10px; /* Below game info */
  left: 5px;
  z-index: 1800; /* High z-index */
  list-style-type: none;
  padding: 0;
  display: inline-block;
  text-align: center;
}
.tools-parent-container #menu li {
  margin: 3px;
  padding: 10px 15px;
  border-radius: 20px;
  background: linear-gradient(135deg, #FFE5F1, #E5F3FF);
  border: 2px solid #FFB6C1;
  font-family: "Comic Neue", sans-serif;
  font-weight: 700;
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: #4A90E2;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
}
.tools-parent-container #menu li:hover {
  background: linear-gradient(135deg, #FFB6C1, #87CEEB);
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.2);
}
.tools-parent-container .menu-toggle {
  font-size: 1.3rem !important;
  background: #FF6B9D !important;
  color: white !important;
}
.tools-parent-container .pieces-option:hover {
  animation: wiggle 0.5s ease;
}
@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-2deg);
  }
  75% {
    transform: rotate(2deg);
  }
}
.tools-parent-container #shape {
  font-family: "Comic Neue", sans-serif;
  font-weight: 600;
  border: 2px solid #FFB6C1;
  border-radius: 8px;
  padding: 4px;
  background: white;
  color: #4A90E2;
  font-size: 0.9rem;
}
.tools-parent-container #forPuzzle {
  position: relative; /* Keep fixed but adjust positioning */
  width: calc(100vw - 20px);
  height: calc(100vh - 180px); /* Adjust for header space */
  top: 0; /* Below all fixed elements */
  left: 10px;
  background: linear-gradient(135deg, #FFF8DC 0%, #F0F8FF 100%);
  overflow: hidden;
  border-radius: 20px;
  border: 4px solid #FFB6C1;
  box-shadow: inset 0 0 50px rgba(255, 182, 193, 0.3);
  z-index: 1;
}
.tools-parent-container .polypiece {
  display: block;
  overflow: hidden;
  position: absolute;
  transition: all 0.3s ease;
}
.tools-parent-container .polypiece:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}
.tools-parent-container .moving {
  transition-property: top, left;
  transition-duration: 1s;
  transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.tools-parent-container .gameCanvas {
  display: none;
  overflow: hidden;
  position: absolute;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}
.tools-parent-container {
  /* Celebration Modal - keep as is */
}
.tools-parent-container .celebration-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  animation: fadeIn 0.5s ease;
}
.tools-parent-container .celebration-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #FFE5F1, #E5F3FF);
  padding: 30px;
  border-radius: 25px;
  text-align: center;
  border: 4px solid #FFB6C1;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
}
.tools-parent-container .celebration-title {
  font-family: "Fredoka One", cursive;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: #FF6B9D;
  margin: 0 0 15px 0;
  animation: celebrationBounce 1s ease infinite;
}
@keyframes celebrationBounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}
.tools-parent-container .celebration-message {
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: #4A90E2;
  font-weight: 700;
  margin-bottom: 15px;
}
.tools-parent-container .final-stars {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  margin: 15px 0;
}
.tools-parent-container .final-time {
  font-family: "Fredoka One", cursive;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  color: #FF6B9D;
  margin: 12px 0;
}
.tools-parent-container .play-again-btn {
  font-family: "Comic Neue", sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 3vw, 1.3rem);
  background: linear-gradient(135deg, #FF6B9D, #4A90E2);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.tools-parent-container .play-again-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}
.tools-parent-container {
  /* Confetti and Balloons - keep as is */
}
.tools-parent-container .confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}
.tools-parent-container .confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #FF6B9D;
  animation: confettiFall 3s linear infinite;
}
@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}
.tools-parent-container .balloons-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}
.tools-parent-container .balloon {
  position: absolute;
  width: 25px;
  height: 35px;
  border-radius: 50% 50% 50% 50%/60% 60% 40% 40%;
  animation: balloonFloat 4s ease-in-out infinite;
}
@keyframes balloonFloat {
  0% {
    transform: translateY(100vh) translateX(0px);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(40px);
    opacity: 0;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.tools-parent-container {
  /* Responsive Design */
}
@media (max-width: 768px) {
  .tools-parent-container body {
    padding-top: 140px;
  }
  .tools-parent-container .header-section {
    padding: 12px 15px;
  }
  .tools-parent-container .main-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }
  .tools-parent-container .description {
    font-size: 0.85rem;
  }
  .tools-parent-container .game-info {
    top: 75px;
    padding: 6px 15px;
    flex-direction: row;
    gap: 15px;
  }
  
  .tools-parent-container #menu li {
    padding: 8px 12px;
    margin: 2px;
    font-size: 0.75rem;
  }
  .tools-parent-container #forPuzzle {
    top: 0;
    left: 5px;
    width: calc(100vw - 10px);
    height: calc(100vh - 150px);
    border-radius: 15px;
    border-width: 2px;
  }
  .tools-parent-container .celebration-content {
    padding: 20px;
    margin: 10px;
  }
}
@media (max-width: 480px) {
  .tools-parent-container body {
    padding-top: 120px;
  }
  .tools-parent-container .header-section {
    padding: 10px;
  }
  .tools-parent-container .main-title {
    font-size: 1.2rem;
  }
  .tools-parent-container .description {
    font-size: 0.8rem;
  }
  .tools-parent-container .game-info {
    top: 65px;
    padding: 5px 10px;
  }
 
  .tools-parent-container #menu li {
    padding: 6px 10px;
    font-size: 0.7rem;
  }
  .tools-parent-container #forPuzzle {
    top: 120px;
    height: calc(100vh - 130px);
  }
  .tools-parent-container .celebration-content {
    padding: 15px;
  }
}
.tools-parent-container {
  /* Tablet Landscape */
}
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
  .tools-parent-container body {
    padding-top: 120px;
  }
  .tools-parent-container .header-section {
    padding: 10px 30px;
  }
  .tools-parent-container .main-title {
    font-size: 1.8rem;
  }
  .tools-parent-container .game-info {
    top: 70px;
    padding: 6px 30px;
  }
 
  .tools-parent-container #forPuzzle {
    top: 120px;
    height: calc(100vh - 130px);
  }
}
.tools-parent-container {
  /* Large Desktop */
}
@media (min-width: 1200px) {
  .tools-parent-container .header-section {
    max-width: 1200px;
    margin: 0 auto;
  }
  .tools-parent-container .game-info {
    max-width: 1200px;
    left: 50%;
    transform: translateX(-50%);
  }
  .tools-parent-container #menu {
    left: calc(50% - 580px);
  }
  .tools-parent-container #forPuzzle {
    max-width: 1200px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 40px);
  }
}
.tools-parent-container {
  /* Portrait Orientation */
}
@media (orientation: portrait) {
  .tools-parent-container .game-info {
    flex-direction: column;
    gap: 8px;
    padding: 8px 15px;
  }
  .tools-parent-container .timer-display {
    font-size: clamp(0.9rem, 3vw, 1.2rem);
  }
  .tools-parent-container .star {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }
}
.tools-parent-container {
  /* High DPI Displays */
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .tools-parent-container .header-section {
    backdrop-filter: blur(15px);
  }
  .tools-parent-container .game-info {
    backdrop-filter: blur(15px);
  }
  .tools-parent-container #menu li {
    backdrop-filter: blur(8px);
  }
}
.tools-parent-container {
  /* Dark mode support (if needed) */
}
@media (prefers-color-scheme: dark) {
  .tools-parent-container .header-section {
    background: rgba(30, 30, 30, 0.95);
    border-bottom-color: #FF6B9D;
    height: 50px;
  }
  .tools-parent-container .game-info {
    background: rgba(40, 40, 40, 0.9);
  }
  .tools-parent-container .main-title {
    color: #FF8FB3;
  }
  .tools-parent-container .description {
    color: #87CEEB;
  }
}
.tools-parent-container {
  /* Reduced motion for accessibility */
}
@media (prefers-reduced-motion: reduce) {
  .tools-parent-container .main-title {
    animation: none;
  }
  .tools-parent-container .timer-icon {
    animation: none;
  }
  .tools-parent-container .star.earned {
    animation: none;
  }
  .tools-parent-container .celebration-title {
    animation: none;
  }
  .tools-parent-container .moving {
    transition-duration: 0.3s;
  }
}
.tools-parent-container {
  /* Focus styles for accessibility */
}
.tools-parent-container #menu li:focus,
.tools-parent-container .play-again-btn:focus {
  outline: 3px solid #FF6B9D;
  outline-offset: 2px;
}
.tools-parent-container {
  /* Print styles */
}
@media print {
  .tools-parent-container .header-section,
  .tools-parent-container .game-info,
  .tools-parent-container #menu,
  .tools-parent-container .celebration-modal {
    display: none;
  }
  .tools-parent-container #forPuzzle {
    position: static;
    width: 100%;
    height: 80vh;
    top: auto;
    left: auto;
    transform: none;
  }
}