.filled-item {
  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;

  background-color: #fff;
  font-weight: 700;
  font-size: 43px;
  color: #0c0c0c;

  border: 1px solid #233a92;
}

.to-select {
  width: 51px;
  border-radius: 8.6px;
  cursor: pointer;
  border: none;
}

.error > span::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #b02626;
  box-shadow: 0px 0px 8.5px 0px #b02626;
  pointer-events: none;
  box-sizing: border-box;
}

.success > span::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #59b026;
  box-shadow: 0px 0px 8.5px 0px #59b026;
  pointer-events: none;
  box-sizing: border-box;
}

.highlight > span::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #ffd700e6;
  box-shadow: 0 0 10px 3px rgba(255, 215, 0, 0.6);
  box-sizing: border-box;
  pointer-events: none;
  box-sizing: border-box;
  animation: glow-pulse 1.2s ease-in-out infinite;
  z-index: 99;
}

@keyframes glow-pulse {
  0% {
    box-shadow: 0 0 6px 2px rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 12px 4px #ffd700e6;
  }
  100% {
    box-shadow: 0 0 6px 2px rgba(255, 215, 0, 0.4);
  }
}

@media (max-width: 768px) {
  .filled-item {
    font-size: 31px;
  }
  .error,
  .success {
    border: 1px;
  }
}

@media (max-width: 580px) {
  .filled-item {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .filled-item {
    font-size: 20px;
  }
}

@media (max-width: 360px) {
  .filled-item {
    font-size: 18px;
  }
}

/* ========================================
   TEMA MODERNO - LETRAS REVELADAS
   ======================================== */

.theme-modern .filled-item {
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
  border-radius: 12px;
  border: 3px solid var(--cor-primaria);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-weight: 900;
  font-size: 47px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  animation: letterReveal 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes letterReveal {
  0% {
    transform: scale(0) rotateY(180deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.15) rotateY(-10deg);
  }
  100% {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
  }
}

.theme-modern .filled-item.to-select {
  cursor: pointer;
  border-radius: 12px;
}

.theme-modern .filled-item.to-select:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  border-color: var(--cor-primaria);
}

.theme-modern .filled-item.to-select:active {
  transform: translateY(-2px) scale(1.02);
}

/* Estados de sucesso e erro modernizados */
.theme-modern .error {
  animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.theme-modern .error > span::before {
  border: 3px solid #ff5252;
  box-shadow: 
    0 0 15px 2px rgba(255, 82, 82, 0.6),
    inset 0 0 10px rgba(255, 82, 82, 0.3);
  border-radius: 12px;
  animation: errorPulse 0.6s ease-in-out;
}

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

.theme-modern .success {
  animation: successBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.theme-modern .success > span::before {
  border: 3px solid #4caf50;
  box-shadow: 
    0 0 15px 2px rgba(76, 175, 80, 0.6),
    inset 0 0 10px rgba(76, 175, 80, 0.3);
  border-radius: 12px;
  animation: successGlow 1s ease-in-out;
}

@keyframes successGlow {
  0% {
    box-shadow: 0 0 5px 1px rgba(76, 175, 80, 0.3);
  }
  50% {
    box-shadow: 0 0 20px 4px rgba(76, 175, 80, 0.8);
  }
  100% {
    box-shadow: 0 0 15px 2px rgba(76, 175, 80, 0.6);
  }
}

.theme-modern .highlight > span::before {
  border: 3px solid var(--cor-primaria);
  box-shadow: 
    0 0 20px 4px rgba(255, 215, 0, 0.8),
    inset 0 0 15px rgba(255, 215, 0, 0.4);
  border-radius: 12px;
  animation: modernGlowPulse 1.5s ease-in-out infinite;
}

@keyframes modernGlowPulse {
  0%, 100% {
    box-shadow: 
      0 0 15px 3px rgba(255, 215, 0, 0.6),
      inset 0 0 10px rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 
      0 0 30px 6px rgba(255, 215, 0, 1),
      inset 0 0 20px rgba(255, 215, 0, 0.6);
  }
}

/* Adiciona brilho nas letras reveladas */
.theme-modern .filled-item::after {
  content: '';
  position: absolute;
  top: 10%;
  left: 10%;
  right: 10%;
  height: 30%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
  border-radius: 8px 8px 50% 50%;
  pointer-events: none;
}

/* Mobile */
@media (max-width: 768px) {
  .theme-modern .filled-item {
    border-radius: 10px;
    border-width: 2px;
    font-size: 36px;
  }
}

@media (max-width: 480px) {
  .theme-modern .filled-item {
    border-radius: 8px;
    border-width: 2px;
    font-size: 26px;
  }
  
  .theme-modern .error > span::before,
  .theme-modern .success > span::before,
  .theme-modern .highlight > span::before {
    border-width: 2px;
  }
}

@media (max-width: 360px) {
  .theme-modern .filled-item {
    border-radius: 6px;
    font-size: 22px;
  }
}
