/* ===== RESET E BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== VARIÁVEIS DE CORES MOAI TROPICAL ===== */
:root {
  /* Cores principais inspiradas na Ilha de Páscoa e cultura Polinésia */
  --moai-ocean-primary: #0077be;
  --moai-ocean-secondary: #005a8b;
  --moai-ocean-deep: #003d5c;
  --moai-ocean-light: #4da6d9;

  /* Cores da ilha vulcânica */
  --moai-volcanic-stone: #8b6f47;
  --moai-volcanic-dark: #654832;
  --moai-earth-brown: #a0522d;
  --moai-sand-warm: #deb887;

  /* Cores tropicais vibrantes */
  --moai-coral: #ff6b6b;
  --moai-gold: #ffd93d;
  --moai-emerald: #6bcf7f;
  --moai-sunset: #ff8c42;
  --moai-teal: #20b2aa;

  /* Cores de gradientes especiais */
  --moai-gradient-ocean: linear-gradient(135deg, var(--moai-ocean-primary), var(--moai-ocean-secondary));
  --moai-gradient-earth: linear-gradient(135deg, var(--moai-volcanic-stone), var(--moai-volcanic-dark));
  --moai-gradient-tropical: linear-gradient(135deg, var(--moai-teal), var(--moai-emerald));
  --moai-gradient-sunset: linear-gradient(135deg, var(--moai-coral), var(--moai-sunset));

  /* Sombras e efeitos */
  --moai-shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.15);
  --moai-shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.25);
  --moai-shadow-strong: 0 12px 40px rgba(0, 0, 0, 0.35);
  --moai-glow-teal: 0 0 20px rgba(32, 178, 170, 0.4);
  --moai-glow-gold: 0 0 20px rgba(255, 217, 61, 0.4);

  /* Transições suaves */
  --moai-transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --moai-transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

body {
  font-family: "Nunito", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--moai-ocean-deep) 0%, var(--moai-ocean-secondary) 30%, var(--moai-ocean-primary) 70%, var(--moai-ocean-light) 100%);
  min-height: 100vh;
  color: white;
  overflow-x: hidden;
}

/* ===== DASHBOARD 3D CONTAINER ===== */
.dashboard-3d {
  background: radial-gradient(
    ellipse at center,
    rgba(32, 178, 170, 0.15) 0%,
    rgba(0, 119, 190, 0.25) 30%,
    rgba(0, 90, 139, 0.35) 60%,
    rgba(0, 61, 92, 0.5) 100%
  );
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ===== AMBIENT LIGHT EFFECTS - TEMA MOAI - VERSÃO SUAVE ===== */
.ambient-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

.light-ray {
  position: absolute;
  width: 2px;
  height: 100vh;
  background: linear-gradient(to bottom, transparent 0%, rgba(32, 178, 170, 0.15) 50%, transparent 100%);
  animation: lightRayMoveSmooth 25s ease-in-out infinite;
  border-radius: 2px;
}

.light-ray-1 {
  left: 15%;
  animation-delay: 0s;
  background: linear-gradient(to bottom, transparent 0%, rgba(255, 217, 61, 0.1) 50%, transparent 100%);
}

.light-ray-2 {
  left: 50%;
  animation-delay: -8s;
  background: linear-gradient(to bottom, transparent 0%, rgba(107, 207, 127, 0.12) 50%, transparent 100%);
}

.light-ray-3 {
  left: 85%;
  animation-delay: -16s;
  background: linear-gradient(to bottom, transparent 0%, rgba(255, 140, 66, 0.08) 50%, transparent 100%);
}

@keyframes lightRayMoveSmooth {
  0%,
  100% {
    opacity: 0.05;
    transform: translateX(-5px) scaleY(0.95);
  }
  50% {
    opacity: 0.15;
    transform: translateX(5px) scaleY(1.05);
  }
}

/* ===== OCEANO CSS SUAVE - INSPIRADO NA TELA DE ILHAS ===== */
.ocean-background-smooth {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ocean-wave-smooth {
  position: absolute;
  width: 200%;
  height: 200%;
  border-radius: 45%;
  opacity: 0.04;
  animation: oceanRotateSmooth 30s linear infinite;
}

.wave-smooth-1 {
  background: radial-gradient(
    ellipse at center,
    var(--moai-ocean-light) 0%,
    transparent 70%
  );
  bottom: -100%;
  left: -50%;
  animation-duration: 25s;
}

.wave-smooth-2 {
  background: radial-gradient(
    ellipse at center,
    var(--moai-emerald) 0%,
    transparent 70%
  );
  bottom: -105%;
  left: -45%;
  animation-duration: 35s;
  animation-direction: reverse;
}

.wave-smooth-3 {
  background: radial-gradient(
    ellipse at center,
    var(--moai-ocean-primary) 0%,
    transparent 70%
  );
  bottom: -110%;
  left: -55%;
  animation-duration: 40s;
}

.wave-smooth-4 {
  background: radial-gradient(
    ellipse at center,
    var(--moai-teal) 0%,
    transparent 70%
  );
  bottom: -95%;
  left: -40%;
  animation-duration: 45s;
  animation-direction: reverse;
}

@keyframes oceanRotateSmooth {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== 3D CANVAS ===== */
.render-canvas-3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: auto;
  touch-action: none;
}

/* ===== HUD OVERLAY PRINCIPAL ===== */
.hud-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9998;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ===== TOP RESOURCES BAR ===== */
.top-resources-bar {
  position: fixed;
  top: max(20px, env(safe-area-inset-top, 20px));
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 0 25px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: auto;

  /* Mobile-first: use dynamic viewport units para Safari */
  top: max(20px, calc(env(safe-area-inset-top, 0px) + 20px));
}

/* ===== RESOURCES CONTAINERS ===== */
.resources-left,
.resources-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.resources-right {
  align-items: flex-end;
}

/* ===== RESOURCE COMPACT ENHANCED - TEMA MOAI ===== */
.resource-compact {
  background: linear-gradient(
    135deg,
    rgba(139, 111, 71, 0.9) 0%,
    rgba(101, 72, 50, 0.95) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
  backdrop-filter: blur(25px);
  border: 3px solid rgba(255, 217, 61, 0.6);
  border-radius: 25px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 160px;
  box-shadow: var(--moai-shadow-medium), inset 0 2px 0 rgba(255, 217, 61, 0.3);
  transition: var(--moai-transition);
  position: relative;
  overflow: hidden;
}

/* Efeito de brilho sutil inspirado nas pedras MOAI */
.resource-compact::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 217, 61, 0.2), transparent);
  transition: left 0.8s ease;
}

.resource-compact:hover::before {
  left: 100%;
}

/* Bordas específicas para cada tipo de recurso - Cores Polinésias */
.resource-compact.moaicoins {
  border-color: var(--moai-teal);
  box-shadow: var(--moai-shadow-medium), var(--moai-glow-teal), inset 0 2px 0 rgba(32, 178, 170, 0.4);
}

.resource-compact.moaimoney {
  border-color: var(--moai-emerald);
  box-shadow: var(--moai-shadow-medium), 0 0 25px rgba(107, 207, 127, 0.4), inset 0 2px 0 rgba(107, 207, 127, 0.4);
}

.resource-compact.experience {
  border-color: var(--moai-coral);
  box-shadow: var(--moai-shadow-medium), 0 0 25px rgba(255, 107, 107, 0.4), inset 0 2px 0 rgba(255, 107, 107, 0.4);
}

.resource-compact:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--moai-shadow-strong), var(--moai-glow-gold);
  border-color: var(--moai-gold);
}

.resource-compact.pulsing {
  animation: resourcePulseEnhanced 4s ease-in-out;
}

@keyframes resourcePulseEnhanced {
  0% {
    transform: scale(1);
    box-shadow: var(--moai-shadow-medium);
  }
  50% {
    transform: scale(1.08);
    box-shadow: var(--moai-shadow-strong), var(--moai-glow-gold);
    border-color: var(--moai-gold);
  }
  100% {
    transform: scale(1);
    box-shadow: var(--moai-shadow-medium);
  }
}

/* ===== RESOURCE GLOW EFFECTS ===== */
.resource-glow {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  border-radius: 32px;
  opacity: 0;
  animation: resourceGlow 6s ease-in-out infinite;
}

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

/* ===== RESOURCE ICONS ENHANCED - ESTILO MOAI ===== */
.resource-icon-tropical {
  position: relative;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: radial-gradient(circle, rgba(255, 217, 61, 0.2), transparent 60%);
  border-radius: 50%;
}

.icon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55px;
  height: 55px;
  border-radius: 50%;
  opacity: 0.7;
  animation: iconGlow 6s ease-in-out infinite;
}

.moaicoins-glow {
  background: radial-gradient(circle, rgba(32, 178, 170, 0.5) 0%, transparent 70%);
}

.moaimoney-glow {
  background: radial-gradient(circle, rgba(107, 207, 127, 0.5) 0%, transparent 70%);
}

.xp-glow {
  background: radial-gradient(circle, rgba(255, 107, 107, 0.5) 0%, transparent 70%);
}

@keyframes iconGlow {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.4;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0.8;
  }
}

.resource-icon-compact {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 8px rgba(255, 217, 61, 0.3));
  flex-shrink: 0;
  z-index: 2;
  transition: var(--moai-transition);
}

.resource-compact:hover .resource-icon-compact {
  transform: scale(1.15) rotate(8deg);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 12px var(--moai-gold));
}

.resource-compact i {
  font-size: 28px;
  color: var(--moai-teal);
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.8), 0 0 6px rgba(32, 178, 170, 0.5);
  flex-shrink: 0;
  z-index: 2;
  transition: var(--moai-transition);
}

.resource-compact:hover i {
  transform: scale(1.15);
  text-shadow: 0 6px 12px rgba(0, 0, 0, 0.9), 0 0 10px var(--moai-gold);
  color: var(--moai-gold);
}

/* ===== RESOURCE INFO - ESTILO MOAI POLINÉSIO ===== */
.resource-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.resource-value-compact {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8), 0 0 6px rgba(255, 217, 61, 0.4);
  line-height: 1;
  margin-bottom: 3px;
  letter-spacing: 0.5px;
}

.resource-label-tropical {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  background: linear-gradient(45deg, rgba(255, 217, 61, 0.3), rgba(32, 178, 170, 0.3));
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 217, 61, 0.4);
}

/* ===== RESOURCE SPARKLES ===== */
.resource-sparkles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: sparkleFloat 8s ease-in-out infinite;
}

.sparkle-0 {
  top: 20%;
  left: 20%;
  animation-delay: 0s;
}

.sparkle-1 {
  top: 30%;
  right: 20%;
  animation-delay: 1s;
}

.sparkle-2 {
  bottom: 20%;
  left: 30%;
  animation-delay: 2s;
}

@keyframes sparkleFloat {
  0%,
  100% {
    opacity: 0;
    transform: translateY(0px) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translateY(-10px) scale(1);
  }
}

/* ===== ISLAND BADGE ENHANCED - TEMA MOAI POLINÉSIO ===== */
.island-badge-tropical {
  background: linear-gradient(
    135deg,
    rgba(139, 111, 71, 0.95) 0%,
    rgba(160, 82, 45, 0.9) 30%,
    rgba(101, 72, 50, 0.95) 70%,
    rgba(0, 0, 0, 0.8) 100%
  );
  backdrop-filter: blur(25px);
  border: 4px solid var(--moai-gold);
  border-radius: 30px;
  padding: 18px 30px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 800;
  color: white;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.9);
  box-shadow: var(--moai-shadow-strong), var(--moai-glow-gold), inset 0 3px 0 rgba(255, 217, 61, 0.4);
  position: relative;
  top: 5px;
  animation: tropicalFloat 8s ease-in-out infinite;
  overflow: hidden;
}

/* Efeito de aura místico inspirado nas estátuas MOAI */
.badge-aura {
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  background: linear-gradient(
    45deg,
    rgba(255, 217, 61, 0.4),
    rgba(32, 178, 170, 0.3),
    rgba(107, 207, 127, 0.3),
    rgba(255, 140, 66, 0.3)
  );
  border-radius: 36px;
  animation: badgeAura 6s ease-in-out infinite;
  z-index: -1;
}

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

@keyframes tropicalFloat {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-3px) rotate(0.5deg);
  }
  66% {
    transform: translateY(2px) rotate(-0.5deg);
  }
}

/* Ícones tropicais com movimento sutil */
.tropical-leaf,
.tropical-palm {
  font-size: 24px;
  animation: leafSway 5s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.tropical-leaf {
  color: var(--moai-emerald);
}

.tropical-palm {
  color: #8bc34a;
  animation-direction: reverse;
}

@keyframes leafSway {
  0%,
  100% {
    transform: rotate(-2deg) scale(1);
  }
  50% {
    transform: rotate(2deg) scale(1.05);
  }
}

.island-info-tropical {
  text-align: center;
  flex: 1;
  position: relative;
}

.island-name-tropical {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: white;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.9), 0 0 8px rgba(255, 217, 61, 0.3);
  line-height: 1.1;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.island-subtitle-tropical {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
  background: linear-gradient(45deg, rgba(255, 217, 61, 0.3), rgba(32, 178, 170, 0.3));
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 217, 61, 0.5);
}

.island-stars {
  display: flex;
  justify-content: center;
  gap: 3px;
}

.island-star {
  font-size: 8px;
  color: #ffd700;
  animation: starTwinkle 2s ease-in-out infinite;
}

.island-star:nth-child(2) {
  animation-delay: 0.4s;
}
.island-star:nth-child(3) {
  animation-delay: 0.8s;
}
.island-star:nth-child(4) {
  animation-delay: 1.2s;
}
.island-star:nth-child(5) {
  animation-delay: 1.6s;
}

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

/* ===== BADGE PARTICLES ===== */
.badge-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.badge-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: badgeParticleFloat 4s ease-in-out infinite;
}

.badge-particle-0 {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}
.badge-particle-1 {
  top: 20%;
  right: 15%;
  animation-delay: 0.7s;
}
.badge-particle-2 {
  bottom: 15%;
  left: 20%;
  animation-delay: 1.4s;
}
.badge-particle-3 {
  bottom: 10%;
  right: 10%;
  animation-delay: 2.1s;
}
.badge-particle-4 {
  top: 50%;
  left: 5%;
  animation-delay: 2.8s;
}
.badge-particle-5 {
  top: 50%;
  right: 5%;
  animation-delay: 3.5s;
}

@keyframes badgeParticleFloat {
  0%,
  100% {
    opacity: 0;
    transform: translateY(0px) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translateY(-15px) scale(1);
  }
}

/* ===== SECONDARY RESOURCES ENHANCED - TEMA MOAI ===== */
.secondary-resources-compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.mini-resource {
  background: linear-gradient(135deg, rgba(139, 111, 71, 0.85) 0%, rgba(101, 72, 50, 0.9) 100%);
  backdrop-filter: blur(18px);
  border: 2px solid rgba(255, 217, 61, 0.4);
  border-radius: 18px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  color: white;
  box-shadow: var(--moai-shadow-soft);
  transition: var(--moai-transition);
  position: relative;
  overflow: hidden;
}

.mini-resource:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--moai-shadow-medium), 0 0 15px rgba(255, 217, 61, 0.4);
  border-color: var(--moai-gold);
}

.mini-glow {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  opacity: 0.5;
  animation: miniGlow 4s ease-in-out infinite;
}

.energia-glow {
  background: radial-gradient(circle, rgba(255, 193, 7, 0.7) 0%, transparent 70%);
}

.ferramenta-glow {
  background: radial-gradient(circle, rgba(156, 39, 176, 0.7) 0%, transparent 70%);
}

.criatividade-glow {
  background: radial-gradient(circle, rgba(233, 30, 99, 0.7) 0%, transparent 70%);
}

@keyframes miniGlow {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(-50%) scale(0.9);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-50%) scale(1.2);
  }
}

.mini-icon {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 4px rgba(255, 217, 61, 0.3));
  z-index: 2;
}

/* ===== BOTTOM HUD ENHANCED ===== */
.bottom-hud-safe {
  position: fixed;
  bottom: 90px;
  left: 25px;
  right: 25px;
  z-index: 9999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
  gap: 25px;
}

/* ===== LEVEL PROGRESS ENHANCED - TEMA MOAI ===== */
.level-progress-tropical {
  background: linear-gradient(
    135deg,
    rgba(139, 111, 71, 0.95) 0%,
    rgba(160, 82, 45, 0.9) 30%,
    rgba(101, 72, 50, 0.95) 70%,
    rgba(0, 0, 0, 0.85) 100%
  );
  backdrop-filter: blur(25px);
  border: 4px solid var(--moai-gold);
  border-radius: 35px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 22px;
  box-shadow: var(--moai-shadow-strong), var(--moai-glow-gold), inset 0 3px 0 rgba(255, 217, 61, 0.3);
  flex: 1;
  max-width: 450px;
  position: relative;
  z-index: 10001 !important;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  overflow: hidden;
}

.progress-aura {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(
    45deg,
    rgba(255, 217, 61, 0.4),
    rgba(32, 178, 170, 0.3),
    rgba(107, 207, 127, 0.3),
    rgba(255, 140, 66, 0.3)
  );
  border-radius: 39px;
  animation: progressAura 4s ease-in-out infinite;
  z-index: -1;
}

@keyframes progressAura {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

.level-badge-tropical {
  background: linear-gradient(135deg, var(--moai-coral) 0%, var(--moai-sunset) 50%, var(--moai-volcanic-stone) 100%);
  border: 4px solid var(--moai-gold);
  border-radius: 50%;
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.badge-inner-glow {
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: innerGlow 2s ease-in-out infinite;
}

@keyframes innerGlow {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

.level-badge-tropical i {
  font-size: 18px;
  color: #ffffff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.level-number-compact {
  font-size: 12px;
  font-weight: 900;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

/* ===== Ícone de nível na barra de progresso */
.level-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* Ajuste no level-badge-tropical para acomodar a imagem */
.level-badge-tropical {
  position: relative;
}

.level-badge-tropical .level-number-compact {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* ===== LEVEL RAYS ===== */
.level-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
}

.level-ray {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 15px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
  transform-origin: center bottom;
  animation: levelRayRotate 4s linear infinite;
}

.level-ray-0 {
  transform: translate(-50%, -100%) rotate(0deg);
}
.level-ray-1 {
  transform: translate(-50%, -100%) rotate(45deg);
}
.level-ray-2 {
  transform: translate(-50%, -100%) rotate(90deg);
}
.level-ray-3 {
  transform: translate(-50%, -100%) rotate(135deg);
}
.level-ray-4 {
  transform: translate(-50%, -100%) rotate(180deg);
}
.level-ray-5 {
  transform: translate(-50%, -100%) rotate(225deg);
}
.level-ray-6 {
  transform: translate(-50%, -100%) rotate(270deg);
}
.level-ray-7 {
  transform: translate(-50%, -100%) rotate(315deg);
}

@keyframes levelRayRotate {
  0% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0.3;
  }
}

/* ===== PROGRESS BAR ENHANCED ===== */
.progress-bar-tropical {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 15px;
  height: 20px;
  flex: 1;
  overflow: hidden;
  position: relative;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.progress-bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 5px,
    rgba(255, 255, 255, 0.05) 5px,
    rgba(255, 255, 255, 0.05) 10px
  );
}

.progress-fill-tropical {
  background: linear-gradient(90deg, var(--moai-teal) 0%, var(--moai-emerald) 30%, var(--moai-gold) 60%, var(--moai-sunset) 100%);
  height: 100%;
  border-radius: 12px;
  transition: width 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 0 25px rgba(255, 217, 61, 0.8), var(--moai-glow-gold), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
}

.progress-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 217, 61, 0.8), transparent);
  animation: progressShine 4s ease-in-out infinite;
}

@keyframes progressShine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* ===== PROGRESS PARTICLES ===== */
.progress-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.progress-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: progressParticleFloat 2s ease-in-out infinite;
}

.progress-particle-0 {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}
.progress-particle-1 {
  top: 60%;
  left: 30%;
  animation-delay: 0.4s;
}
.progress-particle-2 {
  top: 40%;
  left: 50%;
  animation-delay: 0.8s;
}
.progress-particle-3 {
  top: 70%;
  left: 70%;
  animation-delay: 1.2s;
}
.progress-particle-4 {
  top: 30%;
  left: 90%;
  animation-delay: 1.6s;
}

@keyframes progressParticleFloat {
  0%,
  100% {
    opacity: 0;
    transform: translateY(0px);
  }
  50% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

.xp-info-tropical {
  text-align: center;
  flex-shrink: 0;
}

.xp-info-tropical span {
  font-size: 14px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);
  display: block;
  margin-bottom: 3px;
}

.tropical-text {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ===== MATURITY SYSTEM ENHANCED - TEMA MOAI ===== */
.maturity-tropical {
  background: linear-gradient(
    135deg,
    rgba(139, 111, 71, 0.95) 0%,
    rgba(160, 82, 45, 0.9) 30%,
    rgba(101, 72, 50, 0.95) 70%,
    rgba(0, 0, 0, 0.85) 100%
  );
  backdrop-filter: blur(25px);
  border: 4px solid var(--moai-emerald);
  border-radius: 35px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--moai-shadow-strong), 0 0 25px rgba(107, 207, 127, 0.5), inset 0 3px 0 rgba(107, 207, 127, 0.3);
  flex-shrink: 0;
  position: relative;
  z-index: 10001 !important;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  overflow: hidden;
}

.maturity-aura {
  position: absolute;
    top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(
    45deg,
    rgba(107, 207, 127, 0.4),
    rgba(32, 178, 170, 0.3),
    rgba(255, 217, 61, 0.3),
    rgba(255, 140, 66, 0.3)
  );
  border-radius: 39px;
  animation: maturityAura 5s ease-in-out infinite;
  z-index: -1;
}

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

.maturity-label-tropical {
  font-size: 13px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8);
}

.maturity-dots-tropical {
  display: flex;
  gap: 14px;
  align-items: center;
}

.dot-tropical {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(139, 111, 71, 0.6);
  border: 3px solid rgba(255, 217, 61, 0.5);
  transition: var(--moai-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.dot-inner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: var(--moai-transition);
}

.dot-glow {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.dot-tropical.active {
  background: linear-gradient(135deg, var(--moai-emerald) 0%, var(--moai-teal) 100%);
  border-color: var(--moai-gold);
  box-shadow: 0 0 20px rgba(107, 207, 127, 0.7), var(--moai-glow-gold);
}

.dot-tropical.active .dot-inner {
  background: rgba(255, 217, 61, 0.9);
  box-shadow: 0 0 8px rgba(255, 217, 61, 0.8);
}

.dot-tropical.active .dot-glow {
  background: radial-gradient(circle, rgba(0, 188, 212, 0.6) 0%, transparent 70%);
  opacity: 1;
}

.dot-tropical.current {
  background: linear-gradient(135deg, #26a69a 0%, #00695c 100%);
  border-color: #26a69a;
  box-shadow: 0 0 20px rgba(38, 166, 154, 0.8);
  animation: currentDotPulseEnhanced 2s ease-in-out infinite;
}

.dot-tropical.current .dot-glow {
  background: radial-gradient(circle, rgba(38, 166, 154, 0.8) 0%, transparent 70%);
  opacity: 1;
}

@keyframes currentDotPulseEnhanced {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(38, 166, 154, 0.8);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 30px rgba(38, 166, 154, 1);
  }
}

/* ===== DOT SPARKLES ===== */
.dot-sparkles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.dot-sparkle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: dotSparkleFloat 2s ease-in-out infinite;
}

.dot-sparkle-0 {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}
.dot-sparkle-1 {
  top: 10%;
  right: 10%;
  animation-delay: 0.5s;
}
.dot-sparkle-2 {
  bottom: 10%;
  left: 10%;
  animation-delay: 1s;
}
.dot-sparkle-3 {
  bottom: 10%;
  right: 10%;
  animation-delay: 1.5s;
}

@keyframes dotSparkleFloat {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 1;
    transform: scale(1) translateY(-5px);
  }
}

.maturity-text-tropical {
  font-size: 13px;
  font-weight: 900;
  color: var(--moai-emerald);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8), 0 0 6px rgba(107, 207, 127, 0.4);
  background: linear-gradient(45deg, rgba(107, 207, 127, 0.2), rgba(255, 217, 61, 0.2));
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid rgba(107, 207, 127, 0.4);
}

/* ===== UPGRADE BUTTON ENHANCED - TEMA MOAI MÍSTICO ===== */
.upgrade-btn-3d {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, var(--moai-volcanic-stone) 0%, var(--moai-earth-brown) 50%, var(--moai-volcanic-dark) 100%);
  border: 4px solid var(--moai-gold);
  border-radius: 50%;
  width: 85px;
  height: 85px;
  color: white;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: var(--moai-shadow-strong),
              var(--moai-glow-gold),
              inset 0 3px 0 rgba(255, 217, 61, 0.4);
  transition: var(--moai-transition-bounce);
  z-index: 9999;
  pointer-events: auto;
  animation: upgradePulseEnhanced 3s ease-in-out infinite;
  overflow: hidden;
}

/* Efeito místico inspirado na energia das estátuas MOAI */
.upgrade-btn-3d::before {
  content: "";
  position: absolute;
  top: -12px;
  left: -12px;
  right: -12px;
  bottom: -12px;
  background: radial-gradient(circle, rgba(255, 217, 61, 0.5) 0%, rgba(32, 178, 170, 0.3) 50%, transparent 70%);
  border-radius: 50%;
  animation: moaiButtonGlow 2.5s ease-in-out infinite;
  z-index: -1;
}

@keyframes moaiButtonGlow {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

@keyframes upgradePulseEnhanced {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: var(--moai-shadow-strong), var(--moai-glow-gold);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: var(--moai-shadow-strong), 0 0 50px rgba(255, 217, 61, 0.8);
  }
}

.upgrade-btn-3d:hover {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: var(--moai-shadow-strong),
              0 0 60px rgba(255, 217, 61, 1),
              inset 0 3px 0 rgba(255, 217, 61, 0.6);
  animation: none;
  background: linear-gradient(135deg, var(--moai-gold) 0%, var(--moai-sunset) 50%, var(--moai-coral) 100%);
}

/* Aumentar o tamanho do ícone para melhor visibilidade */
.upgrade-btn-3d .btn-icon {
  font-size: 28px;
}

/* Ícone de ferramenta no botão de upgrade 3D - tamanho maior */
.upgrade-tool-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.7)) brightness(1.3);
  transition: all 0.3s ease;
}

.upgrade-btn-3d:hover .upgrade-tool-icon {
  transform: scale(1.15);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8)) brightness(1.5);
}

/* ===== RESPONSIVIDADE PARA BOTÃO SOBRE O MOAI ===== */
@media (max-width: 1024px) {
  .upgrade-btn-3d {
    width: 70px;
    height: 70px;
  }

  .upgrade-tool-icon {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 768px) {
  .upgrade-btn-3d {
    width: 65px;
    height: 65px;
    top: 55%;
  }

  .upgrade-tool-icon {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .upgrade-btn-3d {
    width: 60px;
    height: 60px;
    top: 60%;
  }

  .upgrade-btn-3d .btn-icon {
    font-size: 20px;
  }

  .upgrade-tool-icon {
    width: 22px;
    height: 22px;
  }
}

/* ===== DISPOSITIVOS MUITO PEQUENOS (< 360px) ===== */
@media (max-width: 360px) {
  .maturity-tropical {
    padding: 8px 10px !important;
    gap: 6px !important;
    border-radius: 18px !important;
    border-width: 2px !important;
    max-width: calc(100vw - 40px) !important;
    font-size: 12px !important;
  }

  .maturity-label-tropical {
    font-size: 11px !important;
    font-weight: 600 !important;
  }

  .maturity-text-tropical {
    font-size: 10px !important;
    max-width: 80px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
  }

  .dot-tropical {
    width: 15px !important;
    height: 15px !important;
  }

  .maturity-dots-tropical {
    gap: 6px !important;
  }

  .bottom-hud-safe {
    left: 8px !important;
    right: 8px !important;
    gap: 10px !important;
  }

  .level-progress-tropical {
    padding: 10px 12px !important;
    gap: 12px !important;
    max-width: calc(100vw - 40px) !important;
  }
}

/* ===== RESPONSIVIDADE MOBILE-FIRST MELHORADA ===== */

/* Base mobile (iPhone e dispositivos similares) */
@media (max-width: 768px) {
  .top-resources-bar {
    top: max(15px, calc(env(safe-area-inset-top, 0px) + 15px)) !important;
    padding: 0 15px !important;
    gap: 10px !important;
  }

  .resources-left,
  .resources-right {
    gap: 8px !important;
  }

  .resource-compact {
    min-width: 120px !important;
    padding: 10px 15px !important;
    font-size: 14px !important;
  }

  .island-badge-tropical {
    padding: 8px 15px !important;
    font-size: 13px !important;
  }

  /* Ajuste específico para evitar sobreposição com navbar */
  .bottom-hud-safe {
    bottom: max(100px, calc(80px + env(safe-area-inset-bottom, 0px))) !important;
    z-index: 9997 !important; /* Abaixo da top-resources-bar */
  }
}

@media (max-width: 480px) {
  .top-resources-bar {
    top: max(10px, calc(env(safe-area-inset-top, 0px) + 10px)) !important;
    padding: 0 10px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .resources-left,
  .resources-right {
    gap: 6px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }

  .resource-compact {
    min-width: 100px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
  }

  .resource-value-compact {
    font-size: 14px !important;
  }

  .resource-label-tropical {
    font-size: 9px !important;
    padding: 1px 4px !important;
  }

  .island-badge-tropical {
    padding: 6px 12px !important;
    font-size: 11px !important;
    margin: 0 5px !important;
  }

  .island-name-tropical {
    font-size: 13px !important;
  }

  .island-subtitle-tropical {
    font-size: 9px !important;
  }

  /* Ajustes para elementos secundários */
  .secondary-resources-compact {
    gap: 4px !important;
  }

  .mini-resource {
    padding: 4px 6px !important;
    font-size: 10px !important;
  }

  .mini-icon {
    width: 14px !important;
    height: 14px !important;
  }
}
@media (max-width: 1024px) {
  .top-resources-bar {
    padding: 0 20px;
  }

  .island-badge-tropical {
    padding: 12px 20px;
    gap: 12px;
  }

  .upgrade-btn-3d {
    width: 60px;
    height: 60px;
    right: 20px;
  }
}

@media (max-width: 768px) {
  .top-resources-bar {
    padding: 0 15px;
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .resources-left,
  .resources-right {
    flex-direction: row;
    gap: 10px;
  }

  .island-badge-tropical {
    order: -1;
    margin-bottom: 10px;
  }

  .bottom-hud-safe {
    flex-direction: column;
    gap: 15px;
    left: 15px;
    right: 15px;
    bottom: max(120px, calc(100px + env(safe-area-inset-bottom, 20px)));
    z-index: 10002 !important;
  }

  .level-progress-tropical {
    max-width: none;
    width: 100%;
  }

  .upgrade-btn-3d {
    width: 55px;
    height: 55px;
    right: 15px;
  }
}

@media (max-width: 480px) {
  .top-resources-bar {
    padding: 0 10px;
  }

  .resource-compact {
    min-width: 100px;
    padding: 8px 12px;
    gap: 8px;
  }

  .resource-value-compact {
    font-size: 14px;
  }

  .resource-label-tropical {
    font-size: 9px;
  }

  .island-badge-tropical {
    font-size: 12px;
    padding: 10px 15px;
    gap: 10px;
  }

  .island-name-tropical {
    font-size: 14px;
  }

  .island-subtitle-tropical {
    font-size: 9px;
  }

  .secondary-resources-compact {
    flex-direction: row;
    gap: 6px;
  }

  .mini-resource {
    padding: 6px 10px;
    font-size: 11px;
  }

  .mini-icon {
    width: 18px;
    height: 18px;
  }

  .level-progress-tropical {
    padding: 12px 15px;
    gap: 15px;
  }

  .level-badge-tropical {
    width: 45px;
    height: 45px;
  }

  .progress-bar-tropical {
    height: 18px;
  }

  .maturity-tropical {
    padding: 10px 12px;
    gap: 10px;
    border-radius: 20px;
    border-width: 2px;
    max-width: calc(100vw - 60px);
    min-width: 0;
    flex-shrink: 1;
    font-size: 13px;
    justify-content: space-between;
  }

  .maturity-label-tropical {
    font-size: 12px;
    font-weight: 600;
  }

  .maturity-text-tropical {
    font-size: 11px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
    min-width: 80px;
    flex-shrink: 0;
  }

  .dot-tropical {
    width: 18px;
    height: 18px;
  }

  .upgrade-btn-3d {
    width: 50px;
    height: 50px;
  }

  .upgrade-btn-3d .btn-icon {
    font-size: 18px;
  }

  .upgrade-btn-3d .btn-text {
    font-size: 8px;
  }
}

/* ===== ORIENTAÇÃO LANDSCAPE EM MOBILE ===== */
@media (max-height: 500px) and (max-width: 800px) and (orientation: landscape) {
  .bottom-hud-safe {
    bottom: 80px !important;
    flex-direction: row !important;
    gap: 15px !important;
  }

  .maturity-tropical {
    padding: 8px 12px !important;
    gap: 8px !important;
    flex-shrink: 1 !important;
    max-width: 200px !important;
  }

  .level-progress-tropical {
    flex: 1 !important;
    max-width: 300px !important;
    padding: 8px 12px !important;
  }

  .maturity-label-tropical {
    font-size: 11px !important;
  }

  .maturity-text-tropical {
    font-size: 10px !important;
    max-width: none !important;
    min-width: 75px !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }
}

/* ===== FORÇA VISIBILIDADE E PERFORMANCE ===== */
.hud-overlay,
.top-resources-bar,
.bottom-hud-safe,
.resource-compact,
.island-badge-tropical,
.level-progress-tropical,
.maturity-tropical,
.upgrade-btn-3d {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
  will-change: transform;
}

/* ===== OTIMIZAÇÕES DE PERFORMANCE ===== */
.resource-compact,
.island-badge-tropical,
.level-badge-tropical,
.dot-tropical,
.upgrade-btn-3d {
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* ===== EFEITOS ESPECIAIS ADICIONAIS ===== */
.dashboard-3d::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(0, 188, 212, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(38, 166, 154, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(92, 107, 192, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
  animation: backgroundShift 45s ease-in-out infinite;
}

@keyframes backgroundShift {
  0%,
  100% {
    opacity: 0.3;
  }
  33% {
    opacity: 0.4;
  }
  66% {
    opacity: 0.2;
  }
}

/* ===== EFEITOS DE HOVER GLOBAIS ===== */
.resource-compact:hover .resource-sparkles .sparkle,
.island-badge-tropical:hover .badge-particles .badge-particle,
.upgrade-btn-3d:hover .btn-particles .btn-particle {
  animation-duration: 1.5s;
}

/* ===== TRANSIÇÕES SUAVES ===== */
* {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ===== LOADING STATE ===== */
.dashboard-3d.loading .hud-overlay {
  opacity: 0;
  pointer-events: none;
}

.dashboard-3d.loading .ambient-effects,
.dashboard-3d.loading .weather-effects {
  opacity: 0.3;
}

/* ===== LOADING SCREEN 3D ELEGANTE - TEMA MOAI MODERNO ===== */
.loading-screen-3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at 30% 20%, rgba(0, 119, 190, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(32, 178, 170, 0.04) 0%, transparent 50%),
    linear-gradient(
      135deg,
      #001e2e 0%,
      #003045 25%,
      #003d5c 50%,
      #004a73 75%,
      #005a8b 100%
    );
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  pointer-events: auto;
  overflow: hidden;
}

/* Efeito de ondas sutis de fundo */
.loading-screen-3d::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(77, 166, 217, 0.03) 0%, transparent 25%),
    radial-gradient(circle at 75% 75%, rgba(32, 178, 170, 0.02) 0%, transparent 30%);
  animation: subtleWaveEffect 12s ease-in-out infinite;
  pointer-events: none;
}

@keyframes subtleWaveEffect {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1) translateY(0);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.02) translateY(-5px);
  }
}

.loading-content {
  text-align: center;
  color: white;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
}

/* ===== SPINNER MODERNO E ELEGANTE ===== */
.spinner-3d {
  width: 100px;
  height: 100px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Anel principal com gradiente suave */
.spinner-3d::before {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(77, 166, 217, 0.8) 90deg,
    rgba(32, 178, 170, 0.6) 180deg,
    rgba(0, 119, 190, 0.4) 270deg,
    transparent 360deg
  );
  mask: radial-gradient(circle, transparent 38px, black 40px);
  animation: elegantSpin 3s linear infinite;
}

/* Anel interno secundário */
.spinner-3d::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: conic-gradient(
    from 180deg,
    transparent 0deg,
    rgba(32, 178, 170, 0.6) 120deg,
    rgba(0, 90, 139, 0.4) 240deg,
    transparent 360deg
  );
  mask: radial-gradient(circle, transparent 28px, black 30px);
  animation: elegantSpinReverse 4s linear infinite;
}

/* Núcleo central elegante */
.spinner-3d {
  background: radial-gradient(
    circle,
    rgba(77, 166, 217, 0.8) 0%,
    rgba(32, 178, 170, 0.6) 40%,
    rgba(0, 119, 190, 0.4) 70%,
    transparent 100%
  );
  border-radius: 50%;
  width: 24px;
  height: 24px;
  box-shadow:
    0 0 15px rgba(77, 166, 217, 0.5),
    0 0 30px rgba(32, 178, 170, 0.3),
    inset 0 2px 5px rgba(255, 255, 255, 0.1);
  animation: coreBreathing 2s ease-in-out infinite;
}

/* Partículas orbitais elegantes */
.spinner-3d {
  position: relative;
}

.spinner-3d:after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255, 217, 61, 0.8);
  border-radius: 50%;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow:
    0 0 8px rgba(255, 217, 61, 0.6),
    0 106px 0 rgba(255, 140, 66, 0.6),
    75px 53px 0 rgba(107, 207, 127, 0.6),
    -75px 53px 0 rgba(255, 107, 107, 0.6);
  animation: orbitParticles 4s linear infinite;
}

@keyframes elegantSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes elegantSpinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes coreBreathing {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 15px rgba(77, 166, 217, 0.5),
      0 0 30px rgba(32, 178, 170, 0.3);
  }
  50% {
    transform: scale(1.1);
    box-shadow:
      0 0 20px rgba(77, 166, 217, 0.8),
      0 0 40px rgba(32, 178, 170, 0.5);
  }
}

@keyframes orbitParticles {
  from { transform: translateX(-50%) rotate(0deg) translateX(50px) rotate(0deg); }
  to { transform: translateX(-50%) rotate(360deg) translateX(50px) rotate(-360deg); }
}

/* ===== TEXTOS ELEGANTES ===== */
.loading-content p {
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: textFadeIn 1.5s ease-in-out infinite alternate;
  position: relative;
}

.loading-content p::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(77, 166, 217, 0.8), transparent);
  animation: underlineGrow 2s ease-in-out infinite;
}

@keyframes textFadeIn {
  0% {
    opacity: 0.6;
    transform: translateY(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes underlineGrow {
  0%, 100% { width: 0; opacity: 0; }
  50% { width: 100px; opacity: 1; }
}

/* ===== EFEITOS AMBIENTAIS MINIMALISTAS ===== */
.loading-content::before {
  content: "";
  position: absolute;
  top: -100px;
  left: -100px;
  right: -100px;
  bottom: -100px;
  background:
    radial-gradient(circle at 20% 30%, rgba(77, 166, 217, 0.02) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(32, 178, 170, 0.015) 0%, transparent 50%);
  animation: ambientGlow 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ambientGlow {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05) rotate(180deg);
  }
}

/* ===== RESPONSIVIDADE DO LOADING ===== */
@media (max-width: 768px) {
  .spinner-3d {
    width: 80px;
    height: 80px;
  }

  .spinner-3d::before {
    width: 80px;
    height: 80px;
  }

  .spinner-3d::after {
    width: 56px;
    height: 56px;
  }

  .spinner-3d {
    width: 20px;
    height: 20px;
  }

  .loading-content p {
    font-size: 18px;
    letter-spacing: 1px;
  }
}

@media (max-width: 480px) {
  .spinner-3d {
    width: 70px;
    height: 70px;
  }

  .spinner-3d::before {
    width: 70px;
    height: 70px;
    mask: radial-gradient(circle, transparent 33px, black 35px);
  }

  .spinner-3d::after {
    width: 49px;
    height: 49px;
    mask: radial-gradient(circle, transparent 23px, black 25px);
  }

  .spinner-3d {
    width: 18px;
    height: 18px;
  }

  .loading-content p {
    font-size: 16px;
    letter-spacing: 0.5px;
  }

  .loading-content p::after {
    bottom: -6px;
  }

  @keyframes underlineGrow {
    0%, 100% { width: 0; opacity: 0; }
    50% { width: 80px; opacity: 1; }
  }
}

@media (max-width: 360px) {
  .spinner-3d {
    width: 60px;
    height: 60px;
  }

  .spinner-3d::before {
    width: 60px;
    height: 60px;
    mask: radial-gradient(circle, transparent 28px, black 30px);
  }

  .spinner-3d::after {
    width: 42px;
    height: 42px;
    mask: radial-gradient(circle, transparent 18px, black 20px);
  }

  .spinner-3d {
    width: 16px;
    height: 16px;
  }

  .loading-content p {
    font-size: 14px;
  }

  @keyframes underlineGrow {
    0%, 100% { width: 0; opacity: 0; }
    50% { width: 60px; opacity: 1; }
  }
}

/* ===== TRANSIÇÃO DE SAÍDA DO LOADING ELEGANTE ===== */
.loading-screen-3d.fade-out {
  animation: fadeOutLoadingElegant 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fadeOutLoadingElegant {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0px);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.02);
    filter: blur(2px);
  }
  100% {
    opacity: 0;
    transform: scale(0.95);
    filter: blur(5px);
    pointer-events: none;
  }
}

/* ===== SAFARI E IOS SAFE AREAS - VERSÃO MELHORADA ===== */

/* Detectar Safari e aplicar ajustes específicos */
@supports (-webkit-touch-callout: none) {
  /* Safari específico - solução para barra de endereços dinâmica */
  .top-resources-bar {
    top: max(10px, calc(env(safe-area-inset-top, 0px) + 10px)) !important;
    position: fixed !important;
    z-index: 10001 !important; /* Sempre acima da navbar */
  }

  .bottom-hud-safe {
    bottom: max(120px, calc(90px + env(safe-area-inset-bottom, 0px))) !important;
    z-index: 9998 !important; /* Abaixo da top bar */
  }

  .navbar-moai {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    height: calc(var(--navbar-height-mobile, 70px) + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 9999 !important; /* Entre HUD e top bar */
  }

  /* Força hardware acceleration para Safari */
  .top-resources-bar,
  .bottom-hud-safe {
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    will-change: transform !important;
  }
}

/* iOS Safari específico - usando env() para safe areas */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .dashboard-3d {
    /* Use dynamic viewport height para compensar barra de endereços */
    height: 100dvh !important; /* Dynamic viewport height */
    min-height: 100svh !important; /* Small viewport height como fallback */
  }

  .top-resources-bar {
    top: max(8px, calc(env(safe-area-inset-top, 0px) + 8px)) !important;
  }

  .bottom-hud-safe {
    bottom: max(120px, calc(90px + env(safe-area-inset-bottom, 0px) + 10px)) !important;
  }

  /* Ajuste adicional para dispositivos com home indicator */
  @media screen and (max-device-width: 430px) and (-webkit-min-device-pixel-ratio: 2) {
    .top-resources-bar {
      top: max(12px, calc(env(safe-area-inset-top, 0px) + 12px)) !important;
      padding: 0 12px !important;
    }

    .bottom-hud-safe {
      bottom: max(140px, calc(110px + env(safe-area-inset-bottom, 0px) + 15px)) !important;
    }
  }
}

/* Detecção específica do Safari mobile - solução avançada */
@media screen and (max-width: 768px) {
  @supports (-webkit-appearance: none) and (not (overflow: -webkit-marquee)) and (not (-ms-ime-align: auto)) {
    /* Safari mobile detectado */

    /* Dashboard principal com altura dinâmica */
    .dashboard-3d {
      height: 100dvh !important; /* Dynamic viewport */
      max-height: 100dvh !important;
      overflow: hidden !important;
    }

    /* Top resources bar - posicionamento mais seguro */
    .top-resources-bar {
      position: fixed !important;
      top: max(8px, calc(env(safe-area-inset-top, 0px) + 8px)) !important;
      left: 8px !important;
      right: 8px !important;
      z-index: 10002 !important; /* Máxima prioridade */
      padding: 0 !important;

      /* Layout otimizado para mobile */
      flex-direction: row !important;
      flex-wrap: wrap !important;
      gap: 8px !important;
      align-items: flex-start !important;

      /* Performance otimizations */
      transform: translateZ(0) !important;
      -webkit-transform: translateZ(0) !important;
      will-change: transform !important;
      backface-visibility: hidden !important;
      -webkit-backface-visibility: hidden !important;
    }

    /* Resources containers otimizados */
    .resources-left,
    .resources-right {
      flex: 1 1 auto !important;
      min-width: 0 !important;
      gap: 6px !important;
    }

    /* Island badge centralizado para mobile */
    .island-badge-tropical {
      order: 3 !important;
      flex: 1 1 100% !important;
      margin: 5px 0 !important;
      text-align: center !important;
      max-width: 200px !important;
      margin-left: auto !important;
      margin-right: auto !important;
    }

    /* Bottom HUD com posicionamento seguro */
    .bottom-hud-safe {
      position: fixed !important;
      bottom: max(100px, calc(80px + env(safe-area-inset-bottom, 0px))) !important;
      left: 10px !important;
      right: 10px !important;
      z-index: 9998 !important;

      /* Performance */
      transform: translateZ(0) !important;
      -webkit-transform: translateZ(0) !important;
      will-change: transform !important;
    }

    /* Level progress e maturity com z-index alto */
    .level-progress-tropical,
    .maturity-tropical {
      z-index: 10000 !important;
      position: relative !important;
    }

    /* Navbar com posicionamento correto */
    .navbar-moai {
      z-index: 9999 !important;
      position: fixed !important;
      bottom: 0 !important;
      left: 0 !important;
      right: 0 !important;
    }

    /* Upgrade button posicionamento seguro */
    .upgrade-btn-3d {
      bottom: max(180px, calc(160px + env(safe-area-inset-bottom, 0px))) !important;
      z-index: 9997 !important;
    }
  }
}

/* iPhone específico - baseado em tamanhos de tela conhecidos e orientações */

/* iPhone SE, 12 mini, 13 mini */
@media only screen
  and (device-width: 375px)
  and (device-height: 667px)
  and (-webkit-device-pixel-ratio: 2) {
  .top-resources-bar {
    top: max(8px, calc(env(safe-area-inset-top, 0px) + 8px)) !important;
    padding: 0 8px !important;
  }

  .bottom-hud-safe {
    bottom: max(90px, calc(70px + env(safe-area-inset-bottom, 0px))) !important;
  }
}

/* iPhone 12, 13, 14, 15 (standard) */
@media only screen
  and (device-width: 390px)
  and (device-height: 844px)
  and (-webkit-device-pixel-ratio: 3) {
  .top-resources-bar {
    top: max(12px, calc(env(safe-area-inset-top, 0px) + 12px)) !important;
    padding: 0 10px !important;
  }

  .bottom-hud-safe {
    bottom: max(110px, calc(90px + env(safe-area-inset-bottom, 0px))) !important;
  }
}

/* iPhone 14 Plus, 15 Plus */
@media only screen
  and (device-width: 428px)
  and (device-height: 926px)
  and (-webkit-device-pixel-ratio: 3) {
  .top-resources-bar {
    top: max(15px, calc(env(safe-area-inset-top, 0px) + 15px)) !important;
    padding: 0 12px !important;
  }

  .bottom-hud-safe {
    bottom: max(120px, calc(95px + env(safe-area-inset-bottom, 0px))) !important;
  }
}

/* iPhone 14 Pro, 15 Pro */
@media only screen
  and (device-width: 393px)
  and (device-height: 852px)
  and (-webkit-device-pixel-ratio: 3) {
  .top-resources-bar {
    top: max(15px, calc(env(safe-area-inset-top, 0px) + 15px)) !important;
    padding: 0 10px !important;
  }

  .bottom-hud-safe {
    bottom: max(115px, calc(90px + env(safe-area-inset-bottom, 0px))) !important;
  }
}

/* iPhone 14 Pro Max, 15 Pro Max */
@media only screen
  and (device-width: 430px)
  and (device-height: 932px)
  and (-webkit-device-pixel-ratio: 3) {
  .top-resources-bar {
    top: max(18px, calc(env(safe-area-inset-top, 0px) + 18px)) !important;
    padding: 0 12px !important;
  }

  .bottom-hud-safe {
    bottom: max(125px, calc(100px + env(safe-area-inset-bottom, 0px))) !important;
  }
}

/* Orientação landscape para iPhone */
@media only screen
  and (max-height: 500px)
  and (orientation: landscape)
  and (-webkit-min-device-pixel-ratio: 2) {

  .dashboard-3d {
    height: 100dvh !important;
    overflow: hidden !important;
  }

  .top-resources-bar {
    top: max(5px, calc(env(safe-area-inset-top, 0px) + 5px)) !important;
    left: max(10px, calc(env(safe-area-inset-left, 0px) + 10px)) !important;
    right: max(10px, calc(env(safe-area-inset-right, 0px) + 10px)) !important;
    flex-direction: row !important;
    gap: 8px !important;
  }

  .bottom-hud-safe {
    bottom: max(60px, calc(40px + env(safe-area-inset-bottom, 0px))) !important;
    left: max(10px, calc(env(safe-area-inset-left, 0px) + 10px)) !important;
    right: max(10px, calc(env(safe-area-inset-right, 0px) + 10px)) !important;
  }

  .upgrade-btn-3d {
    bottom: max(120px, calc(100px + env(safe-area-inset-bottom, 0px))) !important;
    right: max(30px, calc(env(safe-area-inset-right, 0px) + 30px)) !important;
  }

  /* Redimensionar elementos para landscape */
  .resource-compact {
    min-width: 80px !important;
    padding: 6px 10px !important;
    font-size: 11px !important;
  }

  .island-badge-tropical {
    padding: 4px 8px !important;
    font-size: 10px !important;
  }

  .level-progress-tropical,
  .maturity-tropical {
    padding: 8px 12px !important;
  }
}

/* Ajustes gerais para WebKit (Safari) */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .bottom-hud-safe {
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    will-change: transform !important;
  }

  .maturity-tropical,
  .level-progress-tropical {
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    -webkit-perspective: 1000px !important;
    perspective: 1000px !important;
  }
}

/* ===== MELHORIAS ESPECÍFICAS PARA MOBILE SAFARI ===== */
/* Solução avançada para barra de endereços dinâmica do Safari */

/* Base: use viewport units dinâmicos quando disponíveis */
.dashboard-3d {
  height: 100vh; /* Fallback */
  height: 100dvh; /* Dynamic viewport height - Safari 15.4+ */
  min-height: 100svh; /* Small viewport height - fallback */
  max-height: 100lvh; /* Large viewport height - máximo */
}

/* Garantir que elementos não sejam cortados pela navbar */
@media (max-width: 768px) {
  /* Ajuste específico para Safari mobile */
  .dashboard-3d .bottom-hud-safe {
    bottom: clamp(110px, 15vh, 160px) !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
  }

  .dashboard-3d .top-resources-bar {
    top: clamp(8px, 2vh, 25px) !important;
    top: max(8px, calc(env(safe-area-inset-top, 0px) + 8px)) !important;
  }

  /* Garantir z-index superior para elementos do HUD */
  .maturity-tropical {
    z-index: 10001 !important;
    position: relative !important;
  }

  .level-progress-tropical {
    z-index: 10001 !important;
    position: relative !important;
  }

  /* Força reposicionamento em Safari */
  @supports (-webkit-touch-callout: none) {
    .bottom-hud-safe {
      position: fixed !important;
      bottom: calc(15vh + env(safe-area-inset-bottom, 20px)) !important;
      transform: translate3d(0, 0, 0) !important;
    }
  }
}

/* ===== FALLBACK PARA DISPOSITIVOS SEM SUPORTE A ENV() ===== */
@media (max-width: 768px) and (max-height: 800px) {
  .bottom-hud-safe {
    bottom: 130px !important;
  }
}

@media (max-width: 480px) and (max-height: 700px) {
  .bottom-hud-safe {
    bottom: 120px !important;
    left: 10px !important;
    right: 10px !important;
  }

  .maturity-tropical {
    font-size: 14px !important;
  }

  .level-progress-tropical {
    max-width: 100% !important;
  }
}

/* ===== AJUSTE ESPECÍFICO PARA TEXTOS LONGOS DE MATURIDADE ===== */
@media (max-width: 480px) {
  .maturity-dots-tropical {
    flex-shrink: 1;
    min-width: 0;
  }

  .maturity-label-tropical {
    flex-shrink: 1;
    min-width: 0;
  }

  .maturity-text-tropical {
    flex-shrink: 0 !important;
    min-width: 85px !important;
    font-weight: 700 !important;
  }
}

@media (max-width: 360px) {
  .maturity-text-tropical {
    font-size: 9px !important;
    min-width: 80px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
  }
}

/* ===== SISTEMA AVANÇADO DE EFEITOS VISUAIS MOAI EVOLUÇÃO ===== */

/* Efeito de pulsação mística da tela - Mais sutil e glorioso */
@keyframes moaiMysticPulse {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    filter: brightness(1) hue-rotate(0deg);
  }
  25% {
    transform: scale(1.002) rotate(0.1deg);
    filter: brightness(1.1) hue-rotate(2deg);
  }
  50% {
    transform: scale(1.005) rotate(-0.1deg);
    filter: brightness(1.2) hue-rotate(5deg);
  }
  75% {
    transform: scale(1.003) rotate(0.05deg);
    filter: brightness(1.15) hue-rotate(3deg);
  }
}

.moai-evolution-shake {
  animation: moaiMysticPulse 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 2;
  transform-origin: center center;
}

/* Efeito de aura dourada gloriosa durante evolução */
@keyframes moaiGloriousGlow {
  0% {
    box-shadow: var(--moai-shadow-medium);
    filter: brightness(1) saturate(1) hue-rotate(0deg);
  }
  20% {
    box-shadow:
      var(--moai-shadow-strong),
      0 0 25px rgba(255, 215, 0, 0.8),
      0 0 50px rgba(255, 185, 0, 0.6),
      inset 0 0 15px rgba(255, 255, 255, 0.3);
    filter: brightness(1.2) saturate(1.3) hue-rotate(5deg);
  }
  40% {
    box-shadow:
      var(--moai-shadow-strong),
      0 0 40px rgba(255, 215, 0, 1),
      0 0 80px rgba(255, 185, 0, 0.8),
      0 0 120px rgba(255, 140, 0, 0.6),
      inset 0 0 25px rgba(255, 255, 255, 0.4);
    filter: brightness(1.4) saturate(1.6) hue-rotate(10deg);
    transform: scale(1.01);
  }
  60% {
    box-shadow:
      var(--moai-shadow-strong),
      0 0 60px rgba(255, 215, 0, 0.9),
      0 0 100px rgba(255, 185, 0, 0.7),
      0 0 140px rgba(255, 140, 0, 0.5),
      inset 0 0 30px rgba(255, 255, 255, 0.5);
    filter: brightness(1.5) saturate(1.8) hue-rotate(15deg);
    transform: scale(1.02);
  }
  80% {
    box-shadow:
      var(--moai-shadow-strong),
      0 0 35px rgba(255, 215, 0, 0.8),
      0 0 70px rgba(255, 185, 0, 0.6),
      inset 0 0 20px rgba(255, 255, 255, 0.3);
    filter: brightness(1.3) saturate(1.4) hue-rotate(8deg);
    transform: scale(1.005);
  }
  100% {
    box-shadow: var(--moai-shadow-medium);
    filter: brightness(1) saturate(1) hue-rotate(0deg);
    transform: scale(1);
  }
}

.moai-evolution-glow {
  animation: moaiGloriousGlow 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) 2;
  position: relative;
  z-index: 10000;
}

/* Partículas douradas flutuantes */
.moai-evolution-glow::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: radial-gradient(
    circle at 20% 20%, rgba(255, 215, 61, 0.3) 2px, transparent 2px),
    radial-gradient(
    circle at 60% 40%, rgba(255, 140, 66, 0.3) 1px, transparent 1px),
    radial-gradient(
    circle at 80% 70%, rgba(255, 255, 255, 0.4) 1px, transparent 1px),
    radial-gradient(
    circle at 30% 80%, rgba(32, 178, 170, 0.3) 1px, transparent 1px);
  background-size: 50px 50px, 30px 30px, 20px 20px, 40px 40px;
  border-radius: inherit;
  opacity: 0;
  animation: evolutionParticles 3s ease-in-out;
  pointer-events: none;
  z-index: -1;
}

@keyframes evolutionParticles {
  0%, 100% {
    opacity: 0;
    transform: translateY(0px);
  }
  20% {
    opacity: 0.7;
    transform: translateY(-10px);
  }
  50% {
    opacity: 1;
    transform: translateY(-20px);
  }
  80% {
    opacity: 0.7;
    transform: translateY(-30px);
  }
}

/* Ondas de energia dourada concêntricas - Efeito místico e glorioso */
.moai-golden-energy-wave {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: radial-gradient(
    circle,
    rgba(255, 215, 0, 0.9) 0%,
    rgba(255, 185, 0, 0.7) 20%,
    rgba(255, 140, 0, 0.5) 40%,
    rgba(255, 215, 0, 0.3) 60%,
    rgba(255, 255, 255, 0.1) 80%,
    transparent 100%
  );
  border: 2px solid rgba(255, 215, 0, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: goldenWaveExpand 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  z-index: 9999;
  box-shadow:
    0 0 30px rgba(255, 215, 0, 0.8),
    inset 0 0 30px rgba(255, 255, 255, 0.2);
}

@keyframes goldenWaveExpand {
  0% {
    width: 20px;
    height: 20px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    box-shadow:
      0 0 30px rgba(255, 215, 0, 0.8),
      inset 0 0 30px rgba(255, 255, 255, 0.2);
  }
  10% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0.1);
  }
  30% {
    width: 80vw;
    height: 80vh;
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0.6);
    box-shadow:
      0 0 60px rgba(255, 215, 0, 0.6),
      inset 0 0 40px rgba(255, 255, 255, 0.3);
  }
  60% {
    width: 120vw;
    height: 120vh;
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(0.9);
  }
  100% {
    width: 150vw;
    height: 150vh;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
    box-shadow:
      0 0 100px rgba(255, 215, 0, 0.2),
      inset 0 0 60px rgba(255, 255, 255, 0.1);
  }
}

/* Efeito de brilho suave que percorre a tela */
.moai-glow-sweep {
  position: fixed;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100vh;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 215, 0, 0.1) 20%,
    rgba(255, 185, 0, 0.3) 40%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 185, 0, 0.3) 60%,
    rgba(255, 215, 0, 0.1) 80%,
    transparent 100%
  );
  animation: glowSweepMove 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  z-index: 9998;
}

@keyframes glowSweepMove {
  0% {
    left: -100%;
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.6;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

/* Notificação estilizada de evolução - Limitada ao dashboard 3D */
.dashboard-3d .moai-evolution-notification {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.3);
  background: linear-gradient(
    135deg,
    rgba(0, 40, 92, 0.95) 0%,
    rgba(139, 111, 71, 0.95) 30%,
    rgba(255, 185, 0, 0.95) 70%,
    rgba(255, 215, 0, 0.95) 100%
  );
  backdrop-filter: blur(25px);
  border: 6px solid transparent;
  background-clip: padding-box;
  border-radius: 30px;
  padding: 40px 50px;
  color: white;
  text-align: center;
  box-shadow:
    var(--moai-shadow-strong),
    0 0 80px rgba(255, 215, 0, 0.8),
    0 0 120px rgba(255, 185, 0, 0.6),
    inset 0 6px 0 rgba(255, 255, 255, 0.4),
    inset 0 -6px 0 rgba(255, 215, 0, 0.3);
  z-index: 200;
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  min-width: 400px;
  max-width: 90vw;
  position: relative;
  overflow: hidden;
}

/* Borda dourada animada */
.dashboard-3d .moai-evolution-notification::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(
    45deg,
    rgba(255, 215, 0, 1) 0%,
    rgba(255, 185, 0, 0.8) 25%,
    rgba(255, 140, 0, 0.6) 50%,
    rgba(255, 185, 0, 0.8) 75%,
    rgba(255, 215, 0, 1) 100%
  );
  border-radius: 33px;
  z-index: -1;
  animation: goldenBorderRotate 4s linear infinite;
}

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

/* Aura de glória */
.dashboard-3d .notification-glory-aura {
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: radial-gradient(
    circle,
    rgba(255, 215, 0, 0.3) 0%,
    rgba(255, 185, 0, 0.2) 40%,
    transparent 70%
  );
  border-radius: 50px;
  animation: gloryAuraPulse 3s ease-in-out infinite;
  z-index: -2;
}

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

.dashboard-3d .moai-evolution-notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.dashboard-3d .moai-evolution-notification.glory-pulse {
  animation: notificationGloryPulse 2s ease-in-out infinite;
}

@keyframes notificationGloryPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    filter: brightness(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.02);
    filter: brightness(1.2);
  }
}

.dashboard-3d .moai-evolution-notification.glory-fade {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  filter: brightness(2) blur(2px);
}

.dashboard-3d .moai-evolution-notification .notification-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: gloriousIconFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
  text-shadow: 0 0 30px rgba(255, 215, 0, 1);
}

@keyframes gloriousIconFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg) scale(1);
  }
  25% {
    transform: translateY(-12px) rotate(3deg) scale(1.05);
  }
  50% {
    transform: translateY(-8px) rotate(0deg) scale(1.1);
  }
  75% {
    transform: translateY(-12px) rotate(-3deg) scale(1.05);
  }
}

.dashboard-3d .moai-evolution-notification h3 {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 15px;
  text-shadow:
    0 4px 8px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(255, 215, 0, 0.8);
  letter-spacing: 3px;
  background: linear-gradient(
    45deg,
    rgba(255, 215, 0, 1) 0%,
    rgba(255, 255, 255, 1) 30%,
    rgba(255, 185, 0, 1) 60%,
    rgba(255, 215, 0, 1) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gloriousTextShine 2s ease-in-out infinite;
}

@keyframes gloriousTextShine {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4); }
}

.dashboard-3d .evolution-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 25px;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.8);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 215, 0, 0.1);
  padding: 8px 16px;
  border-radius: 15px;
  border: 2px solid rgba(255, 215, 0, 0.3);
}

/* Partículas de glória - Limitadas ao dashboard 3D */
.dashboard-3d .glory-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.6) 2px, transparent 2px),
    radial-gradient(circle at 70% 20%, rgba(255, 185, 0, 0.4) 1px, transparent 1px),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    radial-gradient(circle at 30% 90%, rgba(255, 215, 0, 0.5) 2px, transparent 2px),
    radial-gradient(circle at 90% 50%, rgba(255, 140, 0, 0.3) 1px, transparent 1px);
  background-size: 80px 80px, 60px 60px, 40px 40px, 70px 70px, 50px 50px;
  animation: gloryParticlesFloat 6s linear infinite;
}

@keyframes gloryParticlesFloat {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-20px); }
}

/* Raios dourados */
.golden-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
}

.golden-rays::before,
.golden-rays::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 100px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 215, 0, 0.8) 10%,
    rgba(255, 255, 255, 0.9) 50%,
    rgba(255, 215, 0, 0.8) 90%,
    transparent 100%
  );
  border-radius: 2px;
  transform-origin: 50% 50%;
}

.golden-rays::before {
  animation: rayRotate1 4s linear infinite;
}

.golden-rays::after {
  animation: rayRotate2 4s linear infinite reverse;
}

@keyframes rayRotate1 {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes rayRotate2 {
  0% { transform: translate(-50%, -50%) rotate(30deg); }
  100% { transform: translate(-50%, -50%) rotate(390deg); }
}

/* Responsividade para notificação gloriosa */
@media (max-width: 768px) {
  .dashboard-3d .moai-evolution-notification {
    min-width: 350px;
    padding: 35px 40px;
  }

  .dashboard-3d .moai-evolution-notification h3 {
    font-size: 24px;
    letter-spacing: 2px;
  }

  .dashboard-3d .evolution-title {
    font-size: 16px;
  }

  .dashboard-3d .moai-evolution-notification .notification-icon {
    font-size: 56px;
  }
}

@media (max-width: 480px) {
  .dashboard-3d .moai-evolution-notification {
    min-width: 320px;
    padding: 30px 35px;
  }

  .dashboard-3d .moai-evolution-notification h3 {
    font-size: 20px;
    letter-spacing: 1px;
  }

  .dashboard-3d .evolution-title {
    font-size: 14px;
  }

  .dashboard-3d .moai-evolution-notification .notification-icon {
    font-size: 48px;
  }
}

/* ===== EFEITOS VISUAIS DE EVOLUÇÃO MOAI - OVERLAY GLORIOSO ===== */

/* Container principal dos efeitos - Limitado ao dashboard 3D */
.dashboard-3d .moai-evolution-effects {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

/* Overlay de fumaça dourada mística - Limitado ao dashboard 3D */
.dashboard-3d .evolution-mystic-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at 50% 60%,
    rgba(255, 215, 0, 0.15) 0%,
    rgba(255, 185, 0, 0.1) 30%,
    rgba(255, 140, 0, 0.05) 60%,
    transparent 100%
  );
  animation: mysticOverlayPulse 4s ease-in-out infinite;
}

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

/* Partículas douradas flutuantes - Limitado ao dashboard 3D */
.dashboard-3d .evolution-golden-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 215, 0, 0.8) 2px, transparent 2px),
    radial-gradient(circle at 30% 10%, rgba(255, 185, 0, 0.6) 1px, transparent 1px),
    radial-gradient(circle at 60% 15%, rgba(255, 255, 255, 0.9) 1px, transparent 1px),
    radial-gradient(circle at 80% 25%, rgba(255, 215, 0, 0.7) 2px, transparent 2px),
    radial-gradient(circle at 90% 5%, rgba(255, 140, 0, 0.5) 1px, transparent 1px),
    radial-gradient(circle at 15% 70%, rgba(255, 215, 0, 0.6) 1px, transparent 1px),
    radial-gradient(circle at 40% 80%, rgba(255, 185, 0, 0.8) 2px, transparent 2px),
    radial-gradient(circle at 70% 85%, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    radial-gradient(circle at 85% 75%, rgba(255, 215, 0, 0.5) 1px, transparent 2px),
    radial-gradient(circle at 95% 90%, rgba(255, 140, 0, 0.6) 2px, transparent 2px);
  background-size:
    200px 200px, 150px 150px, 100px 100px, 250px 250px, 180px 180px,
    160px 160px, 220px 220px, 120px 120px, 140px 140px, 190px 190px;
  animation: goldenParticlesDrift 8s linear infinite;
}

@keyframes goldenParticlesDrift {
  0% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(-50px) rotate(5deg);
    opacity: 0.6;
  }
}

/* Indicador de progresso sutil */
.loading-content::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(77, 166, 217, 0.3) 20%,
    rgba(32, 178, 170, 0.6) 50%,
    rgba(77, 166, 217, 0.3) 80%,
    transparent 100%
  );
  border-radius: 1px;
  animation: loadingProgress 3s ease-in-out infinite;
}

@keyframes loadingProgress {
  0% {
    transform: translateX(-50%) scaleX(0);
    opacity: 0;
  }
  20% {
    transform: translateX(-50%) scaleX(0.3);
    opacity: 0.6;
  }
  50% {
    transform: translateX(-50%) scaleX(0.8);
    opacity: 1;
  }
  80% {
    transform: translateX(-50%) scaleX(1);
    opacity: 0.8;
  }
  100% {
    transform: translateX(-50%) scaleX(0);
    opacity: 0;
  }
}

/* Efeito de brilho nos anéis do spinner */
.spinner-3d::before,
.spinner-3d::after {
  filter: drop-shadow(0 0 8px rgba(77, 166, 217, 0.4));
}

/* Animação de entrada do loading */
.loading-screen-3d {
  animation: loadingEnter 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes loadingEnter {
  0% {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  100% {
    opacity: 1;
    backdrop-filter: blur(3px);
  }
}

/* Pulso sutil no conteúdo */
.loading-content {
  animation: contentPulse 4s ease-in-out infinite;
}

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

/* Responsividade para o indicador de progresso */
@media (max-width: 480px) {
  .loading-content::after {
    width: 120px;
    bottom: -25px;
  }
}

@media (max-width: 360px) {
  .loading-content::after {
    width: 100px;
    bottom: -20px;
  }
}
