/* Welcome/Tutorial Panel - Animated Game Instructions */

.welcome-tutorial-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10050;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
  overflow: hidden;
}

.welcome-tutorial-panel.visible {
  opacity: 1;
  visibility: visible;
}

.welcome-tutorial-panel.hiding {
  opacity: 0;
  transform: scale(0.95);
}

.welcome-tutorial-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    #667eea 0%,
    #764ba2 25%,
    #f093fb 50%,
    #f5576c 75%,
    #4facfe 100%
  );
  background-size: 400% 400%;
  animation: welcomeGradient 8s ease-in-out;
}

.welcome-tutorial-content {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 30px;
  padding: 40px;
  max-width: 90vw;
  max-height: 90vh;
  width: 1000px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3),
    0 0 100px rgba(255, 255, 255, 0.2) inset;
  border: 3px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.8) rotateY(45deg);
  transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 2;
}

.welcome-tutorial-panel.visible .welcome-tutorial-content {
  transform: scale(1) rotateY(0deg);
}

/* Header Section */
.welcome-tutorial-header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.welcome-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.logo-icon {
  font-size: 3.5em;
  animation: iconSpin 2s ease-in-out;
  filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.4));
}

.logo-text {
  font-family: "Concert One", Arial, sans-serif;
  font-size: 3.5em;
  margin: 0;
  background: linear-gradient(45deg, #667eea, #764ba2, #f093fb);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShine 3s ease-in-out;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.welcome-subtitle {
  font-family: "Concert One", Arial, sans-serif;
  font-size: 1.3em;
  color: #5a5a5a;
  margin: 0;
  animation: subtitlePulse 2s ease-in-out;
}

/* Tutorial Steps */
.tutorial-steps {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-bottom: 30px;
  min-height: 300px;
  position: relative;
}

.tutorial-steps.transitioning {
  opacity: 0.7;
  transform: translateX(10px);
  transition: all 0.3s ease;
}

.tutorial-step {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  border: 2px solid transparent;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transform: translateX(-50px);
  opacity: 0;
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
}

.tutorial-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  transition: left 0.8s ease;
}

.tutorial-step.active {
  transform: translateX(0);
  opacity: 1;
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.2);
}

.tutorial-step.active::before {
  left: 100%;
}

.step-icon {
  font-size: 3em;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: iconBounce 2s ease-in-out;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  min-width: 80px;
  text-align: center;
}

.step-content {
  flex: 1;
}

.step-content h3 {
  font-family: "Concert One", Arial, sans-serif;
  font-size: 1.5em;
  margin: 0 0 10px 0;
  color: #333;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.step-content p {
  font-size: 1.1em;
  line-height: 1.6;
  margin: 0;
  color: #555;
}

.step-content strong {
  color: #667eea;
  font-weight: bold;
}

/* Progress Dots */
.tutorial-progress {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.progress-dots {
  display: flex;
  gap: 15px;
}

.dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(102, 126, 234, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: #667eea;
  transform: scale(1.3);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

/* Control Buttons */
.tutorial-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.tutorial-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: "Concert One", Arial, sans-serif;
  font-size: 1.1em;
  font-weight: 600;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-width: 140px;
  justify-content: center;
}

.tutorial-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.tutorial-btn:hover::before {
  left: 100%;
}

.tutorial-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.tutorial-prev {
  background: linear-gradient(135deg, #f5576c, #f093fb);
  color: white;
  box-shadow: 0 6px 20px rgba(245, 87, 108, 0.3);
}

.tutorial-prev:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
}

.tutorial-next {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.tutorial-next:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.tutorial-skip {
  background: rgba(255, 255, 255, 0.9);
  color: #666;
  border: 2px solid #ddd;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tutorial-skip:hover {
  background: rgba(255, 255, 255, 1);
  border-color: #bbb;
  transform: translateY(-1px);
}

.tutorial-start {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  color: white;
  box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
  animation: startPulse 2s ease-in-out;
}

.tutorial-start:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(79, 172, 254, 0.5);
}

/* Fun Floating Elements */
.fun-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.floating-card,
.floating-star,
.floating-trophy {
  position: absolute;
  font-size: 2em;
  opacity: 0.6;
  animation: floatAround 8s ease-in-out;
}

.floating-card {
  top: 15%;
  left: 10%;
  animation-delay: 0s;
}

.floating-star {
  top: 25%;
  right: 15%;
  animation-delay: 2s;
}

.floating-trophy {
  bottom: 20%;
  left: 15%;
  animation-delay: 4s;
}

/* Animations */
@keyframes welcomeGradient {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes iconSpin {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(10deg) scale(1.1);
  }
}

@keyframes textShine {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes subtitlePulse {
  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

@keyframes iconBounce {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes startPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(79, 172, 254, 0.6);
  }
}

@keyframes floatAround {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-10px) rotate(5deg);
  }
  50% {
    transform: translateY(-5px) rotate(-3deg);
  }
  75% {
    transform: translateY(-15px) rotate(8deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .welcome-tutorial-content {
    padding: 25px;
    width: 95vw;
    max-height: 95vh;
  }

  .logo-text {
    font-size: 2.5em;
  }

  .logo-icon {
    font-size: 2.5em;
  }

  .welcome-subtitle {
    font-size: 1.1em;
  }

  .tutorial-step {
    flex-direction: column;
    text-align: center;
    gap: 15px;
    padding: 20px;
  }

  .step-icon {
    font-size: 2.5em;
    min-width: auto;
  }

  .step-content h3 {
    font-size: 1.3em;
  }

  .step-content p {
    font-size: 1em;
  }

  .tutorial-controls {
    flex-direction: column;
    align-items: center;
  }

  .tutorial-btn {
    width: 100%;
    max-width: 250px;
  }
}

@media (max-width: 480px) {
  .welcome-tutorial-content {
    padding: 20px;
    border-radius: 20px;
  }

  .logo-text {
    font-size: 2em;
  }

  .logo-icon {
    font-size: 2em;
  }

  .tutorial-steps {
    gap: 15px;
    min-height: 250px;
  }

  .tutorial-step {
    padding: 15px;
  }

  .step-icon {
    font-size: 2em;
  }

  .step-content h3 {
    font-size: 1.2em;
  }

  .step-content p {
    font-size: 0.9em;
  }
}

@media (max-height: 600px) {
  .welcome-tutorial-content {
    max-height: 95vh;
    padding: 20px;
  }

  .welcome-tutorial-header {
    margin-bottom: 20px;
  }

  .tutorial-steps {
    min-height: 200px;
    gap: 15px;
  }

  .tutorial-step {
    padding: 15px;
  }

  .tutorial-progress {
    margin-bottom: 20px;
  }
}

.welcome-tutorial-overlay.active .welcome-tutorial-content {
  transform: scale(1) rotateY(0deg);
}

.welcome-tutorial-content::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 1px,
    transparent 1px
  );
  background-size: 50px 50px;
  animation: sparkleMove 20s linear;
  pointer-events: none;
}

.welcome-title {
  font-family: "Concert One", Arial, sans-serif;
  font-size: 3.5em;
  font-weight: bold;
  text-align: center;
  margin: 0 0 30px 0;
  background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: welcomeGradient 3s ease-in-out, titleBounce 1s ease-out;
  text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
  position: relative;
  z-index: 2;
  transform: translateY(-50px);
  opacity: 0;
  animation: titleSlideIn 1s ease-out 0.5s forwards,
    welcomeGradient 3s ease-in-out 1.5s;
}

.welcome-subtitle {
  font-family: "Concert One", Arial, sans-serif;
  font-size: 1.5em;
  text-align: center;
  color: #4a5568;
  margin: 0 0 40px 0;
  opacity: 0;
  transform: translateY(30px);
  animation: subtitleFadeIn 1s ease-out 1s forwards;
}

.tutorial-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  overflow-y: auto;
  padding-right: 10px;
  margin-bottom: 30px;
}

.tutorial-section {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  border: 2px solid rgba(102, 126, 234, 0.2);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transform: translateX(-100px);
  opacity: 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tutorial-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.8s ease;
}

.tutorial-section:hover::before {
  left: 100%;
}

.tutorial-section.animate-in {
  transform: translateX(0);
  opacity: 1;
}

.tutorial-section:nth-child(1) {
  animation-delay: 1.5s;
}
.tutorial-section:nth-child(2) {
  animation-delay: 1.8s;
}
.tutorial-section:nth-child(3) {
  animation-delay: 2.1s;
}
.tutorial-section:nth-child(4) {
  animation-delay: 2.4s;
}

.tutorial-icon {
  font-size: 4em;
  min-width: 100px;
  text-align: center;
  animation: iconFloat 3s ease-in-out;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.tutorial-icon.spin {
  animation: iconSpin 2s linear, iconFloat 3s ease-in-out;
}

.tutorial-icon.bounce {
  animation: iconBounce 1.5s ease-in-out, iconFloat 3s ease-in-out;
}

.tutorial-icon.pulse {
  animation: iconPulse 2s ease-in-out, iconFloat 3s ease-in-out;
}

.tutorial-text {
  flex: 1;
}

.tutorial-text h3 {
  font-family: "Concert One", Arial, sans-serif;
  font-size: 1.8em;
  color: #4a5568;
  margin: 0 0 10px 0;
  font-weight: bold;
}

.tutorial-text p {
  font-family: "Concert One", Arial, sans-serif;
  font-size: 1.2em;
  color: #718096;
  margin: 0;
  line-height: 1.4;
}

.tutorial-actions {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  opacity: 0;
  transform: translateY(30px);
  animation: actionsFadeIn 1s ease-out 3s forwards;
}

.tutorial-btn {
  padding: 18px 40px;
  font-size: 1.4em;
  font-family: "Concert One", Arial, sans-serif;
  font-weight: bold;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
  min-width: 180px;
}

.tutorial-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.tutorial-btn:hover::before {
  left: 100%;
}

.tutorial-btn.start-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.tutorial-btn.start-btn:hover {
  transform: translateY(-5px) scale(1.05);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.6);
}

.tutorial-btn.skip-btn {
  background: rgba(255, 255, 255, 0.8);
  color: #4a5568;
  border: 3px solid rgba(74, 85, 104, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tutorial-btn.skip-btn:hover {
  transform: translateY(-3px) scale(1.02);
  background: rgba(255, 255, 255, 0.9);
  color: #2d3748;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Floating Elements */
.welcome-float-element {
  position: absolute;
  font-size: 2em;
  animation: floatAround 8s ease-in-out;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

.welcome-float-element:nth-child(1) {
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}

.welcome-float-element:nth-child(2) {
  top: 20%;
  right: 8%;
  animation-delay: 2s;
}

.welcome-float-element:nth-child(3) {
  bottom: 15%;
  left: 3%;
  animation-delay: 4s;
}

.welcome-float-element:nth-child(4) {
  bottom: 25%;
  right: 5%;
  animation-delay: 6s;
}

/* Animations */
@keyframes welcomeGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes sparkleMove {
  0% {
    transform: translateX(0) translateY(0);
  }
  100% {
    transform: translateX(-50px) translateY(-50px);
  }
}

@keyframes titleSlideIn {
  0% {
    transform: translateY(-50px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes titleBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes subtitleFadeIn {
  0% {
    transform: translateY(30px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes actionsFadeIn {
  0% {
    transform: translateY(30px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}

@keyframes iconSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes iconBounce {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes floatAround {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(20px) translateY(-15px) rotate(90deg);
  }
  50% {
    transform: translateX(-10px) translateY(-30px) rotate(180deg);
  }
  75% {
    transform: translateX(-25px) translateY(-10px) rotate(270deg);
  }
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
  .welcome-tutorial-content {
    width: 95vw;
    padding: 30px;
  }

  .welcome-title {
    font-size: 3em;
  }

  .tutorial-section {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .tutorial-icon {
    font-size: 3em;
    min-width: auto;
  }

  .tutorial-text h3 {
    font-size: 1.6em;
  }

  .tutorial-text p {
    font-size: 1.1em;
  }
}

@media screen and (max-width: 768px) {
  .welcome-tutorial-content {
    width: 95vw;
    padding: 25px;
    max-height: 95vh;
  }

  .welcome-title {
    font-size: 2.5em;
    margin-bottom: 20px;
  }

  .welcome-subtitle {
    font-size: 1.3em;
    margin-bottom: 30px;
  }

  .tutorial-content {
    gap: 20px;
    margin-bottom: 20px;
  }

  .tutorial-section {
    padding: 20px;
    gap: 15px;
  }

  .tutorial-icon {
    font-size: 2.5em;
  }

  .tutorial-text h3 {
    font-size: 1.4em;
  }

  .tutorial-text p {
    font-size: 1em;
  }

  .tutorial-actions {
    flex-direction: column;
    gap: 15px;
  }

  .tutorial-btn {
    padding: 15px 30px;
    font-size: 1.2em;
    min-width: 150px;
  }
}

@media screen and (max-width: 480px) {
  .welcome-tutorial-content {
    padding: 20px;
    border-radius: 20px;
  }

  .welcome-title {
    font-size: 2em;
    margin-bottom: 15px;
  }

  .welcome-subtitle {
    font-size: 1.1em;
    margin-bottom: 25px;
  }

  .tutorial-section {
    padding: 15px;
  }

  .tutorial-icon {
    font-size: 2em;
  }

  .tutorial-text h3 {
    font-size: 1.2em;
  }

  .tutorial-text p {
    font-size: 0.9em;
  }

  .tutorial-btn {
    padding: 12px 25px;
    font-size: 1.1em;
    min-width: 120px;
  }

  .welcome-float-element {
    font-size: 1.5em;
  }
}

@media screen and (max-height: 600px) {
  .welcome-tutorial-content {
    max-height: 95vh;
    padding: 15px;
  }

  .welcome-title {
    font-size: 2em;
    margin-bottom: 10px;
  }

  .welcome-subtitle {
    font-size: 1em;
    margin-bottom: 20px;
  }

  .tutorial-content {
    gap: 15px;
    margin-bottom: 15px;
  }

  .tutorial-section {
    padding: 15px;
    gap: 10px;
  }

  .tutorial-actions {
    margin-top: 15px;
  }
}
