.tool-main-card {
  --gold: #d4af37;
  --gold-light: #f0d68a;
  --gold-dark: #a8871e;
  --color-white: #fff;

  max-width: 780px;
  margin: 0 auto;
}

.crystal-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  align-items: start;
}

/* ===== LEFT MENU ===== */

.crystal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.crystal-list-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  overflow: hidden;
}

.crystal-list-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: transparent;
  transition: all 0.35s ease;
}

.crystal-list-item:hover {
  border-color: rgba(212, 175, 55, 0.3);
  transform: translateX(3px);
}

.crystal-list-item.active {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(212,175,55,0.04));
  box-shadow: 0 0 30px rgba(212,175,55,0.06);
}

.crystal-list-item.active::before {
  background: var(--gold);
  box-shadow: 0 0 12px rgba(212,175,55,0.5);
}

.crystal-list-item.dragging {
  opacity: 0.3;
  transform: scale(0.95);
}

.crystal-list-item.drag-over {
  border-color: var(--gold);
  background: rgba(212,175,55,0.15);
  box-shadow: 0 0 40px rgba(212,175,55,0.12);
  transform: scale(1.02);
}

.list-grip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0.15;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.crystal-list-item:hover .list-grip {
  opacity: 0.4;
}

.list-grip span {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-base);
}

.list-ovr {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-white);
  flex-shrink: 0;
  letter-spacing: -0.02em;
  box-shadow: 0 0 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.list-ovr::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
}

.list-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.list-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-base);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-hint {
  font-size: 0.5rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.crystal-list-item.active .list-hint {
  opacity: 0.6;
  animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ===== BIG CARD ===== */

.crystal-card-wrap {
  position: relative;
  min-height: 320px;
}

.crystal-card-big {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.crystal-card-big.card-leaving {
  opacity: 0;
  transform: scale(0.96) translateY(6px);
}

.crystal-card-big.card-entering {
  animation: card-enter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.crystal-card-big::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 40%, rgba(0,0,0,0.2) 100%);
  z-index: 1;
  pointer-events: none;
}

.crystal-card-big::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg at 50% 50%, transparent 0%, rgba(255,255,255,0.03) 25%, transparent 50%);
  animation: card-shine 8s linear infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes card-shine {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.card-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  filter: blur(60px);
  opacity: 0.3;
  z-index: 0;
  transition: all 0.6s ease;
}

.card-sparkles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.card-sparkle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 0.5;
    transform: scale(1);
  }
}

.card-gold-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-light), var(--gold), var(--gold-light), transparent);
  z-index: 3;
  animation: gold-shimmer 3s ease-in-out infinite;
}

@keyframes gold-shimmer {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.card-pattern {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image:
    radial-gradient(circle at 25% 25%, #fff 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, #fff 1px, transparent 1px);
  background-size: 24px 24px;
}

.card-header {
  position: relative;
  z-index: 3;
  padding: 1.5rem 1.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.card-ovr-wrap {
  position: relative;
  flex-shrink: 0;
}

.card-ovr-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  animation: ovr-pulse 2.5s ease-in-out infinite;
}

@keyframes ovr-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

.card-ovr {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  position: relative;
  box-shadow: 0 0 30px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.25);
}

.card-ovr-num {
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.card-ovr-label {
  font-size: 0.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
}

.card-title {
  display: flex;
  flex-direction: column;
}

.card-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-white);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.card-name-sub {
  font-size: 0.55rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.1rem;
}

.card-price-gems {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
  padding: 0.35rem 0.65rem;
  border-radius: 2rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
  font-size: 0;
}

.price-gem {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  transform: rotate(45deg);
  border: 1px solid rgba(255,255,255,0.3);
  transition: all 0.3s ease;
}

.price-gem.filled {
  background: var(--gold-light);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(212,175,55,0.5);
  animation: gem-glow 2s ease-in-out infinite;
}

@keyframes gem-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(212,175,55,0.3); }
  50% { box-shadow: 0 0 12px rgba(212,175,55,0.6); }
}

.price-gem.empty {
  background: transparent;
  border-color: rgba(255,255,255,0.08);
}

.card-stats {
  position: relative;
  z-index: 3;
  padding: 0.75rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  opacity: 0;
  animation: stat-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes stat-in {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.card-stat-label {
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  min-width: 36px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-stat-bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.25);
  overflow: hidden;
  position: relative;
}

.card-stat-bar-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.card-stat-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.card-stat-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
}

.card-stat-val {
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  min-width: 24px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ===== FIGHT / COMPARISON ===== */

.crystal-fight {
  margin-top: 1rem;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(212,175,55,0.15);
  background: rgba(0,0,0,0.15);
  animation: fight-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fight-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.crystal-fight-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
}

.crystal-fight-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--gold);
  opacity: 0.35;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  writing-mode: vertical-lr;
  animation: vs-pulse 2s ease-in-out infinite;
}

@keyframes vs-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.5; }
}

.crystal-fight-close {
  display: block;
  width: 100%;
  padding: 0.6rem;
  border: none;
  background: rgba(0,0,0,0.2);
  color: rgba(255,255,255,0.4);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.25s ease;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.crystal-fight-close:hover {
  color: var(--gold-light);
  background: rgba(0,0,0,0.35);
}

/* ===== DRAG TUTORIAL ===== */

.crystal-drag-hint {
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-dimmed);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.4;
  transition: opacity 0.5s ease;
}

.crystal-drag-hint.dimmed {
  opacity: 0.15;
}

.crystal-drag-hint-hidden {
  display: none;
}

.drag-arrow {
  display: inline-block;
  animation: drag-arrow-move 1.5s ease-in-out infinite;
}

@keyframes drag-arrow-move {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

@media (max-width: 600px) {
  .crystal-layout {
    grid-template-columns: 1fr;
  }
  .crystal-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    gap: 0.5rem;
  }
  .crystal-list-item {
    flex-shrink: 0;
    min-width: 120px;
  }
  .list-hint {
    display: none;
  }
}
