/* Container principal melhorado com cores exatas do dashboard */
.firstupgrade-container {
  min-height: 100vh;
  width: 100%;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: url("../../public/firstupgrade/ilha_barco.png") center center
    no-repeat;
  background-size: cover;
  color: white;
  padding: 20px 0;
}

/* Container específico para modo 2D */
.firstupgrade-container.mode-2d {
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Card melhorado da ilha */
.island-header-card {
  padding: 0;
  margin-bottom: 20px;
  position: relative;
  z-index: 10;
}

.island-card-content {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(248, 249, 250, 0.9) 100%
  );
  border-radius: 20px;
  padding: 25px 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(41, 171, 226, 0.2);
  border: 2px solid rgba(41, 171, 226, 0.3);
  backdrop-filter: blur(10px);
  max-width: 400px;
  margin: 0 auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.island-card-content:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(41, 171, 226, 0.3);
}

.island-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.island-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 700;
  color: #1e3a8a;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: 1px;
  line-height: 1.2;
}

.island-subtitle {
  font-size: 1rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 8px;
  letter-spacing: 0.5px;
}

/* Container melhorado do mascote */
.mascote-container-improved {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin: 30px auto;
  max-width: 900px;
  gap: 30px;
  position: relative;
  z-index: 10;
}

.bottom-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  margin-top: 40px;
}

.gift-bottom {
  margin-top: 80px;
  text-align: center;
  background: url("../../public/firstupgrade/receber_presente.png") center
    no-repeat;
  background-size: 200px 140px;
  width: 200px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom {
  position: relative;
  width: 100vw;
  max-width: 220px;
  height: 100vw;
  max-height: 220px;
  margin: 0 0 0 -240px;
  background: url("../../public/firstupgrade/zoom.png") center center no-repeat;
  background-size: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  animation: zoom-move 2.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) 0.2s 1;
}

@keyframes zoom-move {
  0% {
    transform: scale(0.7) translateY(40px) rotate(-8deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.08) translateY(-10px) rotate(3deg);
    opacity: 1;
  }
  80% {
    transform: scale(0.97) translateY(4px) rotate(-2deg);
  }
  100% {
    transform: scale(1) translateY(0) rotate(0deg);
    opacity: 1;
  }
}

/* Seta entre o zoom e o barquinho */
.zoom-boat-arrow {
  position: absolute;
  left: 70%;
  top: 65%;
  width: 60px;
  height: 60px;
  z-index: 22;
  pointer-events: none;
  transform: rotate(20deg);
}

.zoom-boat-arrow svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 480px) {
  .zoom {
    width: 80vw;
    max-width: 180px;
    height: 80vw;
    max-height: 180px;
    margin-left: -166px; /* movido mais para a esquerda */
  }
  .zoom-boat-arrow {
    left: 68%;
    top: 62%;
    width: 38px;
    height: 38px;
    transform: rotate(18deg);
  }
}

.zoom-arrow {
  position: absolute;
  left: 60%;
  top: 70%;
  width: 60px;
  height: 60px;
  z-index: 21;
  background: none;
  pointer-events: none;
}

.zoom-arrow svg {
  width: 100%;
  height: 100%;
  display: block;
}

.character-section {
  flex: 0 0 25%;
  max-width: 200px;
  position: relative;
}

.mascote-img-improved {
  width: 100%;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
  margin-bottom: 0px;
  display: block;
}

.mascote-img-improved:hover {
  transform: scale(1.03);
}

/* Balão de fala estático melhorado */

.speech-bubble-static {
  flex: 0 0 auto;
  position: relative;
  background: url("../../public/firstupgrade/back-boasvindas.png") center center no-repeat;
  background-size: 400px 400px; /* aumentada a altura */
  border-radius: 25px;
  padding: 30px;
  border: 2px solid rgba(41, 171, 226, 0.25);
  transition: all 0.3s ease;
  width: 400px;
  height: 400px; /* aumentada a altura */
  min-width: 280px;
  min-height: 120px;
  max-width: 95vw;
  max-height: 440px; /* aumentada a altura máxima */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin-top: 0px;
}

@media (max-width: 480px) {
  .speech-bubble-static {
    width: 98vw;
    min-width: 0;
    max-width: 100vw;
    height: 370px; /* aumentada a altura */
    min-height: 260px;
    max-height: 440px; /* aumentada a altura máxima */
    padding: 28px 14px 28px 14px;
    background-size: 98vw 370px; /* aumentada a altura da imagem de fundo */
    background-position: center top;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }
}

/* ADICIONADO: Estados do balão de fala para mobile */
.speech-bubble-static.minimized {
  padding: 15px 20px;
  cursor: pointer;
}

/* ADICIONADO: Botão para minimizar/expandir */
.speech-toggle-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  width: 30px;
  height: 30px;
  background: rgba(41, 171, 226, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.speech-toggle-btn:hover {
  background: rgba(41, 171, 226, 0.2);
  transform: scale(1.1);
}

.speech-toggle-btn i {
  color: #29abe2;
  font-size: 14px;
  transition: transform 0.3s ease;
}

/* ADICIONADO: Conteúdo minimizado */
.speech-content-minimized {
  text-align: center;
  position: relative;
  z-index: 2;
}

.speech-title-minimized {
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
  font-style: italic;
}

/* Animação para transições */
.speech-content {
  transition: all 0.3s ease;
  overflow: hidden;
}

.speech-content-minimized {
  transition: all 0.3s ease;
}

.speech-bubble-arrow {
  position: absolute;
  left: -20px;
  top: 40px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 20px 20px 20px 0;
  border-color: transparent #ffffff transparent transparent;
  filter: drop-shadow(-2px 0 3px rgba(0, 0, 0, 0.1));
}

.speech-bubble-arrow::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -22px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 22px 22px 22px 0;
  border-color: transparent rgba(41, 171, 226, 0.25) transparent transparent;
}

.speech-content {
  position: relative;
  z-index: 2;
}

.speech-title-static {
  color: #1e3a8a;
  font-size: 1.4rem;
  margin-bottom: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.speech-text-static {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 0;
  color: #475569;
  font-weight: 500;
}

/* Cabeçalho da ilha original - mantido para compatibilidade */
.island-header {
  padding: 20px 0;
  margin-bottom: 15px;
  position: relative;
  z-index: 10;
}

.island-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), 0 0 20px rgba(41, 171, 226, 0.3);
  letter-spacing: 1.5px;
  position: relative;
}

/* Modificar este seletor para torná-lo específico para a página first upgrade */
.firstupgrade-container .island-header h1::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #29abe2, transparent);
  border-radius: 2px;
}

/* Fundo oceânico aprimorado - MELHORADO seguindo padrão do onboarding */
.ocean-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.ocean {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(
    180deg,
    rgba(0, 61, 92, 0) 0%,
    rgba(0, 90, 139, 0.3) 30%,
    rgba(0, 119, 190, 0.6) 70%,
    rgba(77, 166, 217, 0.8) 100%
  );
  overflow: hidden;
}

/* Ondas melhoradas com cores do dashboard */
.ocean-wave {
  position: absolute;
  width: 300%;
  background: rgba(0, 119, 190, 0.6);
  border-radius: 50%;
  left: -100%;
}

.wave-1 {
  bottom: 5%;
  height: 80px;
  opacity: 0.6;
  animation: wave-flow-1 8s ease-in-out infinite;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 119, 190, 0.4) 25%,
    rgba(0, 119, 190, 0.6) 50%,
    rgba(0, 119, 190, 0.4) 75%,
    transparent 100%
  );
}

.wave-2 {
  bottom: 12%;
  height: 100px;
  opacity: 0.5;
  animation: wave-flow-2 10s ease-in-out infinite;
  animation-delay: 1s;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 119, 190, 0.3) 25%,
    rgba(0, 119, 190, 0.5) 50%,
    rgba(0, 119, 190, 0.3) 75%,
    transparent 100%
  );
}

.wave-3 {
  bottom: 20%;
  height: 120px;
  opacity: 0.4;
  animation: wave-flow-3 12s ease-in-out infinite;
  animation-delay: 2s;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 119, 190, 0.2) 25%,
    rgba(0, 119, 190, 0.4) 50%,
    rgba(0, 119, 190, 0.2) 75%,
    transparent 100%
  );
}

/* Animações de ondas naturais seguindo o padrão do onboarding */
@keyframes wave-flow-1 {
  0%,
  100% {
    transform: translateX(0) scaleY(1);
    border-radius: 50%;
  }
  25% {
    transform: translateX(-10%) scaleY(1.1);
    border-radius: 60% 40% 50% 60%;
  }
  50% {
    transform: translateX(-20%) scaleY(0.9);
    border-radius: 40% 60% 40% 50%;
  }
  75% {
    transform: translateX(-30%) scaleY(1.05);
    border-radius: 55% 45% 55% 45%;
  }
}

@keyframes wave-flow-2 {
  0%,
  100% {
    transform: translateX(0) scaleY(1);
    border-radius: 45% 55% 45% 55%;
  }
  25% {
    transform: translateX(-8%) scaleY(1.15);
    border-radius: 60% 40% 60% 40%;
  }
  50% {
    transform: translateX(-16%) scaleY(0.85);
    border-radius: 35% 65% 35% 65%;
  }
  75% {
    transform: translateX(-24%) scaleY(1.1);
    border-radius: 50% 50% 50% 50%;
  }
}

@keyframes wave-flow-3 {
  0%,
  100% {
    transform: translateX(0) scaleY(1);
    border-radius: 40% 60% 40% 60%;
  }
  25% {
    transform: translateX(-6%) scaleY(1.2);
    border-radius: 65% 35% 65% 35%;
  }
  50% {
    transform: translateX(-12%) scaleY(0.8);
    border-radius: 30% 70% 30% 70%;
  }
  75% {
    transform: translateX(-18%) scaleY(1.15);
    border-radius: 55% 45% 55% 45%;
  }
}

/* Ondas de superfície para maior realismo */
.ocean::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(
    90deg,
    rgba(59, 130, 246, 0.8) 0%,
    rgba(59, 130, 246, 0.9) 25%,
    rgba(59, 130, 246, 1) 50%,
    rgba(59, 130, 246, 0.9) 75%,
    rgba(59, 130, 246, 0.8) 100%
  );
  animation: surface-ripple 6s ease-in-out infinite;
  z-index: 10;
}

.ocean::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  animation: surface-shimmer 4s ease-in-out infinite;
  z-index: 11;
}

@keyframes surface-ripple {
  0%,
  100% {
    transform: scaleX(1) scaleY(1);
    opacity: 0.8;
  }
  50% {
    transform: scaleX(1.05) scaleY(1.2);
    opacity: 1;
  }
}

@keyframes surface-shimmer {
  0%,
  100% {
    transform: translateX(0) scaleX(1);
    opacity: 0.3;
  }
  50% {
    transform: translateX(10px) scaleX(1.1);
    opacity: 0.6;
  }
}

/* Bolhas decorativas melhoradas - seguindo padrão do onboarding */
.bubble {
  position: absolute;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.1)
  );
  border-radius: 50%;
  animation: bubble-float 20s infinite ease-in-out;
  backdrop-filter: blur(2px);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3),
    inset 0 0 5px rgba(255, 255, 255, 0.2);
}

.bubble-1 {
  width: 80px;
  height: 80px;
  top: 15%;
  left: 10%;
  animation-duration: 18s;
}

.bubble-2 {
  width: 60px;
  height: 60px;
  top: 30%;
  right: 20%;
  animation-duration: 15s;
  animation-delay: 2s;
}

.bubble-3 {
  width: 100px;
  height: 100px;
  bottom: 45%;
  left: 35%;
  animation-duration: 20s;
  animation-delay: 1s;
}

@keyframes bubble-float {
  0%,
  100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.7;
  }
  25% {
    transform: translateY(-30px) translateX(15px) scale(1.1);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-50px) translateX(-15px) scale(0.9);
    opacity: 0.6;
  }
  75% {
    transform: translateY(-20px) translateX(20px) scale(1.05);
    opacity: 0.8;
  }
}

/* Estilos da visualização da ilha melhorados */
.island-visualization {
  position: relative;
  margin: 30px auto;
  width: 100%;
  max-width: 550px;
  height: 350px;
  z-index: 10;
}

.island-visualization .position-relative {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.island-visualization .position-relative::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(
    circle,
    rgba(41, 171, 226, 0.15) 0%,
    transparent 60%
  );
  border-radius: 50%;
  z-index: 1;
  animation: island-glow 4s ease-in-out infinite;
}

@keyframes island-glow {
  0%,
  100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

.island-image {
  width: 100%;
  max-width: 320px;
  height: auto;
  position: relative;
  z-index: 3;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
}

.island-image:hover {
  transform: scale(1.02);
}

/* Animação e posicionamento do barco melhorados */
.boat-container {
  z-index: 4;
  bottom: 25%;
  left: -40%;
  width: 32%;
  max-width: 200px;
  transition: all 3.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

.boat-container.animated {
  left: 8%;
}

.boat-container::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: -15px;
  width: 50px;
  height: 15px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.boat-container.animated::after {
  opacity: 1;
  animation: wake-flow 2s ease-in-out infinite;
}

@keyframes wake-flow {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 0.2;
  }
  50% {
    transform: scaleX(1.3);
    opacity: 0.4;
  }
}

.boat-image {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.3));
  animation: boat-rock 3.5s ease-in-out infinite;
  transition: transform 0.3s ease;
}

@keyframes boat-rock {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  25% {
    transform: rotate(1.5deg) translateY(-2px);
  }
  75% {
    transform: rotate(-1.5deg) translateY(-1px);
  }
}

/* Pop-up da ferramenta melhorado */
.tool-popup {
  position: absolute;
  top: 18%;
  left: 28%;
  z-index: 15;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.8);
}

.tool-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  animation: float 2.5s ease-in-out infinite;
}

.tool-circle {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(41, 171, 226, 0.3),
    inset 0 2px 10px rgba(255, 255, 255, 0.8);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border: 2px solid rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.tool-circle::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: rotate(45deg);
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
  0%,
  100% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  50% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.tool-popup:hover .tool-circle {
  transform: scale(1.1);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3), 0 0 0 5px rgba(41, 171, 226, 0.4),
    inset 0 2px 15px rgba(255, 255, 255, 0.9);
}

.tool-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 2;
  position: relative;
}

.tool-icon-img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.tool-glow {
  position: absolute;
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(41, 171, 226, 0.4) 0%,
    rgba(41, 171, 226, 0) 70%
  );
  animation: glow 2.5s ease-in-out infinite;
  z-index: -1;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.02);
  }
}

@keyframes glow {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* Estilos para o mascote e balão de fala melhorados */
.mascote-container {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: 30px auto;
  max-width: 850px;
  gap: 25px;
  position: relative;
  z-index: 10;
}

.character-image {
  flex: 0 0 30%;
  max-width: 220px;
  position: relative;
}

.character-image::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: radial-gradient(
    circle,
    rgba(41, 171, 226, 0.2) 0%,
    transparent 70%
  );
  border-radius: 50%;
  z-index: -1;
  animation: character-glow 3s ease-in-out infinite;
}

@keyframes character-glow {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.mascote-img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.mascote-img:hover {
  transform: scale(1.05);
}

.speech-bubble {
  flex: 1;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #f8f9fa 100%
  ); /* Mantido branco */
  border-radius: 25px;
  padding: 25px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  color: #333; /* Mantido escuro */
  border: 2px solid rgba(41, 171, 226, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.speech-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.speech-bubble:before {
  content: "";
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 22px 22px 22px 0;
  border-style: solid;
  border-color: transparent #ffffff transparent transparent;
  filter: drop-shadow(-2px 0 3px rgba(0, 0, 0, 0.1));
}

.speech-title {
  color: #000000; /* Alterado para preto */
  font-size: 1.3rem;
  margin-bottom: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.speech-text {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0;
  color: #333;
}

/* Tutorial message melhorado */
.tutorial-message {
  position: relative;
  z-index: 10;
  animation: pulse 2.5s infinite;
}

.tutorial-message .alert {
  background: linear-gradient(
    135deg,
    rgba(13, 202, 240, 0.15) 0%,
    rgba(13, 110, 253, 0.15) 100%
  );
  border: 1px solid rgba(13, 202, 240, 0.3);
  color: #ffffff;
  border-radius: 15px;
  padding: 15px 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

@keyframes pulse {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.8;
  }
}

/* Modal de notificação melhorado */
.upgrade-notification {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.upgrade-notification.show {
  opacity: 0.8;
  visibility: visible;
}

.upgrade-notification-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.upgrade-notification-modal.visible {
  opacity: 1;
  visibility: visible;
}

.card-moai {
  background: linear-gradient(135deg, #1a365d 0%, #2d5a87 50%, #1a365d 100%);
  border: 3px solid #29abe2;
  color: white;
  border-radius: 25px;
  position: relative;
  overflow: hidden;
  max-width: 500px;
  margin: 20px;
}

.card-moai::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: modal-shine 3s ease-in-out infinite;
}

@keyframes modal-shine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* MODAL FULLSCREEN ESTILO NOVA PÁGINA */
.upgrade-notification-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  min-width: 100vw;
  background: transparent; /* sem fundo preto externo */
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  padding: 0;
}
.upgrade-notification-modal.visible {
  opacity: 1;
  visibility: visible;
}
.modal-dialog {
  width: 90vw;
  max-width: 420px;
  min-width: 320px;
  height: 90vh;
  max-height: 700px;
  min-height: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  box-shadow: none;
  position: relative;
}
.modal-content.card-moai {
  width: 100%;
  height: 100%;
  background: #181818 url('../../public/firstupgrade/back-video.png') no-repeat center 32px;
  background-size: 92% 92%;
  border-radius: 32px;
  border: 4px solid #7c4a13;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  position: relative;
  overflow: visible;
  box-shadow: 0 8px 40px 0 rgba(0,0,0,0.45);
}
.modal-content.card-moai .p-4 {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 0 32px 0;
  position: relative;
}
.modal-content.card-moai h3 {
  color: #ffe18a;
  font-size: 1.7rem;
  font-weight: 900;
  text-align: center;
  margin: 54px 0 18px 0;
  letter-spacing: 1.2px;
  text-shadow: 0 4px 16px #000a, 0 1px 0 #7c4a13;
  font-family: 'Trebuchet MS', 'Verdana', sans-serif;
  text-transform: uppercase;
  filter: drop-shadow(0 2px 0 #7c4a13);
}
.upgrade-details.mb-4 {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  margin: 0 0 8px 0;
  padding: 0 24px;
}
.video-modal {
  width: 100%;
  max-width: 100%;
  height: 270px;
  max-height: 340px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.25);
  background: #000;
}

.btn-moai-primary {
  margin: 0 auto;
  margin-top: 32px;
  margin-bottom: 0;
  width: 200px;
  height: 80px;
  background: url('../../public/firstupgrade/botao-avancar.png') no-repeat center center;
  background-size: 120px 100px;
  font-weight: 700;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  left: 0;
  bottom: 0;
  transform: none;
  z-index: 10;
  /* Centraliza entre vídeo e base do modal */
}
  background-repeat: no-repeat;
.modal-content.card-moai .p-4 {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 0 32px 0;
  position: relative;
}

/* Centraliza o botão entre o vídeo e o rodapé do modal */
.modal-content.card-moai .btn-moai-primary {
  margin-top: 32px;
  margin-bottom: 0;
  align-self: center;
  /* Centralização vertical exata entre vídeo e base do modal */
  position: absolute;
  left: 50%;
  /* Calcula a posição vertical: metade do espaço entre vídeo e base */
  top: calc(270px + ((100% - 270px - 70px) / 2));
  transform: translate(-50%, 0);
}

@media (max-width: 600px) {
  .btn-moai-primary {
    width: 98vw;
    max-width: 220px;
    height: 48px;
    font-size: 1rem;
    border-radius: 12px;
  }
  .modal-content.card-moai .btn-moai-primary {
    margin-top: 12px;
    top: calc(170px + ((100% - 170px - 48px) / 2));
  }
}
  background-position: top left;
  opacity: 1;
}
.modal-content.card-moai::after {
  bottom: -32px;
  right: -32px;
  width: 120px;
  height: 120px;
  /* background-image: url('../../public/firstupgrade/flor-bottom.png'); */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom right;
  opacity: 1;
}
/* Espaço para decoração lateral (folhas, etc) */
.modal-content.card-moai .decor-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 90px;
  height: 120px;
  /* background-image: url('../../public/firstupgrade/folha-left.png'); */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: top left;
  z-index: 3;
}
.modal-content.card-moai .decor-right {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 90px;
  height: 120px;
  /* background-image: url('../../public/firstupgrade/folha-right.png'); */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom right;
  z-index: 3;
}
@media (max-width: 600px) {
  .modal-dialog {
    width: 100vw !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    height: 100vh !important;
    min-height: 0 !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .modal-content.card-moai {
    width: 100vw !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    height: 100vh !important;
    min-height: 0 !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-width: 0 !important;
    background-size: cover !important;
    background-position: center top !important;
  }
  .modal-content.card-moai h3 {
    font-size: 1.18rem;
    margin: 28px 0 10px 0;
  }
  .upgrade-details.mb-4 {
    padding: 0 6px;
  }
  .video-modal {
    height: 170px;
    max-height: 210px;
    border-radius: 10px;
  }
  .btn-moai-primary {
    width: 98vw;
    max-width: 220px;
    height: 48px;
    font-size: 1rem;
    border-radius: 12px;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
  }
  .modal-content.card-moai::before,
  .modal-content.card-moai::after {
    width: 70px;
    height: 70px;
    top: -18px;
    left: -18px;
    bottom: -18px;
    right: -18px;
  }
  .modal-content.card-moai .decor-left,
  .modal-content.card-moai .decor-right {
    width: 50px;
    height: 70px;
  }
}
  background: linear-gradient(135deg, #29abe2 0%, #1e88e5 100%);
  border: none;
  color: white;
  font-weight: 600;
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 5px 15px rgba(41, 171, 226, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-moai-primary::before {
  margin: 0 auto;
  margin-top: 32px;
  margin-bottom: 0;
  width: 200px;
  height: 70px;
  background: url('../../public/firstupgrade/botao-avancar.png') no-repeat center center;
  background-size: 200px 90px;
  font-weight: 700;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  left: 0;
  bottom: 0;
  transform: none;
  z-index: 10;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px #0005;
  max-width: none;
  background: linear-gradient(135deg, #1e88e5 0%, #29abe2 100%);

.btn-moai-primary:active {
  transform: translateY(0) scale(1);
}

/* Remover backgrounds de cards na página de ilhas */
.islands-container .card-moai,
.islands-container .resource-box,
.islands-container .status-item,
.islands-container .resource-item {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Responsividade melhorada */
@media (max-width: 992px) {
  .island-header h1 {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  }

  .mascote-container {
    max-width: 100%;
    gap: 20px;
  }

  .island-visualization {
    height: 300px;
    max-width: 500px;
  }

  .island-image {
    max-width: 280px;
  }

  .boat-container {
    max-width: 180px;
  }

  .tool-circle {
    width: 70px;
    height: 70px;
  }

  .tool-icon-img {
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 768px) {
  .firstupgrade-container {
    padding: 15px 0;
  }

  .island-header h1 {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
  }

  .island-visualization {
    height: 260px;
    max-width: 450px;
  }

  .island-image {
    max-width: 240px;
  }

  .boat-container {
    max-width: 160px;
    bottom: 20%;
  }

  .tool-circle {
    width: 60px;
    height: 60px;
  }

  .tool-icon-img {
    width: 30px;
    height: 30px;
  }

  /* Media Queries para responsividade do novo design */

  /* Tablets e dispositivos médios */
  @media (max-width: 768px) {
    .island-card-content {
      padding: 20px 25px;
      max-width: 350px;
    }

    .island-title {
      font-size: 1.6rem;
    }

    .island-subtitle {
      font-size: 0.9rem;
    }

    .mascote-container-improved {
      flex-direction: column;
      align-items: center;
      gap: 20px;
      max-width: 100%;
    }

    .character-section {
      flex: 0 0 auto;
      max-width: 180px;
    }

    .speech-bubble-static {
      max-width: 100%;
      padding: 25px;
    }

    .speech-bubble-arrow {
      display: none;
    }

    .speech-title-static {
      font-size: 1.2rem;
    }

    .speech-text-static {
      font-size: 1rem;
    }
  }

  /* Dispositivos móveis pequenos */
  @media (max-width: 480px) {
    .firstupgrade-container {
      padding: 10px 0;
    }

    .island-card-content {
      padding: 15px 20px;
      max-width: 320px;
    }

    .island-icon {
      font-size: 2rem;
    }

    .island-title {
      font-size: 1.4rem;
    }

    .island-subtitle {
      font-size: 0.85rem;
    }

    .mascote-container-improved {
      margin: 20px auto;
      gap: 15px;
    }

    .character-section {
      max-width: 120px;
    }

    .speech-bubble-static {
      padding: 15px 18px;
      border-radius: 18px;
      max-height: 140px;
      overflow-y: auto;
    }

    .speech-title-static {
      font-size: 1rem;
      margin-bottom: 8px;
      line-height: 1.2;
    }

    .speech-text-static {
      font-size: 0.88rem;
      line-height: 1.4;
      margin-bottom: 0;
    }

    /* MELHORADO: Reduzir ainda mais o espaço do balão em telas muito pequenas */
    .island-visualization {
      margin-bottom: 15px;
    }
  }

  /* ADICIONADO: Media query específica para telas extra pequenas */
  @media (max-width: 375px) {
    .island-card-content {
      padding: 12px 16px;
      max-width: 300px;
    }

    .island-title {
      font-size: 1.3rem;
    }

    .mascote-container-improved {
      margin: 15px auto;
      gap: 12px;
    }

    .character-section {
      max-width: 100px;
    }

    .speech-bubble-static {
      padding: 12px 15px;
      max-height: 120px;
      border-radius: 15px;
    }

    .speech-title-static {
      font-size: 0.95rem;
      margin-bottom: 6px;
    }

    .speech-text-static {
      font-size: 0.82rem;
      line-height: 1.3;
    }
  }
}

@media (max-width: 480px) {
  .island-header h1 {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  }

  .island-visualization {
    height: 220px;
    max-width: 400px;
  }

  .island-image {
    max-width: 200px;
  }

  .boat-container {
    max-width: 120px;
    bottom: 15%;
  }

  .tool-popup {
    left: 20%;
    top: 25%;
  }

  .tool-circle {
    width: 50px;
    height: 50px;
  }

  .tool-icon-img {
    width: 25px;
    height: 25px;
  }

  .character-image {
    max-width: 150px;
  }

  .speech-bubble {
    padding: 18px;
    border-radius: 20px;
  }

  .speech-title {
    font-size: 1.1rem;
  }

  .speech-text {
    font-size: 0.9rem;
  }

  .tutorial-message .alert {
    padding: 12px 15px;
    font-size: 0.9rem;
  }

  .upgrade-details {
    padding: 15px;
    font-size: 0.9rem;
  }
}

.video-container{
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Modo escuro */
@media (prefers-color-scheme: dark) {
  .speech-bubble {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
    border-color: rgba(41, 171, 226, 0.3);
  }

  .speech-title {
    color: #29abe2;
  }

  .speech-text {
    color: #cbd5e0;
  }
}

/* ===== ESTILOS 3D PARA FIRST UPGRADE ===== */

/* Canvas 3D */
.render-canvas-3d {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  outline: none;
  display: block;
}

/* Loading Screen 3D - Melhorado para combinar com dashboard */
.loading-screen-3d {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    #0066cc 0%,
    #004499 25%,
    #003366 75%,
    #002244 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.8s ease;
}

.loading-content {
  text-align: center;
  color: white;
  z-index: 101;
  max-width: 400px;
  padding: 40px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.loading-title {
  margin: 20px 0 30px 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  color: #ffffff;
  letter-spacing: 1px;
}

.loading-progress {
  margin: 25px 0;
}

.loading-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 15px;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #29abe2, #ffffff, #29abe2);
  border-radius: 2px;
  animation: loadingBarMove 2s ease-in-out infinite;
  width: 100%;
}

@keyframes loadingBarMove {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(100%);
  }
}

.loading-text {
  margin: 10px 0 0 0;
  font-size: 1rem;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
  animation: loadingTextPulse 2s ease-in-out infinite;
}

@keyframes loadingTextPulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

.loading-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: hidden;
}

.loading-particles::before,
.loading-particles::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(41, 171, 226, 0.6);
  border-radius: 50%;
  animation: floatingParticles 4s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(41, 171, 226, 0.4),
    20px 10px 0 rgba(255, 255, 255, 0.3), -15px 20px 0 rgba(41, 171, 226, 0.2);
}

.loading-particles::before {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.loading-particles::after {
  top: 70%;
  right: 15%;
  animation-delay: 2s;
}

@keyframes floatingParticles {
  0%,
  100% {
    transform: translateY(0px) rotateZ(0deg);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-20px) rotateZ(180deg);
    opacity: 0.8;
  }
}

/* Spinner 3D - Tema MOAI Melhorado */
.spinner-3d {
  width: 100px;
  height: 100px;
  margin: 0 auto 30px;
  border-radius: 50%;
  background: conic-gradient(
    #29abe2 0deg,
    #ffffff 120deg,
    #29abe2 240deg,
    #ffffff 360deg
  );
  position: relative;
  animation: spin3D 3s linear infinite;
  box-shadow: 0 0 30px rgba(41, 171, 226, 0.4),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.spinner-3d::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 15px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0066cc, #004499, #003366);
  box-shadow: inset 0 0 30px rgba(41, 171, 226, 0.3),
    0 0 20px rgba(0, 0, 0, 0.5);
  animation: innerGlow3D 2s ease-in-out infinite alternate;
}

.spinner-3d::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(41, 171, 226, 0.7) 100%
  );
  border-radius: 50%;
  z-index: 2;
  animation: coreGlow3D 3s ease-in-out infinite;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

@keyframes spin3D {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes innerGlow3D {
  0% {
    box-shadow: inset 0 0 30px rgba(41, 171, 226, 0.2),
      0 0 20px rgba(0, 0, 0, 0.5);
  }
  100% {
    box-shadow: inset 0 0 50px rgba(41, 171, 226, 0.5),
      0 0 30px rgba(0, 0, 0, 0.3);
  }
}

@keyframes coreGlow3D {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
  }
}

/* Sobreposição 3D */
.firstupgrade-3d-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* Pop-up da ferramenta 3D - Posicionamento dinâmico sobre o barco */
.tool-popup-3d {
  position: absolute;
  /* Removidas posições fixas - serão controladas dinamicamente */
  z-index: 15;
  opacity: 0;
  visibility: hidden;
  transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.8) translate(-50%, -50%); /* Centralizar no ponto de ancoragem */
  pointer-events: none;
  transform-origin: center center; /* Garantir escala centralizada */
}

.tool-popup-3d.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translate(-50%, -50%); /* Manter centralização no estado visível */
  animation: float3D 3s ease-in-out infinite;
  pointer-events: auto;
}

.tool-circle-3d {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 50%;
  width: 100px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(41, 171, 226, 0.4),
    inset 0 2px 15px rgba(255, 255, 255, 0.8);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border: 3px solid rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.tool-circle-3d::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: rotate(45deg);
  animation: shine3D 4s ease-in-out infinite;
}

@keyframes shine3D {
  0%,
  100% {
    transform: rotate(45deg) translateX(-100%);
  }
  50% {
    transform: rotate(45deg) translateX(100%);
  }
}

.tool-popup-3d:hover .tool-circle-3d {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 0 6px rgba(41, 171, 226, 0.5),
    inset 0 2px 20px rgba(255, 255, 255, 0.9);
}

.tool-icon-3d {
  z-index: 2;
  position: relative;
  margin-bottom: 8px;
}

.tool-icon-img-3d {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.tool-emoji {
  font-size: 32px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.tool-text-3d {
  font-size: 11px;
  font-weight: 600;
  color: #333;
  text-align: center;
  z-index: 2;
  position: relative;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.tool-glow-3d {
  position: absolute;
  width: 140%;
  height: 140%;
  top: -20%;
  left: -20%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(41, 171, 226, 0.5) 0%,
    rgba(41, 171, 226, 0) 70%
  );
  animation: glow3DPulse 3s ease-in-out infinite;
  z-index: -1;
}

@keyframes float3D {
  0%,
  100% {
    transform: scale(1) translate(-50%, -50%) translateY(0px);
  }
  50% {
    transform: scale(1.02) translate(-50%, -50%) translateY(-8px);
  }
}

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

/* Instruções de câmera 3D */
.camera-instructions-3d {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  z-index: 10;
}

.instruction-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 20px;
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.instruction-item i {
  font-size: 1rem;
  color: #29abe2;
}

/* Responsividade para instruções 3D */
@media (max-width: 768px) {
  .camera-instructions-3d {
    bottom: 10px;
    left: 10px;
  }

  .instruction-item {
    font-size: 0.75rem;
    padding: 6px 10px;
  }

  .tool-popup-3d {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
  }

  .tool-popup-3d.visible {
    transform: translate(-50%, -50%) scale(1);
  }

  .tool-circle-3d {
    width: 80px;
    height: 80px;
  }

  .tool-icon-img-3d {
    width: 32px;
    height: 32px;
  }

  .tool-emoji {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .camera-instructions-3d {
    display: none; /* Ocultar em telas muito pequenas */
  }

  .tool-circle-3d {
    width: 70px;
    height: 70px;
  }

  .tool-icon-img-3d {
    width: 28px;
    height: 28px;
  }

  .tool-text-3d {
    font-size: 10px;
  }
}

/* Transições de modo 3D/2D */

.firstupgrade-container[ng-show="!is3DModeEnabled"] {
  position: relative;
  overflow-x: hidden;
}

/* Garantir que elementos 2D não interferem no 3D */
.firstupgrade-container .island-visualization[ng-show="!is3DModeEnabled"] {
  position: relative;
  z-index: 2;
}

/* Melhorar visibilidade do mascote em modo 3D */
.firstupgrade-container[data-mode="3d"] .mascote-container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Indicador de rastreamento dinâmico */
.tracking-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 10;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeInOut 2s ease-in-out infinite alternate;
}

@keyframes fadeInOut {
  0% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

/* ADICIONADO: Media queries específicas para speech bubble mobile */
@media (max-width: 480px) {
  .speech-bubble-static.minimized {
    padding: 10px 15px;
  }

  .speech-toggle-btn {
    top: 8px;
    right: 12px;
    width: 28px;
    height: 28px;
  }

  .speech-title-minimized {
    font-size: 0.8rem;
  }
}

@media (max-width: 375px) {
  .speech-bubble-static.minimized {
    padding: 8px 12px;
  }

  .speech-toggle-btn {
    top: 6px;
    right: 10px;
    width: 26px;
    height: 26px;
  }

  .speech-toggle-btn i {
    font-size: 12px;
  }

  .speech-title-minimized {
    font-size: 0.75rem;
  }
}

/* Dispositivos em landscape - otimização adicional para speech bubble */
@media (max-width: 768px) and (orientation: landscape) {
  .speech-bubble-static.minimized {
    max-height: none;
    overflow: hidden;
  }
}

/* Tutorial Message Card - Popup posicionado abaixo do balão de fala */
.tutorial-message-card {
  position: fixed;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(248, 249, 250, 0.94) 100%
  );
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(41, 171, 226, 0.4);
  border: 3px solid rgba(41, 171, 226, 0.5);
  backdrop-filter: blur(20px);
  z-index: 2000;
  max-width: 380px;
  width: 88%;
  transition: all 0.4s ease;
  animation: tutorialPopupIn 0.7s ease-out;
  cursor: pointer;
}

.tutorial-message-card:hover {
  transform: translate(-50%, -50%) scale(1.02);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(41, 171, 226, 0.5);
}

.tutorial-content {
  display: flex;
  align-items: center;
  padding: 25px 30px;
  gap: 18px;
}

.tutorial-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #29abe2 0%, #0077be 100%);
  border-radius: 50%;
  color: white;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(41, 171, 226, 0.4);
  animation: tutorialIconPulse 2s ease-in-out infinite;
}

@keyframes tutorialIconPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 6px 16px rgba(41, 171, 226, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(41, 171, 226, 0.6);
  }
}

.tutorial-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.tutorial-title {
  font-size: 18px;
  font-weight: 700;
  color: #003d5c;
  line-height: 1.2;
}

.tutorial-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: #0077be;
  line-height: 1.4;
  opacity: 0.95;
}

@keyframes tutorialPopupIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8) rotateY(15deg);
  }
  60% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05) rotateY(-2deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotateY(0deg);
  }
}

/* Responsividade para tutorial popup - Mobile First */
@media (max-width: 768px) {
  .tutorial-message-card {
    top: 65%;
    max-width: 340px;
    width: 92%;
    border-radius: 20px;
  }
}

@media (max-width: 480px) {
  .tutorial-message-card {
    top: 68%;
    max-width: 320px;
    width: 94%;
    border-radius: 18px;
  }

  .tutorial-content {
    padding: 18px 22px;
    gap: 14px;
  }

  .tutorial-icon {
    width: 42px;
    height: 42px;
    font-size: 19px;
  }

  .tutorial-title {
    font-size: 16px;
  }

  .tutorial-subtitle {
    font-size: 13px;
    line-height: 1.5;
  }
}

@media (max-width: 360px) {
  .tutorial-message-card {
    top: 70%;
    width: 96%;
  }

  .tutorial-content {
    padding: 16px 20px;
    gap: 12px;
  }

  .tutorial-icon {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .tutorial-title {
    font-size: 15px;
  }

  .tutorial-subtitle {
    font-size: 12px;
  }
}

/* Animação de saída para tutorial */
.tutorial-message-card.fade-out {
  animation: tutorialPopupOut 0.4s ease-in forwards;
}

@keyframes tutorialPopupOut {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
}
