/**
 * Roll Until feature styles
 */

/* Roll Until Container */
.roll-until-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9500;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  font-family: 'Roboto', sans-serif;
}

/* Roll Until Header */
.roll-until-header {
  text-align: center;
  margin-bottom: 20px;
}

.roll-until-header h2 {
  font-size: 32px;
  margin-bottom: 10px;
  color: #FFD700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.roll-until-target {
  font-size: 24px;
  color: #FFFFFF;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Roll Until Stats */
.roll-until-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
}

.roll-until-stat {
  text-align: center;
}

.roll-until-stat-label {
  font-size: 16px;
  color: #CCCCCC;
  margin-bottom: 5px;
}

.roll-until-stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
}

/* Roll Animation Area */
.roll-until-animation {
  width: 300px;
  height: 300px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
  overflow: hidden;
  position: relative;
}

/* Roll Animation */
.roll-animation, .cycling-animation {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.roll-animation {
  animation: rollSpin 0.5s ease-in-out;
}

.cycling-animation {
  animation: cycleIn 0.3s ease-in-out;
}

@keyframes rollSpin {
  0% {
    transform: scale(0.5) rotate(-10deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

@keyframes cycleIn {
  0% {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Cycling animation container */
.cycling-container {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1000px;
}

/* Individual items in the cycling animation */
.cycling-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.cycling-item.entering {
  transform: translateY(50px) scale(0.8);
  opacity: 0;
}

.cycling-item.active {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.cycling-item.exiting {
  transform: translateY(-50px) scale(0.8);
  opacity: 0;
}

/* Roll Result */
.roll-result {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.roll-result::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
}

.roll-result.common {
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.roll-result.rare {
  box-shadow: 0 0 15px rgba(30, 144, 255, 0.5);
}

.roll-result.epic {
  box-shadow: 0 0 20px rgba(138, 43, 226, 0.6);
}

.roll-result.legendary {
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
  animation: legendaryPulse 2s infinite;
}

.roll-result.mythic {
  box-shadow: 0 0 30px rgba(255, 0, 128, 0.8);
  animation: mythicPulse 1.5s infinite;
}

.roll-result.divine {
  box-shadow: 0 0 35px rgba(255, 255, 255, 0.9);
  animation: divinePulse 1s infinite;
}

@keyframes legendaryPulse {
  0%, 100% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.7); }
  50% { box-shadow: 0 0 35px rgba(255, 215, 0, 0.9); }
}

@keyframes mythicPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(255, 0, 128, 0.8); }
  50% { box-shadow: 0 0 40px rgba(255, 0, 128, 1); }
}

@keyframes divinePulse {
  0%, 100% { box-shadow: 0 0 35px rgba(255, 255, 255, 0.9); }
  50% { box-shadow: 0 0 50px rgba(255, 255, 255, 1); }
}

.roll-result-name {
  font-size: 24px;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  margin-bottom: 10px;
  text-align: center;
  padding: 0 10px;
}

.roll-result-tier {
  font-size: 18px;
  color: white;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
}

/* Roll Until Controls */
.roll-until-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.roll-until-btn {
  padding: 12px 24px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.stop-roll-until {
  background: linear-gradient(45deg, #F44336, #D32F2F);
  color: white;
}

.stop-roll-until:hover {
  background: linear-gradient(45deg, #EF5350, #E57373);
  transform: translateY(-2px);
}

/* Success Message */
.roll-until-success {
  display: none;
  text-align: center;
  margin-top: 20px;
  padding: 15px;
  background-color: rgba(76, 175, 80, 0.2);
  border-radius: 5px;
  color: #4CAF50;
  font-weight: bold;
  font-size: 18px;
}

/* Roll Until Summary */
.roll-until-summary {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
  width: 100%;
  max-width: 500px;
}

.roll-until-summary h3 {
  text-align: center;
  margin-bottom: 15px;
  color: #FFD700;
}

.roll-until-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.roll-until-stat {
  text-align: center;
}

.roll-until-stat span {
  display: block;
  font-size: 14px;
  color: #CCCCCC;
  margin-bottom: 5px;
}

.roll-until-tier-counts {
  margin-top: 15px;
}

.roll-until-tier-counts h4 {
  text-align: center;
  margin-bottom: 10px;
  color: #FFFFFF;
}

.roll-until-tier-count {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  padding: 5px 10px;
  border-radius: 5px;
}

.roll-until-tier-count span {
  font-weight: bold;
}

.roll-until-tier-count.common {
  background-color: rgba(200, 200, 200, 0.2);
}

.roll-until-tier-count.rare {
  background-color: rgba(30, 144, 255, 0.2);
}

.roll-until-tier-count.epic {
  background-color: rgba(138, 43, 226, 0.2);
}

.roll-until-tier-count.legendary {
  background-color: rgba(255, 215, 0, 0.2);
}

.roll-until-tier-count.mythic {
  background-color: rgba(255, 0, 128, 0.2);
}

.roll-until-tier-count.divine {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Roll Until Buttons in Gacha UI */
.roll-until-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.05);
}

.roll-until-buttons-header {
  font-weight: bold;
  margin-bottom: 5px;
  color: #FFD700;
}

.roll-until-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.roll-until-btn {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  font-size: 14px;
  background: linear-gradient(45deg, #4CAF50, #2E7D32);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.roll-until-btn:hover {
  background: linear-gradient(45deg, #66BB6A, #388E3C);
  transform: translateY(-2px);
}

.roll-until-btn.premium {
  background: linear-gradient(45deg, #E91E63, #C2185B);
}

.roll-until-btn.premium:hover {
  background: linear-gradient(45deg, #EC407A, #D81B60);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .roll-until-stats {
    flex-direction: column;
    gap: 15px;
  }

  .roll-until-animation {
    width: 250px;
    height: 250px;
  }

  .roll-result {
    width: 150px;
    height: 150px;
  }

  .roll-result-name {
    font-size: 20px;
  }

  .roll-result-tier {
    font-size: 16px;
  }

  .roll-until-controls {
    flex-direction: column;
    gap: 10px;
  }
}
