.tile {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  cursor: grab;
  user-select: none;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
  box-sizing: border-box;
  font-family: var(--font-ui);
  
  /* Base Tile Style */
  background: rgba(20, 25, 40, 0.95);
  border: 2px solid transparent;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.tile:hover {
  transform: translateY(-5px) scale(1.05);
  z-index: 100;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
}

.tile.dragging {
  opacity: 0.8;
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.4);
  z-index: 1000;
}

/* --- Forces Styling --- */

/* Matter (Blue/Tanky) */
.tile[data-force="Matter"] {
  border-color: var(--accent-cyan);
  background: linear-gradient(160deg, #0a1020 0%, #0d2035 100%);
}
.tile[data-force="Matter"] .card-header { background: rgba(0, 243, 255, 0.1); color: var(--accent-cyan); }
.tile[data-force="Matter"] .cost-badge { background: var(--accent-cyan); color: #000; }

/* Energy (Red/Damage) */
.tile[data-force="Energy"] {
  border-color: var(--accent-pink);
  background: linear-gradient(160deg, #150a10 0%, #350d15 100%);
}
.tile[data-force="Energy"] .card-header { background: rgba(255, 0, 85, 0.1); color: var(--accent-pink); }
.tile[data-force="Energy"] .cost-badge { background: var(--accent-pink); color: #fff; }

/* Aether (Green/Utility) */
.tile[data-force="Aether"] {
  border-color: var(--accent-green);
  background: linear-gradient(160deg, #0a1510 0%, #0d3520 100%);
}
.tile[data-force="Aether"] .card-header { background: rgba(0, 255, 157, 0.1); color: var(--accent-green); }
.tile[data-force="Aether"] .cost-badge { background: var(--accent-green); color: #000; }


/* --- Internal Layout --- */

.card-header {
  display: flex;
  justify-content: space-between;
  padding: 4px 6px;
  font-size: 0.6rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.name {
  padding: 8px 4px 0 4px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.visual-container {
  flex: 1;
  /* Placeholder for potential card art */
  background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, transparent 70%);
}

.stats {
  display: flex;
  justify-content: space-between;
  padding: 4px;
  margin-bottom: 4px;
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(0,0,0,0.6);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 24px;
  justify-content: center;
}

.attack-stat {
  color: #ff9e9e;
  border: 1px solid rgba(255, 100, 100, 0.3);
}

.health-stat {
  color: #9effbc;
  border: 1px solid rgba(100, 255, 100, 0.3);
}

.stat-icon {
  font-size: 0.7rem;
  opacity: 0.8;
}

.cost-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.8rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  z-index: 5;
  font-family: var(--font-head);
}

/* State Styling Overlays */
.tile[data-state="Chaotic"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 5px,
    rgba(255, 255, 255, 0.03) 5px,
    rgba(255, 255, 255, 0.03) 10px
  );
  pointer-events: none;
}

/* Animations */
.tile.attacking {
  animation: attack-lunge 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 500;
}

@keyframes attack-lunge {
  0% { transform: translate(0,0) scale(1); }
  50% { transform: translate(var(--attack-translate-x), var(--attack-translate-y)) scale(1.3); box-shadow: 0 0 30px #fff; }
  100% { transform: translate(0,0) scale(1); }
}