/* NFT System Styles */

/* NFT Карточки */
.nft-card {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.9), rgba(40, 40, 60, 0.9));
  border: 3px solid;
  border-radius: 12px;
  padding: 15px;
  margin: 10px;
  width: 300px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nft-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.nft-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: currentColor;
  opacity: 0.7;
}

.nft-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nft-rarity, .nft-faction {
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
}

.nft-card-image {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.nft-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.nft-card-image:hover img {
  transform: scale(1.05);
}

.nft-card-body {
  text-align: center;
}

.nft-character-name {
  font-size: 20px;
  font-weight: bold;
  margin: 8px 0 4px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.nft-character-role {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 12px;
  font-style: italic;
}

.nft-passive {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  border-left: 3px solid var(--nft-rare);
}

.nft-passive-name {
  font-weight: bold;
  font-size: 14px;
}

.nft-passive-bonus {
  font-weight: bold;
  color: var(--nft-rare);
  font-size: 16px;
}

.nft-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.nft-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nft-stat span:first-child {
  font-size: 10px;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 2px;
}

.nft-stat span:last-child {
  font-weight: bold;
  font-size: 14px;
  color: #fff;
}

.nft-power-score {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
  border-radius: 6px;
  margin-top: 12px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.nft-power-score span:first-child {
  font-size: 14px;
  color: #ccc;
}

.power-score-value {
  font-size: 24px;
  font-weight: bold;
  color: #FFD700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.nft-card-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 11px;
  color: #888;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

.nft-marketplace-price {
  color: #FFD700;
  font-weight: bold;
}

/* Модальное окно минта */
.mint-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 1000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mint-modal.show {
  opacity: 1;
}

.mint-modal-content {
  background: linear-gradient(180deg, #1e1e32 0%, #141428 100%);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: none;
  border-top: 2px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
}

.mint-modal.show .mint-modal-content {
  transform: translateY(0);
  opacity: 1;
}

.mint-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mint-modal-header h2 {
  color: #FFD700;
  font-size: 20px;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.close-modal {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.close-modal:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.95);
}

.mint-modal-body {
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}

.chest-selection h3 {
  color: #fff;
  text-align: center;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
  opacity: 0.9;
}

.chests-carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
}

.chests-slides {
  display: flex;
  width: 260px;
  overflow: hidden;
  position: relative;
}

.chest-slide {
  flex: 0 0 100%;
  transition: transform 0.3s ease;
  display: none;
}

.chest-slide.active {
  display: block;
}

.carousel-arrow {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.carousel-arrow:active {
  background: rgba(255, 215, 0, 0.15);
  transform: scale(0.92);
}

.carousel-arrow img {
  width: 18px;
  height: 18px;
}

.chest-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.chest-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.chest-indicator.active {
  background: #FFD700;
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.chest-item {
  background: linear-gradient(180deg, rgba(40, 40, 65, 0.9) 0%, rgba(30, 30, 50, 0.95) 100%);
  border: 2px solid;
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.chest-item:active {
  transform: scale(0.98);
}

.chest-item.selected {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 215, 0, 0.03) 100%);
  border-color: #FFD700 !important;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2), inset 0 0 20px rgba(255, 215, 0, 0.05);
}

.chest-image {
  width: 100%;
  height: 110px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chest-image img {
  width: auto;
  height: 100%;
  max-height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.chest-name {
  color: #fff;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.3px;
}

.chest-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #FFD700;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.chest-price .gold-icon {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

.chest-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  margin: 8px 0;
}

.chest-cards {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0;
}

.chest-cards .cards-icon {
  width: 90px;
  height: 40px;
  opacity: 0.8;
}

.chest-drops {
  text-align: center;
}

.chest-drop-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.cards-count {
  color: #FFD700;
  font-size: 15px;
  font-weight: 700;
  margin-top: 4px;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.2);
}

.selected-chest-info {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.25) 100%);
  padding: 16px;
  border-radius: 14px;
  margin: 16px 0;
  border: 1px solid rgba(255, 215, 0, 0.15);
}

.selected-chest-info h4 {
  color: #FFD700;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}

.selected-chest-info p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.selected-chest-info p span {
  color: #fff;
  font-weight: 600;
}

.mint-button {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #1a1a2e;
  border: none;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  margin-top: 12px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3);
}

.mint-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
}

.mint-button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(255, 165, 0, 0.3);
}

.mint-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.mint-result {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.minted-nft {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.minted-nft .nft-card {
  animation: cardReveal 0.8s ease;
}

@keyframes cardReveal {
  0% { opacity: 0; transform: scale(0.8) rotateY(90deg); }
  100% { opacity: 1; transform: scale(1) rotateY(0deg); }
}

/* Инвентарь NFT */
.nft-inventory {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.inventory-header {
  text-align: center;
  margin-bottom: 30px;
}

.inventory-header h1 {
  color: #FFD700;
  font-size: 32px;
  margin-bottom: 10px;
}

.inventory-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(30, 30, 50, 0.8);
  border-radius: 10px;
  padding: 15px 25px;
  text-align: center;
  min-width: 150px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card h3 {
  color: #aaa;
  font-size: 14px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card .stat-value {
  color: #FFD700;
  font-size: 24px;
  font-weight: bold;
}

.filters-panel {
  background: rgba(30, 30, 50, 0.8);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

.filters-panel select,
.filters-panel input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 10px 15px;
  border-radius: 6px;
  min-width: 150px;
  font-family: inherit;
}

.filters-panel input {
  width: 120px;
}

.clear-filters {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.clear-filters:hover {
  background: rgba(255, 255, 255, 0.2);
}

.nfts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.empty-inventory {
  text-align: center;
  padding: 60px 20px;
  color: #888;
  font-size: 18px;
}

.empty-inventory h2 {
  color: #aaa;
  margin-bottom: 20px;
}

.empty-inventory button {
  background: linear-gradient(135deg, #4169E1, #9370DB);
  color: #fff;
  border: none;
  padding: 15px 30px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 20px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  margin-top: 30px;
}

.page-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.current-page {
  color: #FFD700;
  font-weight: bold;
  font-size: 18px;
}

/* Маркетплейс */
.marketplace-listing {
  position: relative;
}

.marketplace-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 1;
}

/* Адаптивность */
@media (max-width: 768px) {
  .nft-card {
    width: 100%;
    margin: 10px 0;
  }
  
  .chests-carousel {
    width: 100%;
  }

  .chests-slides {
    width: 250px;
  }

  .chest-name {
    font-size: 14px;
  }

  .chest-price {
    font-size: 16px;
  }

  .chest-price .gold-icon {
    width: 16px;
    height: 16px;
  }

  .chest-cards .cards-icon {
    width: 100px;
    height: 45px;
  }

  .chest-drop-label {
    font-size: 12px;
  }

  .cards-count {
    font-size: 14px;
  }

  .filters-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-panel select,
  .filters-panel input {
    width: 100%;
  }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
  .chests-slides {
    width: 200px;
  }

  .carousel-arrow {
    width: 35px;
    height: 35px;
  }

  .carousel-arrow img {
    width: 35px;
    height: 35px;
  }

  .chest-name {
    font-size: 12px;
  }

  .chest-price {
    font-size: 14px;
  }

  .chest-price .gold-icon {
    width: 14px;
    height: 14px;
  }
  .chest-cards .cards-icon {
    width: 100px;
    height: 50px;
  }
  
  .chest-drop-label {
    font-size: 11px;
  }
  
  .cards-count {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .nft-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .nfts-grid {
    grid-template-columns: 1fr;
  }
}

/* Анимации */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Эффекты глитча для легендарных карт */
.nft-card[data-rarity="Legendary"] {
  animation: legendaryGlow 2s infinite alternate;
}

@keyframes legendaryGlow {
  from {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5),
                0 0 40px rgba(255, 215, 0, 0.3),
                0 0 60px rgba(255, 215, 0, 0.1);
  }
  to {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.7),
                0 0 60px rgba(255, 215, 0, 0.5),
                0 0 90px rgba(255, 215, 0, 0.3);
  }
}

/* Модалка открытия сундуков */
.chest-opening-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  transition: opacity 0.3s ease;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.chest-opening-content {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #1e1e32 0%, #141428 100%);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 480px;
  max-height: 95vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: none;
  border-top: 2px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.7);
}

.chest-opening-header {
  display: none;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  justify-items: center;
  gap: 5px;
  margin: 10px 0;
  min-height: 160px;
  width: 100%;
}

.chest-card {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 160 / 260;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
  transform: translateZ(0);
}

/* Анимация падения карточек */
@keyframes cardFall {
  0% {
    opacity: 0;
    transform: translateY(-80px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chest-card.falling {
  animation: cardFall 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.card-outer-container {
  width: 100%;
  height: 100%;
  perspective: 1000px;
  position: relative;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

/* Анимация переворачивания — применяется к .card-inner через .chest-card.revealing */
.chest-card.revealing .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
}

.card-front {

  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.card-front img {
  width: 97%;
  height: 100%;
  object-fit: cover;
  filter: brightness(1.1) contrast(1.1);
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle, var(--glow-color, rgba(255, 215, 0, 0.4)) 0%, transparent 70%);
  opacity: 0.8;
  pointer-events: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-back {
  background: linear-gradient(135deg, #1a1a2e, #252540);
  border: 2px solid var(--glow-color, #FFD700);
  transform: rotateY(180deg);
  padding: 5px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
}

.card-content {
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.card-image-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;

  flex-shrink: 0;
  margin-bottom: 2px;
}

.card-character-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-character h3 {
  color: white;
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

.card-character p {
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  font-size: 9px;
  line-height: 1.2;
}

.card-rarity {
  font-size: 10px;
  font-weight: bold;
  line-height: 1.2;
  text-shadow: 0 0 5px currentColor;
}

.card-passive {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.2;
}

.passive-name {
  color: rgba(255, 255, 255, 0.6);
  font-size: 8px;
}

.passive-bonus {
  color: var(--glow-color, #FFD700);
  font-size: 9px;
  font-weight: bold;
}

.card-stats-grid {
  display: flex;
  gap: 6px;
  width: 100%;
  justify-content: center;
  margin: 2px 0;
}

.stat-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stat-col .stat {
  display: flex;
  justify-content: space-between;
  gap: 3px;
  color: white;
  font-size: 9px;
  line-height: 1.3;
  margin: 0;
}

.stat-col .stat span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 8px;
}

.power-score {
  margin-top: auto;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.2;
}

.power-score span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 8px;
}

.power-score strong {
  color: #FFD700;
  font-size: 12px;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.card-revealed-indicator {
  margin-top: 12px;
  color: #4CAF50;
  font-weight: bold;
  font-size: 14px;
}

/* Стили для открытых карточек */
.chest-card[data-revealed="true"] {
  box-shadow: 0 0 15px var(--glow-color, rgba(76, 175, 80, 0.6));
  animation: rarityPulse 2s infinite;
}

.chest-card[data-revealed="true"] .card-back {
  border-color: var(--glow-color, #4CAF50);
  box-shadow: inset 0 0 12px var(--glow-color, rgba(76, 175, 80, 0.3));
}

/* Эффект свечения редкости для открытых карточек */
@keyframes rarityPulse {
  0%, 100% { box-shadow: 0 0 8px var(--glow-color, rgba(76, 175, 80, 0.6)); }
  50% { box-shadow: 0 0 20px var(--glow-color, rgba(76, 175, 80, 1)); }
}

.chest-opening-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.opening-info {
  text-align: center;
  margin-bottom: 16px;
}

#opening-instruction {
  color: #FFD700;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.progress-info {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.primary-button {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.primary-button {
  background: linear-gradient(90deg, #4CAF50, #45a049);
  color: white;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.primary-button:hover:not(:disabled) {
  background: linear-gradient(90deg, #45a049, #3d8b40);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.primary-button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.primary-button:disabled {
  background: #444;
  color: #777;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: #4CAF50;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .chest-opening-content {
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    border-radius: 16px 16px 0 0;
  }

  .chest-card {
    max-width: 140px;
  }

  .cards-container {
    gap: 8px;
    grid-template-columns: repeat(2, 1fr);
  }

  .action-buttons {
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .chest-card {
    max-width: 130px;
  }

  .cards-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .card-image-wrapper {
    width: 40px;
    height: 40px;
  }

  .card-character h3 {
    font-size: 11px;
  }

  .power-score strong {
    font-size: 11px;
  }

  .mint-modal-content,
  .chest-opening-content {
    border-radius: 16px 16px 0 0;
  }

  .mint-modal-header h2 {
    font-size: 18px;
  }

  .chests-slides {
    width: 220px;
  }

  .chest-name {
    font-size: 13px;
  }

  .chest-price {
    font-size: 16px;
  }

  .selected-chest-info {
    padding: 12px;
  }

  .mint-button {
    font-size: 15px;
    padding: 12px 20px;
  }
}

/* Поддержка очень маленьких экранов */
@media (max-width: 360px) {
  .chests-slides {
    width: 180px;
  }

  .carousel-arrow {
    width: 32px;
    height: 32px;
  }

  .carousel-arrow img {
    width: 16px;
    height: 16px;
  }

  .cards-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }

  .chest-card {
    max-width: 130px;
  }
}

/* Поддержка горизонтальной ориентации */
@media (max-height: 500px) and (orientation: landscape) {
  .mint-modal {
    align-items: center;
    padding-bottom: 0;
  }

  .mint-modal-content,
  .chest-opening-content {
    border-radius: 16px;
    max-height: 85vh;
  }

  .cards-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Предотвращение выделения текста на мобильных */
.mint-modal,
.chest-opening-modal {
  -webkit-user-select: none;
  user-select: none;
}

.mint-modal-content,
.chest-opening-content {
  -webkit-user-select: text;
  user-select: text;
}