/* KMKZ - Estilos de la Forja de Fusión & Colección de Cosméticos */

:root {
  --rarity-common: #94a3b8;
  --rarity-rare: #38bdf8;
  --rarity-epic: #a855f7;
  --rarity-legendary: #f59e0b;
  --rarity-mythic: #ef4444;
}

/* Tier Selector Chips */
.forge-tier-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.forge-tier-btn {
  background: rgba(13, 20, 36, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.forge-tier-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(22, 34, 62, 0.85);
}

.forge-tier-btn.active {
  border-color: var(--accent-cyan);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(13, 20, 36, 0.9));
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.forge-tier-btn[data-rarity="rare"].active {
  border-color: var(--rarity-epic);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.forge-tier-btn[data-rarity="epic"].active {
  border-color: var(--rarity-legendary);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
}

.forge-tier-btn[data-rarity="legendary"].active {
  border-color: var(--rarity-mythic);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
}

.forge-tier-stars {
  font-size: 0.95rem;
  letter-spacing: 2px;
  font-weight: 800;
  color: var(--accent-gold-bright);
}

.forge-tier-name {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.forge-tier-cost {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* Main Altar Card */
.forge-altar-card {
  background: linear-gradient(160deg, rgba(16, 24, 46, 0.92) 0%, rgba(10, 14, 28, 0.97) 100%);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: relative;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  margin-bottom: 24px;
}

.forge-altar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.forge-altar-title {
  font-family: 'Cinzel', serif;
  font-size: 1.55rem;
  color: #fff;
  letter-spacing: 0.5px;
}

.forge-altar-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 650px;
  margin-top: 4px;
  line-height: 1.45;
}

/* Pity Badge */
.forge-pity-badge {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: inset 0 0 12px rgba(245, 158, 11, 0.1);
}

.forge-pity-badge.ready {
  border-color: #22c55e;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.35);
  animation: pityPulse 1.8s ease-in-out infinite alternate;
}

@keyframes pityPulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.03); filter: brightness(1.2); }
}

.pity-shield {
  font-size: 1.5rem;
}

.pity-text-group {
  display: flex;
  flex-direction: column;
}

.pity-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.pity-status {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-gold-bright);
}

.forge-pity-badge.ready .pity-status {
  color: #4ade80;
}

.pity-dots {
  display: flex;
  gap: 5px;
}

.pity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pity-dot.active {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  border-color: #fef08a;
}

.pity-dot.guaranteed {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  border-color: #86efac;
}

/* Crucible Stage & Slots */
.forge-crucible-stage {
  min-height: 290px;
  background: radial-gradient(circle at 50% 50%, rgba(30, 27, 75, 0.6) 0%, rgba(13, 20, 36, 0.7) 65%, transparent 100%);
  border: 1.5px dashed rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  overflow: hidden;
}

.forge-spark-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.forge-magic-aura {
  position: absolute;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, rgba(56, 189, 248, 0.15) 50%, transparent 75%);
  border-radius: 50%;
  animation: auraSpin 8s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes auraSpin {
  0% { transform: scale(0.9) rotate(0deg); opacity: 0.6; }
  50% { transform: scale(1.15) rotate(180deg); opacity: 0.9; }
  100% { transform: scale(0.9) rotate(360deg); opacity: 0.6; }
}

.forge-core-pedestal {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.forge-core-crystal {
  width: 76px;
  height: 76px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(168, 85, 247, 0.4));
  border: 2px solid #fef08a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.5), inset 0 0 16px rgba(254, 240, 138, 0.4);
  animation: crystalLevitate 3s ease-in-out infinite;
  transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.forge-core-crystal.shaking {
  animation: crucibleRumble 0.6s cubic-bezier(.36,.07,.19,.97) both infinite;
}

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

@keyframes crucibleRumble {
  10%, 90% { transform: translate3d(-3px, 0, 0) rotate(-4deg); }
  20%, 80% { transform: translate3d(4px, 0, 0) rotate(5deg); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0) rotate(-6deg); }
  40%, 60% { transform: translate3d(5px, 0, 0) rotate(6deg); }
}

.target-tier-pill {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-gold-bright);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--border-gold);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Slots Grid */
.forge-slots-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.forge-slot {
  width: 90px;
  height: 105px;
  background: rgba(13, 20, 36, 0.85);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.forge-slot:hover {
  transform: translateY(-3px) scale(1.04);
  border-color: var(--accent-cyan);
  background: rgba(22, 34, 62, 0.95);
}

.forge-slot.filled {
  border-style: solid;
  border-color: var(--accent-cyan);
  background: linear-gradient(145deg, rgba(22, 34, 62, 0.9), rgba(13, 20, 36, 0.95));
}

.forge-slot.filled[data-rarity="rare"] { border-color: var(--rarity-rare); box-shadow: 0 0 14px rgba(56, 189, 248, 0.3); }
.forge-slot.filled[data-rarity="epic"] { border-color: var(--rarity-epic); box-shadow: 0 0 14px rgba(168, 85, 247, 0.35); }
.forge-slot.filled[data-rarity="legendary"] { border-color: var(--rarity-legendary); box-shadow: 0 0 16px rgba(245, 158, 11, 0.4); }

.forge-slot-empty-icon {
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 300;
}

.forge-slot-empty-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 4px;
}

.forge-slot-filled-icon {
  font-size: 2rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.forge-slot-filled-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
}

.forge-slot-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  border: 1.5px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}

.forge-slot-remove-btn:hover {
  transform: scale(1.2);
}

/* Odds Bar */
.forge-odds-wrapper {
  background: rgba(10, 15, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forge-odds-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 8px;
}

.odds-title {
  font-weight: 800;
  color: #fff;
}

.odds-detail {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.forge-odds-bar {
  height: 24px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.odds-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  transition: width 0.3s ease;
}

.odds-upgrade { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.odds-lateral { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.odds-fail { background: linear-gradient(90deg, #b91c1c, #ef4444); }

/* Forge Action Controls */
.forge-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.forge-btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.forge-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--accent-cyan);
}

.forge-btn-fuse {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  border: 1px solid #fef08a;
  color: #000;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.forge-btn-fuse:hover:not(.disabled) {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.15);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.7);
}

.forge-btn-fuse.disabled {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

/* Material Drawer (Available Items) */
.forge-drawer-card {
  background: rgba(13, 20, 36, 0.85);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.forge-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.drawer-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.drawer-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.forge-drawer-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
}

.drawer-cosmetic-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.drawer-cosmetic-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

.drawer-cosmetic-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.drawer-card-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(245, 158, 11, 0.9);
  color: #000;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 10px;
}

.drawer-card-icon {
  font-size: 2.2rem;
  margin: 4px 0;
}

.drawer-card-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.drawer-card-cat {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

/* ==========================================================================
   MI COLECCIÓN (Collection View)
   ========================================================================== */
.collection-overview-card {
  background: linear-gradient(160deg, rgba(16, 24, 46, 0.9), rgba(10, 14, 28, 0.95));
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.collection-stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.collection-title {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: #fff;
}

.collection-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.collection-counter-pill {
  background: rgba(245, 158, 11, 0.15);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.count-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent-gold-bright);
  line-height: 1;
}

.count-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.collection-rarity-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.rarity-stat-pod {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  border-left: 3px solid #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rarity-stat-label {
  font-size: 0.76rem;
  font-weight: 800;
}

.rarity-stat-val {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
}

/* Collection Filters */
.collection-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.coll-cat-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.coll-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.coll-chip:hover, .coll-chip.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  color: #fff;
}

.coll-select {
  background: rgba(13, 20, 36, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

/* Collection Grid */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.collection-card {
  background: linear-gradient(145deg, rgba(22, 28, 52, 0.85), rgba(14, 18, 36, 0.95));
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.collection-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
}

.collection-card.rarity-common { border-color: var(--rarity-common); }
.collection-card.rarity-rare { border-color: var(--rarity-rare); }
.collection-card.rarity-epic { border-color: var(--rarity-epic); }
.collection-card.rarity-legendary { border-color: var(--rarity-legendary); }
.collection-card.rarity-mythic { border-color: var(--rarity-mythic); box-shadow: 0 0 25px rgba(239, 68, 68, 0.35); }

.coll-card-count {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(245, 158, 11, 0.95);
  color: #000;
  font-size: 0.74rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 12px;
}

.coll-card-stage {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0;
}

.coll-card-icon {
  font-size: 3.2rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.coll-card-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coll-card-desc {
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.35;
  min-height: 40px;
}

.coll-card-actions {
  width: 100%;
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.coll-action-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.coll-action-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--accent-cyan);
}

.coll-action-btn.fuse-send {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
}

.coll-action-btn.fuse-send:hover {
  background: rgba(168, 85, 247, 0.35);
}

/* ==========================================================================
   FORGE REVEAL MODAL CINEMATICS
   ========================================================================== */
.forge-reveal-modal-card {
  background: linear-gradient(160deg, #131b34 0%, #080c1a 100%);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  width: 90%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  position: relative;
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.45);
  animation: revealCardPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@keyframes revealCardPop {
  0% { transform: scale(0.6) rotate(-4deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.forge-reveal-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 500px;
  margin-top: -250px;
  margin-left: -250px;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(245, 158, 11, 0.15) 30deg, transparent 60deg, rgba(168, 85, 247, 0.15) 90deg, transparent 120deg, rgba(56, 189, 248, 0.15) 150deg, transparent 180deg);
  border-radius: 50%;
  animation: spinRays 12s linear infinite;
  pointer-events: none;
  z-index: 0;
}

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

.forge-reveal-banner {
  position: relative;
  z-index: 1;
}

#forge-outcome-badge {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid #4ade80;
  color: #4ade80;
}

#forge-outcome-badge.lateral {
  background: rgba(168, 85, 247, 0.2);
  border-color: #c084fc;
  color: #c084fc;
}

#forge-outcome-badge.fail {
  background: rgba(239, 68, 68, 0.2);
  border-color: #f87171;
  color: #f87171;
}

.forge-reveal-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: #fff;
  position: relative;
  z-index: 1;
}

.forge-reveal-item-info {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.forge-reveal-name {
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
}

.forge-reveal-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 380px;
  line-height: 1.4;
}

.forge-reveal-actions {
  width: 100%;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   KMKZ INVENTORY DUAL-TAB NAVIGATION, VIEWS & TOOLBAR SYSTEM
   ========================================================================== */

/* Tab View Base Flex Behavior */
.inventory-tab-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.inventory-tab-view.hidden,
.inventory-tab-view[style*="display: none"] {
  display: none !important;
}

/* Forge Embed Container - Scrollable Altar & Drawer */
.forge-embed-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.4) transparent;
  -webkit-overflow-scrolling: touch;
}

.inventory-nav-tabs-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 15, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 12px;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.inv-nav-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.inv-nav-tab:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.inv-nav-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.12));
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.inv-nav-tab[data-tab="forge"].active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.15));
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.inv-tab-icon {
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.inv-tab-text {
  font-weight: 800;
  letter-spacing: -0.1px;
}

.inv-tab-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  line-height: 1.2;
}

.inv-tab-badge-glow {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.5);
  color: #d8b4fe;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.35);
}

/* Toolbar: Search & Sort */
.inv-toolbar-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.inv-search-box {
  position: relative;
  flex: 1 1 240px;
  display: flex;
  align-items: center;
}

.inv-search-icon {
  position: absolute;
  left: 12px;
  pointer-events: none;
  font-size: 0.88rem;
  opacity: 0.7;
}

.inv-search-input {
  width: 100%;
  padding: 8px 32px 8px 34px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.82rem;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.inv-search-input:focus {
  outline: none;
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.25);
}

.inv-search-input::placeholder {
  color: #64748b;
  font-size: 0.80rem;
}

.inv-search-clear {
  position: absolute;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #cbd5e1;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.78rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.inv-search-clear:hover {
  background: rgba(239, 68, 68, 0.6);
  color: #ffffff;
}

.inv-sort-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 2px 10px 2px 10px;
}

.inv-sort-label {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 700;
  white-space: nowrap;
}

.inv-sort-select {
  background: transparent;
  border: none;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.80rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 4px;
}

.inv-sort-select:focus {
  outline: none;
}

.inv-sort-select option {
  background: #0f172a;
  color: #f8fafc;
}

/* Card Actions: Equip & Forge side by side */
.inventory-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.inventory-card-footer > * {
  flex: 1 1 0;
  min-width: 0;
}

.btn-inventory-card-forge {
  font-size: 0.74rem;
  font-weight: 900;
  padding: 6px 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #ffffff;
  border: 1px solid rgba(192, 132, 252, 0.4);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.18s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-inventory-card-forge:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #9333ea, #c084fc);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.55);
  border-color: rgba(255, 255, 255, 0.6);
  filter: brightness(1.1);
}

.btn-inventory-card-forge:active {
  transform: scale(0.96);
}

/* Card aesthetics upgrade */
.inventory-cosmetic-card {
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.inventory-cosmetic-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7), 0 0 22px rgba(251, 191, 36, 0.25);
}

/* ==========================================================================
   KMKZ INVENTORY & FORGE RESPONSIVE DESIGN SYSTEM
   ========================================================================== */

/* Tablet & Medium Screens (<= 768px) */
@media (max-width: 768px) {
  .inventory-modal-card {
    max-width: min(96vw, calc(100vw - 12px)) !important;
    max-height: min(94vh, 94dvh) !important;
    padding: 16px 14px !important;
  }

  .inventory-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)) !important;
    gap: 10px !important;
  }

  .forge-tier-selector {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }

  .forge-altar-card {
    padding: 18px 16px !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
  }

  .forge-crucible-stage {
    min-height: 230px !important;
    padding: 20px 14px !important;
    gap: 16px !important;
  }

  .forge-slot {
    width: 76px !important;
    height: 90px !important;
    padding: 6px 4px !important;
  }

  .forge-slots-container {
    gap: 8px !important;
  }
}

/* Mobile Screens (<= 640px) - Fullscreen, Fluid, Zero Cut-offs */
@media (max-width: 640px) {
  #modal-inventory.friends-modal-overlay,
  .friends-modal-overlay.inventory-modal-overlay {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }

  #modal-inventory .inventory-modal-card,
  .inventory-modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    margin: 0 !important;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px calc(env(safe-area-inset-bottom, 0px) + 8px) 8px !important;
  }

  .inventory-modal-header {
    padding-bottom: 8px !important;
    margin-bottom: 8px !important;
    gap: 8px !important;
  }

  .inventory-modal-title {
    font-size: 1.05rem !important;
    gap: 6px !important;
    min-width: 0 !important;
  }

  .inventory-modal-title span:last-child {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: calc(100vw - 145px) !important;
  }

  .inventory-badge-count {
    font-size: 0.70rem !important;
    padding: 2px 7px !important;
  }

  .btn-close-modal#btn-close-inventory-modal {
    width: 32px !important;
    height: 32px !important;
    font-size: 1rem !important;
    flex-shrink: 0 !important;
  }

  /* Segmented Nav Tabs */
  .inventory-nav-tabs-bar {
    gap: 4px !important;
    padding: 3px !important;
    margin-bottom: 8px !important;
    border-radius: 12px !important;
  }

  .inv-nav-tab {
    padding: 7px 6px !important;
    font-size: 0.78rem !important;
    gap: 5px !important;
    border-radius: 8px !important;
  }

  .inv-tab-icon {
    font-size: 1rem !important;
  }

  .inv-tab-badge,
  .inv-tab-badge-glow {
    font-size: 0.68rem !important;
    padding: 1px 6px !important;
  }

  /* Tab 1: Toolbar */
  .inv-toolbar-strip {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    margin-bottom: 8px !important;
  }

  .inv-search-box {
    flex: 1 1 150px !important;
    min-width: 0 !important;
  }

  .inv-search-input {
    padding: 6px 28px 6px 30px !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
  }

  .inv-search-icon {
    font-size: 0.78rem !important;
    left: 9px !important;
  }

  .inv-sort-box {
    flex: 0 0 auto !important;
    padding: 1px 6px !important;
    gap: 4px !important;
    border-radius: 8px !important;
  }

  .inv-sort-label {
    font-size: 0.70rem !important;
  }

  .inv-sort-select {
    font-size: 0.74rem !important;
    padding: 5px 2px !important;
  }

  /* Tab 1: Categories Bar */
  .inventory-filters-scrollable {
    gap: 5px !important;
    padding: 2px 2px 6px 2px !important;
    margin-bottom: 6px !important;
  }

  .inventory-filter-pill {
    padding: 4px 9px !important;
    font-size: 0.72rem !important;
    border-radius: 8px !important;
  }

  /* Tab 1: Grid & Cards */
  .inventory-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 8px !important;
    padding: 2px 2px 14px 2px !important;
  }

  .inventory-cosmetic-card {
    padding: 8px !important;
    border-radius: 12px !important;
  }

  .inventory-card-preview-stage {
    height: 92px !important;
    margin-bottom: 6px !important;
    border-radius: 10px !important;
  }

  .inventory-card-title {
    font-size: 0.75rem !important;
    margin-bottom: 4px !important;
  }

  .inventory-card-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
    width: 100% !important;
  }

  .inventory-card-footer > * {
    width: 100% !important;
    flex: none !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
  }

  .inventory-status-pill,
  .btn-inventory-card-equip,
  .btn-inventory-card-forge {
    width: 100% !important;
    min-height: 28px !important;
    padding: 6px 6px !important;
    font-size: 0.72rem !important;
    border-radius: 7px !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* Tab 2: Forge Responsive Layout */
  .forge-embed-container {
    gap: 12px !important;
    padding-right: 2px !important;
  }

  .forge-tier-selector {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
    margin-bottom: 8px !important;
  }

  .forge-tier-btn {
    padding: 8px 10px !important;
    gap: 2px !important;
    border-radius: 10px !important;
  }

  .forge-tier-stars {
    font-size: 0.76rem !important;
    letter-spacing: 1px !important;
  }

  .forge-tier-name {
    font-size: 0.78rem !important;
  }

  .forge-tier-cost {
    font-size: 0.64rem !important;
  }

  .forge-altar-card {
    padding: 12px 10px !important;
    gap: 10px !important;
    border-radius: 14px !important;
    margin-bottom: 10px !important;
  }

  .forge-altar-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .forge-altar-title {
    font-size: 1.12rem !important;
  }

  .forge-altar-desc {
    font-size: 0.76rem !important;
    line-height: 1.35 !important;
  }

  .forge-pity-badge {
    padding: 6px 10px !important;
    gap: 8px !important;
    align-self: flex-start !important;
  }

  .pity-shield {
    font-size: 1.2rem !important;
  }

  .pity-label {
    font-size: 0.65rem !important;
  }

  .pity-status {
    font-size: 0.75rem !important;
  }

  .forge-crucible-stage {
    min-height: 170px !important;
    padding: 14px 6px !important;
    gap: 12px !important;
    border-radius: 12px !important;
  }

  .forge-magic-aura {
    width: 170px !important;
    height: 170px !important;
  }

  .forge-core-crystal {
    width: 52px !important;
    height: 52px !important;
    font-size: 1.5rem !important;
  }

  .target-tier-pill {
    font-size: 0.65rem !important;
    padding: 3px 8px !important;
    letter-spacing: 1px !important;
  }

  .forge-slots-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    padding: 2px 0 !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .forge-slot {
    width: clamp(48px, 16vw, 64px) !important;
    height: clamp(62px, 19vw, 78px) !important;
    min-width: 48px !important;
    padding: 4px 2px !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
  }

  .forge-slot-empty-icon {
    font-size: 1.15rem !important;
  }

  .forge-slot-empty-label {
    font-size: 0.54rem !important;
    margin-top: 2px !important;
  }

  .forge-slot-filled-icon {
    font-size: 1.25rem !important;
  }

  .forge-slot-filled-name {
    font-size: 0.56rem !important;
    max-width: 44px !important;
    margin-top: 2px !important;
  }

  .forge-slot-remove-btn {
    width: 17px !important;
    height: 17px !important;
    font-size: 0.65rem !important;
    top: -4px !important;
    right: -4px !important;
  }

  .forge-odds-wrapper {
    padding: 8px 10px !important;
    gap: 5px !important;
    border-radius: 10px !important;
  }

  .forge-odds-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
    font-size: 0.72rem !important;
  }

  .odds-detail {
    font-size: 0.68rem !important;
  }

  .forge-odds-bar {
    height: 18px !important;
    border-radius: 9px !important;
  }

  .odds-segment {
    font-size: 0.62rem !important;
  }

  .forge-actions-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .forge-btn-secondary {
    padding: 9px 8px !important;
    font-size: 0.76rem !important;
    border-radius: 10px !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 5px !important;
  }

  .forge-btn-fuse {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    padding: 11px 14px !important;
    font-size: 0.88rem !important;
    border-radius: 10px !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 8px !important;
  }

  .forge-drawer-card {
    padding: 12px 10px !important;
    gap: 8px !important;
    border-radius: 12px !important;
  }

  .drawer-title {
    font-size: 0.94rem !important;
  }

  .drawer-subtitle {
    font-size: 0.72rem !important;
  }

  .forge-drawer-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)) !important;
    gap: 6px !important;
    max-height: 240px !important;
    padding: 2px !important;
  }

  .drawer-cosmetic-card {
    padding: 7px 4px !important;
    border-radius: 8px !important;
    gap: 4px !important;
  }

  .drawer-card-icon {
    font-size: 1.35rem !important;
  }

  .drawer-card-name {
    font-size: 0.70rem !important;
  }

  .drawer-card-count {
    font-size: 0.62rem !important;
  }

  .forge-reveal-modal-card {
    width: 94% !important;
    max-width: 94vw !important;
    padding: 18px 12px !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    gap: 10px !important;
  }
}

/* Ultra Compact Mobile Screens (<= 440px) */
@media (max-width: 440px) {
  .inventory-modal-title {
    font-size: 0.95rem !important;
  }

  .inv-tab-badge-glow {
    display: none !important;
  }

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

  .inventory-cosmetic-card {
    padding: 6px !important;
  }

  .inventory-card-preview-stage {
    height: 82px !important;
  }

  .forge-tier-selector {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 4px !important;
  }

  .forge-tier-btn {
    padding: 6px 6px !important;
  }

  .forge-tier-stars {
    font-size: 0.70rem !important;
  }

  .forge-tier-name {
    font-size: 0.72rem !important;
  }

  .forge-tier-cost {
    display: none !important;
  }

  .forge-crucible-stage {
    min-height: 155px !important;
    padding: 10px 4px !important;
    gap: 10px !important;
  }

  .forge-core-crystal {
    width: 46px !important;
    height: 46px !important;
    font-size: 1.35rem !important;
  }

  .forge-slot {
    width: 48px !important;
    height: 62px !important;
    min-width: 48px !important;
  }

  .forge-slots-container {
    gap: 4px !important;
  }
}

/* ─── WCAG 2.3.3 Reduced Motion Accessibility ─── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .pulse,
  .pulsing,
  .glow-pulse,
  .neon-pulse,
  .shimmer,
  .spinning,
  .rotating,
  .forge-core-crystal,
  .crucible-glow-ring {
    animation: none !important;
    transform: none !important;
  }
}
