/* ================================================
   CRATE SYSTEM & GUI ENHANCEMENTS
   Additional styles for loot boxes and fixes
   ================================================ */

/* ─────────────── SHOP CATEGORY TABS ─────────────── */
.shop-categories {
  display: flex;
  gap: 8px;
  margin: 16px 0 0;
  flex-shrink: 0;
}

.shop-category {
  flex: 1;
  background: linear-gradient(135deg, rgba(13, 21, 37, 0.8), rgba(13, 21, 37, 0.6));
  border: 2px solid rgba(88, 166, 255, 0.25);
  border-radius: 10px 10px 0 0;
  padding: 12px 16px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.shop-cat-icon { margin-right: 6px; }

.shop-category:hover {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.12), rgba(88, 166, 255, 0.06));
  border-color: rgba(88, 166, 255, 0.45);
  color: var(--accent2);
}

.shop-category.active {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.2), rgba(88, 166, 255, 0.1));
  border-color: var(--accent);
  color: var(--accent2);
  box-shadow: 0 -3px 12px rgba(88, 166, 255, 0.25);
}

/* ─────────────── SUB-TAB PILLS ─────────────── */
.shop-sub-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 0 14px;
  border-bottom: 1px solid rgba(88, 166, 255, 0.15);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.shop-sub-tab {
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 20px;
  padding: 6px 16px;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.shop-sub-tab:hover {
  background: rgba(88, 166, 255, 0.15);
  border-color: rgba(88, 166, 255, 0.4);
  color: var(--accent2);
}

.shop-sub-tab.active {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.3), rgba(88, 166, 255, 0.15));
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 8px rgba(88, 166, 255, 0.2);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.shop-tab-content {
  animation: fadeIn 0.18s ease;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  flex: 1;  /* grow to fill space between tabs and back button */
  /* scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: rgba(88,166,255,0.3) transparent;
}
.shop-tab-content::-webkit-scrollbar { width: 5px; }
.shop-tab-content::-webkit-scrollbar-track { background: transparent; }
.shop-tab-content::-webkit-scrollbar-thumb { background: rgba(88,166,255,0.3); border-radius: 4px; }

/* ─────────────── CRATES GRID ─────────────── */
.crates-info {
  text-align: center;
  margin-bottom: 20px;
  padding: 15px;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.1), rgba(88, 166, 255, 0.05));
  border-radius: 8px;
  border: 1px solid rgba(88, 166, 255, 0.3);
}

.crates-info p {
  margin: 5px 0;
  color: var(--accent2);
  font-weight: 500;
}

.crates-hint {
  font-size: 13px;
  color: var(--muted);
}

.crates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 10px;
}

.crate-card {
  background: linear-gradient(135deg, rgba(13, 21, 37, 0.9), rgba(13, 21, 37, 0.7));
  border: 2px solid;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.crate-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.05), transparent);
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

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

.crate-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.4), 0 0 20px currentColor;
}

.crate-icon {
  font-size: 64px;
  margin-bottom: 15px;
  filter: drop-shadow(0 0 15px currentColor);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.crate-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 10px;
  font-family: var(--font-title);
}

.crate-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 15px;
  line-height: 1.5;
}

.crate-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 15px 0;
  min-height: 50px;
}

.crate-rarity-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1.5px solid;
  letter-spacing: 0.5px;
}

.crate-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  margin: 15px 0;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.crate-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(88, 166, 255, 0.4);
}

.crate-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.6);
}

.crate-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.crate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.crate-message {
  text-align: center;
  padding: 12px;
  margin: 15px 0;
  border-radius: 8px;
  background: rgba(13, 21, 37, 0.8);
  border: 2px solid;
  font-weight: 600;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─────────────── CRATE OPENING MODAL ─────────────── */
.crate-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.crate-modal-box {
  width: 95%;
  max-width: 1200px;
  background: linear-gradient(135deg, rgba(13, 21, 37, 0.98), rgba(6, 12, 24, 0.98));
  border: 3px solid var(--accent);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 0 50px rgba(88, 166, 255, 0.5);
}

/* CS2-Style Reel Animation */
.crate-animation-container {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(6, 12, 24, 0.8), rgba(13, 21, 37, 0.8));
  border-radius: 12px;
  border: 2px solid rgba(88, 166, 255, 0.3);
}

.crate-selector-line {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
  box-shadow: 0 0 20px var(--accent);
  z-index: 10;
  pointer-events: none;
  animation: selectorPulse 1s ease-in-out infinite;
}

@keyframes selectorPulse {
  0%, 100% { opacity: 0.8; box-shadow: 0 0 20px var(--accent); }
  50% { opacity: 1; box-shadow: 0 0 30px var(--accent); }
}

.crate-reel {
  display: flex;
  gap: 20px;
  padding: 40px 0;
  position: absolute;
  left: 50%;
  transform: translateX(0);
}

.crate-reel-item {
  min-width: 120px;
  height: 220px;
  background: linear-gradient(135deg, rgba(13, 21, 37, 0.9), rgba(6, 12, 24, 0.9));
  border: 2px solid;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

/* Winning item special styling */
.crate-reel-item.winning-item {
  position: relative;
}

/* Landing animation - CS2 style: subtle and professional */
.crate-reel-item.item-landed {
  animation: itemLandCS2 0.8s ease-out;
  transform: scale(1.1);
  z-index: 5;
}

@keyframes itemLandCS2 {
  0% { 
    transform: scale(1);
    filter: brightness(1);
  }
  15% { 
    transform: scale(1.15);
    filter: brightness(1.3);
  }
  30% { 
    transform: scale(1.08);
    filter: brightness(1.6);
  }
  45% { 
    transform: scale(1.12);
    filter: brightness(1.5);
  }
  60% { 
    transform: scale(1.09);
    filter: brightness(1.4);
  }
  75% { 
    transform: scale(1.11);
    filter: brightness(1.3);
  }
  90% { 
    transform: scale(1.095);
    filter: brightness(1.25);
  }
  100% { 
    transform: scale(1.1);
    filter: brightness(1.2);
  }
}

/* CS2 Style: Intense continuous glow for landed item */
.crate-reel-item.item-landed::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 14px;
  background: inherit;
  filter: blur(25px);
  opacity: 0.9;
  animation: landedGlowCS2 1.5s ease-in-out infinite;
  z-index: -1;
}

@keyframes landedGlowCS2 {
  0%, 100% { 
    opacity: 0.7;
    transform: scale(0.95);
    filter: blur(25px);
  }
  50% { 
    opacity: 1;
    transform: scale(1.15);
    filter: blur(30px);
  }
}

/* Stars/sparkle effect on landing */
.crate-reel-item.item-landed::after {
  content: '✨';
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 32px;
  animation: sparkleFloat 1s ease-out;
  pointer-events: none;
}

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

.crate-item-preview {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  margin-bottom: 10px;
}

.crate-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  text-align: center;
}

.crate-item-rarity {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Results Display */
.crate-results-container {
  animation: fadeIn 0.5s ease;
}

.crate-results-title {
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  color: var(--accent2);
  margin-bottom: 25px;
  font-family: var(--font-title);
  text-shadow: 0 0 20px rgba(88, 166, 255, 0.6);
  animation: pulse 1.5s ease-in-out infinite;
}

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

.crate-rewards-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
}

/* Single reward gets special centered layout */
.crate-reward-card.single-reward {
  grid-column: 1 / -1;
  max-width: 500px;
  margin: 0 auto;
  padding: 40px;
}

.crate-reward-card {
  background: linear-gradient(135deg, rgba(13, 21, 37, 0.9), rgba(6, 12, 24, 0.9));
  border: 2px solid;
  border-radius: 10px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: popIn 0.5s ease backwards;
}

.crate-reward-card:nth-child(1) { animation-delay: 0.1s; }
.crate-reward-card:nth-child(2) { animation-delay: 0.2s; }
.crate-reward-card:nth-child(3) { animation-delay: 0.3s; }
.crate-reward-card:nth-child(4) { animation-delay: 0.4s; }
.crate-reward-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.crate-reward-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

/* Larger preview for single item */
.crate-reward-preview.large-preview {
  width: 150px;
  height: 150px;
  animation: rewardPulse 2s ease-in-out infinite;
}

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

.crate-reward-info {
  text-align: center;
  width: 100%;
}

.crate-reward-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 5px;
}

/* Larger name for single item */
.crate-reward-name.large-name {
  font-size: 28px;
  margin-bottom: 10px;
  font-family: var(--font-title);
  text-shadow: 0 0 15px rgba(88, 166, 255, 0.6);
}

.crate-reward-rarity {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

/* Larger rarity for single item */
.crate-reward-rarity.large-rarity {
  font-size: 18px;
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.crate-reward-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
}

/* Larger status for single item */
.crate-reward-status.large-status {
  font-size: 16px;
  padding: 15px 25px;
  border-radius: 10px;
  margin-top: 10px;
}

.crate-summary {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.15), rgba(88, 166, 255, 0.08));
  border: 2px solid rgba(88, 166, 255, 0.4);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.crate-summary-stat {
  text-align: center;
}

.crate-summary-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.crate-summary-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent2);
  text-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

.crate-close-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--success), #50d466);
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  box-shadow: 0 4px 20px rgba(107, 255, 123, 0.4);
}

.crate-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(107, 255, 123, 0.6);
}

.crate-close-btn:active {
  transform: translateY(0);
}

/* ─────────────── GUI IMPROVEMENTS ─────────────── */

/* Better responsive layout for home screen */
@media (max-height: 700px) {
  .home-title {
    font-size: 48px;
  }
  .home-sub {
    font-size: 14px;
  }
  .home-btn {
    padding: 12px 28px;
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .shop-categories {
    flex-direction: column;
    gap: 4px;
  }

  .shop-category {
    border-radius: 8px;
    font-size: 12px;
  }
  
  .crates-grid {
    grid-template-columns: 1fr;
  }
  
  .crate-rewards-list {
    grid-template-columns: 1fr;
  }
}

/* Smoother transitions */
.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.panel-overlay {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.panel-box {
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Improved scrollbar styling */
.skin-grid::-webkit-scrollbar,
.crates-grid::-webkit-scrollbar,
.crate-rewards-list::-webkit-scrollbar {
  width: 8px;
}

.skin-grid::-webkit-scrollbar-track,
.crates-grid::-webkit-scrollbar-track,
.crate-rewards-list::-webkit-scrollbar-track {
  background: rgba(13, 21, 37, 0.5);
  border-radius: 10px;
}

.skin-grid::-webkit-scrollbar-thumb,
.crates-grid::-webkit-scrollbar-thumb,
.crate-rewards-list::-webkit-scrollbar-thumb {
  background: rgba(88, 166, 255, 0.5);
  border-radius: 10px;
}

.skin-grid::-webkit-scrollbar-thumb:hover,
.crates-grid::-webkit-scrollbar-thumb:hover,
.crate-rewards-list::-webkit-scrollbar-thumb:hover {
  background: rgba(88, 166, 255, 0.7);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes flagWave {
  0%, 100% {
    transform: translateY(0) scaleY(1);
  }
  25% {
    transform: translateY(-2px) scaleY(1.02);
  }
  50% {
    transform: translateY(0) scaleY(1);
  }
  75% {
    transform: translateY(2px) scaleY(0.98);
  }
}

/* ================================================
   CHROMEBOOK & SMALL SCREEN FIXES FOR CRATES
   ================================================ */

@media (max-height: 768px) {
  .crate-modal-box {
    max-height: 90vh;
    padding: 20px;
  }

  .crate-animation-container {
    height: 220px;
  }

  .crate-reel-item {
    min-width: 100px;
    height: 180px;
  }

  .crates-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-height: 600px) {
  .crate-modal-box {
    max-height: 95vh;
    padding: 16px;
  }

  .crate-animation-container {
    height: 180px;
  }

  .crate-reel-item {
    min-width: 80px;
    height: 140px;
    padding: 10px;
  }

  .crate-item-preview {
    width: 50px;
    height: 50px;
  }

  .crate-results-title {
    font-size: 24px;
    margin-bottom: 15px;
  }

  .crate-rewards-list {
    max-height: 300px;
  }

  .crate-reward-preview {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 1280px) and (max-height: 720px) {
  .crate-modal-box {
    width: 96%;
    max-width: 96%;
  }

  .crates-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
  }

  .crate-card {
    padding: 16px;
  }

  .crate-icon {
    font-size: 48px;
  }

  .crate-name {
    font-size: 18px;
  }
}

/* ============================================
   CRATE INDEX / BROWSE CONTENTS
   ============================================ */

.crate-browse-btn {
  width: 100%;
  padding: 8px;
  margin-bottom: 8px;
  background: transparent;
  color: var(--muted);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.crate-browse-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.crate-index-box {
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.crate-index-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.crate-index-title {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
}

.crate-index-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
  transition: color 0.2s;
}

.crate-index-close:hover {
  color: #fff;
}

.crate-index-body {
  overflow-y: auto;
  flex: 1;
  padding-right: 6px;
}

.crate-index-body::-webkit-scrollbar {
  width: 6px;
}

.crate-index-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

.crate-index-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.crate-index-section {
  margin-bottom: 20px;
}

.crate-index-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.crate-index-rarity {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
}

.crate-index-chance {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
}

.crate-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.crate-index-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 6px 8px;
  text-align: center;
  transition: all 0.2s ease;
}

.crate-index-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.crate-index-item.owned {
  border-style: solid;
  background: rgba(107, 255, 123, 0.06);
}

.crate-index-swatch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 8px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
}

.crate-index-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crate-index-status {
  font-size: 9px;
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: 0.5px;
  min-height: 13px;
}

@media (max-width: 500px) {
  .crate-index-box {
    padding: 20px 16px;
    max-height: 90vh;
  }

  .crate-index-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }

  .crate-index-swatch {
    width: 40px;
    height: 40px;
  }

  .crate-index-label {
    font-size: 10px;
  }
}

/* ===================== MUTATION STYLES ===================== */

/* Keyframe animations */
@keyframes mutationGlowPulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}

@keyframes prismaticShift {
  0%   { filter: hue-rotate(0deg)   saturate(2.5) brightness(1.1); }
  25%  { filter: hue-rotate(90deg)  saturate(3)   brightness(1.2); }
  50%  { filter: hue-rotate(180deg) saturate(2.5) brightness(1.1); }
  75%  { filter: hue-rotate(270deg) saturate(3)   brightness(1.2); }
  100% { filter: hue-rotate(360deg) saturate(2.5) brightness(1.1); }
}

/* Per-mutation skin overlays */
.mutation-corrupted {
  outline: 2px solid rgba(255, 51, 51, 0.7);
  animation: mutationGlowPulse 1.4s ease-in-out infinite;
}
.mutation-gilded {
  outline: 2px solid rgba(255, 215, 0, 0.8);
  animation: mutationGlowPulse 1.8s ease-in-out infinite;
}
.mutation-void {
  outline: 2px solid rgba(153, 0, 255, 0.8);
  animation: mutationGlowPulse 2s ease-in-out infinite;
}
.mutation-prismatic {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  animation: prismaticShift 3s linear infinite;
}

/* Mutation reveal badge shown in crate result card */
.crate-mutation-reveal {
  display: inline-block;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 6px 0 4px;
  padding: 4px 12px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  animation: mutationGlowPulse 1.6s ease-in-out infinite;
}
.crate-mutation-reveal.mutation-prismatic {
  animation: prismaticShift 3s linear infinite;
}

/* Marketplace mutation tag badge */
.mp-mutation-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.5);
  margin-left: 6px;
  vertical-align: middle;
}