.tools-parent-container {
  /* Screen Management */
}
.tools-parent-container .screen {
  display: none;
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  animation: fadeIn 0.5s ease;
}
.tools-parent-container .screen.active {
  display: flex;
  justify-content: center;
  align-items: center;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.tools-parent-container {
  /* Main Menu */
}
.tools-parent-container .menu-container {
  background: white;
  border-radius: 30px;
  padding: 3rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 90%;
  width: 600px;
  position: relative;
  overflow: hidden;
}
.tools-parent-container .game-title {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #FF6B6B;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.tools-parent-container .title-emoji {
  font-size: clamp(2rem, 5vw, 3rem);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}
.tools-parent-container .menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}
.tools-parent-container .menu-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1.5rem;
  border-radius: 20px;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.tools-parent-container .menu-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
.tools-parent-container .play-btn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.tools-parent-container .help-btn {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.tools-parent-container .character-btn {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
.tools-parent-container .btn-icon {
  font-size: 2rem;
}
.tools-parent-container .floating-emoji {
  position: absolute;
  font-size: 3rem;
  animation: float 6s ease-in-out infinite;
  opacity: 0.3;
}
.tools-parent-container .floating-emoji:nth-child(1) {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}
.tools-parent-container .floating-emoji:nth-child(2) {
  top: 20%;
  right: 10%;
  animation-delay: 2s;
}
.tools-parent-container .floating-emoji:nth-child(3) {
  bottom: 10%;
  left: 15%;
  animation-delay: 4s;
}
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-30px);
  }
}
.tools-parent-container {
  /* Level Selection */
}
.tools-parent-container .level-select-container {
  background: white;
  border-radius: 30px;
  padding: 2rem;
  max-width: 90%;
  width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.tools-parent-container .back-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 15px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}
.tools-parent-container .back-btn:hover {
  transform: translateX(-5px);
}
.tools-parent-container .section-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  color: #FF6B6B;
  text-align: center;
  margin-bottom: 2rem;
}
.tools-parent-container .levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.tools-parent-container .level-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.tools-parent-container .level-card:hover:not(.locked) {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}
.tools-parent-container .level-card.locked {
  background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
  cursor: not-allowed;
  opacity: 0.7;
}
.tools-parent-container .level-card.completed {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}
.tools-parent-container .level-number {
  font-size: 1.8rem;
  color: white;
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.tools-parent-container .level-icon {
  font-size: 3rem;
  margin: 1rem 0;
}
.tools-parent-container .level-stars {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  margin: 0.5rem 0;
}
.tools-parent-container .level-star {
  font-size: 1.5rem;
  color: #ddd;
}
.tools-parent-container .level-star.filled {
  color: #FFD700;
}
.tools-parent-container .level-score {
  color: white;
  font-weight: bold;
  margin-top: 0.5rem;
  font-size: 1.1rem;
}
.tools-parent-container .random-btn {
  width: 100%;
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: white;
  border: none;
  padding: 1.5rem;
  border-radius: 20px;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.tools-parent-container .random-btn:hover {
  transform: scale(1.05);
}
.tools-parent-container .dice-icon {
  font-size: 2rem;
  animation: rotate 2s linear infinite;
}
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.tools-parent-container {
  /* Character Selection */
}
.tools-parent-container .character-select-container {
  background: white;
  border-radius: 30px;
  padding: 2rem;
  max-width: 90%;
  width: 800px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.tools-parent-container .characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.tools-parent-container .character-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.tools-parent-container .character-card:hover {
  transform: translateY(-10px) scale(1.1);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}
.tools-parent-container .character-card.selected {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  transform: scale(1.1);
}
.tools-parent-container .character-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 0.5rem;
}
.tools-parent-container .character-name {
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
}
.tools-parent-container {
  /* How to Play */
}
.tools-parent-container .help-container {
  background: white;
  border-radius: 30px;
  padding: 2rem;
  max-width: 90%;
  width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.tools-parent-container .help-steps {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}
.tools-parent-container .help-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.tools-parent-container .step-icon {
  font-size: 2rem;
}
.tools-parent-container .help-card p {
  font-size: 1.3rem;
  margin: 0;
}
.tools-parent-container .got-it-btn {
  width: 100%;
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
  border: none;
  padding: 1.5rem;
  border-radius: 20px;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.tools-parent-container .got-it-btn:hover {
  transform: scale(1.05);
}
.tools-parent-container {
  /* Game Screen */
}
.tools-parent-container .game-container {
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
}
.tools-parent-container .game-header {
  background: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
  gap: 1rem;
}
.tools-parent-container .game-back-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.tools-parent-container .game-back-btn:hover {
  transform: translateX(-5px);
}
.tools-parent-container .level-info {
  font-size: 1.5rem;
  font-weight: bold;
  color: #FF6B6B;
}
.tools-parent-container .game-controls {
  display: flex;
  gap: 1rem;
}
.tools-parent-container .control-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}
.tools-parent-container .control-btn:hover {
  transform: translateY(-3px);
}
.tools-parent-container .run-btn {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}
.tools-parent-container .reset-btn {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
.tools-parent-container .clear-btn {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}
.tools-parent-container .game-area {
  flex: 1;
  display: flex;
  padding: 1rem;
  gap: 1rem;
  overflow: hidden;
}
.tools-parent-container .canvas-container {
  flex: 1;
  background: white;
  border-radius: 20px;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.tools-parent-container #gameCanvas {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 15px;
  border: 3px solid #667eea;
}
.tools-parent-container .character-display {
  position: absolute;
  font-size: 3rem;
  transition: all 0.3s ease;
}
.tools-parent-container .blockly-container {
  flex: 1;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  min-width: 300px;
}
.tools-parent-container #blocklyDiv {
  width: 100%;
  height: 100%;
}
.tools-parent-container {
  /* Result Modal */
}
.tools-parent-container .modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.tools-parent-container .modal.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}
.tools-parent-container .modal-content {
  background: white;
  border-radius: 30px;
  padding: 3rem;
  max-width: 90%;
  width: 500px;
  text-align: center;
  animation: slideIn 0.5s ease;
      position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes slideIn {
  from {
    transform: scale(0.8) translateY(50px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}
.tools-parent-container .win-title {
  font-size: 2.5rem;
  color: #11998e;
  margin-bottom: 1rem;
  animation: pulse 1s ease infinite;
}
.tools-parent-container .lose-title {
  font-size: 2.5rem;
  color: #FF6B6B;
  margin-bottom: 1rem;
}
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}
.tools-parent-container .stars-display {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
}
.tools-parent-container .result-star {
  font-size: 3rem;
  color: #ddd;
  animation: starPop 0.5s ease forwards;
}
.tools-parent-container .result-star.filled {
  color: #FFD700;
}
@keyframes starPop {
  0% {
    transform: scale(0) rotate(0deg);
  }
  50% {
    transform: scale(1.3) rotate(180deg);
  }
  100% {
    transform: scale(1) rotate(360deg);
  }
}
.tools-parent-container .sad-emoji {
  font-size: 5rem;
  margin: 1rem 0;
  animation: shake 0.5s ease infinite;
}
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}
.tools-parent-container .result-message {
  font-size: 1.5rem;
  color: #666;
  margin: 1rem 0;
}
.tools-parent-container .score-text {
  font-size: 1.8rem;
  color: #667eea;
  font-weight: bold;
  margin: 1rem 0;
}
.tools-parent-container .result-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.tools-parent-container .result-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.tools-parent-container .result-btn:hover {
  transform: translateY(-5px);
}
.tools-parent-container .play-again {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
.tools-parent-container .next-level {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}
.tools-parent-container {
  /* Celebration */
}
.tools-parent-container .celebration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}
.tools-parent-container .confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: confettiFall 3s linear forwards;
}
@keyframes confettiFall {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}
.tools-parent-container {
  /* Responsive Design */
}
@media (max-width: 768px) {
  .tools-parent-container .game-area {
    flex-direction: column;
  }
  .tools-parent-container .canvas-container {
    min-height: 300px;
  }
  .tools-parent-container .blockly-container {
    min-height: 300px;
  }
  .tools-parent-container .game-header {
    padding: 0.5rem 1rem;
  }
  .tools-parent-container .control-btn {
    padding: 0.6rem 1rem;
    font-size: 1rem;
  }
  .tools-parent-container .levels-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  .tools-parent-container .characters-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
  .tools-parent-container .character-emoji {
    font-size: 3rem;
  }
}
@media (max-width: 480px) {
  .tools-parent-container .menu-container {
    padding: 2rem 1.5rem;
  }
  .tools-parent-container .game-title {
    font-size: 1.8rem;
  }
  .tools-parent-container .title-emoji {
    font-size: 1.8rem;
  }
  .tools-parent-container .menu-btn {
    padding: 1rem;
    font-size: 1.1rem;
  }
  .tools-parent-container .btn-icon {
    font-size: 1.5rem;
  }
  .tools-parent-container .levels-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .tools-parent-container .level-card {
    padding: 1.5rem 0.5rem;
  }
  .tools-parent-container .characters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tools-parent-container .character-card {
    padding: 1rem;
  }
  .tools-parent-container .character-emoji {
    font-size: 2.5rem;
  }
  .tools-parent-container .game-controls {
    width: 100%;
    justify-content: space-around;
  }
  .tools-parent-container .control-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
  }
}
.tools-parent-container {
  /* Touch Device Optimizations */
}
@media (hover: none) and (pointer: coarse) {
  .tools-parent-container .menu-btn:active {
    transform: scale(0.95);
  }
  .tools-parent-container .level-card:active:not(.locked) {
    transform: scale(0.95);
  }
  .tools-parent-container .character-card:active {
    transform: scale(0.95);
  }
  .tools-parent-container .control-btn:active {
    transform: scale(0.95);
  }
}
.tools-parent-container {
  /* Large Screens */
}
@media (min-width: 1920px) {
  .tools-parent-container .menu-container {
    width: 800px;
    padding: 4rem;
  }
  .tools-parent-container .level-select-container {
    width: 1200px;
  }
  .tools-parent-container .character-select-container {
    width: 1000px;
  }
  .tools-parent-container #gameCanvas {
    max-width: 800px;
  }
}
.tools-parent-container .character-svg {
  width: 80px;
  height: 80px;
  display: block;
  margin: 0 auto 0.5rem;
}
.tools-parent-container {
  /* Update character-emoji class to character-svg */
}
.tools-parent-container .character-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.tools-parent-container .character-card:hover .character-svg {
  transform: scale(1.2);
  transition: transform 0.3s ease;
}
.tools-parent-container .character-card.selected .character-svg {
  animation: wiggle 0.5s ease infinite;
}
@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-5deg);
  }
  75% {
    transform: rotate(5deg);
  }
}
.tools-parent-container {
  /* Responsive adjustments */
}
@media (max-width: 768px) {
  .tools-parent-container .character-svg {
    width: 60px;
    height: 60px;
  }
}
@media (max-width: 480px) {
  .tools-parent-container .character-svg {
    width: 50px;
    height: 50px;
  }
}